diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-10-03 12:40:52 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-10-03 16:47:11 -0600 |
commit | 0269b1f766a4e9e8ded91505855cff58c18086e2 (patch) | |
tree | c557c4c189bb536ab5ef7b8642011fe4f1da4eff /src/main.cpp | |
parent | eb22b66b0821e49ed550d30d20d9db5af535e6a3 (diff) | |
download | mana-0269b1f766a4e9e8ded91505855cff58c18086e2.tar.gz mana-0269b1f766a4e9e8ded91505855cff58c18086e2.tar.bz2 mana-0269b1f766a4e9e8ded91505855cff58c18086e2.tar.xz mana-0269b1f766a4e9e8ded91505855cff58c18086e2.zip |
Do some more post-merge cleanup
Fixes a few more bugs
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/main.cpp b/src/main.cpp index 2a76f759..90e31f5a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -924,6 +924,8 @@ int main(int argc, char *argv[]) loadUpdates(); } + //printf("State change: %d to %d\n", oldstate, state); + oldstate = state; // Get rid of the dialog of the previous state @@ -963,11 +965,8 @@ int main(int argc, char *argv[]) break; case STATE_CONNECT_SERVER: - Net::connectToServer(currentServer); - logger->log("State: CONNECT_SERVER"); - currentDialog = new ConnectionDialog( - STATE_SWITCH_SERVER_ATTEMPT); + currentDialog = new ConnectionDialog(STATE_SWITCH_SERVER); break; case STATE_UPDATE: @@ -1039,6 +1038,7 @@ int main(int argc, char *argv[]) logger->log("State: WORLD SELECT"); { Worlds worlds = Net::getLoginHandler()->getWorlds(); + if (worlds.size() == 0) { state = STATE_UPDATE; @@ -1074,7 +1074,7 @@ int main(int argc, char *argv[]) break; case STATE_SWITCH_SERVER: - logger->log("State: SWITCH_SERVER"); + logger->log("State: SWITCH SERVER"); #ifdef TMWSERV_SUPPORT gameServerConnection->disconnect(); @@ -1085,12 +1085,12 @@ int main(int argc, char *argv[]) state = STATE_CHOOSE_SERVER; break; - case STATE_SWITCH_SERVER_ATTEMPT: - logger->log("State: SWITCH_SERVER_ATTEMPT"); + case STATE_SWITCH_LOGIN: + logger->log("State: SWITCH LOGIN"); - // TODO + Net::getLoginHandler()->logout(); - state = STATE_SWITCH_SERVER; + state = STATE_LOGIN; break; case STATE_REGISTER: @@ -1194,8 +1194,7 @@ int main(int argc, char *argv[]) case STATE_CONNECT_GAME: logger->log("State: CONNECT_GAME"); Net::getGameHandler()->connect(); - currentDialog = new ConnectionDialog( - STATE_SWITCH_SERVER_ATTEMPT); + currentDialog = new ConnectionDialog(STATE_SWITCH_CHARACTER); break; case STATE_GAME: |