diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2022-08-19 15:05:52 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2022-08-19 15:05:59 +0200 |
commit | 20d2a17dccd77f5b31e41a170bacc656fa5acc7d (patch) | |
tree | 0abbe21d16b3f9a721b75f9204520ca9fddfd1c2 | |
parent | 77f7206d91a12abd4effd5c20188653e83faa54b (diff) | |
download | manaserv-20d2a17dccd77f5b31e41a170bacc656fa5acc7d.tar.gz manaserv-20d2a17dccd77f5b31e41a170bacc656fa5acc7d.tar.bz2 manaserv-20d2a17dccd77f5b31e41a170bacc656fa5acc7d.tar.xz manaserv-20d2a17dccd77f5b31e41a170bacc656fa5acc7d.zip |
Added net_accountListenToGameHost config option
This is because the network interface on which the account server
listens to the game server does not need to match the one on which the
account server listens to the client.
-rw-r--r-- | src/account-server/main-account.cpp | 4 | ||||
-rw-r--r-- | src/game-server/accountconnection.cpp | 3 | ||||
-rw-r--r-- | src/net/connectionhandler.cpp | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/account-server/main-account.cpp b/src/account-server/main-account.cpp index b3edf207..e14b301f 100644 --- a/src/account-server/main-account.cpp +++ b/src/account-server/main-account.cpp @@ -331,6 +331,8 @@ int main(int argc, char *argv[]) std::string accountHost = Configuration::getValue("net_accountHost", "localhost"); + std::string accountListenToGameHost = Configuration::getValue("net_accountListenToGameHost", + accountHost); // We separate the chat host as the chat server will be separated out // from the account server. @@ -354,7 +356,7 @@ int main(int argc, char *argv[]) if (!AccountClientHandler::initialize(DEFAULT_ATTRIBUTEDB_FILE, options.port, accountHost) || - !GameServerHandler::initialize(accountGamePort, accountHost) || + !GameServerHandler::initialize(accountGamePort, accountListenToGameHost) || !chatHandler->startListen(chatClientPort, chatHost)) { LOG_FATAL("Unable to create an ENet server host."); diff --git a/src/game-server/accountconnection.cpp b/src/game-server/accountconnection.cpp index 6b7b728a..546ae5ae 100644 --- a/src/game-server/accountconnection.cpp +++ b/src/game-server/accountconnection.cpp @@ -56,7 +56,8 @@ AccountConnection::~AccountConnection() bool AccountConnection::start(int gameServerPort) { const std::string accountServerAddress = - Configuration::getValue("net_accountHost", "localhost"); + Configuration::getValue("net_accountListenToGameHost", + Configuration::getValue("net_accountHost", "localhost")); // When the accountListenToGamePort is set, we use it. // Otherwise, we use the accountListenToClientPort + 1 if the option is set. diff --git a/src/net/connectionhandler.cpp b/src/net/connectionhandler.cpp index f1bcf5ff..edf46dba 100644 --- a/src/net/connectionhandler.cpp +++ b/src/net/connectionhandler.cpp @@ -45,7 +45,7 @@ bool ConnectionHandler::startListen(enet_uint16 port, if (!listenHost.empty()) enet_address_set_host(&address, listenHost.c_str()); - LOG_INFO("Listening on port " << port << "..."); + LOG_INFO("Listening on " << listenHost << ":" << port << "..."); #if defined(ENET_VERSION) && ENET_VERSION >= ENET_CUTOFF host = enet_host_create( &address /* the address to bind the server host to */, |