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>
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 |
Wesnoth-Server, for multiplayer-games.
Definition in file server.cpp.
#define DBG_SERVER LOG_STREAM(debug, log_server) |
Definition at line 82 of file server.cpp.
Referenced by wesnothd::server::accept_connection(), wesnothd::server::create_game(), wesnothd::server::handle_join_game(), and wesnothd::server::handle_player_in_game().
#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) |
fatal and directly server related errors/warnings, ie not caused by erroneous client data
Definition at line 75 of file server.cpp.
Referenced by wesnothd::server::accept_connection(), wesnothd::server::bans_handler(), wesnothd::check_error(), wesnothd::server::delete_game(), wesnothd::server::dul_handler(), wesnothd::server::handle_handshake(), wesnothd::server::handle_player_in_game(), main(), wesnothd::handle_receive_doc< Handler, ErrorHandler >::operator()(), wesnothd::server::process_command(), wesnothd::server::setup_fifo(), and wesnothd::server::start_new_server().
#define FIFODIR "/var/run/wesnothd" |
Referenced by wesnothd::server::load_config().
#define LOG_SERVER LOG_STREAM(info, log_server) |
normal events
Definition at line 81 of file server.cpp.
Referenced by wesnothd::server::accept_connection(), wesnothd::server::adminmsg_handler(), wesnothd::server::cleanup_game(), wesnothd::server::dump_stats(), wesnothd::server::handle_login(), wesnothd::server::handle_player_in_game(), wesnothd::server::handle_query(), wesnothd::server::handle_read_from_fifo(), wesnothd::server::handle_termination(), wesnothd::server::lobbymsg_handler(), wesnothd::server::msg_handler(), wesnothd::server::read_config(), wesnothd::server::read_version(), wesnothd::server::remove_player(), wesnothd::server::run(), wesnothd::server::setup_fifo(), and wesnothd::server::start_new_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) |
clients send wrong/unexpected data
Definition at line 78 of file server.cpp.
Referenced by wesnothd::server::handle_join_game(), wesnothd::server::handle_player_in_game(), wesnothd::server::handle_query(), and wesnothd::server::handle_sighup().
Definition at line 2981 of file server.cpp.
References lg::debug(), lg::err(), ERR_SERVER, filesystem::get_cwd(), lg::logger::get_severity(), lg::info(), game_config::path, wesnothd::request_sample_frequency, wesnothd::server::run(), lg::set_log_domain_severity(), lg::timestamps(), game_config::version, and lg::warn().
|
static |
|
static |