This class represents the info a client has about a game on the server. More...
#include <lobby_data.hpp>
Classes | |
struct | required_addon |
Public Types | |
enum | disp_status { disp_status::CLEAN, disp_status::NEW, disp_status::UPDATED, disp_status::DELETED } |
enum | addon_req { addon_req::SATISFIED, addon_req::NEED_DOWNLOAD, addon_req::CANNOT_SATISFY } |
Public Member Functions | |
game_info (const config &c, const std::vector< std::string > &installed_addons) | |
bool | can_join () const |
bool | can_observe () const |
addon_req | check_addon_version_compatibility (const config &local_item, const config &game) |
const char * | display_status_string () const |
bool | match_string_filter (const std::string &filter) const |
Public Attributes | |
int | id |
std::string | map_data |
std::string | name |
std::string | scenario |
std::string | type_marker |
bool | remote_scenario |
std::string | map_info |
std::string | map_size_info |
std::string | era |
std::vector< std::pair< std::string, bool > > | mod_info |
List of modification names and whether they're installed or not. More... | |
std::string | gold |
std::string | support |
std::string | xp |
std::string | vision |
std::string | status |
std::string | time_limit |
std::size_t | vacant_slots |
unsigned int | current_turn |
bool | reloaded |
bool | started |
bool | fog |
bool | shroud |
bool | observers |
bool | shuffle_sides |
bool | use_map_settings |
bool | private_replay |
bool | verified |
bool | password_required |
bool | have_era |
bool | have_all_mods |
bool | has_friends |
bool | has_ignored |
bool | auto_hosted |
disp_status | display_status |
std::vector< required_addon > | required_addons |
addon_req | addons_outcome |
This class represents the info a client has about a game on the server.
Definition at line 65 of file lobby_data.hpp.
|
strong |
Enumerator | |
---|---|
SATISFIED | |
NEED_DOWNLOAD | |
CANNOT_SATISFY |
Definition at line 120 of file lobby_data.hpp.
|
strong |
Enumerator | |
---|---|
CLEAN | |
NEW | |
UPDATED | |
DELETED |
Definition at line 111 of file lobby_data.hpp.
mp::game_info::game_info | ( | const config & | c, |
const std::vector< std::string > & | installed_addons | ||
) |
Definition at line 114 of file lobby_data.cpp.
References _(), _n(), mp::game_info::required_addon::addon_id, addons_outcome, check_addon_version_compatibility(), game_config_view::child(), config::child_or_empty(), config::child_range(), current_turn, wml_exception::dev_message, e, config::empty(), era, ERR_CF, game_config_view::find_child(), fog, game_config_manager::game_config(), gui2::dialogs::generate_difficulty_config(), game_config_manager::get(), gamemap_base::h(), have_all_mods, have_era, i, translation::icompare(), map_data, map_info, map_size_info, mp::game_info::required_addon::message, mod_info, name, NEED_DOWNLOAD, mp::game_info::required_addon::outcome, filesystem::read_map(), reloaded, remote_scenario, required_addons, s, SATISFIED, scenario, shroud, started, status, t, time_limit, type_marker, font::unicode_em_dash, font::unicode_multiplication_sign, vacant_slots, verified, VGETTEXT, vision, and gamemap_base::w().
bool mp::game_info::can_join | ( | ) | const |
Definition at line 475 of file lobby_data.cpp.
References started, and vacant_slots.
Referenced by gui2::dialogs::mp_lobby::enter_game(), and gui2::dialogs::mp_lobby::update_selected_game().
bool mp::game_info::can_observe | ( | ) | const |
Definition at line 480 of file lobby_data.cpp.
References mp::logged_in_as_moderator(), and observers.
Referenced by gui2::dialogs::mp_lobby::enter_game(), and gui2::dialogs::mp_lobby::update_selected_game().
game_info::addon_req mp::game_info::check_addon_version_compatibility | ( | const config & | local_item, |
const config & | game | ||
) |
Definition at line 409 of file lobby_data.cpp.
References CANNOT_SATISFY, DBG_LB, config::find_child(), config::has_attribute(), NEED_DOWNLOAD, required_addons, SATISFIED, version_info::str(), and VGETTEXT.
Referenced by game_info().
const char * mp::game_info::display_status_string | ( | ) | const |
Definition at line 485 of file lobby_data.cpp.
References CLEAN, DELETED, display_status, ERR_CF, NEW, and UPDATED.
Referenced by mp::do_notify().
bool mp::game_info::match_string_filter | ( | const std::string & | filter | ) | const |
Definition at line 502 of file lobby_data.cpp.
References utils::chars_equal_insensitive(), map_info, and name.
Referenced by gui2::dialogs::mp_lobby::game_filter_init().
addon_req mp::game_info::addons_outcome |
Definition at line 129 of file lobby_data.hpp.
Referenced by gui2::dialogs::mp_lobby::enter_game(), and game_info().
bool mp::game_info::auto_hosted |
Definition at line 109 of file lobby_data.hpp.
Referenced by gui2::dialogs::mp_lobby::game_filter_init().
unsigned int mp::game_info::current_turn |
Definition at line 93 of file lobby_data.hpp.
Referenced by game_info().
disp_status mp::game_info::display_status |
Definition at line 118 of file lobby_data.hpp.
Referenced by display_status_string(), and gui2::dialogs::mp_lobby::update_gamelist_diff().
std::string mp::game_info::era |
Definition at line 80 of file lobby_data.hpp.
Referenced by gui2::dialogs::mp_lobby::adjust_game_row_contents(), game_info(), and gui2::dialogs::mp_lobby::make_game_row_data().
bool mp::game_info::fog |
Definition at line 96 of file lobby_data.hpp.
Referenced by game_info().
std::string mp::game_info::gold |
Definition at line 85 of file lobby_data.hpp.
Referenced by gui2::dialogs::mp_lobby::adjust_game_row_contents().
bool mp::game_info::has_friends |
Definition at line 107 of file lobby_data.hpp.
Referenced by gui2::dialogs::mp_lobby::game_filter_init(), and mp::lobby_info::process_userlist().
bool mp::game_info::has_ignored |
Definition at line 108 of file lobby_data.hpp.
Referenced by gui2::dialogs::mp_lobby::game_filter_init(), and mp::lobby_info::process_userlist().
bool mp::game_info::have_all_mods |
Definition at line 105 of file lobby_data.hpp.
Referenced by gui2::dialogs::mp_lobby::adjust_game_row_contents(), and game_info().
bool mp::game_info::have_era |
Definition at line 104 of file lobby_data.hpp.
Referenced by gui2::dialogs::mp_lobby::adjust_game_row_contents(), and game_info().
int mp::game_info::id |
Definition at line 72 of file lobby_data.hpp.
Referenced by gui2::dialogs::mp_lobby::adjust_game_row_contents(), mp::do_notify(), gui2::dialogs::mp_lobby::enter_game(), mp::lobby_info::process_gamelist(), gui2::dialogs::mp_lobby::update_gamelist(), gui2::dialogs::mp_lobby::update_gamelist_diff(), and gui2::dialogs::mp_lobby::update_selected_game().
std::string mp::game_info::map_data |
Definition at line 73 of file lobby_data.hpp.
Referenced by gui2::dialogs::mp_lobby::adjust_game_row_contents(), and game_info().
std::string mp::game_info::map_info |
Definition at line 78 of file lobby_data.hpp.
Referenced by game_info(), and match_string_filter().
std::string mp::game_info::map_size_info |
Definition at line 79 of file lobby_data.hpp.
Referenced by gui2::dialogs::mp_lobby::adjust_game_row_contents(), and game_info().
std::vector<std::pair<std::string, bool> > mp::game_info::mod_info |
List of modification names and whether they're installed or not.
Definition at line 83 of file lobby_data.hpp.
Referenced by gui2::dialogs::mp_lobby::adjust_game_row_contents(), and game_info().
std::string mp::game_info::name |
Definition at line 74 of file lobby_data.hpp.
Referenced by mp::do_notify(), game_info(), gui2::dialogs::mp_lobby::make_game_row_data(), match_string_filter(), gui2::dialogs::lobby_player_info::pre_show(), and gui2::dialogs::mp_lobby::update_gamelist_diff().
bool mp::game_info::observers |
Definition at line 98 of file lobby_data.hpp.
Referenced by gui2::dialogs::mp_lobby::adjust_game_row_contents(), can_observe(), and gui2::dialogs::mp_lobby::enter_game().
bool mp::game_info::password_required |
Definition at line 103 of file lobby_data.hpp.
Referenced by gui2::dialogs::mp_lobby::adjust_game_row_contents(), and gui2::dialogs::mp_lobby::enter_game().
bool mp::game_info::private_replay |
Definition at line 101 of file lobby_data.hpp.
bool mp::game_info::reloaded |
Definition at line 94 of file lobby_data.hpp.
Referenced by gui2::dialogs::mp_lobby::adjust_game_row_contents(), game_info(), and gui2::dialogs::mp_lobby::make_game_row_data().
bool mp::game_info::remote_scenario |
Definition at line 77 of file lobby_data.hpp.
Referenced by game_info().
std::vector<required_addon> mp::game_info::required_addons |
Definition at line 128 of file lobby_data.hpp.
Referenced by gui2::dialogs::mp_lobby::adjust_game_row_contents(), check_addon_version_compatibility(), gui2::dialogs::mp_lobby::enter_game(), and game_info().
std::string mp::game_info::scenario |
Definition at line 75 of file lobby_data.hpp.
Referenced by game_info(), gui2::dialogs::mp_lobby::make_game_row_data(), and gui2::dialogs::mp_lobby::update_gamelist_diff().
bool mp::game_info::shroud |
Definition at line 97 of file lobby_data.hpp.
Referenced by game_info().
bool mp::game_info::shuffle_sides |
Definition at line 99 of file lobby_data.hpp.
Referenced by gui2::dialogs::mp_lobby::adjust_game_row_contents().
bool mp::game_info::started |
Definition at line 95 of file lobby_data.hpp.
Referenced by can_join(), game_info(), and gui2::dialogs::mp_lobby::make_game_row_data().
std::string mp::game_info::status |
Definition at line 89 of file lobby_data.hpp.
Referenced by game_info(), and gui2::dialogs::mp_lobby::make_game_row_data().
std::string mp::game_info::support |
Definition at line 86 of file lobby_data.hpp.
std::string mp::game_info::time_limit |
Definition at line 90 of file lobby_data.hpp.
Referenced by gui2::dialogs::mp_lobby::adjust_game_row_contents(), and game_info().
std::string mp::game_info::type_marker |
Definition at line 76 of file lobby_data.hpp.
Referenced by game_info(), and gui2::dialogs::mp_lobby::make_game_row_data().
bool mp::game_info::use_map_settings |
Definition at line 100 of file lobby_data.hpp.
Referenced by gui2::dialogs::mp_lobby::adjust_game_row_contents().
std::size_t mp::game_info::vacant_slots |
Definition at line 91 of file lobby_data.hpp.
Referenced by can_join(), gui2::dialogs::mp_lobby::game_filter_init(), game_info(), and gui2::dialogs::mp_lobby::make_game_row_data().
bool mp::game_info::verified |
Definition at line 102 of file lobby_data.hpp.
Referenced by game_info().
std::string mp::game_info::vision |
Definition at line 88 of file lobby_data.hpp.
Referenced by gui2::dialogs::mp_lobby::adjust_game_row_contents(), and game_info().
std::string mp::game_info::xp |
Definition at line 87 of file lobby_data.hpp.
Referenced by gui2::dialogs::mp_lobby::adjust_game_row_contents().