The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
multiplayer.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2005 - 2017 Philippe Plantier <ayin@anathas.org>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #pragma once
16 
17 #include "commandline_options.hpp"
18 #include "connect_engine.hpp"
19 #include "mp_game_settings.hpp"
21 
22 class config;
24 namespace mp {
25 
26 // max. length of a player name
27 const size_t max_login_size = 20;
28 
29 /*
30  * This is the main entry points of multiplayer mode.
31  */
32 
33 /** Starts a multiplayer game in single-user mode.
34  *
35  * @param game_config The global, top-level WML configuration for the game
36  */
38  saved_game& state);
39 
40 /** Starts a multiplayer game in single-user mode.
41  *
42  * Same parameters as start_local_game plus:
43  * cmdline_opts The commandline options
44  */
46  saved_game& state, const commandline_options& cmdline_opts);
47 
48 /** Starts a multiplayer game in client mode.
49  *
50  * @param game_config The global, top-level WML configuration for the game
51  * @param host The host to connect to.
52  */
53 void start_client(const config& game_config,
54  saved_game& state, const std::string& host);
55 
56 /**
57  * Opens mp::connect screen and sets game state according to the
58  * changes made.
59  */
61  const config& game_config, wesnothd_connection* connection);
62 
63 /**
64  * Opens mp::wait screen and sets game state according to the
65  * changes made.
66  */
67 bool goto_mp_wait(saved_game& state, const config& game_config, wesnothd_connection* connection, bool observe);
68 
69 }
void start_local_game_commandline(const config &game_config, saved_game &state, const commandline_options &cmdline_opts)
Starts a multiplayer game in single-user mode.
std::vector< char_t > string
Pubic entry points for the MP workflow.
Definition: lobby_data.cpp:48
A class that represents a TCP/IP connection to the wesnothd server.
const size_t max_login_size
Definition: multiplayer.hpp:27
void start_client(const config &game_config, saved_game &state, const std::string &host)
Starts a multiplayer game in client mode.
void start_local_game(const config &game_config, saved_game &state)
Starts a multiplayer game in single-user mode.
Game configuration data as global variables.
Definition: build_info.cpp:53
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:93
bool goto_mp_wait(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.
bool goto_mp_connect(ng::connect_engine &engine, const config &game_config, wesnothd_connection *connection)
Opens mp::connect screen and sets game state according to the changes made.