Skip to content

Commit

Permalink
Removed unused Ping Timeout preference
Browse files Browse the repository at this point in the history
It no longer had any effect. The selective_ping flag is set was ignored by the
server since it now utilizes TCP keepalive.
  • Loading branch information
Vultraz committed Apr 20, 2018
1 parent 6b35926 commit b81a702
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 33 deletions.
11 changes: 0 additions & 11 deletions data/advanced_preferences.cfg
Expand Up @@ -56,17 +56,6 @@
default=yes
[/advanced_preference]

[advanced_preference]
field=ping_timeout
name= _ "Ping timeout"
description= _ "Number of seconds to wait for a ping reply before timing out. Set to 0 to disable"
type=int
default=0
min=0
max=60
step=5
[/advanced_preference]

[advanced_preference]
field=lobby_auto_open_whisper_windows
name= _ "Auto-open whisper windows in lobby"
Expand Down
13 changes: 0 additions & 13 deletions src/game_initialization/multiplayer.cpp
Expand Up @@ -189,19 +189,6 @@ std::pair<wesnothd_connection_ptr, config> open_connection(std::string host)
config& sp = response.add_child("login") ;
sp["username"] = login ;

// Login and enable selective pings -- saves server bandwidth
// If ping_timeout has a non-zero value, do not enable
// selective pings as this will cause clients to falsely
// believe the server has died and disconnect.
if(preferences::get_ping_timeout()) {
// Pings required so disable selective pings
sp["selective_ping"] = false;
} else {
// Client is bandwidth friendly so allow
// server to optimize ping frequency as needed.
sp["selective_ping"] = true;
}

sock->send_data(response);
sock->wait_and_receive_data(data);

Expand Down
7 changes: 0 additions & 7 deletions src/preferences/game.cpp
Expand Up @@ -135,8 +135,6 @@ manager::manager() :
}
}
}

//network::ping_timeout = get_ping_timeout();
}

manager::~manager()
Expand Down Expand Up @@ -403,11 +401,6 @@ void set_network_host(const std::string& host)
preferences::set("host", host);
}

unsigned int get_ping_timeout()
{
return lexical_cast_default<unsigned>(preferences::get("ping_timeout"), 0);
}

std::string campaign_server()
{
if(!preferences::get("campaign_server").empty()) {
Expand Down
2 changes: 0 additions & 2 deletions src/preferences/game.hpp
Expand Up @@ -78,8 +78,6 @@ class acquaintance;
std::string network_host();
void set_network_host(const std::string& host);

unsigned int get_ping_timeout();

std::string campaign_server();
void set_campaign_server(const std::string& host);

Expand Down

0 comments on commit b81a702

Please sign in to comment.