The Battle for Wesnoth  1.15.0-dev
Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
ng::connect_engine Class Reference

#include <connect_engine.hpp>

Inheritance diagram for ng::connect_engine:
Inheritance graph

Classes

struct  team_data_pod
 

Public Member Functions

 connect_engine (saved_game &state, const bool first_scenario, mp_campaign_info *campaign_info)
 
configcurrent_config ()
 
void import_user (const std::string &name, const bool observer, int side_taken=-1)
 
void import_user (const config &data, const bool observer, int side_taken=-1)
 
bool sides_available () const
 
void update_level ()
 
void update_and_send_diff (bool update_time_of_day=false)
 
bool can_start_game () const
 
void start_game ()
 
void start_game_commandline (const commandline_options &cmdline_opts, const config &game_config)
 
void leave_game ()
 
std::pair< bool, bool > process_network_data (const config &data)
 
int find_user_side_index_by_id (const std::string &id) const
 
const configlevel () const
 
configscenario ()
 
const std::set< std::string > & connected_users () const
 
const std::vector< team_data_pod > & team_data () const
 
std::vector< side_engine_ptr > & side_engines ()
 
const mp_game_settingsparams () const
 
bool first_scenario () const
 
bool force_lock_settings () const
 
bool receive_from_server (config &dst) const
 
const mp_campaign_infocampaign_info () const
 

Private Member Functions

 connect_engine (const connect_engine &)=delete
 
void operator= (const connect_engine &)=delete
 
void send_level_data () const
 
void save_reserved_sides_information ()
 
void load_previous_sides_users ()
 
void update_side_controller_options ()
 
std::set< std::string > & connected_users_rw ()
 
void send_to_server (const config &cfg) const
 

Private Attributes

config level_
 
saved_gamestate_
 
const mp_game_settingsparams_
 
const ng::controller default_controller_
 
mp_campaign_infocampaign_info_
 
const bool first_scenario_
 
bool force_lock_settings_
 
std::vector< side_engine_ptrside_engines_
 
std::vector< const config * > era_factions_
 
std::vector< team_data_podteam_data_
 

Friends

class side_engine
 

Detailed Description

Definition at line 43 of file connect_engine.hpp.

Constructor & Destructor Documentation

◆ connect_engine() [1/2]

ng::connect_engine::connect_engine ( saved_game state,
const bool  first_scenario,
mp_campaign_info campaign_info 
)

◆ connect_engine() [2/2]

ng::connect_engine::connect_engine ( const connect_engine )
privatedelete

Member Function Documentation

◆ campaign_info()

const mp_campaign_info* ng::connect_engine::campaign_info ( ) const
inline

Definition at line 113 of file connect_engine.hpp.

◆ can_start_game()

bool ng::connect_engine::can_start_game ( ) const

◆ connected_users()

const std::set< std::string > & ng::connect_engine::connected_users ( ) const

◆ connected_users_rw()

std::set< std::string > & ng::connect_engine::connected_users_rw ( )
private

Definition at line 861 of file connect_engine.cpp.

References campaign_info_, and mp_campaign_info::connected_players.

Referenced by import_user(), and process_network_data().

◆ current_config()

config * ng::connect_engine::current_config ( )

Definition at line 213 of file connect_engine.cpp.

References s, and scenario().

Referenced by connect_engine(), and create_side_engine().

◆ find_user_side_index_by_id()

int ng::connect_engine::find_user_side_index_by_id ( const std::string &  id) const

Definition at line 764 of file connect_engine.cpp.

References i, and side_engines_.

Referenced by process_network_data().

◆ first_scenario()

bool ng::connect_engine::first_scenario ( ) const
inline

Definition at line 108 of file connect_engine.hpp.

◆ force_lock_settings()

bool ng::connect_engine::force_lock_settings ( ) const
inline

Definition at line 109 of file connect_engine.hpp.

Referenced by gui2::dialogs::mp_staging::add_side_node().

◆ import_user() [1/2]

