diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-14 16:51:36 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-14 16:51:36 +0300 |
commit | da98d12637db106b87341560cc72ca6207b2d12f (patch) | |
tree | c79f1c3389f38ec878fc2dfc4729839242e2e81c /src/net | |
parent | 8a616021cbefff5f62b0ca55cf535130c8c1b5f0 (diff) | |
download | manaverse-da98d12637db106b87341560cc72ca6207b2d12f.tar.gz manaverse-da98d12637db106b87341560cc72ca6207b2d12f.tar.bz2 manaverse-da98d12637db106b87341560cc72ca6207b2d12f.tar.xz manaverse-da98d12637db106b87341560cc72ca6207b2d12f.zip |
Add configure and cmake option to enable/disable compilation for tmwa/evol.
Tmwa/evol by default enabled.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/net.cpp | 10 | ||||
-rw-r--r-- | src/net/netconsts.h | 4 | ||||
-rw-r--r-- | src/net/serverinfo.h | 10 |
3 files changed, 21 insertions, 3 deletions
diff --git a/src/net/net.cpp b/src/net/net.cpp index 1ca5ac5c0..aee279a58 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -26,7 +26,9 @@ #include "net/loginhandler.h" +#ifdef TMWA_SUPPORT #include "net/tmwa/generalhandler.h" +#endif #ifdef EATHENA_SUPPORT #include "net/eathena/generalhandler.h" @@ -161,9 +163,6 @@ void connectToServer(const ServerInfo &server) switch (server.type) { - case ServerInfo::EVOL: - new TmwAthena::GeneralHandler; - break; case ServerInfo::EATHENA: #ifdef EATHENA_SUPPORT new EAthena::GeneralHandler; @@ -172,9 +171,14 @@ void connectToServer(const ServerInfo &server) #endif break; case ServerInfo::TMWATHENA: + case ServerInfo::EVOL: case ServerInfo::UNKNOWN: default: +#ifdef TMWA_SUPPORT new TmwAthena::GeneralHandler; +#else + new EAthena::GeneralHandler; +#endif break; } diff --git a/src/net/netconsts.h b/src/net/netconsts.h index 1ea1c579e..1977698ea 100644 --- a/src/net/netconsts.h +++ b/src/net/netconsts.h @@ -27,6 +27,10 @@ #include <stdint.h> #endif +#ifdef EATHENA_SUPPORT +static const uint16_t DEFAULT_PORT = 6900; +#else static const uint16_t DEFAULT_PORT = 6901; +#endif #endif // NET_NETCONSTS_H diff --git a/src/net/serverinfo.h b/src/net/serverinfo.h index c523ecce7..c3e1ac5ad 100644 --- a/src/net/serverinfo.h +++ b/src/net/serverinfo.h @@ -69,7 +69,11 @@ class ServerInfo final onlineListUrl(), supportUrl(), updateMirrors(), +#ifdef EATHENA_SUPPORT + port(6900), +#else port(6901), +#endif version(), save(false), persistentIp(true) @@ -133,10 +137,16 @@ class ServerInfo final static Type parseType(const std::string &serverType) A_WARN_UNUSED { +#ifdef TMWA_SUPPORT if (compareStrI(serverType, "tmwathena") == 0) return TMWATHENA; if (compareStrI(serverType, "evol") == 0) return EVOL; +#else + if (compareStrI(serverType, "tmwathena") == 0 + || compareStrI(serverType, "evol") == 0) + return EATHENA; +#endif #ifdef EATHENA_SUPPORT else if (compareStrI(serverType, "eathena") == 0) return EATHENA; |