summaryrefslogtreecommitdiff
path: root/src/net/ea/generalhandler.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-10-03 12:40:52 -0600
committerJared Adams <jaxad0127@gmail.com>2009-10-03 16:47:11 -0600
commit0269b1f766a4e9e8ded91505855cff58c18086e2 (patch)
treec557c4c189bb536ab5ef7b8642011fe4f1da4eff /src/net/ea/generalhandler.cpp
parenteb22b66b0821e49ed550d30d20d9db5af535e6a3 (diff)
downloadmana-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/generalhandler.cpp')
-rw-r--r--src/net/ea/generalhandler.cpp15
1 files changed, 13 insertions, 2 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()