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 class | disp_status { CLEAN , NEW , UPDATED , DELETED } |
enum class | addon_req { SATISFIED , NEED_DOWNLOAD , 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 62 of file lobby_data.hpp.
|
strong |
Enumerator | |
---|---|
SATISFIED | |
NEED_DOWNLOAD | |
CANNOT_SATISFY |
Definition at line 118 of file lobby_data.hpp.
|
strong |
Enumerator | |
---|---|
CLEAN | |
NEW | |
UPDATED | |
DELETED |
Definition at line 109 of file lobby_data.hpp.
mp::game_info::game_info | ( | const config & | c, |
const std::vector< std::string > & | installed_addons | ||
) |
Definition at line 112 of file lobby_data.cpp.
References _(), _n(), mp::game_info::required_addon::addon_id, addons_outcome, check_addon_version_compatibility(), config::child_range(), current_turn, e, era, ERR_CF, utils::find(), fog, game_config_manager::game_config(), gui2::dialogs::generate_difficulty_config(), game_config_manager::get(), gamemap_base::h(), have_all_mods, have_era, i, installed_addons(), 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 473 of file lobby_data.cpp.
References started, and vacant_slots.
bool mp::game_info::can_observe | ( | ) | const |
Definition at line 478 of file lobby_data.cpp.
References mp::logged_in_as_moderator(), and observers.
game_info::addon_req mp::game_info::check_addon_version_compatibility | ( | const config & | local_item, |
const config & | game | ||
) |
Definition at line 407 of file lobby_data.cpp.
References CANNOT_SATISFY, DBG_LB, 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 483 of file lobby_data.cpp.
References CLEAN, DELETED, display_status, ERR_CF, NEW, and UPDATED.
bool mp::game_info::match_string_filter | ( | const std::string & | filter | ) | const |
Definition at line 500 of file lobby_data.cpp.
References translation::ci_search(), utils::views::filter, map_info, and name.
addon_req mp::game_info::addons_outcome |
Definition at line 127 of file lobby_data.hpp.
Referenced by game_info().
bool mp::game_info::auto_hosted |
Definition at line 107 of file lobby_data.hpp.
unsigned int mp::game_info::current_turn |
Definition at line 90 of file lobby_data.hpp.
Referenced by game_info().
disp_status mp::game_info::display_status |
Definition at line 116 of file lobby_data.hpp.
Referenced by display_status_string().
std::string mp::game_info::era |
Definition at line 77 of file lobby_data.hpp.
Referenced by game_info().
bool mp::game_info::fog |
Definition at line 93 of file lobby_data.hpp.
Referenced by game_info().
std::string mp::game_info::gold |
Definition at line 82 of file lobby_data.hpp.
bool mp::game_info::has_friends |
Definition at line 105 of file lobby_data.hpp.
bool mp::game_info::has_ignored |
Definition at line 106 of file lobby_data.hpp.
bool mp::game_info::have_all_mods |
Definition at line 103 of file lobby_data.hpp.
Referenced by game_info().
bool mp::game_info::have_era |
Definition at line 102 of file lobby_data.hpp.
Referenced by game_info().
int mp::game_info::id |
Definition at line 69 of file lobby_data.hpp.
std::string mp::game_info::map_data |
Definition at line 70 of file lobby_data.hpp.
Referenced by game_info().
std::string mp::game_info::map_info |
Definition at line 75 of file lobby_data.hpp.
Referenced by game_info(), and match_string_filter().
std::string mp::game_info::map_size_info |
Definition at line 76 of file lobby_data.hpp.
Referenced by 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 80 of file lobby_data.hpp.
Referenced by game_info().
std::string mp::game_info::name |
Definition at line 71 of file lobby_data.hpp.
Referenced by game_info(), and match_string_filter().
bool mp::game_info::observers |
Definition at line 95 of file lobby_data.hpp.
Referenced by can_observe().
bool mp::game_info::password_required |
Definition at line 101 of file lobby_data.hpp.
bool mp::game_info::private_replay |
Definition at line 98 of file lobby_data.hpp.
bool mp::game_info::reloaded |
Definition at line 91 of file lobby_data.hpp.
Referenced by game_info().
bool mp::game_info::remote_scenario |
Definition at line 74 of file lobby_data.hpp.
Referenced by game_info().
std::vector<required_addon> mp::game_info::required_addons |
Definition at line 126 of file lobby_data.hpp.
Referenced by check_addon_version_compatibility(), and game_info().
std::string mp::game_info::scenario |
Definition at line 72 of file lobby_data.hpp.
Referenced by game_info().
bool mp::game_info::shroud |
Definition at line 94 of file lobby_data.hpp.
Referenced by game_info().
bool mp::game_info::shuffle_sides |
Definition at line 96 of file lobby_data.hpp.
bool mp::game_info::started |
Definition at line 92 of file lobby_data.hpp.
Referenced by can_join(), and game_info().
std::string mp::game_info::status |
Definition at line 86 of file lobby_data.hpp.
Referenced by game_info().
std::string mp::game_info::support |
Definition at line 83 of file lobby_data.hpp.
std::string mp::game_info::time_limit |
Definition at line 87 of file lobby_data.hpp.
Referenced by game_info().
std::string mp::game_info::type_marker |
Definition at line 73 of file lobby_data.hpp.
Referenced by game_info().
bool mp::game_info::use_map_settings |
Definition at line 97 of file lobby_data.hpp.
std::size_t mp::game_info::vacant_slots |
Definition at line 88 of file lobby_data.hpp.
Referenced by can_join(), and game_info().
bool mp::game_info::verified |
Definition at line 100 of file lobby_data.hpp.
Referenced by game_info().
std::string mp::game_info::vision |
Definition at line 85 of file lobby_data.hpp.
Referenced by game_info().
std::string mp::game_info::xp |
Definition at line 84 of file lobby_data.hpp.