summaryrefslogtreecommitdiff
path: root/src/gui/windows/serverdialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-22 18:59:41 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-22 18:59:41 +0300
commit1cf6cb343c6c8df8a998c617fd6f8d40f5affbea (patch)
treed5e090e99c02a0ce70d00c4dc527d777881cd83c /src/gui/windows/serverdialog.cpp
parentf20c99d2bffe798806790e1f1ae838bba494d93c (diff)
downloadmv-1cf6cb343c6c8df8a998c617fd6f8d40f5affbea.tar.gz
mv-1cf6cb343c6c8df8a998c617fd6f8d40f5affbea.tar.bz2
mv-1cf6cb343c6c8df8a998c617fd6f8d40f5affbea.tar.xz
mv-1cf6cb343c6c8df8a998c617fd6f8d40f5affbea.zip
Add support for packet version in servers list xml and in editor.
Diffstat (limited to 'src/gui/windows/serverdialog.cpp')
-rw-r--r--src/gui/windows/serverdialog.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp
index 179173d2c..f03d28f03 100644
--- a/src/gui/windows/serverdialog.cpp
+++ b/src/gui/windows/serverdialog.cpp
@@ -236,6 +236,7 @@ void ServerDialog::connectToSelectedServer()
mServerInfo->save = true;
mServerInfo->persistentIp = server.persistentIp;
mServerInfo->updateMirrors = server.updateMirrors;
+ mServerInfo->packetVersion = server.packetVersion;
settings.persistentIp = mServerInfo->persistentIp;
settings.supportUrl = mServerInfo->supportUrl;
@@ -521,6 +522,8 @@ void ServerDialog::loadServers(const bool addNew)
subNode, "althostname", "");
server.port = CAST_U16(
XML::getProperty(subNode, "port", 0));
+ server.packetVersion = XML::getProperty(subNode,
+ "packetVersion", 0);
if (server.port == 0)
{
@@ -584,6 +587,7 @@ void ServerDialog::loadServers(const bool addNew)
mServers[i].althostname = server.althostname;
mServers[i].persistentIp = server.persistentIp;
mServers[i].updateMirrors = server.updateMirrors;
+ mServers[i].packetVersion = server.packetVersion;
mServersListModel->setVersionString(i, version);
found = true;
break;
@@ -609,6 +613,8 @@ void ServerDialog::loadCustomServers()
const std::string onlineListUrlKey
("MostUsedServerOnlineList" + index);
const std::string persistentIpKey("persistentIp" + index);
+ const std::string packetVersionKey
+ ("MostUsedServerPacketVersion" + index);
ServerInfo server;
server.name = config.getValue(nameKey, "");
@@ -618,6 +624,7 @@ void ServerDialog::loadCustomServers()
server.type = ServerInfo::parseType(config.getValue(typeKey, ""));
server.persistentIp = config.getValue(
persistentIpKey, 0) ? true : false;
+ server.packetVersion = config.getValue(packetVersionKey, 0);
const int defaultPort = defaultPortForServerType(server.type);
server.port = CAST_U16(
@@ -676,6 +683,8 @@ void ServerDialog::saveCustomServers(const ServerInfo &currentServer,
const std::string onlineListUrlKey
("MostUsedServerOnlineList" + num);
const std::string persistentIpKey("persistentIp" + num);
+ const std::string packetVersionKey
+ ("MostUsedServerPacketVersion" + num);
config.setValue(nameKey, server.name);
config.setValue(descKey, server.description);
@@ -684,6 +693,7 @@ void ServerDialog::saveCustomServers(const ServerInfo &currentServer,
config.setValue(typeKey, serverTypeToString(server.type));
config.setValue(portKey, toString(server.port));
config.setValue(persistentIpKey, server.persistentIp);
+ config.setValue(packetVersionKey, server.packetVersion);
++ savedServerCount;
}