diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 15:43:00 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 15:43:04 +0100 |
commit | 73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6 (patch) | |
tree | ea00f8e3ccbdb601bcac58f60d40ab1db1d2408a /src/net/tmwa/charserverhandler.cpp | |
parent | bf8a3fc881d17f44cdcfdf3639289bef09229c03 (diff) | |
download | mana-73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6.tar.gz mana-73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6.tar.bz2 mana-73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6.tar.xz mana-73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6.zip |
Added support for the "persistentIp" server info setting
This option was added in ManaPlus and support for it is required to
connect to The Mana World as it is currently set up, since the server
sends 127.0.0.1 for the character server and map server IP.
Can't play yet, because of an unknown packet 0x226 being received once
connecting to the map server.
Diffstat (limited to 'src/net/tmwa/charserverhandler.cpp')
-rw-r--r-- | src/net/tmwa/charserverhandler.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index 7c5f5c88..a8e87622 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -158,7 +158,14 @@ void CharServerHandler::handleMessage(MessageIn &msg) msg.skip(4); // CharID, must be the same as local_player->charID GameHandler *gh = static_cast<GameHandler*>(Net::getGameHandler()); gh->setMap(msg.readString(16)); - mapServer.hostname = ipToString(msg.readInt32()); + + const auto ip = msg.readInt32(); + + if (charServer.persistentIp) + mapServer.hostname = charServer.hostname; + else + mapServer.hostname = ipToString(ip); + mapServer.port = msg.readInt16(); local_player = mSelectedCharacter->dummy; |