The Battle for Wesnoth  1.19.7+dev
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
mp::game_info Struct Reference

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_addonrequired_addons
 
addon_req addons_outcome
 

Detailed Description

This class represents the info a client has about a game on the server.

Definition at line 62 of file lobby_data.hpp.

Member Enumeration Documentation

◆ addon_req

Enumerator
SATISFIED 
NEED_DOWNLOAD 
CANNOT_SATISFY 

Definition at line 118 of file lobby_data.hpp.

◆ disp_status

Enumerator
CLEAN 
NEW 
UPDATED 
DELETED 

Definition at line 109 of file lobby_data.hpp.

Constructor & Destructor Documentation

◆ game_info()

mp::game_info::game_info ( const config c,
const std::vector< std::string > &  installed_addons 
)

Member Function Documentation

◆ can_join()

bool mp::game_info::can_join ( ) const

Definition at line 473 of file lobby_data.cpp.

References started, and vacant_slots.

◆ can_observe()

bool mp::game_info::can_observe ( ) const

Definition at line 478 of file lobby_data.cpp.

References mp::logged_in_as_moderator(), and observers.

◆ check_addon_version_compatibility()

game_info::addon_req mp::game_info::check_addon_version_compatibility ( const config local_item,
const config game 
)

◆ display_status_string()

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.

◆ match_string_filter()

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.

Member Data Documentation

◆ addons_outcome

addon_req mp::game_info::addons_outcome

Definition at line 127 of file lobby_data.hpp.

Referenced by game_info().

◆ auto_hosted

bool mp::game_info::auto_hosted

Definition at line 107 of file lobby_data.hpp.

◆ current_turn

unsigned int mp::game_info::current_turn

Definition at line 90 of file lobby_data.hpp.

Referenced by game_info().

◆ display_status

disp_status mp::game_info::display_status

Definition at line 116 of file lobby_data.hpp.

Referenced by display_status_string().

◆ era

std::string mp::game_info::era

Definition at line 77 of file lobby_data.hpp.

Referenced by game_info().

◆ fog

bool mp::game_info::fog

Definition at line 93 of file lobby_data.hpp.

Referenced by game_info().

◆ gold

std::string mp::game_info::gold

Definition at line 82 of file lobby_data.hpp.

◆ has_friends

bool mp::game_info::has_friends

Definition at line 105 of file lobby_data.hpp.

◆ has_ignored

bool mp::game_info::has_ignored

Definition at line 106 of file lobby_data.hpp.

◆ have_all_mods

bool mp::game_info::have_all_mods

Definition at line 103 of file lobby_data.hpp.

Referenced by game_info().

◆ have_era

bool mp::game_info::have_era

Definition at line 102 of file lobby_data.hpp.

Referenced by game_info().

◆ id

int mp::game_info::id

Definition at line 69 of file lobby_data.hpp.

◆ map_data

std::string mp::game_info::map_data

Definition at line 70 of file lobby_data.hpp.

Referenced by game_info().

◆ map_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().

◆ map_size_info

std::string mp::game_info::map_size_info

Definition at line 76 of file lobby_data.hpp.

Referenced by game_info().

◆ mod_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().

◆ name

std::string mp::game_info::name

Definition at line 71 of file lobby_data.hpp.

Referenced by game_info(), and match_string_filter().

◆ observers

bool mp::game_info::observers

Definition at line 95 of file lobby_data.hpp.

Referenced by can_observe().

◆ password_required

bool mp::game_info::password_required

Definition at line 101 of file lobby_data.hpp.

◆ private_replay

bool mp::game_info::private_replay

Definition at line 98 of file lobby_data.hpp.

◆ reloaded

bool mp::game_info::reloaded

Definition at line 91 of file lobby_data.hpp.

Referenced by game_info().

◆ remote_scenario

bool mp::game_info::remote_scenario

Definition at line 74 of file lobby_data.hpp.

Referenced by game_info().

◆ required_addons

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().

◆ scenario

std::string mp::game_info::scenario

Definition at line 72 of file lobby_data.hpp.

Referenced by game_info().

◆ shroud

bool mp::game_info::shroud

Definition at line 94 of file lobby_data.hpp.

Referenced by game_info().

◆ shuffle_sides

bool mp::game_info::shuffle_sides

Definition at line 96 of file lobby_data.hpp.

◆ started

bool mp::game_info::started

Definition at line 92 of file lobby_data.hpp.

Referenced by can_join(), and game_info().

◆ status

std::string mp::game_info::status

Definition at line 86 of file lobby_data.hpp.

Referenced by game_info().

◆ support

std::string mp::game_info::support

Definition at line 83 of file lobby_data.hpp.

◆ time_limit

std::string mp::game_info::time_limit

Definition at line 87 of file lobby_data.hpp.

Referenced by game_info().

◆ type_marker

std::string mp::game_info::type_marker

Definition at line 73 of file lobby_data.hpp.

Referenced by game_info().

◆ use_map_settings

bool mp::game_info::use_map_settings

Definition at line 97 of file lobby_data.hpp.

◆ vacant_slots

std::size_t mp::game_info::vacant_slots

Definition at line 88 of file lobby_data.hpp.

Referenced by can_join(), and game_info().

◆ verified

bool mp::game_info::verified

Definition at line 100 of file lobby_data.hpp.

Referenced by game_info().

◆ vision

std::string mp::game_info::vision

Definition at line 85 of file lobby_data.hpp.

Referenced by game_info().

◆ xp

std::string mp::game_info::xp

Definition at line 84 of file lobby_data.hpp.


The documentation for this struct was generated from the following files: