diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-04-12 14:46:06 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-04-12 15:15:37 -0600 |
commit | 612c842f32fec68ece4244ac672a1b889cf2eb18 (patch) | |
tree | 8682f225a4681e281505bd0f4c501be701228a9e /src/net/manaserv | |
parent | f30f3e6a51fc20bded8a3a04cd3a0f328a064469 (diff) | |
download | mana-612c842f32fec68ece4244ac672a1b889cf2eb18.tar.gz mana-612c842f32fec68ece4244ac672a1b889cf2eb18.tar.bz2 mana-612c842f32fec68ece4244ac672a1b889cf2eb18.tar.xz mana-612c842f32fec68ece4244ac672a1b889cf2eb18.zip |
Add support for map-server switching under eAthena
Also do some cleanup that's been needed for a while.
Reviewed-by: Bertram
Diffstat (limited to 'src/net/manaserv')
-rw-r--r-- | src/net/manaserv/gamehandler.cpp | 22 | ||||
-rw-r--r-- | src/net/manaserv/gamehandler.h | 2 | ||||
-rw-r--r-- | src/net/manaserv/generalhandler.cpp | 9 | ||||
-rw-r--r-- | src/net/manaserv/generalhandler.h | 2 |
4 files changed, 26 insertions, 9 deletions
diff --git a/src/net/manaserv/gamehandler.cpp b/src/net/manaserv/gamehandler.cpp index dd6120ae..4c6c8e38 100644 --- a/src/net/manaserv/gamehandler.cpp +++ b/src/net/manaserv/gamehandler.cpp @@ -108,15 +108,7 @@ void GameHandler::disconnect() void GameHandler::inGame() { - - MessageOut msg(PGMSG_CONNECT); - msg.writeString(netToken, 32); - gameServerConnection->send(msg); - - chatHandler->connect(); - - // Attack range from item DB - player_node->setAttackRange(-1); + // TODO } void GameHandler::mapLoaded(const std::string &mapName) @@ -141,4 +133,16 @@ void GameHandler::ping(int tick) // TODO } +void GameHandler::gameLoading() +{ + MessageOut msg(PGMSG_CONNECT); + msg.writeString(netToken, 32); + gameServerConnection->send(msg); + + chatHandler->connect(); + + // Attack range from item DB + player_node->setAttackRange(-1); +} + } // namespace ManaServ diff --git a/src/net/manaserv/gamehandler.h b/src/net/manaserv/gamehandler.h index b021555f..dde1748f 100644 --- a/src/net/manaserv/gamehandler.h +++ b/src/net/manaserv/gamehandler.h @@ -57,6 +57,8 @@ class GameHandler : public MessageHandler, public Net::GameHandler bool removeDeadBeings() const { return false; } void clear(); + + void gameLoading(); }; } // namespace ManaServ diff --git a/src/net/manaserv/generalhandler.cpp b/src/net/manaserv/generalhandler.cpp index 6e1639af..0e030aa8 100644 --- a/src/net/manaserv/generalhandler.cpp +++ b/src/net/manaserv/generalhandler.cpp @@ -182,4 +182,13 @@ void GeneralHandler::clearHandlers() clearNetworkHandlers(); } +void GeneralHandler::stateChanged(State oldState, State newState) +{ + if (newState == STATE_GAME) + { + GameHandler *game = static_cast<GameHandler*>(Net::getGameHandler()); + game->gameLoading(); + } +} + } // namespace ManaServ diff --git a/src/net/manaserv/generalhandler.h b/src/net/manaserv/generalhandler.h index 61fa4aa3..58b95529 100644 --- a/src/net/manaserv/generalhandler.h +++ b/src/net/manaserv/generalhandler.h @@ -48,6 +48,8 @@ class GeneralHandler : public Net::GeneralHandler void clearHandlers(); + void stateChanged(State oldState, State newState); + protected: MessageHandlerPtr mBeingHandler; MessageHandlerPtr mBuySellHandler; |