Skip to content

Commit

Permalink
Avoid useless user list sending
Browse files Browse the repository at this point in the history
  • Loading branch information
soliton- committed Jan 8, 2018
1 parent 2288098 commit 3fa5272
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 7 additions & 0 deletions src/gui/dialogs/multiplayer/player_list_helper.cpp
Expand Up @@ -23,6 +23,13 @@ namespace gui2
player_list_helper::player_list_helper(window* window)
: list_(find_widget<listbox>(window, "player_list", false))
{
// add ourselves as the host
std::map<std::string, string_map> data = {
{ "player_type_icon", {{ "label", "misc/leader-crown.png~CROP(12, 1, 15, 15)"}}},
{ "player_name", {{ "label", preferences::login()}}}
};
list_.add_row(data);
list_.select_row(0);
}

void player_list_helper::update_list(const config::const_child_itors& users)
Expand Down
5 changes: 0 additions & 5 deletions src/server/game.cpp
Expand Up @@ -133,11 +133,6 @@ game::game(player_connections& player_connections,
// Mark the host as unavailable in the lobby.
iter->info().mark_available(id_, name_);
iter->info().set_status(player::PLAYING);

// Send player list to the host. At this point, it only contains the host themelves.
// This *could* therefor be handled on the client side, but having the server send it
// means we can have the same code handle the player list UI in multiple dialogs.
send_user_list();
}

game::~game()
Expand Down

0 comments on commit 3fa5272

Please sign in to comment.