diff options
Diffstat (limited to 'src/net/net.cpp')
-rw-r--r-- | src/net/net.cpp | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/src/net/net.cpp b/src/net/net.cpp index 593d9cb7..75f8229c 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -126,41 +126,20 @@ ServerInfo::Type networkType = ServerInfo::UNKNOWN; void connectToServer(const ServerInfo &server) { - // Remove with ifdefs - if (networkType != ServerInfo::UNKNOWN) - { - getGeneralHandler()->reload(); - } - else - { -#ifdef MANASERV_SUPPORT - new ManaServ::GeneralHandler; -#else - new EAthena::GeneralHandler; -#endif - - getGeneralHandler()->load(); - - networkType = server.type; - } - // End remove section - - // Uncomment after ifdefs removed - /*ServerInfo server = ServerInfo(inServer); if (server.type == ServerInfo::UNKNOWN) { // TODO: Query the server about itself and choose the netcode based on // that } - //if (networkType == server.type) - if (networkType != ServerInfo::UNKNOWN) + if (networkType == server.type && getGeneralHandler() != NULL) + //if (networkType != ServerInfo::UNKNOWN) { getGeneralHandler()->reload(); } else { - if (networkType != ServerInfo::UNKNOWN) + if (networkType != ServerInfo::UNKNOWN && getGeneralHandler() != NULL) { getGeneralHandler()->unload(); } @@ -183,7 +162,7 @@ void connectToServer(const ServerInfo &server) getGeneralHandler()->load(); networkType = server.type; - }*/ + } getLoginHandler()->setServer(server); @@ -199,5 +178,10 @@ void unload() } } +ServerInfo::Type getNetworkType() +{ + return networkType; +} + } // namespace Net |