From c674793a8657aa099c9637c92f8696f230c327ca Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 10 Jan 2011 00:07:12 +0200 Subject: Add persistent ip as connection option. Usefull is player using some kind of port mapping. --- src/net/tmwa/charserverhandler.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/net/tmwa/charserverhandler.cpp') diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index e500f667b..4bf9df8b3 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -160,7 +160,15 @@ void CharServerHandler::handleMessage(Net::MessageIn &msg) PlayerInfo::setCharId(msg.readInt32()); GameHandler *gh = static_cast(Net::getGameHandler()); gh->setMap(msg.readString(16)); - mapServer.hostname = ipToString(msg.readInt32()); + if (config.getBoolValue("usePersistentIP")) + { + msg.readInt32(); + mapServer.hostname = Client::getServerName(); + } + else + { + mapServer.hostname = ipToString(msg.readInt32()); + } mapServer.port = msg.readInt16(); // Prevent the selected local player from being deleted -- cgit v1.2.3-70-g09d2