diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-04-11 08:58:32 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-04-11 08:58:52 -0600 |
commit | 14a6e6a4bc5d39ddf8f31efc07a5e2493a6f6d0a (patch) | |
tree | da62e5694614e55df1c1a0fc5d5676ac7415daa6 /src/net/ea | |
parent | 78cab005ab427e64ccdf8ba8f6ca7d4c6f6bd4b4 (diff) | |
download | mana-client-14a6e6a4bc5d39ddf8f31efc07a5e2493a6f6d0a.tar.gz mana-client-14a6e6a4bc5d39ddf8f31efc07a5e2493a6f6d0a.tar.bz2 mana-client-14a6e6a4bc5d39ddf8f31efc07a5e2493a6f6d0a.tar.xz mana-client-14a6e6a4bc5d39ddf8f31efc07a5e2493a6f6d0a.zip |
Remove more support #ifdefs
Diffstat (limited to 'src/net/ea')
-rw-r--r-- | src/net/ea/generalhandler.cpp | 30 | ||||
-rw-r--r-- | src/net/ea/generalhandler.h | 6 |
2 files changed, 35 insertions, 1 deletions
diff --git a/src/net/ea/generalhandler.cpp b/src/net/ea/generalhandler.cpp index 91406278..7d5a7d40 100644 --- a/src/net/ea/generalhandler.cpp +++ b/src/net/ea/generalhandler.cpp @@ -82,6 +82,11 @@ GeneralHandler::GeneralHandler(): generalHandler = this; } +GeneralHandler::~GeneralHandler() +{ + delete mNetwork; +} + void GeneralHandler::handleMessage(MessageIn &msg) { int code; @@ -140,11 +145,13 @@ void GeneralHandler::load() void GeneralHandler::unload() { mNetwork->clearHandlers(); - delete partyTab; } void GeneralHandler::flushNetwork() { + if (!mNetwork) + return; + mNetwork->flush(); mNetwork->dispatchMessages(); } @@ -154,9 +161,30 @@ bool GeneralHandler::isNetworkConnected() return mNetwork->isConnected(); } +void GeneralHandler::tick() +{ + if (!mNetwork) + return; + + if (mNetwork->getState() == Network::NET_ERROR) + { + state = STATE_ERROR; + + if (!mNetwork->getError().empty()) + errorMessage = mNetwork->getError(); + else + errorMessage = _("Got disconnected from server!"); + } +} + void GeneralHandler::guiWindowsLoaded() { partyTab = new PartyTab; } +void GeneralHandler::guiWindowsUnloaded() +{ + delete partyTab; +} + } // namespace EAthena diff --git a/src/net/ea/generalhandler.h b/src/net/ea/generalhandler.h index 3e2a6707..ebbc84ca 100644 --- a/src/net/ea/generalhandler.h +++ b/src/net/ea/generalhandler.h @@ -33,6 +33,8 @@ class GeneralHandler : public MessageHandler, public Net::GeneralHandler public: GeneralHandler(); + ~GeneralHandler(); + void handleMessage(MessageIn &msg); void load(); @@ -43,8 +45,12 @@ class GeneralHandler : public MessageHandler, public Net::GeneralHandler bool isNetworkConnected(); + void tick(); + void guiWindowsLoaded(); + void guiWindowsUnloaded(); + protected: MessageHandlerPtr mAdminHandler; MessageHandlerPtr mBeingHandler; |