summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-16 14:39:32 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-16 14:39:32 +0300
commit279efb073f06175d734126b3ba61453347ec4e45 (patch)
tree7eec2d656f65eb3f2074bbe3dead670ce2b03b37 /src
parent904ab7f6570a7f9836a7a11fa127b411c75e8923 (diff)
downloadplus-279efb073f06175d734126b3ba61453347ec4e45.tar.gz
plus-279efb073f06175d734126b3ba61453347ec4e45.tar.bz2
plus-279efb073f06175d734126b3ba61453347ec4e45.tar.xz
plus-279efb073f06175d734126b3ba61453347ec4e45.zip
add server feature for language tab.
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp4
-rw-r--r--src/net/eathena/serverfeatures.cpp5
-rw-r--r--src/net/eathena/serverfeatures.h2
-rw-r--r--src/net/serverfeatures.h2
-rw-r--r--src/net/tmwa/serverfeatures.cpp5
-rw-r--r--src/net/tmwa/serverfeatures.h2
6 files changed, 19 insertions, 1 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 4bbaa9324..025f4c6d1 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -97,6 +97,7 @@
#include "net/gamehandler.h"
#include "net/net.h"
#include "net/packetcounters.h"
+#include "net/serverfeatures.h"
#include "resources/delayedmanager.h"
#include "resources/imagewriter.h"
@@ -238,7 +239,8 @@ static void createGuiWindows()
if (config.getBoolValue("showChatHistory"))
localChatTab->loadFromLogFile("#General");
- if (serverVersion >= 8 && serverConfig.getValue("enableLangTab", 1))
+ if (Net::getServerFeatures()->haveLangTab()
+ && serverConfig.getValue("enableLangTab", 1))
{
const std::string lang = getLangShort();
if (lang.size() == 2)
diff --git a/src/net/eathena/serverfeatures.cpp b/src/net/eathena/serverfeatures.cpp
index 98deca54f..d4c37927c 100644
--- a/src/net/eathena/serverfeatures.cpp
+++ b/src/net/eathena/serverfeatures.cpp
@@ -52,4 +52,9 @@ bool ServerFeatures::haveServerHp() const
return true;
}
+bool ServerFeatures::haveLangTab() const
+{
+ return false;
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/serverfeatures.h b/src/net/eathena/serverfeatures.h
index 9e297b25e..35c348ecd 100644
--- a/src/net/eathena/serverfeatures.h
+++ b/src/net/eathena/serverfeatures.h
@@ -41,6 +41,8 @@ class ServerFeatures final : public Net::ServerFeatures
bool haveChangePartyLeader() const override final;
bool haveServerHp() const override final;
+
+ bool haveLangTab() const override final;
};
} // namespace EAthena
diff --git a/src/net/serverfeatures.h b/src/net/serverfeatures.h
index a653e2679..ef61bdc16 100644
--- a/src/net/serverfeatures.h
+++ b/src/net/serverfeatures.h
@@ -38,6 +38,8 @@ class ServerFeatures notfinal
virtual bool haveChangePartyLeader() const = 0;
virtual bool haveServerHp() const = 0;
+
+ virtual bool haveLangTab() const = 0;
};
} // namespace Net
diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp
index aeb514bb1..e6aa700ab 100644
--- a/src/net/tmwa/serverfeatures.cpp
+++ b/src/net/tmwa/serverfeatures.cpp
@@ -54,4 +54,9 @@ bool ServerFeatures::haveServerHp() const
return serverVersion > 0 || tmwServerVersion >= 0x0E0701;
}
+bool ServerFeatures::haveLangTab() const
+{
+ return serverVersion >= 8;
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/serverfeatures.h b/src/net/tmwa/serverfeatures.h
index 0ce0b507a..10c6dd899 100644
--- a/src/net/tmwa/serverfeatures.h
+++ b/src/net/tmwa/serverfeatures.h
@@ -41,6 +41,8 @@ class ServerFeatures final : public Net::ServerFeatures
bool haveChangePartyLeader() const override final;
bool haveServerHp() const override final;
+
+ bool haveLangTab() const override final;
};
} // namespace TmwAthena