The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Namespaces | Classes | Enumerations | Functions | Variables
mp Namespace Reference

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::stringcontroller_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
 

Detailed Description

This module controls the multiplayer lobby.

A section on the server which allows players to chat, create games, and join games.

Enumeration Type Documentation

Enumerator
SATISFIED 
NEED_DOWNLOAD 
CANNOT_SATISFY 

Definition at line 37 of file multiplayer_lobby.hpp.

Function Documentation

static void mp::add_multiplayer_classification ( config multiplayer,
saved_game state 
)
static
static mp::ADDON_REQ mp::check_addon_version_compatibility ( const config local_item,
const config game,
std::vector< required_addon > &  req_list 
)
static
void mp::check_response ( bool  res,
const config data 
)

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 config mp::find_helper ( const ng::create_engine eng_ptr,
const config cfg 
)
static
static std::string mp::generate_user_description ( const config side)
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)
std::string mp::get_color_string ( const std::string id)
static std::string mp::get_income_string ( int  income)
static

Definition at line 51 of file multiplayer_connect.cpp.

References _().

Referenced by mp::connect::side::process_event().

static config mp::get_selected_helper ( const ng::create_engine eng_ptr)
static
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 void mp::handle_addon_requirements_gui ( CVideo v,
const std::vector< required_addon > &  reqs,
mp::ADDON_REQ  addon_outcome 
)
static
config mp::initial_level_config ( saved_game state)
void mp::level_to_gamestate ( const config level,
saved_game state 
)
void mp::run_lobby_loop ( CVideo video,
mp::ui ui 
)
void mp::start_client ( CVideo video,
const config game_config,
saved_game state,
const std::string host 
)

Starts a multiplayer game in client mode.

Parameters
videoThe global display
game_configThe global, top-level WML configuration for the game
hostThe 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.

Parameters
videoThe global display
game_configThe 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 
)

Variable Documentation

const size_t mp::max_login_size = 20

Definition at line 28 of file multiplayer.hpp.

Referenced by gui2::tmp_method_selection::pre_show().