mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-24 10:32:56 +00:00

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.