diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-06-12 23:02:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-06-12 23:02:11 +0300 |
commit | 5546a30788216ca9bab885cc97744ef8240dc32f (patch) | |
tree | 5de39ec4aee068d53e12807d31199481971bb3ef /src/net | |
parent | 6b0ade8b1ba9d9364b889d93c37486a52840031e (diff) | |
download | manaplus-5546a30788216ca9bab885cc97744ef8240dc32f.tar.gz manaplus-5546a30788216ca9bab885cc97744ef8240dc32f.tar.bz2 manaplus-5546a30788216ca9bab885cc97744ef8240dc32f.tar.xz manaplus-5546a30788216ca9bab885cc97744ef8240dc32f.zip |
Add comments for unknown licensed and non free servers.
For non free: (NON FREE)
for unknown: (UNKNOWN)
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/serverinfo.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/net/serverinfo.h b/src/net/serverinfo.h index c02e67505..e83e51b56 100644 --- a/src/net/serverinfo.h +++ b/src/net/serverinfo.h @@ -23,6 +23,7 @@ #ifndef NET_SERVERINFO_H #define NET_SERVERINFO_H +#include "enums/net/serverfreetype.h" #include "enums/net/servertype.h" #include "net/hostsgroup.h" @@ -37,6 +38,7 @@ class ServerInfo final typedef std::pair<int, std::string> VersionString; ServerTypeT type; + ServerFreeTypeT freeType; std::string name; std::string hostname; std::string althostname; @@ -55,6 +57,7 @@ class ServerInfo final ServerInfo() : type(ServerType::TMWATHENA), + freeType(ServerFreeType::NotSet), name(), hostname(), althostname(), @@ -80,6 +83,7 @@ class ServerInfo final ServerInfo(const ServerInfo &info) : type(info.type), + freeType(info.freeType), name(info.name), hostname(info.hostname), althostname(info.althostname), @@ -105,6 +109,7 @@ class ServerInfo final ServerInfo &operator=(const ServerInfo &info) { type = info.type; + freeType = info.freeType; name = info.name; hostname = info.hostname; althostname = info.althostname; @@ -150,6 +155,7 @@ class ServerInfo final packetVersion = 0; save = false; persistentIp = true; + freeType = ServerFreeType::Unknown; } bool operator==(const ServerInfo &other) const @@ -180,6 +186,18 @@ class ServerInfo final return ServerType::EVOL2; return ServerType::UNKNOWN; } + + static ServerFreeTypeT parseFreeType(const std::string &serverFreeType) + A_WARN_UNUSED + { + if (compareStrI(serverFreeType, "free") == 0) + return ServerFreeType::Free; + else if (compareStrI(serverFreeType, "nonfree") == 0) + return ServerFreeType::NonFree; + else if (compareStrI(serverFreeType, "unknown") == 0) + return ServerFreeType::Unknown; + return ServerFreeType::NotSet; + } }; typedef std::vector<ServerInfo> ServerInfos; |