summaryrefslogtreecommitdiff
path: root/src/net/ea/gamehandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-03-28 01:51:25 +0300
committerAndrei Karas <akaras@inbox.ru>2013-03-28 01:51:25 +0300
commitff936ce120283ade23d88725c7d38542beca0a93 (patch)
tree5b2d26630c3a0537b0f578994d9ada7653c0cab3 /src/net/ea/gamehandler.cpp
parentc9b13ba269857de0311863bf4d4461185fe10459 (diff)
downloadManaVerse-ff936ce120283ade23d88725c7d38542beca0a93.tar.gz
ManaVerse-ff936ce120283ade23d88725c7d38542beca0a93.tar.bz2
ManaVerse-ff936ce120283ade23d88725c7d38542beca0a93.tar.xz
ManaVerse-ff936ce120283ade23d88725c7d38542beca0a93.zip
improve gamehandler class
Diffstat (limited to 'src/net/ea/gamehandler.cpp')
-rw-r--r--src/net/ea/gamehandler.cpp34
1 files changed, 11 insertions, 23 deletions
diff --git a/src/net/ea/gamehandler.cpp b/src/net/ea/gamehandler.cpp
index 19978979b..4a011c6a8 100644
--- a/src/net/ea/gamehandler.cpp
+++ b/src/net/ea/gamehandler.cpp
@@ -37,27 +37,9 @@ namespace Ea
GameHandler::GameHandler() :
mCharID(0)
{
- listen(CHANNEL_GAME);
}
-void GameHandler::processEvent(Channels channel,
- const DepricatedEvent &event)
-{
- if (channel == CHANNEL_GAME)
- {
- if (event.getName() == EVENT_ENGINESINITALIZED)
- {
- if (!mMap.empty())
- Game::instance()->changeMap(mMap);
- }
- else if (event.getName() == EVENT_MAPLOADED)
- {
- mapLoadedEvent();
- }
- }
-}
-
-void GameHandler::who()
+void GameHandler::who() const
{
}
@@ -66,7 +48,7 @@ void GameHandler::setMap(const std::string &map)
mMap = map.substr(0, map.rfind("."));
}
-void GameHandler::processMapLogin(Net::MessageIn &msg)
+void GameHandler::processMapLogin(Net::MessageIn &msg) const
{
unsigned char direction;
uint16_t x, y;
@@ -81,18 +63,18 @@ void GameHandler::processMapLogin(Net::MessageIn &msg)
player_node->setTileCoords(x, y);
}
-void GameHandler::processWhoAnswer(Net::MessageIn &msg)
+void GameHandler::processWhoAnswer(Net::MessageIn &msg) const
{
NotifyManager::notify(NotifyManager::ONLINE_USERS, msg.readInt32());
}
-void GameHandler::processCharSwitchResponse(Net::MessageIn &msg)
+void GameHandler::processCharSwitchResponse(Net::MessageIn &msg) const
{
if (msg.readInt8())
Client::setState(STATE_SWITCH_CHARACTER);
}
-void GameHandler::processMapQuitResponse(Net::MessageIn &msg)
+void GameHandler::processMapQuitResponse(Net::MessageIn &msg) const
{
if (msg.readInt8())
new OkDialog(_("Game"), _("Request to quit denied!"), DIALOG_ERROR);
@@ -104,4 +86,10 @@ void GameHandler::clear()
mCharID = 0;
}
+void GameHandler::initEngines() const
+{
+ if (!mMap.empty())
+ Game::instance()->changeMap(mMap);
+}
+
} // namespace Ea