The Battle for Wesnoth  1.15.1+dev
Namespaces | Macros | Typedefs | Functions | Variables
server.cpp File Reference

Wesnoth-Server, for multiplayer-games. More...

#include "server/server.hpp"
#include "config.hpp"
#include "filesystem.hpp"
#include "game_config.hpp"
#include "lexical_cast.hpp"
#include "log.hpp"
#include "multiplayer_error_codes.hpp"
#include "serialization/parser.hpp"
#include "serialization/preprocessor.hpp"
#include "serialization/string_utils.hpp"
#include "serialization/unicode.hpp"
#include "utils/functional.hpp"
#include "utils/iterable_pair.hpp"
#include "game_version.hpp"
#include "server/ban.hpp"
#include "server/game.hpp"
#include "server/metrics.hpp"
#include "server/player.hpp"
#include "server/player_network.hpp"
#include "server/simple_wml.hpp"
#include "server/user_handler.hpp"
#include <boost/algorithm/string.hpp>
#include <algorithm>
#include <cassert>
#include <cerrno>
#include <csignal>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <vector>
#include "server/send_receive_wml_helpers.ipp"
Include dependency graph for server.cpp:

Go to the source code of this file.

Namespaces

 wesnothd
 

Macros

#define ERR_SERVER   LOG_STREAM(err, log_server)
 fatal and directly server related errors/warnings, ie not caused by erroneous client data More...
 
#define WRN_SERVER   LOG_STREAM(warn, log_server)
 clients send wrong/unexpected data More...
 
#define LOG_SERVER   LOG_STREAM(info, log_server)
 normal events More...
 
#define DBG_SERVER   LOG_STREAM(debug, log_server)
 
#define ERR_CONFIG   LOG_STREAM(err, log_config)
 
#define WRN_CONFIG   LOG_STREAM(warn, log_config)
 
#define SETUP_HANDLER(name, function)
 
#define FIFODIR   "/var/run/wesnothd"
 

Typedefs

using wesnothd::SendQueue = std::map< socket_ptr, std::queue< std::shared_ptr< simple_wml::document > >>
 

Functions

static void wesnothd::make_add_diff (const simple_wml::node &src, const char *gamelist, const char *type, simple_wml::document &out, int index=-1)
 
static bool wesnothd::make_delete_diff (const simple_wml::node &src, const char *gamelist, const char *type, const simple_wml::node *remove, simple_wml::document &out)
 
static bool wesnothd::make_change_diff (const simple_wml::node &src, const char *gamelist, const char *type, const simple_wml::node *item, simple_wml::document &out)
 
static std::string wesnothd::player_status (const wesnothd::player_record &player)
 
static void wesnothd::handle_send_to_player (socket_ptr socket)
 
void wesnothd::send_to_player (socket_ptr socket, simple_wml::document &doc)
 
void wesnothd::send_server_message (socket_ptr socket, const std::string &message)
 
int main (int argc, char **argv)
 

Variables

static lg::log_domain log_server ("server")
 
static lg::log_domain log_config ("config")
 
int wesnothd::request_sample_frequency = 1
 
version_info wesnothd::secure_version = version_info("1.14.4")
 
const std::string wesnothd::denied_msg = "You're not allowed to execute this command."
 
const std::string wesnothd::help_msg
 
SendQueue wesnothd::send_queue
 

Detailed Description

Wesnoth-Server, for multiplayer-games.

Definition in file server.cpp.

Macro Definition Documentation

◆ DBG_SERVER

#define DBG_SERVER   LOG_STREAM(debug, log_server)

◆ ERR_CONFIG

#define ERR_CONFIG   LOG_STREAM(err, log_config)

Definition at line 78 of file server.cpp.

Referenced by wesnothd::server::read_config().

◆ ERR_SERVER

#define ERR_SERVER   LOG_STREAM(err, log_server)

◆ FIFODIR

#define FIFODIR   "/var/run/wesnothd"

◆ LOG_SERVER

#define LOG_SERVER   LOG_STREAM(info, log_server)

◆ SETUP_HANDLER

#define SETUP_HANDLER (   name,
  function 
)
Value:
cmd_handlers_[name] = std::bind(function, this, \
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4);
static const char * name(const std::vector< SDL_Joystick *> &joysticks, const std::size_t index)
Definition: joystick.cpp:48

Referenced by wesnothd::server::setup_handlers().

◆ WRN_CONFIG

#define WRN_CONFIG   LOG_STREAM(warn, log_config)

Definition at line 79 of file server.cpp.

◆ WRN_SERVER

#define WRN_SERVER   LOG_STREAM(warn, log_server)

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Variable Documentation

◆ log_config

lg::log_domain log_config("config")
static

◆ log_server

lg::log_domain log_server("server")
static