summaryrefslogtreecommitdiff
path: root/src/net/ea/gamehandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/ea/gamehandler.cpp')
-rw-r--r--src/net/ea/gamehandler.cpp50
1 files changed, 9 insertions, 41 deletions
diff --git a/src/net/ea/gamehandler.cpp b/src/net/ea/gamehandler.cpp
index 8f21edf8f..4f8734e92 100644
--- a/src/net/ea/gamehandler.cpp
+++ b/src/net/ea/gamehandler.cpp
@@ -34,6 +34,8 @@
#include "net/messagein.h"
+#include "net/ea/gamerecv.h"
+
#include "utils/gettext.h"
#include "debug.h"
@@ -41,14 +43,11 @@
namespace Ea
{
-std::string GameHandler::mMap;
-BeingId GameHandler::mCharID = BeingId_zero;
-
GameHandler::GameHandler() :
Net::GameHandler()
{
- mMap.clear();
- mCharID = BeingId_zero;
+ GameRecv::mMap.clear();
+ GameRecv::mCharID = BeingId_zero;
}
void GameHandler::who() const
@@ -57,50 +56,19 @@ void GameHandler::who() const
void GameHandler::setMap(const std::string &map)
{
- mMap = map.substr(0, map.rfind("."));
-}
-
-void GameHandler::processWhoAnswer(Net::MessageIn &msg)
-{
- NotifyManager::notify(NotifyTypes::ONLINE_USERS,
- msg.readInt32("users count"));
-}
-
-void GameHandler::processCharSwitchResponse(Net::MessageIn &msg)
-{
- if (msg.readUInt8("response"))
- client->setState(STATE_SWITCH_CHARACTER);
-}
-
-void GameHandler::processMapQuitResponse(Net::MessageIn &msg)
-{
- if (msg.readUInt8("response"))
- {
- CREATEWIDGET(OkDialog,
- // TRANSLATORS: error header
- _("Game"),
- // TRANSLATORS: error message
- _("Request to quit denied!"),
- // TRANSLATORS: ok dialog button
- _("OK"),
- DialogType::ERROR,
- Modal_true,
- ShowCenter_true,
- nullptr,
- 260);
- }
+ GameRecv::mMap = map.substr(0, map.rfind("."));
}
void GameHandler::clear()
{
- mMap.clear();
- mCharID = BeingId_zero;
+ GameRecv::mMap.clear();
+ GameRecv::mCharID = BeingId_zero;
}
void GameHandler::initEngines() const
{
- if (!mMap.empty())
- Game::instance()->changeMap(mMap);
+ if (!GameRecv::mMap.empty())
+ Game::instance()->changeMap(GameRecv::mMap);
}
} // namespace Ea