diff options
Diffstat (limited to 'src/net/net.cpp')
-rw-r--r-- | src/net/net.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/net/net.cpp b/src/net/net.cpp index 6a9c072a..bce0844c 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -122,19 +122,34 @@ Net::TradeHandler *Net::getTradeHandler() return tradeHandler; } +namespace Net +{ + bool networkLoaded = false; +} + void Net::connectToServer(const ServerInfo &server) { // TODO: Actually query the server about itself and choose the netcode // based on that + if (networkLoaded) + { + printf("Reload!\n"); + Net::getGeneralHandler()->reload(); + } + else + { #ifdef TMWSERV_SUPPORT - new TmwServ::GeneralHandler; + new TmwServ::GeneralHandler; #else - new EAthena::GeneralHandler; + new EAthena::GeneralHandler; #endif + } Net::getGeneralHandler()->load(); + networkLoaded = true; + Net::getLoginHandler()->setServer(server); Net::getLoginHandler()->connect(); |