The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Namespaces | Macros | Typedefs | Functions | Variables
multiplayer.cpp File Reference
#include "game_initialization/multiplayer.hpp"
#include "addon/manager.hpp"
#include "formula/string_utils.hpp"
#include "game_config_manager.hpp"
#include "game_initialization/mp_game_utils.hpp"
#include "game_initialization/playcampaign.hpp"
#include "preferences/credentials.hpp"
#include "preferences/game.hpp"
#include "gettext.hpp"
#include "gui/dialogs/message.hpp"
#include "gui/dialogs/multiplayer/lobby.hpp"
#include "gui/dialogs/multiplayer/mp_connect.hpp"
#include "gui/dialogs/multiplayer/mp_create_game.hpp"
#include "gui/dialogs/multiplayer/mp_join_game.hpp"
#include "gui/dialogs/multiplayer/mp_login.hpp"
#include "gui/dialogs/multiplayer/mp_staging.hpp"
#include "gui/dialogs/network_transmission.hpp"
#include "gui/widgets/settings.hpp"
#include "hash.hpp"
#include "log.hpp"
#include "multiplayer_error_codes.hpp"
#include "settings.hpp"
#include "sound.hpp"
#include "statistics.hpp"
#include "video.hpp"
#include "wesnothd_connection.hpp"
#include "resources.hpp"
#include "replay.hpp"
#include "utils/functional.hpp"
Include dependency graph for multiplayer.cpp:

Go to the source code of this file.


struct  mp_workflow_helper
 Helper struct to manage the MP workflow arguments. More...


 Pubic entry points for the MP workflow.


#define DBG_MP   LOG_STREAM(debug, log_mp)


using mp_workflow_helper_ptr = std::shared_ptr< mp_workflow_helper >


static wesnothd_connection_ptr open_connection (CVideo &video, const std::string &original_host)
 Opens a new server connection and prompts the client for login credentials, if necessary. More...
static void enter_wait_mode (mp_workflow_helper_ptr helper, int game_id, bool observe)
 The main components of the MP workflow. More...
static void enter_staging_mode (mp_workflow_helper_ptr helper)
static void enter_create_mode (mp_workflow_helper_ptr helper)
static bool enter_lobby_mode (mp_workflow_helper_ptr helper, const std::vector< std::string > &installed_addons)
void mp::start_client (CVideo &video, const config &game_config, saved_game &state, const std::string &host)
 Starts a multiplayer game in client mode. More...
bool mp::goto_mp_connect (CVideo &video, ng::connect_engine &engine, const config &game_config, wesnothd_connection *connection)
 Opens mp::connect screen and sets game state according to the changes made. More...
bool mp::goto_mp_wait (CVideo &video, saved_game &state, const config &game_config, wesnothd_connection *connection, bool observe)
 Opens mp::wait screen and sets game state according to the changes made. More...
void mp::start_local_game (CVideo &video, const config &game_config, saved_game &state)
 Starts a multiplayer game in single-user mode. More...
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. More...


static lg::log_domain log_mp ("mp/main")

Macro Definition Documentation

#define DBG_MP   LOG_STREAM(debug, log_mp)

Typedef Documentation

using mp_workflow_helper_ptr = std::shared_ptr<mp_workflow_helper>

Definition at line 351 of file multiplayer.cpp.

Function Documentation

static void enter_create_mode ( mp_workflow_helper_ptr  helper)
static bool enter_lobby_mode ( mp_workflow_helper_ptr  helper,
const std::vector< std::string > &  installed_addons 
static void enter_staging_mode ( mp_workflow_helper_ptr  helper)
static void enter_wait_mode ( mp_workflow_helper_ptr  helper,
int  game_id,
bool  observe 

The main components of the MP workflow.

It consists of four screens:

Host POV: LOBBY <—> CREATE GAME —> STAGING ---------------—> GAME BEGINS Player POV: LOBBY <------------------------------—> JOIN GAME —> GAME BEGINS

NOTE: since these functions are static, they appear here in the opposite order they'd be accessed.

Definition at line 361 of file multiplayer.cpp.

References preferences::blindfold_replay(), mp_campaign_info::current_turn, DBG_MP, gui2::dialogs::mp_join_game::fetch_game_config(), statistics::fresh_stats(), game_config_manager::get(), gui2::dialogs::modal_dialog::get_retval(), mp_campaign_info::is_host, gui2::window::OK, gui2::dialogs::modal_dialog::show(), preferences::skip_mp_replay(), mp_campaign_info::skip_replay, mp_campaign_info::skip_replay_blindfolded, and game_config_manager::terrain_types().

Referenced by enter_lobby_mode().

static wesnothd_connection_ptr open_connection ( CVideo video,
const std::string &  original_host 

Variable Documentation

lg::log_domain log_mp("mp/main")