diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-12-05 00:12:04 -0700 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-12-05 00:12:04 -0700 |
commit | 3353d1a87fbfe2e6830a4b77470d9a5a1cdac593 (patch) | |
tree | f272b22eee0baa24f1de3cbc136327652045bb58 /src/net/serverinfo.h | |
parent | 1eb02f83a5d3895e4e18db30ea10d88da94ba4c0 (diff) | |
download | mana-3353d1a87fbfe2e6830a4b77470d9a5a1cdac593.tar.gz mana-3353d1a87fbfe2e6830a4b77470d9a5a1cdac593.tar.bz2 mana-3353d1a87fbfe2e6830a4b77470d9a5a1cdac593.tar.xz mana-3353d1a87fbfe2e6830a4b77470d9a5a1cdac593.zip |
Add a type member to ServerInfo and code for it
Some of the code is waiting for ifdef removal.
Diffstat (limited to 'src/net/serverinfo.h')
-rw-r--r-- | src/net/serverinfo.h | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/net/serverinfo.h b/src/net/serverinfo.h index 4f68c6d6..82d11fec 100644 --- a/src/net/serverinfo.h +++ b/src/net/serverinfo.h @@ -28,12 +28,34 @@ class ServerInfo { public: + enum Type { + UNKNOWN, + MANASERV, + EATHENA + }; + + Type type; std::string name; std::string hostname; unsigned short port; + ServerInfo() + { + type = UNKNOWN; + port = 0; + } + + ServerInfo(const ServerInfo &info) + { + type = info.type; + name = info.name; + hostname = info.hostname; + port = info.port; + } + void clear() { + type = UNKNOWN; name.clear(); hostname.clear(); port = 0; @@ -41,12 +63,14 @@ public: bool operator==(const ServerInfo &other) { - return (hostname == other.hostname && port == other.port); + return (type == other.type && hostname == other.hostname && + port == other.port); } bool operator!=(const ServerInfo &other) { - return (hostname != other.hostname || port != other.port); + return (type != other.type || hostname != other.hostname || + port != other.port); } }; |