summaryrefslogtreecommitdiff
path: root/src/net/net.cpp
diff options
context:
space:
mode:
authorDaniel Bradshaw <daniel+commits@the-cell.co.uk>2010-01-31 13:14:07 +0000
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-01-31 17:50:29 +0100
commit2ff6ad2e8a67bd8ef34b56b866ef277c30135f19 (patch)
tree536497f63044441a6e8032209446d1c3213b9d55 /src/net/net.cpp
parent22c75a346e029fad746b6aa0b123c886ddeb5c75 (diff)
downloadmana-2ff6ad2e8a67bd8ef34b56b866ef277c30135f19.tar.gz
mana-2ff6ad2e8a67bd8ef34b56b866ef277c30135f19.tar.bz2
mana-2ff6ad2e8a67bd8ef34b56b866ef277c30135f19.tar.xz
mana-2ff6ad2e8a67bd8ef34b56b866ef277c30135f19.zip
Unify eAthena and manaserv support in to one build.
Finish support for server types in the server dialog. Using the new server type function, strip out ifdefs, replacing them with if blocks for later merging in smaller atomic commits. Remove any remaining references to the support defs, including in build system.
Diffstat (limited to 'src/net/net.cpp')
-rw-r--r--src/net/net.cpp34
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