The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Namespaces | Macros | Typedefs | Functions | Variables
server.cpp File Reference

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

#include "server.hpp"
#include "global.hpp"
#include "config.hpp"
#include "game_config.hpp"
#include "log.hpp"
#include "map/map.hpp"
#include "filesystem.hpp"
#include "multiplayer_error_codes.hpp"
#include "serialization/parser.hpp"
#include "serialization/preprocessor.hpp"
#include "serialization/string_utils.hpp"
#include "serialization/unicode.hpp"
#include "util.hpp"
#include "game.hpp"
#include "metrics.hpp"
#include "player.hpp"
#include "simple_wml.hpp"
#include "ban.hpp"
#include "exceptions.hpp"
#include "user_handler.hpp"
#include "sample_user_handler.hpp"
#include "utils/functional.hpp"
#include <boost/scoped_ptr.hpp>
#include <boost/scoped_array.hpp>
#include <boost/make_shared.hpp>
#include <boost/utility.hpp>
#include <algorithm>
#include <cassert>
#include <cerrno>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <sstream>
#include <vector>
#include <queue>
#include <csignal>
Include dependency graph for server.cpp:

Go to the source code of this file.

Classes

struct  wesnothd::handle_doc< Handler, ErrorHandler >
 
union  wesnothd::handle_doc< Handler, ErrorHandler >::DataSize
 
struct  wesnothd::handle_receive_doc< Handler, ErrorHandler >
 

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 SIGHUP   20
 
#define FIFODIR   "/var/run/wesnothd"
 

Typedefs

typedef std::map< socket_ptr,
std::deque< boost::shared_ptr
< simple_wml::document > > > 
wesnothd::SendQueue
 

Functions

void wesnothd::async_send_error (socket_ptr socket, const std::string &msg, const char *error_code="")
 
std::string wesnothd::client_address (socket_ptr socket)
 
static bool wesnothd::check_error (const boost::system::error_code &error, socket_ptr socket)
 
template<typename Handler , typename ErrorHandler >
void wesnothd::async_send_doc (socket_ptr socket, simple_wml::document &doc, Handler handler, ErrorHandler error_handler)
 
static void wesnothd::null_handler (socket_ptr)
 
template<typename Handler >
void wesnothd::async_send_doc (socket_ptr socket, simple_wml::document &doc, Handler handler)
 
static void wesnothd::async_send_doc (socket_ptr socket, simple_wml::document &doc)
 
template<typename Handler , typename ErrorHandler >
void wesnothd::async_receive_doc (socket_ptr socket, Handler handler, ErrorHandler error_handler)
 
template<typename Handler >
void wesnothd::async_receive_doc (socket_ptr socket, Handler handler)
 
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::async_send_warning (socket_ptr socket, const std::string &msg, const char *warning_code)
 
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
 
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

#define DBG_SERVER   LOG_STREAM(debug, log_server)
#define ERR_CONFIG   LOG_STREAM(err, log_config)

Definition at line 85 of file server.cpp.

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

#define ERR_SERVER   LOG_STREAM(err, log_server)
#define FIFODIR   "/var/run/wesnothd"
#define LOG_SERVER   LOG_STREAM(info, log_server)
#define SIGHUP   20

Definition at line 90 of file server.cpp.

#define WRN_CONFIG   LOG_STREAM(warn, log_config)

Definition at line 86 of file server.cpp.

Referenced by wesnothd::async_send_doc().

#define WRN_SERVER   LOG_STREAM(warn, log_server)

Function Documentation

int main ( int  argc,
char **  argv 
)

Variable Documentation

lg::log_domain log_config("config")
static
lg::log_domain log_server("server")
static