diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-02-21 20:40:07 +0100 |
---|---|---|
committer | Chuck Miller <shadowmil@gmail.com> | 2010-02-21 17:05:40 -0500 |
commit | c8b0d1e56f27c3141895d28b2fc768afffe7bb2d (patch) | |
tree | 0a03458836badee3e1b0da13a0721c9261e7fa86 /src/net/ea/loginhandler.cpp | |
parent | 204a14c91bbe4436eb3b26bebf30cbe5669bdd1a (diff) | |
download | mana-client-c8b0d1e56f27c3141895d28b2fc768afffe7bb2d.tar.gz mana-client-c8b0d1e56f27c3141895d28b2fc768afffe7bb2d.tar.bz2 mana-client-c8b0d1e56f27c3141895d28b2fc768afffe7bb2d.tar.xz mana-client-c8b0d1e56f27c3141895d28b2fc768afffe7bb2d.zip |
Made tick counter and framerate limiter work during login sequence
Much code was moved from main() to the new Client::exec(). This new
event loop now integrates with the Game class, so that the tick counter
and framerate limiter apply universally.
The Client class is also responsible for some things that used to be
global variables.
Mantis-issue: ...
Diffstat (limited to 'src/net/ea/loginhandler.cpp')
-rw-r--r-- | src/net/ea/loginhandler.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp index 3f0fe0d0..bec97ed7 100644 --- a/src/net/ea/loginhandler.cpp +++ b/src/net/ea/loginhandler.cpp @@ -21,8 +21,8 @@ #include "net/ea/loginhandler.h" +#include "client.h" #include "log.h" -#include "main.h" #include "net/logindata.h" #include "net/messagein.h" @@ -68,7 +68,7 @@ void LoginHandler::handleMessage(Net::MessageIn &msg) // Successful pass change if (errMsg == 1) { - state = STATE_CHANGEPASSWORD_SUCCESS; + Client::setState(STATE_CHANGEPASSWORD_SUCCESS); } // pass change failed else @@ -88,7 +88,7 @@ void LoginHandler::handleMessage(Net::MessageIn &msg) errorMessage = _("Unknown error."); break; } - state = STATE_ACCOUNTCHANGE_ERROR; + Client::setState(STATE_ACCOUNTCHANGE_ERROR); } } break; @@ -136,7 +136,7 @@ void LoginHandler::handleMessage(Net::MessageIn &msg) mWorlds.push_back(world); } - state = STATE_WORLD_SELECT; + Client::setState(STATE_WORLD_SELECT); break; case SMSG_LOGIN_ERROR: @@ -175,8 +175,9 @@ void LoginHandler::handleMessage(Net::MessageIn &msg) errorMessage = _("Unknown error."); break; } - state = STATE_ERROR; + Client::setState(STATE_ERROR); break; + case SMSG_SERVER_VERSION_RESPONSE: { // TODO: verify these! @@ -214,7 +215,7 @@ void LoginHandler::disconnect() void LoginHandler::getRegistrationDetails() { // Not supported, so move on - state = STATE_REGISTER; + Client::setState(STATE_REGISTER); } void LoginHandler::loginAccount(LoginData *loginData) @@ -250,7 +251,7 @@ void LoginHandler::chooseServer(unsigned int server) charServer.hostname = ipToString(mWorlds[server]->address); charServer.port = mWorlds[server]->port; - state = STATE_UPDATE; + Client::setState(STATE_UPDATE); } void LoginHandler::registerAccount(LoginData *loginData) |