The Battle for Wesnoth  1.13.4+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 - 2016 Philippe Plantier <[email protected]>
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 #ifndef MULTIPLAYER_HPP_INCLUDED
15 #define MULTIPLAYER_HPP_INCLUDED
16 
17 #include "commandline_options.hpp"
18 #include "mp_game_settings.hpp"
19 #include "connect_engine.hpp"
20 #include "multiplayer_ui.hpp"
21 
22 class config;
23 class CVideo;
25 namespace mp {
26 
27 // max. length of a player name
28 const size_t max_login_size = 20;
29 
31 
32 /*
33  * This is the main entry points of multiplayer mode.
34  */
35 
36 /** Starts a multiplayer game in single-user mode.
37  *
38  * @param video The global display
39  * @param game_config The global, top-level WML configuration for the game
40  */
41 void start_local_game(CVideo& video, const config& game_config,
42  saved_game& state);
43 
44 /** Starts a multiplayer game in single-user mode.
45  *
46  * Same parameters as start_local_game plus:
47  * cmdline_opts The commandline options
48  */
50  saved_game& state, const commandline_options& cmdline_opts);
51 
52 /** Starts a multiplayer game in client mode.
53  *
54  * @param video The global display
55  * @param game_config The global, top-level WML configuration for the game
56  * @param host The host to connect to.
57  */
58 void start_client(CVideo& video, const config& game_config,
59  saved_game& state, const std::string& host);
60 
61 /**
62  * Opens mp::connect screen and sets game state according to the
63  * changes made.
64  */
66  const config& game_config, twesnothd_connection* wesnothd_connection, const std::string& game_name);
67 
68 /**
69  * Opens mp::wait screen and sets game state according to the
70  * changes made.
71  */
72 mp::ui::result goto_mp_wait(CVideo& video, saved_game& state, const config& game_config, twesnothd_connection* wesnothd_connection, bool observe);
73 
74 }
75 #endif
void start_client(CVideo &video, const config &game_config, saved_game &state, const std::string &host)
Starts a multiplayer game in client mode.
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.
Definition: video.hpp:58
This module controls the multiplayer lobby.
A class that represents a TCP/IP connection to the wesnothd server.
const GLdouble * v
Definition: glew.h:1359
const size_t max_login_size
Definition: multiplayer.hpp:28
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.
Game configuration data as global variables.
Definition: build_info.cpp:38
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.
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:83
GLsizei const GLcharARB ** string
Definition: glew.h:4503
a base class for the different multiplayer base dialogs: game list, create game, wait game...
void run_lobby_loop(CVideo &video, mp::ui &ui)
Definition: multiplayer.cpp:72
void start_local_game(CVideo &video, const config &game_config, saved_game &state)
Starts a multiplayer game in single-user mode.