Skip to content

Commit

Permalink
Seed initial lobby data only once
Browse files Browse the repository at this point in the history
Should address #4148 (my testing seems to indicate it is so, but I'd like additional verification)
  • Loading branch information
Vultraz committed Oct 26, 2020
1 parent 261819e commit 06677a1
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/game_initialization/multiplayer.cpp
Expand Up @@ -412,8 +412,8 @@ class mp_manager

/* Enters the mp loop. It consists of four screens:
*
* Host POV: LOBBY <---> CREATE GAME ---> STAGING ------------------> GAME BEGINS
* Player POV: LOBBY <---------------------------------> JOIN GAME ---> GAME BEGINS
* Host POV: LOBBY <---> CREATE GAME ---> STAGING -----> GAME BEGINS
* Player POV: LOBBY <--------------------> JOIN GAME ---> GAME BEGINS
*/
void run_lobby_loop()
{
Expand All @@ -423,6 +423,11 @@ class mp_manager
return;
}

// Seed initial data
if(!lobby_config.empty()) {
lobby_info.process_gamelist(lobby_config);
}

// A return of false means a config reload was requested, so do that and then loop.
while(!enter_lobby_mode()) {
game_config_manager* gcm = game_config_manager::get();
Expand All @@ -449,6 +454,8 @@ class mp_manager
void enter_staging_mode();
void enter_wait_mode(int game_id, bool observe);

// TODO: refactor this out. It's really only passed through to the dialogs for the
// minimap and the preferences dialog. Shouldn't need to be kept here.
const game_config_view* game_config;

saved_game& state;
Expand Down Expand Up @@ -579,10 +586,6 @@ bool mp_manager::enter_lobby_mode()
sound::stop_music();
}

if(!lobby_config.empty()) {
lobby_info.process_gamelist(lobby_config);
}

int dlg_retval = 0;
int dlg_joined_game_id = 0;
{
Expand Down

0 comments on commit 06677a1

Please sign in to comment.