From ea90383f1de6ee14f6eedc4f78c9de5f5303a46b Mon Sep 17 00:00:00 2001 From: pentarctagon Date: Tue, 22 Oct 2019 01:07:44 -0500 Subject: [PATCH] Make additional changes to client source handling based on discussion. Add a "BSD Repository" option. Add data/dist to .gitignore. Delete data/dist from git. Error conditions reading data/dist just set the value to Default. Remove a leftover TODO comment. Add description comments for the two new database columns. --- .gitignore | 1 + data/dist | 1 - src/game_initialization/multiplayer.cpp | 8 ++++---- utils/mp-server/table_definitions.sql | 2 ++ 4 files changed, 7 insertions(+), 5 deletions(-) delete mode 100644 data/dist diff --git a/.gitignore b/.gitignore index 9165ec82ff64..eecc4197140f 100644 --- a/.gitignore +++ b/.gitignore @@ -212,3 +212,4 @@ config.h 6not .kdev* callgrind.out.* +data/dist diff --git a/data/dist b/data/dist deleted file mode 100644 index 697bb66f2c65..000000000000 --- a/data/dist +++ /dev/null @@ -1 +0,0 @@ -Default diff --git a/src/game_initialization/multiplayer.cpp b/src/game_initialization/multiplayer.cpp index 11185aa3154f..3d82d0743fa8 100644 --- a/src/game_initialization/multiplayer.cpp +++ b/src/game_initialization/multiplayer.cpp @@ -150,7 +150,6 @@ std::pair open_connection(std::string host) config res; cfg["version"] = game_config::wesnoth_version.str(); - // TODO: retest with below string values - dist doesn't exist std::string info; std::ifstream infofile("./data/dist"); if(infofile.is_open()){ @@ -158,13 +157,14 @@ std::pair open_connection(std::string host) infofile.close(); if(info == "Default" || info == "Steam" || info == "SourceForge" || info == "Flatpak" - || info == "macOS App Store" || info == "Linux repository" || info == "iOS" || info == "Android") { + || info == "macOS App Store" || info == "Linux repository" || info == "iOS" || info == "Android" + || info == "BSD repository") { cfg["client_source"] = info; } else { - cfg["client_source"] = "dist file has wrong value!"; + cfg["client_source"] = "Default"; } } else { - cfg["client_source"] = "failed to read dist file!"; + cfg["client_source"] = "Default"; } res.add_child("version", std::move(cfg)); sock->send_data(res); diff --git a/utils/mp-server/table_definitions.sql b/utils/mp-server/table_definitions.sql index 95427cfe67d7..668fa605b623 100644 --- a/utils/mp-server/table_definitions.sql +++ b/utils/mp-server/table_definitions.sql @@ -79,6 +79,8 @@ create table game_info -- IS_HOST: if USER_ID is the game's host -- FACTION: the faction being played by this side -- STATUS: the status of the side, currently only updated at game end +-- CLIENT_VERSION: the version of the wesnoth client used to connect +-- CLIENT_SOURCE: where the wesnoth client was downloaded from - SourceForge, Steam, etc create table game_player_info ( INSTANCE_UUID CHAR(36) NOT NULL,