summaryrefslogtreecommitdiff
path: root/src/net/ea/generalhandler.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-04-11 08:58:32 -0600
committerJared Adams <jaxad0127@gmail.com>2009-04-11 08:58:52 -0600
commit14a6e6a4bc5d39ddf8f31efc07a5e2493a6f6d0a (patch)
treeda62e5694614e55df1c1a0fc5d5676ac7415daa6 /src/net/ea/generalhandler.cpp
parent78cab005ab427e64ccdf8ba8f6ca7d4c6f6bd4b4 (diff)
downloadmana-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/generalhandler.cpp')
-rw-r--r--src/net/ea/generalhandler.cpp30
1 files changed, 29 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