diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-11-06 00:13:06 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-11-06 00:13:06 +0300 |
commit | 6245aed671abe032d47db8b0bce7d7b3f3ca522a (patch) | |
tree | ecc1a5c4b5f18c3554c1dcbf7c82ce7f3ad4e704 /src | |
parent | 4cac7fcfd4ee4fc7c5ca6bd932de39bb28ed2ea3 (diff) | |
download | mv-6245aed671abe032d47db8b0bce7d7b3f3ca522a.tar.gz mv-6245aed671abe032d47db8b0bce7d7b3f3ca522a.tar.bz2 mv-6245aed671abe032d47db8b0bce7d7b3f3ca522a.tar.xz mv-6245aed671abe032d47db8b0bce7d7b3f3ca522a.zip |
Add server type Evol2.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/models/typelistmodel.h | 8 | ||||
-rw-r--r-- | src/gui/windows/editserverdialog.cpp | 17 | ||||
-rw-r--r-- | src/gui/windows/serverdialog.cpp | 9 | ||||
-rw-r--r-- | src/net/net.cpp | 1 | ||||
-rw-r--r-- | src/net/serverinfo.h | 7 |
5 files changed, 38 insertions, 4 deletions
diff --git a/src/gui/models/typelistmodel.h b/src/gui/models/typelistmodel.h index 7a50c6905..2836dbbf2 100644 --- a/src/gui/models/typelistmodel.h +++ b/src/gui/models/typelistmodel.h @@ -38,9 +38,9 @@ class TypeListModel final : public ListModel */ int getNumberOfElements() override final A_WARN_UNUSED #if defined(EATHENA_SUPPORT) && defined(TMWA_SUPPORT) - { return 3; } + { return 4; } #elif defined(EATHENA_SUPPORT) - { return 1; } + { return 2; } #else { return 2; } #endif @@ -59,12 +59,16 @@ class TypeListModel final : public ListModel #ifdef EATHENA_SUPPORT else if (elementIndex == 2) return "eAthena"; + else if (elementIndex == 3) + return "Evol2"; #endif // EATHENA_SUPPORT else #else // TMWA_SUPPORT #ifdef EATHENA_SUPPORT if (elementIndex == 0) return "eAthena"; + else if (elementIndex == 1) + return "Evol2"; else #endif // EATHENA_SUPPORT #endif // TMWA_SUPPORT diff --git a/src/gui/windows/editserverdialog.cpp b/src/gui/windows/editserverdialog.cpp index 6d06bba08..13b1ea0a1 100644 --- a/src/gui/windows/editserverdialog.cpp +++ b/src/gui/windows/editserverdialog.cpp @@ -166,6 +166,17 @@ EditServerDialog::EditServerDialog(ServerDialog *const parent, mTypeField->setSelected(0); #endif // TMWA_SUPPORT break; + case ServerInfo::EVOL2: +#ifdef EATHENA_SUPPORT +#ifdef TMWA_SUPPORT + mTypeField->setSelected(3); +#else // TMWA_SUPPORT + mTypeField->setSelected(1); +#endif // TMWA_SUPPORT +#else // EATHENA_SUPPORT + mTypeField->setSelected(0); +#endif // EATHENA_SUPPORT + break; } setLocationRelativeTo(getParentWindow()); @@ -237,12 +248,18 @@ void EditServerDialog::action(const ActionEvent &event) case 2: mServer.type = ServerInfo::EATHENA; break; + case 3: + mServer.type = ServerInfo::EVOL2; + break; #endif #else #ifdef EATHENA_SUPPORT case 0: mServer.type = ServerInfo::EATHENA; break; + case 1: + mServer.type = ServerInfo::EVOL2; + break; #endif #endif default: diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp index 035a98a10..ffb9c3bb9 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -74,9 +74,15 @@ static std::string serverTypeToString(const ServerInfo::Type type) case ServerInfo::EVOL: return ""; #endif - case ServerInfo::EATHENA: #ifdef EATHENA_SUPPORT + case ServerInfo::EATHENA: return "eAthena"; + case ServerInfo::EVOL2: + return "Evol2"; +#else + case ServerInfo::EATHENA: + case ServerInfo::EVOL2: + return ""; #endif default: case ServerInfo::UNKNOWN: @@ -90,6 +96,7 @@ static uint16_t defaultPortForServerType(const ServerInfo::Type type) { default: case ServerInfo::EATHENA: + case ServerInfo::EVOL2: #ifdef EATHENA_SUPPORT return 6900; #endif diff --git a/src/net/net.cpp b/src/net/net.cpp index 9822b0f03..9ae41a72b 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -118,6 +118,7 @@ void connectToServer(const ServerInfo &server) switch (server.type) { case ServerInfo::EATHENA: + case ServerInfo::EVOL2: #ifdef EATHENA_SUPPORT new EAthena::GeneralHandler; #else diff --git a/src/net/serverinfo.h b/src/net/serverinfo.h index af53577e6..019c6fd18 100644 --- a/src/net/serverinfo.h +++ b/src/net/serverinfo.h @@ -40,7 +40,8 @@ class ServerInfo final UNKNOWN = 0, TMWATHENA, EVOL, - EATHENA + EATHENA, + EVOL2 }; typedef std::pair<int, std::string> VersionString; @@ -150,9 +151,13 @@ class ServerInfo final #ifdef EATHENA_SUPPORT else if (compareStrI(serverType, "eathena") == 0) return EATHENA; + else if (compareStrI(serverType, "evol2") == 0) + return EVOL2; #else else if (compareStrI(serverType, "eathena") == 0) return TMWATHENA; + else if (compareStrI(serverType, "evol2") == 0) + return TMWATHENA; #endif return UNKNOWN; } |