[Commits] [wesnoth/wesnoth] 002b1a: MP Staging/Join Game: unified player list handling...

GitHub noreply at github.com
Thu Dec 14 00:13:08 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 002b1a3c871ff8f782d1a1449fc2b4ee9b7f6b29
      https://github.com/wesnoth/wesnoth/commit/002b1a3c871ff8f782d1a1449fc2b4ee9b7f6b29
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2017-12-14 (Thu, 14 Dec 2017)

  Changed paths:
    A data/gui/macros/player_list_panel.cfg
    M data/gui/window/mp_join_game.cfg
    M data/gui/window/mp_staging.cfg
    M projectfiles/VC12/wesnoth.vcxproj
    M projectfiles/VC12/wesnoth.vcxproj.filters
    M source_lists/wesnoth
    M src/gui/dialogs/multiplayer/mp_join_game.cpp
    M src/gui/dialogs/multiplayer/mp_join_game.hpp
    M src/gui/dialogs/multiplayer/mp_staging.cpp
    M src/gui/dialogs/multiplayer/mp_staging.hpp
    A src/gui/dialogs/multiplayer/player_list_helper.cpp
    A src/gui/dialogs/multiplayer/player_list_helper.hpp
    M src/server/game.cpp

  Log Message:
  -----------
  MP Staging/Join Game: unified player list handling and added player icons

Previously, MP Staging was using connect_engine::connected_users() to fill in the user list.
However, I noticed that the server was already sending the user list to all clients, including
the host, so I could unify the handling between Staging and Join Game by just using the server
data for both.

I've also added appropriate indicators for host, observer, and self in the list for both dialogs.
Additional host= and observer= status keys are sent by the server for that purpose.

I've also made the server dispatch the player list to the host when a game is created. This is
slightly redundant, since the host is the only player at that point, but it's easier than creating
a user config locally, or using connected_users(), not to mention easier to maintain.

The wesnothd::game::send_user_list function no longer exists early id `description_` is null.
No idea why it did that. It's not even used in the function. Anyway, it needed to be removed in
order for the above change to work.

Speaking of the host's copy of the player list, I haven't touched that. It's still needed for
managing things in the connect_engine. Might simplify things further in the future by delegating
more handling to the server, since it has a lot of the data needed already, but that's a different
project.





More information about the Commits mailing list