Skip to content

Commit

Permalink
Make additional changes to client source handling based on discussion.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Pentarctagon committed Oct 22, 2019
1 parent c7e84e1 commit 3bc7b3f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -212,3 +212,4 @@ config.h
6not
.kdev*
callgrind.out.*
data/dist
1 change: 0 additions & 1 deletion data/dist

This file was deleted.

8 changes: 4 additions & 4 deletions src/game_initialization/multiplayer.cpp
Expand Up @@ -159,21 +159,21 @@ 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()){
infofile >> info;
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);
Expand Down
2 changes: 2 additions & 0 deletions utils/mp-server/table_definitions.sql
Expand Up @@ -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,
Expand Down

0 comments on commit 3bc7b3f

Please sign in to comment.