diff options
Diffstat (limited to 'src/net/tmwa')
-rw-r--r-- | src/net/tmwa/gamehandler.cpp | 18 | ||||
-rw-r--r-- | src/net/tmwa/gamehandler.h | 3 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp index fabd15b1b..e74315b44 100644 --- a/src/net/tmwa/gamehandler.cpp +++ b/src/net/tmwa/gamehandler.cpp @@ -171,4 +171,22 @@ void GameHandler::disconnect2() const MessageOut outMsg(CMSG_CLIENT_DISCONNECT); } +void GameHandler::processMapLogin(Net::MessageIn &msg) const +{ + unsigned char direction; + uint16_t x, y; + msg.readInt32(); // server tick + msg.readCoordinates(x, y, direction); + msg.skip(2); // 0x0505 + logger->log("Protocol: Player start position: (%d, %d)," + " Direction: %d", x, y, direction); + + mLastHost &= 0xffffff; + + // Switch now or we'll have problems + client->setState(STATE_GAME); + if (localPlayer) + localPlayer->setTileCoords(x, y); +} + } // namespace TmwAthena diff --git a/src/net/tmwa/gamehandler.h b/src/net/tmwa/gamehandler.h index fdbb4cf17..b3736289e 100644 --- a/src/net/tmwa/gamehandler.h +++ b/src/net/tmwa/gamehandler.h @@ -55,6 +55,9 @@ class GameHandler final : public MessageHandler, public Ea::GameHandler bool mustPing() const override final A_WARN_UNUSED { return false; } + + protected: + void processMapLogin(Net::MessageIn &msg) const; }; } // namespace TmwAthena |