Revert network protocol change from 002b1a3c87
Best to keep compatible and also not introduce yet another format for the userlist.
This commit is contained in:
parent
3fa5272737
commit
15059ec10c
3 changed files with 6 additions and 6 deletions
|
@ -473,8 +473,8 @@ void mp_join_game::network_handler(window& window)
|
|||
}
|
||||
|
||||
// Update player list
|
||||
if(data.has_child("userlist")) {
|
||||
player_list_->update_list(data.child("userlist").child_range("user"));
|
||||
if(data.has_child("user")) {
|
||||
player_list_->update_list(data.child_range("user"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -479,8 +479,8 @@ void mp_staging::network_handler(window& window)
|
|||
}
|
||||
|
||||
// Update player list
|
||||
if(data.has_child("userlist")) {
|
||||
player_list_->update_list(data.child("userlist").child_range("user"));
|
||||
if(data.has_child("user")) {
|
||||
player_list_->update_list(data.child_range("user"));
|
||||
}
|
||||
|
||||
// Update status label and buttons
|
||||
|
|
|
@ -1519,7 +1519,7 @@ void game::send_user_list(const socket_ptr exclude) const
|
|||
}
|
||||
|
||||
simple_wml::document cfg;
|
||||
simple_wml::node& list = cfg.root().add_child("userlist");
|
||||
simple_wml::node& list = cfg.root();
|
||||
|
||||
for(const socket_ptr& user_ptr : all_game_users()) {
|
||||
const auto pl = player_connections_.find(user_ptr);
|
||||
|
@ -1527,7 +1527,7 @@ void game::send_user_list(const socket_ptr exclude) const
|
|||
if(pl != player_connections_.end()) {
|
||||
simple_wml::node& user = list.add_child("user");
|
||||
|
||||
// Don't need to duplicate pl->second.name().c_str() because the
|
||||
// Don't need to duplicate pl->info().name().c_str() because the
|
||||
// document will be destroyed by the end of the function
|
||||
user.set_attr("name", pl->info().name().c_str());
|
||||
user.set_attr("host", is_owner(user_ptr) ? "yes" : "no");
|
||||
|
|
Loading…
Add table
Reference in a new issue