void ng::connect_engine::import_user ( const std::string &  name,
const bool  observer,
int  side_taken = -1 
)

Definition at line 221 of file connect_engine.cpp.

References name().

Referenced by connect_engine(), load_previous_sides_users(), and process_network_data().

◆ import_user() [2/2]

void ng::connect_engine::import_user ( const config data,
const bool  observer,
int  side_taken = -1 
)

◆ leave_game()

void ng::connect_engine::leave_game ( )

Definition at line 609 of file connect_engine.cpp.

References DBG_MP, and send_to_server().

Referenced by gui2::dialogs::mp_staging::post_show().

◆ level()

const config& ng::connect_engine::level ( ) const
inline

Definition at line 81 of file connect_engine.hpp.

◆ load_previous_sides_users()

void ng::connect_engine::load_previous_sides_users ( )
private

◆ operator=()

void ng::connect_engine::operator= ( const connect_engine )
privatedelete

◆ params()

const mp_game_settings& ng::connect_engine::params ( ) const
inline

Definition at line 107 of file connect_engine.hpp.

Referenced by gui2::dialogs::mp_staging::add_side_node().

◆ process_network_data()

std::pair< bool, bool > ng::connect_engine::process_network_data ( const config data)

◆ receive_from_server()

bool ng::connect_engine::receive_from_server ( config dst) const

◆ save_reserved_sides_information()

void ng::connect_engine::save_reserved_sides_information ( )
private

◆ scenario()

config& ng::connect_engine::scenario ( )
inline

◆ send_level_data()

void ng::connect_engine::send_level_data ( ) const
private

◆ send_to_server()

void ng::connect_engine::send_to_server ( const config cfg) const
private

◆ side_engines()

std::vector<side_engine_ptr>& ng::connect_engine::side_engines ( )
inline

◆ sides_available()

bool ng::connect_engine::sides_available ( ) const

◆ start_game()

void ng::connect_engine::start_game ( )

◆ start_game_commandline()

void ng::connect_engine::start_game_commandline ( const commandline_options cmdline_opts,
const config game_config 
)

◆ team_data()

const std::vector<team_data_pod>& ng::connect_engine::team_data ( ) const
inline

Definition at line 101 of file connect_engine.hpp.

Referenced by gui2::dialogs::mp_staging::add_side_node().

◆ update_and_send_diff()

void ng::connect_engine::update_and_send_diff ( bool  update_time_of_day = false)

◆ update_level()

void ng::connect_engine::update_level ( )

◆ update_side_controller_options()

void ng::connect_engine::update_side_controller_options ( )
private

Definition at line 844 of file connect_engine.cpp.

References side_engines_.

Referenced by import_user(), and process_network_data().

Friends And Related Function Documentation

◆ side_engine

friend class side_engine
friend

Definition at line 129 of file connect_engine.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), and connect_engine().

Member Data Documentation

◆ campaign_info_

mp_campaign_info* ng::connect_engine::campaign_info_
private

◆ default_controller_

const ng::controller ng::connect_engine::default_controller_
private

◆ era_factions_

std::vector<const config*> ng::connect_engine::era_factions_
private

Definition at line 143 of file connect_engine.hpp.

Referenced by connect_engine(), and start_game_commandline().

◆ first_scenario_

const bool ng::connect_engine::first_scenario_
private

Definition at line 138 of file connect_engine.hpp.

Referenced by connect_engine(), process_network_data(), and send_level_data().

◆ force_lock_settings_

bool ng::connect_engine::force_lock_settings_
private

Definition at line 140 of file connect_engine.hpp.

Referenced by connect_engine(), and start_game().

◆ level_

config ng::connect_engine::level_
private

◆ params_

const mp_game_settings& ng::connect_engine::params_
private

◆ side_engines_

std::vector<side_engine_ptr> ng::connect_engine::side_engines_
private

◆ state_

saved_game& ng::connect_engine::state_
private

◆ team_data_

std::vector<team_data_pod> ng::connect_engine::team_data_
private

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