diff options
Diffstat (limited to 'src/account-server')
-rw-r--r-- | src/account-server/accounthandler.cpp | 5 | ||||
-rw-r--r-- | src/account-server/accounthandler.hpp | 2 | ||||
-rw-r--r-- | src/account-server/main-account.cpp | 7 | ||||
-rw-r--r-- | src/account-server/serverhandler.cpp | 4 | ||||
-rw-r--r-- | src/account-server/serverhandler.hpp | 2 |
5 files changed, 11 insertions, 9 deletions
diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp index e785d809..d04671e2 100644 --- a/src/account-server/accounthandler.cpp +++ b/src/account-server/accounthandler.cpp @@ -90,11 +90,12 @@ AccountHandler::AccountHandler(): { } -bool AccountClientHandler::initialize(int port) +bool AccountClientHandler::initialize(int port, const std::string &host) { accountHandler = new AccountHandler; LOG_INFO("Account handler started:"); - return accountHandler->startListen(port); + + return accountHandler->startListen(port, host); } void AccountClientHandler::deinitialize() diff --git a/src/account-server/accounthandler.hpp b/src/account-server/accounthandler.hpp index e509cb06..c5793b54 100644 --- a/src/account-server/accounthandler.hpp +++ b/src/account-server/accounthandler.hpp @@ -29,7 +29,7 @@ namespace AccountClientHandler /** * Creates a connection handler and starts listening on given port. */ - bool initialize(int port); + bool initialize(int port, const std::string &host); /** * Stops listening to messages and destroys the connection handler. diff --git a/src/account-server/main-account.cpp b/src/account-server/main-account.cpp index 7fec91b2..b207ae0e 100644 --- a/src/account-server/main-account.cpp +++ b/src/account-server/main-account.cpp @@ -315,9 +315,10 @@ int main(int argc, char *argv[]) initialize(); int port = Configuration::getValue("net_accountServerPort", DEFAULT_SERVER_PORT); - if (!AccountClientHandler::initialize(port) || - !GameServerHandler::initialize(port + 1) || - !chatHandler->startListen(port + 2)) + std::string host = Configuration::getValue("net_listenHost", std::string()); + if (!AccountClientHandler::initialize(port, host) || + !GameServerHandler::initialize(port + 1, host) || + !chatHandler->startListen(port + 2, host)) { LOG_FATAL("Unable to create an ENet server host."); return 3; diff --git a/src/account-server/serverhandler.cpp b/src/account-server/serverhandler.cpp index 6def952f..5bfa6a57 100644 --- a/src/account-server/serverhandler.cpp +++ b/src/account-server/serverhandler.cpp @@ -90,11 +90,11 @@ class ServerHandler: public ConnectionHandler static ServerHandler *serverHandler; -bool GameServerHandler::initialize(int port) +bool GameServerHandler::initialize(int port, const std::string &host) { serverHandler = new ServerHandler; LOG_INFO("Game server handler started:"); - return serverHandler->startListen(port); + return serverHandler->startListen(port, host); } void GameServerHandler::deinitialize() diff --git a/src/account-server/serverhandler.hpp b/src/account-server/serverhandler.hpp index f89c6ddc..dab3cf2e 100644 --- a/src/account-server/serverhandler.hpp +++ b/src/account-server/serverhandler.hpp @@ -34,7 +34,7 @@ namespace GameServerHandler /** * Creates a connection handler and starts listening on given port. */ - bool initialize(int port); + bool initialize(int port, const std::string &host); /** * Stops listening to messages and destroys the connection handler. |