diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-11-02 13:35:10 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-11-02 13:35:10 +0000 |
commit | f555abfda840099d34af90fe3682acce09fe5fdf (patch) | |
tree | ffba696c5a4bf41bdfac39a5d4e7b3c74b5c9a76 /src/main.cpp | |
parent | 5f0ebee0d4d75fa91d417f4f352abdbc7502c2f0 (diff) | |
download | mana-client-f555abfda840099d34af90fe3682acce09fe5fdf.tar.gz mana-client-f555abfda840099d34af90fe3682acce09fe5fdf.tar.bz2 mana-client-f555abfda840099d34af90fe3682acce09fe5fdf.tar.xz mana-client-f555abfda840099d34af90fe3682acce09fe5fdf.zip |
Removed some cruft that was needed for eAthena.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/src/main.cpp b/src/main.cpp index 41d49b43..0ae328ea 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -68,7 +68,6 @@ #include "net/charserverhandler.h" #include "net/connection.h" #include "net/loginhandler.h" -#include "net/maploginhandler.h" #include "net/network.h" #include "net/accountserver/accountserver.h" @@ -446,17 +445,16 @@ CharServerHandler charServerHandler; LoginData loginData; LoginHandler loginHandler; LockedArray<LocalPlayer*> charInfo(MAX_SLOT + 1); -MapLoginHandler mapLoginHandler; // TODO Find some nice place for these functions void accountLogin(LoginData *loginData) { logger->log("Username is %s", loginData->username.c_str()); + Net::registerHandler(&loginHandler); - Net::registerHandler(&charServerHandler); - loginHandler.setLoginData(loginData); - charServerHandler.setLoginData(loginData); + charServerHandler.setCharInfo(&charInfo); + Net::registerHandler(&charServerHandler); // Send login infos Net::AccountServer::login(accountServerConnection, 0, @@ -477,27 +475,16 @@ void accountLogin(LoginData *loginData) void accountRegister(LoginData *loginData) { logger->log("Username is %s", loginData->username.c_str()); + Net::registerHandler(&loginHandler); - loginHandler.setLoginData(loginData); - charServerHandler.setLoginData(loginData); + charServerHandler.setCharInfo(&charInfo); + Net::registerHandler(&charServerHandler); Net::AccountServer::registerAccount(accountServerConnection, 0, loginData->username, loginData->password, loginData->email); } -void mapLogin(LoginData *loginData) -{ - Net::registerHandler(&mapLoginHandler); - - logger->log("Memorizing selected character %s", - player_node->getName().c_str()); - config.setValue("lastCharacter", player_node->getName()); - - Net::GameServer::connect(gameServerConnection, token); - Net::ChatServer::connect(chatServerConnection, token); -} - /** Main */ int main(int argc, char *argv[]) { @@ -647,6 +634,7 @@ int main(int argc, char *argv[]) chatServerConnection->isConnected()) { accountServerConnection->disconnect(); + Net::clearHandlers(); state = STATE_GAME; } @@ -752,7 +740,12 @@ int main(int argc, char *argv[]) break; case STATE_GAME: - mapLogin(&loginData); + logger->log("Memorizing selected character %s", + player_node->getName().c_str()); + config.setValue("lastCharacter", player_node->getName()); + + Net::GameServer::connect(gameServerConnection, token); + Net::ChatServer::connect(chatServerConnection, token); sound.fadeOutMusic(1000); currentDialog = NULL; |