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.
This commit is contained in:
pentarctagon 2019-10-22 01:07:44 -05:00
parent c7e84e1d49
commit 3bc7b3fae7
No known key found for this signature in database
GPG key ID: 29E48D667D52CCF3
4 changed files with 7 additions and 5 deletions

1
.gitignore vendored
View file

@ -212,3 +212,4 @@ config.h
6not
.kdev*
callgrind.out.*
data/dist

View file

@ -1 +0,0 @@
Default

View file

@ -159,7 +159,6 @@ std::pair<wesnothd_connection_ptr, config> open_connection(std::string host)
config res;
cfg["version"] = game_config::version;
// TODO: retest with below string values - dist doesn't exist
std::string info;
std::ifstream infofile("./data/dist");
if(infofile.is_open()){
@ -167,13 +166,14 @@ std::pair<wesnothd_connection_ptr, config> 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);

View file

@ -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,