diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 15:43:00 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 15:43:04 +0100 |
commit | 73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6 (patch) | |
tree | ea00f8e3ccbdb601bcac58f60d40ab1db1d2408a /src/net/serverinfo.h | |
parent | bf8a3fc881d17f44cdcfdf3639289bef09229c03 (diff) | |
download | mana-73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6.tar.gz mana-73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6.tar.bz2 mana-73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6.tar.xz mana-73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6.zip |
Added support for the "persistentIp" server info setting
This option was added in ManaPlus and support for it is required to
connect to The Mana World as it is currently set up, since the server
sends 127.0.0.1 for the character server and map server IP.
Can't play yet, because of an unknown packet 0x226 being received once
connecting to the map server.
Diffstat (limited to 'src/net/serverinfo.h')
-rw-r--r-- | src/net/serverinfo.h | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/src/net/serverinfo.h b/src/net/serverinfo.h index 8e2ee5b0..98881931 100644 --- a/src/net/serverinfo.h +++ b/src/net/serverinfo.h @@ -38,35 +38,16 @@ public: typedef std::pair<int, std::string> VersionString; - Type type; + Type type = UNKNOWN; std::string name; std::string hostname; - unsigned short port; + unsigned short port = 0; std::string description; - VersionString version; + VersionString version = std::make_pair(0, std::string()); - bool save; - - ServerInfo() - { - type = UNKNOWN; - port = 0; - save = false; - version.first = 0; - } - - ServerInfo(const ServerInfo &info) - { - type = info.type; - name = info.name; - hostname = info.hostname; - port = info.port; - description = info.description; - version.first = info.version.first; - version.second = info.version.second; - save = info.save; - } + bool save = false; + bool persistentIp = true; bool isValid() const { @@ -75,14 +56,7 @@ public: void clear() { - type = UNKNOWN; - name.clear(); - hostname.clear(); - port = 0; - description.clear(); - version.first = 0; - version.second.clear(); - save = false; + *this = ServerInfo(); } bool operator==(const ServerInfo &other) const |