Revert "Fix excessive mp lobby refreshing."

This reverts commit 590fd3c4d5.
This commit is contained in:
Lipka Boldizsár 2018-05-06 13:02:56 +02:00
parent 590fd3c4d5
commit 8bd6646182
2 changed files with 10 additions and 11 deletions

View file

@ -142,7 +142,7 @@ mp_lobby::mp_lobby(const config& game_config, mp::lobby_info& info, wesnothd_con
, player_list_()
, player_list_dirty_(true)
, gamelist_dirty_(true)
, last_lobby_update_(0)
, last_gamelist_update_(0)
, gamelist_diff_update_(true)
, network_connection_(connection)
, lobby_update_timer_(0)
@ -292,7 +292,7 @@ void mp_lobby::update_gamelist()
update_selected_game();
gamelist_dirty_ = false;
last_lobby_update_ = SDL_GetTicks();
last_gamelist_update_ = SDL_GetTicks();
lobby_info_.sync_games_display_status();
lobby_info_.apply_game_filter();
update_gamelist_header();
@ -392,7 +392,7 @@ void mp_lobby::update_gamelist_diff()
update_selected_game();
gamelist_dirty_ = false;
last_lobby_update_ = SDL_GetTicks();
last_gamelist_update_ = SDL_GetTicks();
lobby_info_.sync_games_display_status();
lobby_info_.apply_game_filter();
update_gamelist_header();
@ -551,6 +551,10 @@ void mp_lobby::update_gamelist_filter()
void mp_lobby::update_playerlist()
{
if(delay_playerlist_update_) {
return;
}
SCOPE_LB;
DBG_LB << "Playerlist update: " << lobby_info_.users().size() << "\n";
lobby_info_.update_user_statuses(selected_game_id_, chatbox_->active_window_room());
@ -679,7 +683,6 @@ void mp_lobby::update_playerlist()
player_list_.other_games.update_player_count_label();
player_list_dirty_ = false;
last_lobby_update_ = SDL_GetTicks();
}
void mp_lobby::update_selected_game()
@ -859,11 +862,7 @@ void mp_lobby::network_handler()
throw;
}
if ((SDL_GetTicks() - last_lobby_update_ < game_config::lobby_refresh)) {
return;
}
if(gamelist_dirty_ && !delay_gamelist_update_) {
if(gamelist_dirty_ && !delay_gamelist_update_ && (SDL_GetTicks() - last_gamelist_update_ > game_config::lobby_refresh)) {
if(gamelist_diff_update_) {
update_gamelist_diff();
} else {
@ -872,7 +871,7 @@ void mp_lobby::network_handler()
}
}
if(player_list_dirty_ && !delay_playerlist_update_) {
if(player_list_dirty_) {
update_gamelist_filter();
update_playerlist();
}

View file

@ -202,7 +202,7 @@ private:
bool gamelist_dirty_;
unsigned last_lobby_update_;
unsigned last_gamelist_update_;
bool gamelist_diff_update_;