#include <connect_engine.hpp>
Classes | |
struct | team_data_pod |
Public Member Functions | |
connect_engine (saved_game &state, const bool first_scenario, mp_game_metadata *metadata) | |
config * | current_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 | can_start_game () const |
void | start_game () |
void | start_game_commandline (const commandline_options &cmdline_opts, const game_config_view &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 config & | level () const |
config & | scenario () |
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_settings & | params () const |
bool | first_scenario () const |
bool | force_lock_settings () const |
Private Member Functions | |
connect_engine (const connect_engine &)=delete | |
connect_engine & | 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 () |
Private Attributes | |
config | level_ |
saved_game & | state_ |
const mp_game_settings & | params_ |
const ng::controller | default_controller_ |
mp_game_metadata * | mp_metadata_ |
const bool | first_scenario_ |
bool | force_lock_settings_ |
std::vector< side_engine_ptr > | side_engines_ |
std::vector< const config * > | era_factions_ |
std::vector< team_data_pod > | team_data_ |
Friends | |
class | side_engine |
Definition at line 43 of file connect_engine.hpp.
ng::connect_engine::connect_engine | ( | saved_game & | state, |
const bool | first_scenario, | ||
mp_game_metadata * | metadata | ||
) |
Definition at line 66 of file connect_engine.cpp.
References _(), ai::configuration::add_era_ai_from_config(), ai::configuration::add_mod_ai_from_config(), config::child_range(), saved_game::classification(), translation::compare(), current_config(), data, config::empty(), config_attribute_value::empty(), era_factions_, utils::find(), force_lock_settings_, mp::initial_level_config(), game_classification::is_normal_mp_game(), level_, config::mandatory_child(), saved_game::mp_settings(), config::optional_child(), params_, mp_game_settings::saved_game, scenario(), state_, config_attribute_value::str(), config_attribute_value::t_str(), team_data_, t_string::to_serialized(), and mp_game_settings::use_map_settings.
|
privatedelete |
bool ng::connect_engine::can_start_game | ( | ) | const |
Definition at line 325 of file connect_engine.cpp.
References ng::CNTR_EMPTY, and DBG_MP.
Referenced by gui2::dialogs::mp_staging::network_handler(), campaign_controller::play_game(), and gui2::dialogs::mp_staging::update_status_label_and_buttons().
const std::set< std::string > & ng::connect_engine::connected_users | ( | ) | const |
Definition at line 805 of file connect_engine.cpp.
Referenced by ng::side_engine::update_controller_options().
|
private |
Definition at line 815 of file connect_engine.cpp.
config * ng::connect_engine::current_config | ( | ) |
Definition at line 223 of file connect_engine.cpp.
Referenced by connect_engine(), and create_side_engine().
int ng::connect_engine::find_user_side_index_by_id | ( | const std::string & | id | ) | const |
Definition at line 717 of file connect_engine.cpp.
References i.
|
inline |
Definition at line 108 of file connect_engine.hpp.
References first_scenario_.
|
inline |
Definition at line 109 of file connect_engine.hpp.
References force_lock_settings_.
Referenced by gui2::dialogs::mp_staging::add_side_node().
void ng::connect_engine::import_user | ( | const config & | data, |
const bool | observer, | ||
int | side_taken = -1 |
||
) |
Definition at line 234 of file connect_engine.cpp.
References ng::CNTR_COMPUTER, ng::CNTR_LOCAL, data, and game_config::images::observer.
void ng::connect_engine::import_user | ( | const std::string & | name, |
const bool | observer, | ||
int | side_taken = -1 |
||
) |
Definition at line 227 of file connect_engine.cpp.
References game_config::images::observer, and user_data.
void ng::connect_engine::leave_game | ( | ) |
Definition at line 562 of file connect_engine.cpp.
References DBG_MP, and mp::send_to_server().
Referenced by gui2::dialogs::mp_staging::post_show().
|
inline |
Definition at line 81 of file connect_engine.hpp.
References level_.
|
private |
Definition at line 771 of file connect_engine.cpp.
References ng::CNTR_COMPUTER, ng::CNTR_RESERVED, utils::find(), utils::map_split(), and names.
|
privatedelete |
|
inline |
Definition at line 107 of file connect_engine.hpp.
References params_.
Referenced by gui2::dialogs::mp_staging::add_side_node(), and gui2::dialogs::mp_staging::pre_show().
std::pair< bool, bool > ng::connect_engine::process_network_data | ( | const config & | data | ) |
Definition at line 569 of file connect_engine.cpp.
References config::add_child(), data, ERR_CF, utils::find(), LOG_CF, LOG_MP, LOG_NW, game_config::images::observer, s, and mp::send_to_server().
Referenced by gui2::dialogs::mp_staging::network_handler().
|
private |
Definition at line 755 of file connect_engine.cpp.
References utils::join_map(), and utils::map_split().
|
inline |
Definition at line 82 of file connect_engine.hpp.
References level_, and config::optional_child().
Referenced by connect_engine(), and gui2::dialogs::mp_staging::pre_show().
|
private |
Definition at line 735 of file connect_engine.cpp.
References config::add_child(), prefs::get(), prefs::get_ignored_delim(), and mp::send_to_server().
|
inline |
Definition at line 106 of file connect_engine.hpp.
References side_engines_.
Referenced by gui2::dialogs::mp_staging::get_side_node_position(), and gui2::dialogs::mp_staging::pre_show().
bool ng::connect_engine::sides_available | ( | ) | const |
Definition at line 290 of file connect_engine.cpp.
Referenced by gui2::dialogs::mp_staging::update_status_label_and_buttons().
void ng::connect_engine::start_game | ( | ) |
Definition at line 383 of file connect_engine.cpp.
References DBG_MP, randomness::mt_rng::get_next_random(), i, mp::level_to_gamestate(), mp::send_to_server(), and swap().
Referenced by sp::configure_campaign(), campaign_controller::play_game(), and gui2::dialogs::mp_staging::post_show().
void ng::connect_engine::start_game_commandline | ( | const commandline_options & | cmdline_opts, |
const game_config_view & | game_config | ||
) |
Definition at line 462 of file connect_engine.cpp.
References DBG_MP, ERR_MP, mp::level_to_gamestate(), commandline_options::multiplayer_ai_config, commandline_options::multiplayer_algorithm, commandline_options::multiplayer_controller, commandline_options::multiplayer_ignore_map_settings, commandline_options::multiplayer_parm, commandline_options::multiplayer_side, commandline_options::multiplayer_turns, and mp::send_to_server().
Referenced by mp::start_local_game_commandline().
|
inline |
Definition at line 101 of file connect_engine.hpp.
References team_data_.
Referenced by gui2::dialogs::mp_staging::add_side_node().
void ng::connect_engine::update_and_send_diff | ( | ) |
Definition at line 312 of file connect_engine.cpp.
References config::add_child(), config::empty(), config::get_diff(), and mp::send_to_server().
Referenced by gui2::dialogs::mp_staging::network_handler().
void ng::connect_engine::update_level | ( | ) |
Definition at line 301 of file connect_engine.cpp.
References DBG_MP.
|
private |
Definition at line 798 of file connect_engine.cpp.
|
friend |
Definition at line 122 of file connect_engine.hpp.
|
private |
Definition at line 129 of file connect_engine.hpp.
Referenced by ng::side_engine::controller_changed(), ng::side_engine::place_user(), ng::side_engine::reset(), ng::side_engine::side_engine(), and ng::side_engine::update_controller_options().
|
private |
Definition at line 136 of file connect_engine.hpp.
Referenced by connect_engine().
|
private |
Definition at line 131 of file connect_engine.hpp.
Referenced by first_scenario().
|
private |
Definition at line 133 of file connect_engine.hpp.
Referenced by connect_engine(), and force_lock_settings().
|
private |
Definition at line 124 of file connect_engine.hpp.
Referenced by connect_engine(), level(), and scenario().
|
private |
Definition at line 130 of file connect_engine.hpp.
Referenced by ng::side_engine::update_controller_options().
|
private |
Definition at line 127 of file connect_engine.hpp.
Referenced by connect_engine(), ng::side_engine::new_config(), params(), ng::side_engine::reset(), and ng::side_engine::resolve_random().
|
private |
Definition at line 135 of file connect_engine.hpp.
Referenced by side_engines().
|
private |
Definition at line 125 of file connect_engine.hpp.
Referenced by connect_engine(), and ng::side_engine::side_engine().
|
private |
Definition at line 137 of file connect_engine.hpp.
Referenced by connect_engine(), ng::side_engine::new_config(), ng::side_engine::side_engine(), team_data(), ng::side_engine::team_name(), and ng::side_engine::user_team_name().