The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Namespaces | Macros | Functions | Variables
multiplayer.cpp File Reference
#include "multiplayer.hpp"
#include "addon/manager.hpp"
#include "config_assign.hpp"
#include "dialogs.hpp"
#include "formula/string_utils.hpp"
#include "game_preferences.hpp"
#include "generators/map_create.hpp"
#include "generators/map_generator.hpp"
#include "gettext.hpp"
#include "gui/dialogs/lobby/lobby.hpp"
#include "gui/dialogs/message.hpp"
#include "gui/dialogs/multiplayer/mp_connect.hpp"
#include "gui/dialogs/multiplayer/mp_create_game.hpp"
#include "gui/dialogs/multiplayer/mp_login.hpp"
#include "gui/dialogs/network_transmission.hpp"
#include "gui/widgets/settings.hpp"
#include "gui/widgets/window.hpp"
#include "hash.hpp"
#include "lobby_reload_request_exception.hpp"
#include "log.hpp"
#include "mp_game_utils.hpp"
#include "multiplayer_configure.hpp"
#include "configure_engine.hpp"
#include "multiplayer_connect.hpp"
#include "multiplayer_create.hpp"
#include "multiplayer_error_codes.hpp"
#include "multiplayer_wait.hpp"
#include "multiplayer_lobby.hpp"
#include "playcampaign.hpp"
#include "settings.hpp"
#include "scripting/plugins/context.hpp"
#include "sdl/rect.hpp"
#include "sound.hpp"
#include "statistics.hpp"
#include "units/id.hpp"
#include "video.hpp"
#include "wesnothd_connection.hpp"
#include "game_config_manager.hpp"
#include "utils/functional.hpp"
Include dependency graph for multiplayer.cpp:

Go to the source code of this file.

Namespaces

 mp
 This module controls the multiplayer lobby.
 

Macros

#define LOG_NW   LOG_STREAM(info, log_network)
 
#define DBG_MP   LOG_STREAM(debug, log_mp)
 

Functions

void mp::run_lobby_loop (CVideo &video, mp::ui &ui)
 
static std::unique_ptr
< twesnothd_connection
open_connection (CVideo &video, const std::string &original_host)
 
static void enter_wait_mode (CVideo &video, const config &game_config, saved_game &state, twesnothd_connection *wesnothd_connection, bool observe, int current_turn=0)
 
static void enter_create_mode (CVideo &video, const config &game_config, saved_game &state, twesnothd_connection *wesnothd_connection, bool local_players_only=false)
 
static bool enter_connect_mode (CVideo &video, const config &game_config, saved_game &state, twesnothd_connection *wesnothd_connection, bool local_players_only=false)
 
static bool enter_configure_mode (CVideo &video, const config &game_config, saved_game &state, twesnothd_connection *wesnothd_connection, bool local_players_only=false)
 
static void do_preferences_dialog (CVideo &video, const config &game_config)
 
static void enter_lobby_mode (CVideo &video, const config &game_config, saved_game &state, twesnothd_connection *wesnothd_connection, const std::vector< std::string > &installed_addons)
 
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...
 
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...
 
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. More...
 
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. More...
 

Variables

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

Macro Definition Documentation

#define DBG_MP   LOG_STREAM(debug, log_mp)
#define LOG_NW   LOG_STREAM(info, log_network)

Definition at line 58 of file multiplayer.cpp.

Function Documentation

static void do_preferences_dialog ( CVideo video,
const config game_config 
)
static

The screen size might have changed force an update of the size.

Todo:
This might no longer be needed when gui2 is done.

Definition at line 614 of file multiplayer.cpp.

References DBG_MP, gui2::settings::gamemap_height, gui2::settings::gamemap_width, screen_area(), gui2::settings::screen_height, gui2::settings::screen_width, CVideo::set_resolution(), and preferences::show_preferences_dialog().

Referenced by enter_lobby_mode().

static bool enter_configure_mode ( CVideo video,
const config game_config,
saved_game state,
twesnothd_connection wesnothd_connection,
bool  local_players_only = false 
)
static
static bool enter_connect_mode ( CVideo video,
const config game_config,
saved_game state,
twesnothd_connection wesnothd_connection,
bool  local_players_only = false 
)
static
static void enter_create_mode ( CVideo video,
const config game_config,
saved_game state,
twesnothd_connection wesnothd_connection,
bool  local_players_only = false 
)
static
static void enter_lobby_mode ( CVideo video,
const config game_config,
saved_game state,
twesnothd_connection wesnothd_connection,
const std::vector< std::string > &  installed_addons 
)
static
static void enter_wait_mode ( CVideo video,
const config game_config,
saved_game state,
twesnothd_connection wesnothd_connection,
bool  observe,
int  current_turn = 0 
)
static
static std::unique_ptr<twesnothd_connection> open_connection ( CVideo video,
const std::string original_host 
)
static

Variable Documentation

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