This class represents the collective information the client has about the players and games on the server. More...
#include <info.hpp>
Public Types | |
typedef std::map< int, game_info * > | game_info_map |
Private Member Functions | |
void | process_userlist () |
Private Attributes | |
const config & | game_config_ |
config | gamelist_ |
bool | gamelist_initialized_ |
std::vector< room_info > | rooms_ |
game_info_map | games_by_id_ |
std::vector< game_info * > | games_ |
std::vector< game_info * > | games_filtered_ |
std::vector< user_info > | users_ |
std::vector< user_info * > | users_sorted_ |
std::map< std::string, chat_log > | whispers_ |
game_filter_and_stack | game_filter_ |
bool | game_filter_invert_ |
std::vector< bool > | games_visibility_ |
twesnothd_connection & | wesnothd_connection_ |
This class represents the collective information the client has about the players and games on the server.
typedef std::map<int, game_info*> lobby_info::game_info_map |
|
explicit |
lobby_info::~lobby_info | ( | ) |
Definition at line 59 of file info.cpp.
References delete_games().
void lobby_info::add_game_filter | ( | game_filter_base * | f | ) |
Definition at line 306 of file info.cpp.
References game_filter_stack::append(), and game_filter_.
Referenced by gui2::tlobby_main::game_filter_reload().
void lobby_info::apply_game_filter | ( | ) |
Definition at line 332 of file info.cpp.
References g, game_filter_, game_filter_invert_, games_, games_filtered_, games_visibility_, game_filter_and_stack::match(), and gui2::tip::show().
Referenced by gui2::tlobby_main::update_gamelist(), gui2::tlobby_main::update_gamelist_diff(), and gui2::tlobby_main::update_gamelist_filter().
void lobby_info::clear_game_filter | ( | ) |
Definition at line 311 of file info.cpp.
References game_filter_stack::clear(), and game_filter_.
Referenced by gui2::tlobby_main::game_filter_reload().
void lobby_info::close_room | ( | const std::string & | name | ) |
Definition at line 291 of file info.cpp.
References DBG_LB, get_room(), and rooms_.
Referenced by gui2::tlobby_main::close_window().
void lobby_info::delete_games | ( | ) |
Definition at line 64 of file info.cpp.
References games_by_id_.
Referenced by process_gamelist(), and ~lobby_info().
|
inline |
|
inline |
Definition at line 83 of file info.hpp.
References games_.
Referenced by gui2::tlobby_main::do_game_join(), gui2::tlobby_main::join_or_observe(), gui2::tlobby_main::update_gamelist(), gui2::tlobby_main::update_gamelist_diff(), gui2::tlobby_main::update_gamelist_filter(), gui2::tlobby_main::update_gamelist_header(), and gui2::tlobby_main::update_selected_game().
const std::vector< game_info * > & lobby_info::games_filtered | ( | ) | const |
Definition at line 301 of file info.cpp.
References games_filtered_.
Referenced by gui2::tlobby_main::update_gamelist_header().
|
inline |
Definition at line 87 of file info.hpp.
References games_visibility_.
Referenced by gui2::tlobby_main::update_gamelist(), gui2::tlobby_main::update_gamelist_diff(), and gui2::tlobby_main::update_gamelist_filter().
Definition at line 242 of file info.cpp.
References games_by_id_, and i.
Referenced by gui2::tlobby_player_info::pre_show(), and process_userlist().
Definition at line 248 of file info.cpp.
References games_by_id_, and i.
room_info * lobby_info::get_room | ( | const std::string & | name | ) |
Definition at line 254 of file info.cpp.
References rooms_.
Referenced by gui2::tlobby_main::active_window_room(), gui2::tlobby_main::add_chat_room_message_received(), gui2::tlobby_main::add_chat_room_message_sent(), close_room(), has_room(), gui2::tlobby_main::process_room_join(), gui2::tlobby_main::process_room_part(), and gui2::tlobby_main::process_room_query_response().
const room_info * lobby_info::get_room | ( | const std::string & | name | ) | const |
user_info& lobby_info::get_user | ( | const std::string & | name | ) |
chat_log & lobby_info::get_whisper_log | ( | const std::string & | name | ) |
Definition at line 279 of file info.cpp.
References whispers_.
Referenced by gui2::tlobby_main::add_whisper_received(), gui2::tlobby_main::add_whisper_sent(), and gui2::tlobby_main::close_window().
bool lobby_info::has_room | ( | const std::string & | name | ) | const |
void lobby_info::make_games_vector | ( | ) |
Definition at line 321 of file info.cpp.
References games_, games_by_id_, games_filtered_, and games_visibility_.
Referenced by sync_games_display_status(), gui2::tlobby_main::update_gamelist(), and gui2::tlobby_main::update_gamelist_diff().
void lobby_info::open_room | ( | const std::string & | name | ) |
Definition at line 284 of file info.cpp.
References has_room(), and rooms_.
Referenced by gui2::tlobby_main::process_room_join(), and gui2::tlobby_main::search_create_window().
Process a full gamelist.
Current info is discarded.
Definition at line 102 of file info.cpp.
References config::child(), config::child_range(), DBG_LB, delete_games(), game_config_, gamelist_, gamelist_initialized_, games_by_id_, game_info::id, process_userlist(), and SCOPE_LB.
Referenced by gui2::tlobby_main::process_gamelist().
bool lobby_info::process_gamelist_diff | ( | const config & | data | ) |
Process a gamelist diff.
Definition at line 120 of file info.cpp.
References config::apply_diff(), config::child(), config::child_range(), config::clear_diff_track(), DBG_LB, game_info::DELETED, config::diff_track_attribute, game_info::display_status, e, ERR_LB, game_config_, gamelist_, gamelist_initialized_, games_by_id_, i, game::error::message, game_info::NEW, process_userlist(), SCOPE_LB, twesnothd_connection::send_data(), game_info::UPDATED, wesnothd_connection_, and WRN_LB.
Referenced by gui2::tlobby_main::process_gamelist_diff().
|
private |
Definition at line 194 of file info.cpp.
References config::child_range(), user_info::FRIEND, gamelist_, get_game_by_id(), game_info::has_friends, game_info::has_ignored, user_info::IGNORED, SCOPE_LB, users_, and WRN_NG.
Referenced by process_gamelist(), and process_gamelist_diff().
|
inline |
void lobby_info::set_game_filter_invert | ( | bool | value | ) |
Definition at line 316 of file info.cpp.
References game_filter_invert_.
Referenced by gui2::tlobby_main::game_filter_reload().
void lobby_info::sort_users | ( | bool | by_name, |
bool | by_relation | ||
) |
Definition at line 396 of file info.cpp.
References sort(), users_, and users_sorted_.
Referenced by gui2::tlobby_main::update_playerlist().
void lobby_info::sync_games_display_status | ( | ) |
Definition at line 225 of file info.cpp.
References game_info::CLEAN, DBG_LB, game_info::DELETED, games_by_id_, i, and make_games_vector().
Referenced by gui2::tlobby_main::update_gamelist(), and gui2::tlobby_main::update_gamelist_diff().
Definition at line 350 of file info.cpp.
References users_.
Referenced by gui2::tlobby_main::update_playerlist().
|
inline |
Definition at line 92 of file info.hpp.
References users_.
Referenced by gui2::tlobby_main::chat_input_keypress_callback(), and gui2::tlobby_main::update_playerlist().
const std::vector< user_info * > & lobby_info::users_sorted | ( | ) | const |
Definition at line 420 of file info.cpp.
References users_sorted_.
Referenced by gui2::tlobby_main::update_playerlist().
|
private |
Definition at line 101 of file info.hpp.
Referenced by process_gamelist(), and process_gamelist_diff().
|
private |
Definition at line 113 of file info.hpp.
Referenced by add_game_filter(), apply_game_filter(), and clear_game_filter().
|
private |
Definition at line 114 of file info.hpp.
Referenced by apply_game_filter(), and set_game_filter_invert().
|
private |
Definition at line 102 of file info.hpp.
Referenced by gamelist(), process_gamelist(), process_gamelist_diff(), and process_userlist().
|
private |
Definition at line 103 of file info.hpp.
Referenced by process_gamelist(), and process_gamelist_diff().
|
private |
Definition at line 108 of file info.hpp.
Referenced by apply_game_filter(), games(), and make_games_vector().
|
private |
Definition at line 106 of file info.hpp.
Referenced by delete_games(), get_game_by_id(), make_games_vector(), process_gamelist(), process_gamelist_diff(), and sync_games_display_status().
|
private |
Definition at line 109 of file info.hpp.
Referenced by apply_game_filter(), games_filtered(), and make_games_vector().
|
private |
Definition at line 115 of file info.hpp.
Referenced by apply_game_filter(), games_visibility(), and make_games_vector().
|
private |
Definition at line 104 of file info.hpp.
Referenced by close_room(), get_room(), open_room(), and rooms().
|
private |
Definition at line 110 of file info.hpp.
Referenced by process_userlist(), sort_users(), update_user_statuses(), and users().
|
private |
Definition at line 111 of file info.hpp.
Referenced by sort_users(), and users_sorted().
|
private |
Definition at line 116 of file info.hpp.
Referenced by process_gamelist_diff().
|
private |
Definition at line 112 of file info.hpp.
Referenced by get_whisper_log().