The Battle for Wesnoth  1.17.0-dev
Classes | Enumerations | Functions | Variables
mp Namespace Reference

Main entry points of multiplayer mode. More...

Classes

class  chat_info
 
struct  chat_message
 This class represents a single stored chat message. More...
 
class  chat_session
 this class memorizes a chat session. More...
 
struct  game_info
 This class represents the info a client has about a game on the server. More...
 
class  lobby_info
 This class represents the collective information the client has about the players and games on the server. More...
 
class  room_info
 This class represents the information a client has about a room. More...
 
struct  user_info
 This class represents the information a client has about another player. More...
 

Enumerations

enum  notify_mode {
  NOTIFY_NONE, NOTIFY_MESSAGE, NOTIFY_MESSAGE_OTHER_WINDOW, NOTIFY_SERVER_MESSAGE,
  NOTIFY_OWN_NICK, NOTIFY_FRIEND_MESSAGE, NOTIFY_WHISPER, NOTIFY_WHISPER_OTHER_WINDOW,
  NOTIFY_LOBBY_JOIN, NOTIFY_LOBBY_QUIT, NOTIFY_GAME_CREATED
}
 

Functions

void do_notify (notify_mode mode, const std::string &sender, const std::string &message)
 
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 start_client (const std::string &host)
 Pubic entry points for the MP workflow. More...
 
void start_local_game ()
 Starts a multiplayer game in single-user mode. More...
 
void start_local_game_commandline (const commandline_options &cmdline_opts)
 Starts a multiplayer game in single-user mode using command line settings. More...
 
bool goto_mp_staging (ng::connect_engine &engine)
 Opens the MP Staging screen and sets the game state according to the changes made. More...
 
bool goto_mp_wait (bool observe)
 Opens the MP Join Game screen and sets the game state according to the changes made. More...
 
bool logged_in_as_moderator ()
 Gets whether the currently logged-in user is a moderator. More...
 
std::string get_profile_link (int user_id)
 Gets the forum profile link for the given user. More...
 

Variables

const std::size_t max_login_size = 20
 Max length of a player name. More...
 

Detailed Description

Main entry points of multiplayer mode.

Enumeration Type Documentation

◆ notify_mode

Enumerator
NOTIFY_NONE 
NOTIFY_MESSAGE 
NOTIFY_MESSAGE_OTHER_WINDOW 
NOTIFY_SERVER_MESSAGE 
NOTIFY_OWN_NICK 
NOTIFY_FRIEND_MESSAGE 
NOTIFY_WHISPER 
NOTIFY_WHISPER_OTHER_WINDOW 
NOTIFY_LOBBY_JOIN 
NOTIFY_LOBBY_QUIT 
NOTIFY_GAME_CREATED 

Definition at line 189 of file lobby_info.hpp.

Function Documentation

◆ add_multiplayer_classification()

static void mp::add_multiplayer_classification ( config multiplayer,
saved_game state 
)
static

◆ do_notify()

void mp::do_notify ( notify_mode  mode,
const std::string &  sender,
const std::string &  message 
)

◆ get_profile_link()

std::string mp::get_profile_link ( int  user_id)

Gets the forum profile link for the given user.

Definition at line 817 of file multiplayer.cpp.

Referenced by gui2::dialogs::mp_lobby::pre_show().

◆ goto_mp_staging()

bool mp::goto_mp_staging ( ng::connect_engine engine)

Opens the MP Staging screen and sets the game state according to the changes made.

Meant to be used between scenarios in a campaign.

Parameters
engineA connect_engine instance to pass to MP Staging.

Definition at line 802 of file multiplayer.cpp.

Referenced by campaign_controller::play_game().

◆ goto_mp_wait()

bool mp::goto_mp_wait ( bool  observe)

Opens the MP Join Game screen and sets the game state according to the changes made.

Meant to be used between scenarios in a campaign.

Parameters
observeWhether entering as an observer or player.

Definition at line 807 of file multiplayer.cpp.

Referenced by campaign_controller::play_game().

◆ initial_level_config()

config mp::initial_level_config ( saved_game state)

◆ level_to_gamestate()

void mp::level_to_gamestate ( const config level,
saved_game state 
)

◆ logged_in_as_moderator()

bool mp::logged_in_as_moderator ( )

Gets whether the currently logged-in user is a moderator.

Definition at line 812 of file multiplayer.cpp.

Referenced by mp::game_info::can_observe(), events::chat_command_handler::is_enabled(), events::console_handler::is_enabled(), and gui2::dialogs::lobby_player_info::pre_show().

◆ start_client()

void mp::start_client ( const std::string &  host)

Pubic entry points for the MP workflow.

Starts a multiplayer game in client mode.

Parameters
hostThe host to connect to.

Definition at line 681 of file multiplayer.cpp.

References DBG_MP.

Referenced by game_launcher::play_multiplayer().

◆ start_local_game()

void mp::start_local_game ( )

Starts a multiplayer game in single-user mode.

Definition at line 687 of file multiplayer.cpp.

References DBG_MP, and preferences::set_message_private().

Referenced by game_launcher::play_multiplayer().

◆ start_local_game_commandline()

void mp::start_local_game_commandline ( const commandline_options cmdline_opts)

Variable Documentation

◆ max_login_size

const std::size_t mp::max_login_size = 20

Max length of a player name.

Definition at line 28 of file multiplayer.hpp.

Referenced by gui2::dialogs::mp_method_selection::pre_show().