Fixed MP admins being unable to observe private games (fixes #2851)

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.

(cherry-picked from commit e8d55062c4)
This commit is contained in:
Charles Dang 2018-06-11 13:03:37 +11:00
parent 39785177e2
commit 2b4ae206ab
2 changed files with 7 additions and 0 deletions

View file

@ -49,6 +49,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

View file

@ -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;