Skip to content

Commit

Permalink
MP: fixed infinite loop on connecting to redirected server (fixes #2441)
Browse files Browse the repository at this point in the history
Regression from 50c9b52, found by @soliton-. I didn't get a new handshake after
connecting to the new server.
  • Loading branch information
Vultraz committed Feb 5, 2018
1 parent 9f0df10 commit 70aec1d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/game_initialization/multiplayer.cpp
Expand Up @@ -135,9 +135,19 @@ std::pair<wesnothd_connection_ptr, config> open_connection(std::string host)

shown_hosts.emplace(host, port);

gui2::dialogs::loading_screen::progress(loading_stage::redirect);

// Open a new connection with the new host and port.
sock = wesnothd_connection_ptr();
sock = wesnothd_connection::create(host, std::to_string(port));

// Wait for new handshake.
while(!sock->handshake_finished()) {
sock->poll();
SDL_Delay(1);
}

gui2::dialogs::loading_screen::progress(loading_stage::waiting);
continue;
}

Expand Down

0 comments on commit 70aec1d

Please sign in to comment.