Revert "Fix excessive mp lobby refreshing."
This reverts commit590fd3c4d5
. (cherry-picked from commit8bd6646182
)
This commit is contained in:
parent
32f9747188
commit
e98b9d7937
2 changed files with 10 additions and 11 deletions
|
@ -142,7 +142,7 @@ mp_lobby::mp_lobby(const config& game_config, mp::lobby_info& info, wesnothd_con
|
||||||
, player_list_()
|
, player_list_()
|
||||||
, player_list_dirty_(true)
|
, player_list_dirty_(true)
|
||||||
, gamelist_dirty_(true)
|
, gamelist_dirty_(true)
|
||||||
, last_lobby_update_(0)
|
, last_gamelist_update_(0)
|
||||||
, gamelist_diff_update_(true)
|
, gamelist_diff_update_(true)
|
||||||
, network_connection_(connection)
|
, network_connection_(connection)
|
||||||
, lobby_update_timer_(0)
|
, lobby_update_timer_(0)
|
||||||
|
@ -292,7 +292,7 @@ void mp_lobby::update_gamelist()
|
||||||
|
|
||||||
update_selected_game();
|
update_selected_game();
|
||||||
gamelist_dirty_ = false;
|
gamelist_dirty_ = false;
|
||||||
last_lobby_update_ = SDL_GetTicks();
|
last_gamelist_update_ = SDL_GetTicks();
|
||||||
lobby_info_.sync_games_display_status();
|
lobby_info_.sync_games_display_status();
|
||||||
lobby_info_.apply_game_filter();
|
lobby_info_.apply_game_filter();
|
||||||
update_gamelist_header();
|
update_gamelist_header();
|
||||||
|
@ -392,7 +392,7 @@ void mp_lobby::update_gamelist_diff()
|
||||||
|
|
||||||
update_selected_game();
|
update_selected_game();
|
||||||
gamelist_dirty_ = false;
|
gamelist_dirty_ = false;
|
||||||
last_lobby_update_ = SDL_GetTicks();
|
last_gamelist_update_ = SDL_GetTicks();
|
||||||
lobby_info_.sync_games_display_status();
|
lobby_info_.sync_games_display_status();
|
||||||
lobby_info_.apply_game_filter();
|
lobby_info_.apply_game_filter();
|
||||||
update_gamelist_header();
|
update_gamelist_header();
|
||||||
|
@ -551,6 +551,10 @@ void mp_lobby::update_gamelist_filter()
|
||||||
|
|
||||||
void mp_lobby::update_playerlist()
|
void mp_lobby::update_playerlist()
|
||||||
{
|
{
|
||||||
|
if(delay_playerlist_update_) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SCOPE_LB;
|
SCOPE_LB;
|
||||||
DBG_LB << "Playerlist update: " << lobby_info_.users().size() << "\n";
|
DBG_LB << "Playerlist update: " << lobby_info_.users().size() << "\n";
|
||||||
lobby_info_.update_user_statuses(selected_game_id_, chatbox_->active_window_room());
|
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_.other_games.update_player_count_label();
|
||||||
|
|
||||||
player_list_dirty_ = false;
|
player_list_dirty_ = false;
|
||||||
last_lobby_update_ = SDL_GetTicks();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void mp_lobby::update_selected_game()
|
void mp_lobby::update_selected_game()
|
||||||
|
@ -859,11 +862,7 @@ void mp_lobby::network_handler()
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((SDL_GetTicks() - last_lobby_update_ < game_config::lobby_refresh)) {
|
if(gamelist_dirty_ && !delay_gamelist_update_ && (SDL_GetTicks() - last_gamelist_update_ > game_config::lobby_refresh)) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(gamelist_dirty_ && !delay_gamelist_update_) {
|
|
||||||
if(gamelist_diff_update_) {
|
if(gamelist_diff_update_) {
|
||||||
update_gamelist_diff();
|
update_gamelist_diff();
|
||||||
} else {
|
} 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_gamelist_filter();
|
||||||
update_playerlist();
|
update_playerlist();
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,7 +202,7 @@ private:
|
||||||
|
|
||||||
bool gamelist_dirty_;
|
bool gamelist_dirty_;
|
||||||
|
|
||||||
unsigned last_lobby_update_;
|
unsigned last_gamelist_update_;
|
||||||
|
|
||||||
bool gamelist_diff_update_;
|
bool gamelist_diff_update_;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue