Skip to content

Commit

Permalink
Fixed MP admins being unable to observe private games (fixes #2851)
Browse files Browse the repository at this point in the history
This was due to the change in the MP initialization process wherein the lobby wouldn't
show up until the initial gamelist was received. Since the admin auth message is sent
after [join_game] and before the initial gamelist, and the chatbox widget handled parsing
the auth message, the client was never marked as authenticated and therefor couldn't
observe private games. This fixes that by adding auth parsing to the MP initialization
process.

Note this doesn't fix the issue of the auth confirmation not showing up in the lobby chat
(issue #2920). I'll have to think of a way to fix that separately.
  • Loading branch information
Vultraz committed Jun 11, 2018
1 parent 643b4aa commit ef9a87b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.md
Expand Up @@ -6,6 +6,7 @@
* New attack animation for the Peasant.
### Miscellaneous and bug fixes
* Added an advanced preference to enable experimental PRNG combat.
* Fixed MP admins being unable to observe private games.

## Version 1.14.3
### AI
Expand Down
6 changes: 6 additions & 0 deletions src/game_initialization/multiplayer.cpp
Expand Up @@ -176,6 +176,12 @@ std::pair<wesnothd_connection_ptr, config> open_connection(std::string host)
throw wesnothd_rejected_client_error(error_message);
}

// The only message we should get here is the admin authentication message.
// It's sent after [join_lobby] and before the initial gamelist.
if(const config& message = data.child("message")) {
preferences::parse_admin_authentication(message["sender"], message["message"]);
}

// Continue if we did not get a direction to login
if(!data.has_child("mustlogin")) {
continue;
Expand Down

0 comments on commit ef9a87b

Please sign in to comment.