mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-05 16:33:31 +00:00
Validate the dist value server-side rather than client-side.
This commit is contained in:
parent
719e4f2a7f
commit
288e859b7c
@ -155,14 +155,7 @@ std::pair<wesnothd_connection_ptr, config> open_connection(std::string host)
|
||||
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 == "BSD repository") {
|
||||
cfg["client_source"] = info;
|
||||
} else {
|
||||
cfg["client_source"] = "Default";
|
||||
}
|
||||
cfg["client_source"] = info;
|
||||
} else {
|
||||
cfg["client_source"] = "Default";
|
||||
}
|
||||
|
@ -1636,6 +1636,12 @@ void server::handle_player_in_game(socket_ptr socket, std::shared_ptr<simple_wml
|
||||
} else {
|
||||
version = player->info().version();
|
||||
source = player->info().source();
|
||||
|
||||
if(source != "Default" && source != "Steam" && source != "SourceForge" && source != "Flatpak"
|
||||
&& source != "macOS App Store" && source != "Linux repository" && source != "iOS" && source != "Android"
|
||||
&& source != "BSD repository") {
|
||||
source = "Default";
|
||||
}
|
||||
}
|
||||
user_handler_->db_insert_game_player_info(uuid_, g.id(), side["player_id"].to_string(), side["side"].to_int(), side["is_host"].to_bool(), side["faction"].to_string(), version, source, side["current_player"].to_string());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user