mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-08 01:14:05 +00:00
don't process a corrupted gamelist_diff further
fixes #3017, assuming that the error is actually casued by the 'process_gamelist_diff failed' As process_gamelist_diff simply returns after getting an error its quite likeley that the gamelist is then in a corrupted state so we stop processing it until we get a fresh gamelist. (cherry-picked from commit 367aec2bb2d5fc5f5acbb53842441c6190c9d452)
This commit is contained in:
parent
80d0ab3ee8
commit
de0a5b6ed7
@ -126,6 +126,17 @@ void lobby_info::process_gamelist(const config& data)
|
||||
}
|
||||
|
||||
bool lobby_info::process_gamelist_diff(const config& data)
|
||||
{
|
||||
if(!process_gamelist_diff_impl(data)) {
|
||||
// the gamelist is now corrupted, stop further processing and wait for a fresh list.
|
||||
gamelist_initialized_ = false;
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
bool lobby_info::process_gamelist_diff_impl(const config& data)
|
||||
{
|
||||
SCOPE_LB;
|
||||
if(!gamelist_initialized_) {
|
||||
|
@ -47,6 +47,8 @@ public:
|
||||
*/
|
||||
bool process_gamelist_diff(const config& data);
|
||||
|
||||
bool process_gamelist_diff_impl(const config& data);
|
||||
|
||||
void sync_games_display_status();
|
||||
|
||||
/**
|
||||
@ -140,6 +142,10 @@ public:
|
||||
return users_;
|
||||
}
|
||||
|
||||
bool gamelist_initialized() const
|
||||
{
|
||||
return gamelist_initialized_;
|
||||
}
|
||||
private:
|
||||
void process_userlist();
|
||||
|
||||
|
@ -849,6 +849,11 @@ void mp_lobby::network_handler()
|
||||
return;
|
||||
}
|
||||
|
||||
if(gamelist_diff_update_ && !lobby_info_.gamelist_initialized()) {
|
||||
//don't process a corrupted gamelist further to prevent crashes later.
|
||||
return;
|
||||
}
|
||||
|
||||
if(gamelist_dirty_ && !delay_gamelist_update_) {
|
||||
if(gamelist_diff_update_) {
|
||||
update_gamelist_diff();
|
||||
|
Loading…
x
Reference in New Issue
Block a user