diff options
Diffstat (limited to 'src/net/ea')
-rw-r--r-- | src/net/ea/gamehandler.cpp | 14 | ||||
-rw-r--r-- | src/net/ea/gamehandler.h | 10 |
2 files changed, 14 insertions, 10 deletions
diff --git a/src/net/ea/gamehandler.cpp b/src/net/ea/gamehandler.cpp index 64e952680..8d42cc220 100644 --- a/src/net/ea/gamehandler.cpp +++ b/src/net/ea/gamehandler.cpp @@ -41,10 +41,14 @@ namespace Ea { +std::string GameHandler::mMap; +int GameHandler::mCharID = 0; + GameHandler::GameHandler() : - mMap(), - mCharID(0) + Net::GameHandler() { + mMap.clear(); + mCharID = 0; } void GameHandler::who() const @@ -56,19 +60,19 @@ void GameHandler::setMap(const std::string &map) mMap = map.substr(0, map.rfind(".")); } -void GameHandler::processWhoAnswer(Net::MessageIn &msg) const +void GameHandler::processWhoAnswer(Net::MessageIn &msg) { NotifyManager::notify(NotifyTypes::ONLINE_USERS, msg.readInt32("users count")); } -void GameHandler::processCharSwitchResponse(Net::MessageIn &msg) const +void GameHandler::processCharSwitchResponse(Net::MessageIn &msg) { if (msg.readUInt8("response")) client->setState(STATE_SWITCH_CHARACTER); } -void GameHandler::processMapQuitResponse(Net::MessageIn &msg) const +void GameHandler::processMapQuitResponse(Net::MessageIn &msg) { if (msg.readUInt8("response")) { diff --git a/src/net/ea/gamehandler.h b/src/net/ea/gamehandler.h index 68de36c70..09854b7a5 100644 --- a/src/net/ea/gamehandler.h +++ b/src/net/ea/gamehandler.h @@ -50,19 +50,19 @@ class GameHandler notfinal : public Net::GameHandler virtual bool canUseMagicBar() const override final A_WARN_UNUSED { return true; } - virtual void processWhoAnswer(Net::MessageIn &msg) const; + static void processWhoAnswer(Net::MessageIn &msg); - virtual void processCharSwitchResponse(Net::MessageIn &msg) const; + static void processCharSwitchResponse(Net::MessageIn &msg); - virtual void processMapQuitResponse(Net::MessageIn &msg) const; + static void processMapQuitResponse(Net::MessageIn &msg); virtual void clear() override final; virtual void initEngines() const override final; protected: - std::string mMap; - int mCharID; // < Saved for map-server switching + static std::string mMap; + static int mCharID; // < Saved for map-server switching }; } // namespace Ea |