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/net/ea | |
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/net/ea')
-rw-r--r-- | src/net/ea/generalhandler.cpp | 15 | ||||
-rw-r--r-- | src/net/ea/generalhandler.h | 2 | ||||
-rw-r--r-- | src/net/ea/loginhandler.cpp | 11 | ||||
-rw-r--r-- | src/net/ea/loginhandler.h | 3 |
4 files changed, 23 insertions, 8 deletions
diff --git a/src/net/ea/generalhandler.cpp b/src/net/ea/generalhandler.cpp index 692ebec0..8f02d629 100644 --- a/src/net/ea/generalhandler.cpp +++ b/src/net/ea/generalhandler.cpp @@ -60,14 +60,16 @@ #include "utils/gettext.h" +#include <assert.h> #include <list> -Net::GeneralHandler *generalHandler; +Net::GeneralHandler *generalHandler = NULL; namespace EAthena { Token netToken; ServerInfo charServer; ServerInfo mapServer; +Worlds worlds; GeneralHandler::GeneralHandler(): mAdminHandler(new AdminHandler), @@ -86,6 +88,7 @@ GeneralHandler::GeneralHandler(): mSpecialHandler(new SpecialHandler), mTradeHandler(new TradeHandler) { + //assert(false); static const Uint16 _messages[] = { SMSG_CONNECTION_PROBLEM, 0 @@ -172,9 +175,17 @@ void GeneralHandler::load() mNetwork->registerHandler(mPartyHandler.get()); } +void GeneralHandler::reload() +{ + if (mNetwork) + mNetwork->disconnect(); + worlds.clear(); +} + void GeneralHandler::unload() { - mNetwork->clearHandlers(); + if (mNetwork) + mNetwork->clearHandlers(); } void GeneralHandler::flushNetwork() diff --git a/src/net/ea/generalhandler.h b/src/net/ea/generalhandler.h index 099bed0b..b8ea8049 100644 --- a/src/net/ea/generalhandler.h +++ b/src/net/ea/generalhandler.h @@ -40,6 +40,8 @@ class GeneralHandler : public MessageHandler, public Net::GeneralHandler void load(); + void reload(); + void unload(); void flushNetwork(); diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp index d2e2adc0..de52bfa3 100644 --- a/src/net/ea/loginhandler.cpp +++ b/src/net/ea/loginhandler.cpp @@ -35,13 +35,12 @@ #include "utils/gettext.h" #include "utils/stringutils.h" -Worlds worlds; - Net::LoginHandler *loginHandler; namespace EAthena { extern Token netToken; extern ServerInfo charServer; +extern Worlds worlds; LoginHandler::LoginHandler() { @@ -212,10 +211,14 @@ void LoginHandler::disconnect() void LoginHandler::loginAccount(LoginData *loginData) { - mLoginData = loginData; sendLoginRegister(loginData->username, loginData->password); } +void LoginHandler::logout() +{ + // TODO +} + void LoginHandler::changeEmail(const std::string &email) { // TODO @@ -242,8 +245,6 @@ void LoginHandler::chooseServer(unsigned int server) void LoginHandler::registerAccount(LoginData *loginData) { - mLoginData = loginData; - std::string username = loginData->username; username.append((netToken.sex == GENDER_FEMALE) ? "_F" : "_M"); diff --git a/src/net/ea/loginhandler.h b/src/net/ea/loginhandler.h index 780aa832..c5ce975e 100644 --- a/src/net/ea/loginhandler.h +++ b/src/net/ea/loginhandler.h @@ -51,6 +51,8 @@ class LoginHandler : public MessageHandler, public Net::LoginHandler void loginAccount(LoginData *loginData); + void logout(); + void changeEmail(const std::string &email); void changePassword(const std::string &username, @@ -70,7 +72,6 @@ class LoginHandler : public MessageHandler, public Net::LoginHandler void sendLoginRegister(const std::string &username, const std::string &password); - LoginData *mLoginData; std::string mUpdateHost; }; |