summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2012-04-07 17:31:06 +0200
committerErik Schilling <ablu.erikschilling@googlemail.com>2012-04-12 12:48:28 +0200
commitdcd66debbe519403d3b8f7bf30313fbdee71fe6c (patch)
tree6a5df54bb70078e3fa673b30af45484777232ee0
parent2d2d8e70911de15c8c82c06b7cdaff1d33e9992e (diff)
downloadmanaserv-dcd66debbe519403d3b8f7bf30313fbdee71fe6c.tar.gz
manaserv-dcd66debbe519403d3b8f7bf30313fbdee71fe6c.tar.xz
manaserv-dcd66debbe519403d3b8f7bf30313fbdee71fe6c.zip
Fixed issues with server behind router
Tested-by: jurkan. Reviewed-by: Bertram.
-rw-r--r--docs/manaserv.xml.example6
-rw-r--r--src/account-server/accounthandler.cpp4
-rw-r--r--src/game-server/accountconnection.cpp4
3 files changed, 11 insertions, 3 deletions
diff --git a/docs/manaserv.xml.example b/docs/manaserv.xml.example
index a2171e9..75331b6 100644
--- a/docs/manaserv.xml.example
+++ b/docs/manaserv.xml.example
@@ -148,6 +148,9 @@
-->
<option name="net_chatHost" value="localhost"/>
<option name="net_chatListenToClientPort" value="9603"/>
+ <!-- needed to set when hosting behind router or in situations
+ where you cannot bind the server to the public url -->
+ <!-- <option name="net_publicChatHost" value="mydomain.org"/> -->
<!--
The clients use this address to connect to a game server on this machine.
@@ -156,6 +159,9 @@
-->
<option name="net_gameHost" value="localhost"/>
<option name="net_gameListenToClientPort" value="9604"/>
+ <!-- needed to set when hosting behind router or in situations
+ where you cannot bind the server to the public url -->
+ <!-- <option name="net_publicGameHost" value="mydomain.org"/> -->
<!--
Update host url: E.g.: "http://updates.manasource.org/"
diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp
index b0ac4d5..3590dbe 100644
--- a/src/account-server/accounthandler.cpp
+++ b/src/account-server/accounthandler.cpp
@@ -881,8 +881,8 @@ void AccountHandler::handleCharacterSelectMessage(AccountClient &client,
reply.writeInt16(port);
// Give address and port for the chat server
- reply.writeString(Configuration::getValue("net_chatHost",
- "localhost"));
+ reply.writeString(Configuration::getValue("net_publicChatHost",
+ Configuration::getValue("net_chatHost", "localhost")));
// When the chatListenToClientPort is set, we use it.
// Otherwise, we use the accountListenToClientPort + 2 if the option is set.
diff --git a/src/game-server/accountconnection.cpp b/src/game-server/accountconnection.cpp
index 52282a9..3d37ea6 100644
--- a/src/game-server/accountconnection.cpp
+++ b/src/game-server/accountconnection.cpp
@@ -78,7 +78,9 @@ bool AccountConnection::start(int gameServerPort)
LOG_INFO("Connection established to the account server.");
const std::string gameServerAddress =
- Configuration::getValue("net_gameHost", "localhost");
+ Configuration::getValue("net_publicGameHost",
+ Configuration::getValue("net_gameHost",
+ "localhost"));
const std::string password =
Configuration::getValue("net_password", "changeMe");