This module controls the multiplayer lobby. More...
Namespaces | |
options | |
Classes | |
class | chat |
this class memorizes a chat session. More... | |
class | configure |
class | connect |
class | create |
class | gamebrowser |
class | lobby |
struct | lobby_reload_request_exception |
struct | minimap_cache_item |
struct | required_addon |
class | ui |
a base class for the different multiplayer base dialogs: game list, create game, wait game, game setup. More... | |
class | wait |
Enumerations | |
enum | ADDON_REQ { SATISFIED, NEED_DOWNLOAD, CANNOT_SATISFY } |
Functions | |
static void | add_multiplayer_classification (config &multiplayer, saved_game &state) |
config | initial_level_config (saved_game &state) |
void | level_to_gamestate (const config &level, saved_game &state) |
void | check_response (bool res, const config &data) |
void | run_lobby_loop (CVideo &video, mp::ui &ui) |
void | start_local_game (CVideo &video, const config &game_config, saved_game &state) |
Starts a multiplayer game in single-user mode. More... | |
void | start_local_game_commandline (CVideo &video, const config &game_config, saved_game &state, const commandline_options &cmdline_opts) |
Starts a multiplayer game in single-user mode. More... | |
void | start_client (CVideo &video, const config &game_config, saved_game &state, const std::string &host) |
Starts a multiplayer game in client mode. More... | |
mp::ui::result | goto_mp_connect (CVideo &video, ng::connect_engine &engine, const config &game_config, twesnothd_connection *wesnothd_connection, const std::string &game_name) |
Opens mp::connect screen and sets game state according to the changes made. More... | |
mp::ui::result | goto_mp_wait (CVideo &video, saved_game &state, const config &game_config, twesnothd_connection *wesnothd_connection, bool observe) |
Opens mp::wait screen and sets game state according to the changes made. More... | |
std::vector< std::string > | controller_options_names (const std::vector< ng::controller_option > &controller_options) |
static std::string | get_income_string (int income) |
static config | get_selected_helper (const ng::create_engine *eng_ptr) |
static config | find_helper (const ng::create_engine *eng_ptr, const config &cfg) |
static mp::ADDON_REQ | check_addon_version_compatibility (const config &local_item, const config &game, std::vector< required_addon > &req_list) |
static void | handle_addon_requirements_gui (CVideo &v, const std::vector< required_addon > &reqs, mp::ADDON_REQ addon_outcome) |
std::string | get_color_string (int id) |
std::string | get_color_string (const std::string &id) |
static std::string | generate_user_description (const config &side) |
Variables | |
const size_t | max_login_size = 20 |
This module controls the multiplayer lobby.
A section on the server which allows players to chat, create games, and join games.
enum mp::ADDON_REQ |
Enumerator | |
---|---|
SATISFIED | |
NEED_DOWNLOAD | |
CANNOT_SATISFY |
Definition at line 37 of file multiplayer_lobby.hpp.
|
static |
Definition at line 47 of file mp_game_utils.cpp.
References game_classification::campaign, saved_game::classification(), game_classification::difficulty, saved_game::get_scenario_id(), and saved_game::get_starting_pos().
Referenced by initial_level_config().
|
static |
Definition at line 638 of file multiplayer_lobby.cpp.
References mp::required_addon::addon_id, CANNOT_SATISFY, config::find_child(), config::has_attribute(), mp::required_addon::message, NEED_DOWNLOAD, mp::required_addon::outcome, SATISFIED, version_info::str(), and vgettext().
Referenced by mp::gamebrowser::populate_game_item_campaign_or_scenario_info(), mp::gamebrowser::populate_game_item_era_info(), and mp::gamebrowser::populate_game_item_mod_info().
Definition at line 132 of file mp_game_utils.cpp.
References _(), config::child(), and lg::err().
Referenced by mp::wait::download_level_data().
std::vector< std::string > mp::controller_options_names | ( | const std::vector< ng::controller_option > & | controller_options | ) |
Definition at line 40 of file multiplayer_connect.cpp.
Referenced by mp::connect::side::update_controller_ui().
|
static |
Definition at line 76 of file multiplayer_create.cpp.
References ng::create_engine::find_level_by_id(), and ng::create_engine::find_level_type_by_id().
Referenced by mp::create::create().
|
static |
Definition at line 480 of file multiplayer_wait.cpp.
References _(), ERR_RG, config::get(), and vgettext().
Referenced by mp::wait::generate_menu().
std::string mp::get_color_string | ( | int | id | ) |
Definition at line 82 of file multiplayer_ui.cpp.
References _(), team::get_side_highlight(), and game_config::team_rgb_name.
Referenced by mp::wait::generate_menu(), and ng::side_engine::get_colors().
std::string mp::get_color_string | ( | const std::string & | id | ) |
Definition at line 93 of file multiplayer_ui.cpp.
References _(), rgb2highlight(), game_config::team_rgb_name, and game_config::team_rgb_range.
|
static |
Definition at line 51 of file multiplayer_connect.cpp.
References _().
Referenced by mp::connect::side::process_event().
|
static |
Definition at line 64 of file multiplayer_create.cpp.
References ng::level::allow_era_choice(), ng::create_engine::current_level(), ng::create_engine::current_level_type(), ng::level::description(), ng::level::icon(), ng::level::id(), and ng::level::name().
Referenced by mp::create::create().
mp::ui::result mp::goto_mp_connect | ( | CVideo & | video, |
ng::connect_engine & | engine, | ||
const config & | game_config, | ||
twesnothd_connection * | wesnothd_connection, | ||
const std::string & | game_name | ||
) |
Opens mp::connect screen and sets game state according to the changes made.
Definition at line 881 of file multiplayer.cpp.
References mp::ui::get_result(), mp::ui::PLAY, run_lobby_loop(), and mp::connect::start_game().
Referenced by campaign_controller::play_game().
mp::ui::result mp::goto_mp_wait | ( | CVideo & | video, |
saved_game & | state, | ||
const config & | game_config, | ||
twesnothd_connection * | wesnothd_connection, | ||
bool | observe | ||
) |
Opens mp::wait screen and sets game state according to the changes made.
Definition at line 900 of file multiplayer.cpp.
References mp::ui::get_result(), mp::wait::join_game(), mp::ui::PLAY, run_lobby_loop(), and mp::wait::start_game().
Referenced by campaign_controller::play_game().
|
static |
Definition at line 1192 of file multiplayer_lobby.cpp.
References _(), ad_hoc_addon_fetch_session(), gui2::tmessage::auto_close, CANNOT_SATISFY, NEED_DOWNLOAD, gui2::twindow::OK, gui2::show_message(), and gui2::tmessage::yes_no_buttons.
Referenced by mp::lobby::process_event_impl().
config mp::initial_level_config | ( | saved_game & | state | ) |
Definition at line 55 of file mp_game_utils.cpp.
References mp_game_settings::active_mods, config::add_child(), config::add_child_at(), add_multiplayer_classification(), config::child(), config::child_or_add(), preferences::era(), error(), saved_game::expand_mp_events(), saved_game::expand_mp_options(), saved_game::expand_random_scenario(), config::find_child(), game_config_manager::game_config(), game_config_manager::get(), saved_game::get_starting_pos(), i, mp_game_settings::mp_era, saved_game::mp_settings(), N_, mp_game_settings::saved_game, saved_game::set_defaults(), saved_game::set_random_seed(), saved_game::to_config(), game_config::version, vgettext(), and WRN_CF.
Referenced by ng::connect_engine::connect_engine().
void mp::level_to_gamestate | ( | const config & | level, |
saved_game & | state | ||
) |
Definition at line 123 of file mp_game_utils.cpp.
References saved_game::classification(), saved_game::mp_settings(), and mp_game_settings::show_connect.
Referenced by mp::wait::start_game(), ng::connect_engine::start_game(), and ng::connect_engine::start_game_commandline().
Definition at line 72 of file multiplayer.cpp.
References font::CACHE_GAME, font::CACHE_LOBBY, font::cache_mode(), mp::ui::CONTINUE, sdl::create_rect(), DBG_MP, CVideo::delay(), CVideo::flip(), mp::ui::get_plugins_context(), mp::ui::get_result(), CVideo::getx(), CVideo::gety(), CVideo::modeChanged(), mp::ui::process_network(), events::pump(), events::raise_draw_event(), events::raise_process_event(), and mp::ui::set_location().
Referenced by sp::enter_configure_mode(), enter_configure_mode(), sp::enter_connect_mode(), enter_connect_mode(), enter_create_mode(), enter_lobby_mode(), enter_wait_mode(), goto_mp_connect(), and goto_mp_wait().
void mp::start_client | ( | CVideo & | video, |
const config & | game_config, | ||
saved_game & | state, | ||
const std::string & | host | ||
) |
Starts a multiplayer game in client mode.
video | The global display |
game_config | The global, top-level WML configuration for the game |
host | The host to connect to. |
Definition at line 843 of file multiplayer.cpp.
References saved_game::classification(), DBG_MP, enter_lobby_mode(), game_config_manager::game_config(), game_config_manager::get(), installed_addons(), game_config_manager::load_game_config_for_game(), open_connection(), game_config_manager::reload_changed_game_config(), and twesnothd_connection::send_data().
Referenced by game_launcher::play_multiplayer().
void mp::start_local_game | ( | CVideo & | video, |
const config & | game_config, | ||
saved_game & | state | ||
) |
Starts a multiplayer game in single-user mode.
video | The global display |
game_config | The global, top-level WML configuration for the game |
Definition at line 731 of file multiplayer.cpp.
References DBG_MP, enter_create_mode(), and preferences::set_message_private().
Referenced by game_launcher::play_multiplayer().
void mp::start_local_game_commandline | ( | CVideo & | video, |
const config & | game_config, | ||
saved_game & | state, | ||
const commandline_options & | cmdline_opts | ||
) |
Starts a multiplayer game in single-user mode.
Same parameters as start_local_game plus: cmdline_opts The commandline options
Definition at line 741 of file multiplayer.cpp.
References saved_game::classification(), DBG_MP, game_classification::era_define, saved_game::expand_mp_events(), saved_game::expand_mp_options(), saved_game::expand_random_scenario(), config::find_child(), statistics::fresh_stats(), game_config_manager::get(), saved_game::get_starting_pos(), settings::get_turns(), settings::get_village_gold(), settings::get_village_support(), settings::get_xp_modifier(), i, game_config_manager::load_game_config_for_game(), mp_game_settings::mp_era, saved_game::mp_settings(), commandline_options::multiplayer_era, commandline_options::multiplayer_ignore_map_settings, commandline_options::multiplayer_label, commandline_options::multiplayer_repeat, commandline_options::multiplayer_scenario, mp_game_settings::name, mp_game_settings::num_turns, parameters, campaign_controller::play_game(), game_classification::scenario_define, saved_game::set_carryover_sides_start(), preferences::set_message_private(), mp::connect::start_game_commandline(), mp_game_settings::use_map_settings, mp_game_settings::village_gold, mp_game_settings::village_support, and mp_game_settings::xp_modifier.
Referenced by game_launcher::play_multiplayer_commandline().
const size_t mp::max_login_size = 20 |
Definition at line 28 of file multiplayer.hpp.
Referenced by gui2::tmp_method_selection::pre_show().