diff --git a/include/stratosphere/existingportserver.hpp b/include/stratosphere/existingportserver.hpp index f2589ab1..4ec15b00 100644 --- a/include/stratosphere/existingportserver.hpp +++ b/include/stratosphere/existingportserver.hpp @@ -4,10 +4,6 @@ template class ExistingPortServer : public IServer { - private: - virtual Result register_self(const char *service_name) { - return 0; - } public: ExistingPortServer(Handle port_h, unsigned int max_s) : IServer(NULL, max_s) { this->port_handle = port_h; diff --git a/include/stratosphere/iserver.hpp b/include/stratosphere/iserver.hpp index ed6cb57a..66cb1e7a 100644 --- a/include/stratosphere/iserver.hpp +++ b/include/stratosphere/iserver.hpp @@ -17,15 +17,9 @@ class IServer : public IWaitable { unsigned int max_sessions; unsigned int num_sessions; ServiceSession **sessions; - virtual Result register_self(const char *service_name) { - return smRegisterService(&this->port_handle, service_name, false, this->max_sessions); - } - public: + public: IServer(const char *service_name, unsigned int max_s) : max_sessions(max_s) { - if (R_FAILED(register_self(service_name))) { - /* TODO: Panic. */ - } this->sessions = new ServiceSession *[this->max_sessions]; for (unsigned int i = 0; i < this->max_sessions; i++) { this->sessions[i] = NULL; diff --git a/include/stratosphere/managedportserver.hpp b/include/stratosphere/managedportserver.hpp index 17c91d63..af86db42 100644 --- a/include/stratosphere/managedportserver.hpp +++ b/include/stratosphere/managedportserver.hpp @@ -4,10 +4,10 @@ template class ManagedPortServer : public IServer { - private: - virtual Result register_self(const char *service_name) { - return svcManageNamedPort(&this->port_handle, service_name, this->max_sessions); - } public: - ManagedPortServer(const char *service_name, unsigned int max_s) : IServer(service_name, max_s) { } + ManagedPortServer(const char *service_name, unsigned int max_s) : IServer(service_name, max_s) { + if (R_FAILED(svcManageNamedPort(&this->port_handle, service_name, this->max_sessions))) { + /* TODO: panic */ + } + } }; \ No newline at end of file diff --git a/include/stratosphere/serviceserver.hpp b/include/stratosphere/serviceserver.hpp index 65671881..28951822 100644 --- a/include/stratosphere/serviceserver.hpp +++ b/include/stratosphere/serviceserver.hpp @@ -4,10 +4,10 @@ template class ServiceServer : public IServer { - private: - virtual Result register_self(const char *service_name) { - return smRegisterService(&this->port_handle, service_name, false, this->max_sessions); - } public: - ServiceServer(const char *service_name, unsigned int max_s) : IServer(service_name, max_s) { } + ServiceServer(const char *service_name, unsigned int max_s) : IServer(service_name, max_s) { + if (R_FAILED(smRegisterService(&this->port_handle, service_name, false, this->max_sessions))) { + /* TODO: Panic. */ + } + } }; \ No newline at end of file diff --git a/source/waitablemanager.cpp b/source/waitablemanager.cpp index ea2edee8..32db56cf 100644 --- a/source/waitablemanager.cpp +++ b/source/waitablemanager.cpp @@ -1,7 +1,6 @@ #include #include -#include #include