#include <server.hpp>
Classes | |
struct | connection_log |
struct | login_log |
Public Member Functions | |
server (int port, bool keep_alive, const std::string &config_file) | |
~server () | |
template<class SocketPtr > | |
void | send_server_message (SocketPtr socket, const std::string &message, const std::string &type) |
void | send_server_message (player_iterator player, const std::string &message, const std::string &type) |
void | send_to_lobby (simple_wml::document &data, utils::optional< player_iterator > exclude={}) |
void | send_to_player (player_iterator player, simple_wml::document &data) |
void | send_server_message_to_lobby (const std::string &message, utils::optional< player_iterator > exclude={}) |
void | send_server_message_to_all (const std::string &message, utils::optional< player_iterator > exclude={}) |
bool | player_is_in_game (player_iterator player) const |
Public Member Functions inherited from server_base | |
server_base (unsigned short port, bool keep_alive) | |
virtual | ~server_base () |
int | run () |
template<class SocketPtr > | |
void | coro_send_doc (SocketPtr socket, simple_wml::document &doc, boost::asio::yield_context yield) |
Send a WML document from within a coroutine. More... | |
void | coro_send_file (socket_ptr socket, const std::string &filename, boost::asio::yield_context yield) |
Send contents of entire file directly to socket from within a coroutine. More... | |
void | coro_send_file (tls_socket_ptr socket, const std::string &filename, boost::asio::yield_context yield) |
template<class SocketPtr > | |
std::unique_ptr< simple_wml::document > | coro_receive_doc (SocketPtr socket, boost::asio::yield_context yield) |
Receive WML document from a coroutine. More... | |
template<class SocketPtr > | |
void | async_send_doc_queued (SocketPtr socket, simple_wml::document &doc) |
High level wrapper for sending a WML document. More... | |
template<class SocketPtr > | |
void | async_send_error (SocketPtr socket, const std::string &msg, const char *error_code="", const info_table &info={}) |
template<class SocketPtr > | |
void | async_send_warning (SocketPtr socket, const std::string &msg, const char *warning_code="", const info_table &info={}) |
std::string | create_unsecure_nonce (int length=8) |
Create the poor security nonce for use with passwords still hashed with MD5. More... | |
std::string | create_secure_nonce () |
Create a good security nonce for use with bcrypt/crypt_blowfish hashing. More... | |
std::string | hash_password (const std::string &pw, const std::string &salt, const std::string &username) |
Handles hashing the password provided by the player before comparing it to the hashed password in the forum database. More... | |
Public Attributes | |
bool | destructed = false |
Private Types | |
typedef std::function< void(const std::string &, const std::string &, std::string &, std::ostringstream *)> | cmd_handler |
Private Member Functions | |
void | handle_new_client (socket_ptr socket) |
void | handle_new_client (tls_socket_ptr socket) |
template<class SocketPtr > | |
void | login_client (boost::asio::yield_context yield, SocketPtr socket) |
template<class SocketPtr > | |
bool | is_login_allowed (boost::asio::yield_context yield, SocketPtr socket, const simple_wml::node *const login, const std::string &username, bool ®istered, bool &is_moderator) |
template<class SocketPtr > | |
bool | authenticate (SocketPtr socket, const std::string &username, const std::string &password, bool name_taken, bool ®istered) |
template<class SocketPtr > | |
void | send_password_request (SocketPtr socket, const std::string &msg, const char *error_code="", bool force_confirmation=false) |
bool | accepting_connections () const |
template<class SocketPtr > | |
void | handle_player (boost::asio::yield_context yield, SocketPtr socket, player_iterator player) |
void | handle_player_in_lobby (player_iterator player, simple_wml::document &doc) |
void | handle_player_in_game (player_iterator player, simple_wml::document &doc) |
void | handle_whisper (player_iterator player, simple_wml::node &whisper) |
void | handle_query (player_iterator player, simple_wml::node &query) |
void | handle_nickserv (player_iterator player, simple_wml::node &nickserv) |
void | handle_message (player_iterator player, simple_wml::node &message) |
void | handle_create_game (player_iterator player, simple_wml::node &create_game) |
void | cleanup_game (game *) |
void | handle_join_game (player_iterator player, simple_wml::node &join) |
void | disconnect_player (player_iterator player) |
void | remove_player (player_iterator player) |
config | read_config () const |
Read the server config from file 'config_file_'. More... | |
void | load_config () |
Parse the server config into local variables. More... | |
bool | ip_exceeds_connection_limit (const std::string &ip) const |
std::string | is_ip_banned (const std::string &ip) |
std::deque< std::shared_ptr< game > > | games () const |
void | start_dump_stats () |
void | dump_stats (const boost::system::error_code &ec) |
void | start_tournaments_timer () |
void | refresh_tournaments (const boost::system::error_code &ec) |
std::string | process_command (std::string cmd, std::string issuer_name) |
Process commands from admins and users. More... | |
void | delete_game (int, const std::string &reason="") |
void | update_game_in_lobby (const game &g, utils::optional< player_iterator > exclude={}) |
void | start_new_server () |
void | setup_fifo () |
void | handle_read_from_fifo (const boost::system::error_code &error, std::size_t bytes_transferred) |
void | setup_handlers () |
void | shut_down_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | restart_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | sample_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | help_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | stats_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | metrics_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | requests_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | roll_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | games_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | wml_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | adminmsg_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | pm_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | version_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | msg_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | lobbymsg_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | status_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | clones_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | bans_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | ban_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | unban_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | ungban_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | kick_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | kickban_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | gban_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | motd_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | searchlog_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | dul_handler (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | stopgame (const std::string &, const std::string &, std::string &, std::ostringstream *) |
void | handle_sighup (const boost::system::error_code &error, int signal_number) |
void | handle_graceful_timeout (const boost::system::error_code &error) |
void | start_lan_server_timer () |
void | abort_lan_server_timer () |
void | handle_lan_server_shutdown (const boost::system::error_code &error) |
void | start_dummy_player_updates () |
void | dummy_player_updates (const boost::system::error_code &ec) |
Additional Inherited Members | |
Public Types inherited from server_base | |
typedef std::map< std::string, std::string > | info_table |
Protected Member Functions inherited from server_base | |
void | load_tls_config (const config &cfg) |
void | start_server () |
void | serve (boost::asio::yield_context yield, boost::asio::ip::tcp::acceptor &acceptor, boost::asio::ip::tcp::endpoint endpoint) |
void | read_from_fifo () |
Protected Attributes inherited from server_base | |
unsigned short | port_ |
bool | keep_alive_ |
boost::asio::io_service | io_service_ |
boost::asio::ssl::context | tls_context_ { boost::asio::ssl::context::sslv23 } |
bool | tls_enabled_ { false } |
boost::asio::ip::tcp::acceptor | acceptor_v6_ |
boost::asio::ip::tcp::acceptor | acceptor_v4_ |
uint32_t | handshake_response_ |
boost::asio::posix::stream_descriptor | input_ |
std::string | fifo_path_ |
boost::asio::streambuf | admin_cmd_ |
boost::asio::signal_set | sighup_ |
Definition at line 35 of file server.hpp.
|
private |
Definition at line 225 of file server.hpp.
wesnothd::server::server | ( | int | port, |
bool | keep_alive, | ||
const std::string & | config_file | ||
) |
Definition at line 206 of file server.cpp.
References ban_manager_, load_config(), wesnothd::ban_manager::read(), setup_handlers(), start_dump_stats(), server_base::start_server(), and start_tournaments_timer().
|
inline |
Definition at line 43 of file server.hpp.
References destructed.
|
private |
Definition at line 303 of file server.cpp.
References lan_server_timer_.
Referenced by handle_player().
|
inlineprivatevirtual |
Reimplemented from server_base.
Definition at line 55 of file server.hpp.
References graceful_restart.
|
private |
Definition at line 2288 of file server.cpp.
References data, wesnothd::player::is_moderator(), LOG_SERVER, wfl::msg(), n, wesnothd::player::name(), player_connections_, and send_to_player().
Referenced by setup_handlers().
|
private |
Definition at line 945 of file server.cpp.
References server_base::async_send_error(), server_base::async_send_warning(), wesnothd::ban_manager::ban(), ban_manager_, campaignd::client_address(), image::exists(), failed_login_ban_, failed_login_buffer_size_, failed_login_limit_, failed_logins_, server_base::hash_password(), i, log_address(), LOG_SERVER, MP_HASHING_PASSWORD_FAILED, MP_INCORRECT_PASSWORD_ERROR, MP_NAME_INACTIVE_WARNING, MP_PASSWORD_REQUEST, MP_PASSWORD_REQUEST_FOR_LOGGED_IN_NAME, MP_TOO_MANY_ATTEMPTS_ERROR, send_password_request(), and user_handler_.
Referenced by is_login_allowed().
|
private |
Definition at line 2539 of file server.cpp.
References wesnothd::ban_manager::ban(), ban_manager_, wesnothd::ban_manager::get_ban_help(), wesnothd::player::name(), wesnothd::ban_manager::parse_time(), player_connections_, utils::trim(), and utils::wildcard_string_match().
Referenced by setup_handlers().
|
private |
Definition at line 2514 of file server.cpp.
References ban_manager_, e, ERR_SERVER, wesnothd::ban_manager::list_bans(), wesnothd::ban_manager::list_deleted_bans(), utf8::lowercase(), and utils::trim().
Referenced by setup_handlers().
|
private |
Definition at line 1391 of file server.cpp.
References simple_wml::document::child(), simple_wml::node::children(), wesnothd::game::db_id(), wesnothd::game::description(), destructed, wesnothd::game::emergency_cleanup(), g, metrics::game_terminated(), games(), games_and_users_list_, wesnothd::game::get_replay_filename(), wesnothd::game::id(), utf8::index(), LOG_SERVER, wesnothd::make_delete_diff(), metrics_, simple_wml::node::remove_child(), send_to_lobby(), wesnothd::game::termination_reason(), user_handler_, and uuid_.
Referenced by handle_create_game().
|
private |
Definition at line 2480 of file server.cpp.
References player_connections_, and wesnothd::player_status().
Referenced by setup_handlers().
|
private |
Definition at line 2940 of file server.cpp.
References simple_wml::document::child(), wesnothd::player_record::enter_lobby(), ERR_SERVER, games_and_users_list_, simple_wml::INIT_COMPRESSED, simple_wml::INIT_STATIC, wesnothd::make_change_diff(), p, player_connections_, simple_wml::document::root(), send_to_lobby(), send_to_player(), and simple_wml::node::set_attr_dup().
Referenced by handle_player_in_game(), remove_player(), and stopgame().
|
private |
Definition at line 1946 of file server.cpp.
References utils::decayed_is_same.
Referenced by kick_handler(), and kickban_handler().
|
private |
Definition at line 2898 of file server.cpp.
References deny_unregistered_login_, e, ERR_SERVER, and utf8::lowercase().
Referenced by setup_handlers().
|
private |
Definition at line 612 of file server.cpp.
References simple_wml::node::add_child_at(), simple_wml::node::children(), ERR_SERVER, games_and_users_list_, LOG_SERVER, wesnothd::make_add_diff(), wesnothd::make_delete_diff(), simple_wml::node::remove_child(), simple_wml::document::root(), send_to_lobby(), simple_wml::node::set_attr_dup(), simple_wml::node::set_attr_int(), utf8::size(), and start_dummy_player_updates().
Referenced by start_dummy_player_updates().
|
private |
Definition at line 594 of file server.cpp.
References ERR_SERVER, games(), LOG_SERVER, player_connections_, and start_dump_stats().
Referenced by start_dump_stats().
|
inlineprivate |
Definition at line 185 of file server.hpp.
References player_connections_.
Referenced by cleanup_game(), dump_stats(), handle_graceful_timeout(), and stats_handler().
|
private |
Definition at line 2270 of file server.cpp.
References metrics::games(), and metrics_.
Referenced by setup_handlers().
|
private |
Definition at line 2678 of file server.cpp.
References wesnothd::ban_manager::ban(), ban_manager_, wesnothd::ban_manager::get_ban_help(), wesnothd::player::name(), wesnothd::ban_manager::parse_time(), player_connections_, utils::trim(), and utils::wildcard_string_match().
Referenced by setup_handlers().
|
private |
Definition at line 1347 of file server.cpp.
References cleanup_game(), simple_wml::node::copy_into(), DBG_SERVER, g, games_and_users_list_, wesnothd::player_record::get_game(), graceful_restart, simple_wml::INIT_COMPRESSED, wesnothd::player::name(), player_connections_, replay_save_path_, save_replays_, send_server_message(), send_to_player(), and utils::split().
Referenced by handle_player_in_lobby().
|
private |
Definition at line 284 of file server.cpp.
References games(), process_command(), and timer_.
Referenced by restart_handler(), and shut_down_handler().
|
private |
Definition at line 1425 of file server.cpp.
References simple_wml::document::child(), wesnothd::player::config_address(), DBG_SERVER, g, games_and_users_list_, simple_wml::INIT_COMPRESSED, wesnothd::player::is_moderator(), utils::join(), wesnothd::make_change_diff(), wesnothd::player::name(), game_config::images::observer, player_connections_, simple_wml::document::root(), send_server_message(), send_to_lobby(), send_to_player(), wesnothd::player_record::set_game(), and WRN_SERVER.
Referenced by handle_player_in_lobby().
|
private |
Definition at line 308 of file server.cpp.
Referenced by start_lan_server_timer().
|
private |
Definition at line 1320 of file server.cpp.
References simple_wml::node::add_child(), LOG_SERVER, wfl::msg(), simple_wml::document::root(), send_server_message(), send_to_lobby(), and wesnothd::chat_message::truncate_message().
Referenced by handle_player_in_lobby().
|
privatevirtual |
Implements server_base.
Definition at line 667 of file server.cpp.
References e, server_base::io_service_, and login_client().
|
privatevirtual |
Implements server_base.
|
private |
Definition at line 1295 of file server.cpp.
References simple_wml::node::child(), e, send_server_message(), and user_handler_.
Referenced by handle_player().
|
private |
Definition at line 1069 of file server.cpp.
References abort_lan_server_timer(), announcements_, server_base::async_send_doc_queued(), simple_wml::node::child(), server_base::coro_receive_doc(), destructed, games_and_users_list_, handle_nickserv(), handle_player_in_game(), handle_player_in_lobby(), handle_query(), handle_whisper(), information_, lan_server_, wesnothd::make_add_diff(), motd_, player_is_in_game(), recommended_version_, remove_player(), simple_wml::document::root(), wesnothd::secure_version, send_server_message(), send_to_lobby(), version_info::str(), tournaments_, and wesnothd::player::version().
Referenced by login_client().
|
private |
Definition at line 1503 of file server.cpp.
References simple_wml::node::add_child(), simple_wml::node::add_child_at(), simple_wml::node::attr(), simple_wml::node::child(), simple_wml::document::child(), simple_wml::node::children(), client_sources_, wesnothd::player::config_address(), data, DBG_SERVER, delete_game(), e, wesnothd::player_record::enter_lobby(), ERR_SERVER, g, games_and_users_list_, lg::info(), simple_wml::INIT_COMPRESSED, utils::join(), LOG_SERVER, wesnothd::make_add_diff(), wesnothd::make_change_diff(), wesnothd::player::name(), simple_wml::node_to_string(), p, player_connections_, simple_wml::document::root(), s, send_server_message(), send_to_lobby(), send_to_player(), server_id_, simple_wml::node::set_attr(), simple_wml::node::set_attr_dup(), wesnothd::player::source(), wesnothd::game::starting_pos(), simple_wml::string_span::to_string(), update_game_in_lobby(), user_handler_, uuid_, wesnothd::player::version(), and WRN_SERVER.
Referenced by handle_player().
|
private |
Definition at line 1132 of file server.cpp.
References data, handle_create_game(), handle_join_game(), handle_message(), server_base::io_service_, utils::join(), LOG_SERVER, wesnothd::player::name(), player_connections_, and user_handler_.
Referenced by handle_player().
|
private |
Definition at line 1217 of file server.cpp.
References admin_passwd_, wesnothd::player::is_moderator(), LOG_SERVER, wesnothd::player::name(), process_command(), send_server_message(), wesnothd::player::set_moderator(), user_handler_, and WRN_SERVER.
Referenced by handle_player().
|
privatevirtual |
Implements server_base.
Definition at line 333 of file server.cpp.
References server_base::admin_cmd_, LOG_SERVER, process_command(), and server_base::read_from_fifo().
|
privatevirtual |
Implements server_base.
Definition at line 271 of file server.cpp.
References cfg_, load_config(), read_config(), server_base::sighup_, and WRN_SERVER.
|
private |
Definition at line 1177 of file server.cpp.
References simple_wml::node::add_child(), data, g, simple_wml::INIT_COMPRESSED, wfl::msg(), wesnothd::player::name(), player_connections_, simple_wml::document::root(), send_server_message(), send_to_player(), and wesnothd::chat_message::truncate_message().
Referenced by handle_player().
|
private |
Definition at line 2190 of file server.cpp.
References wesnothd::help_msg.
Referenced by setup_handlers().
|
privatevirtual |
Reimplemented from server_base.
Definition at line 561 of file server.cpp.
References concurrent_connections_, and player_connections_.
|
privatevirtual |
Reimplemented from server_base.
Definition at line 577 of file server.cpp.
References ban_manager_, wesnothd::ban_manager::is_ip_banned(), and tor_ip_list_.
|
private |
Definition at line 821 of file server.cpp.
References server_base::async_send_error(), authenticate(), user_handler::BAN_EMAIL, user_handler::BAN_IP, user_handler::BAN_USER, campaignd::client_address(), d, deny_unregistered_login_, disallowed_names_, user_handler::ban_info::duration, utils::isvalid_username(), log_address(), LOG_SERVER, utf8::lowercase(), MP_INVALID_CHARS_IN_NAME_ERROR, MP_NAME_AUTH_BAN_EMAIL_ERROR, MP_NAME_AUTH_BAN_IP_ERROR, MP_NAME_AUTH_BAN_USER_ERROR, MP_NAME_RESERVED_ERROR, MP_NAME_TAKEN_ERROR, MP_NAME_TOO_LONG_ERROR, MP_NAME_UNREGISTERED_ERROR, p, player_connections_, process_command(), send_server_message(), user_handler::ban_info::type, user_handler_, and utils::wildcard_string_match().
Referenced by login_client().
|
private |
Definition at line 2773 of file server.cpp.
References server_base::async_send_error(), disconnect_player(), i, wesnothd::player::name(), player_connections_, and utils::wildcard_string_match().
Referenced by setup_handlers().
|
private |
Definition at line 2602 of file server.cpp.
References server_base::async_send_error(), wesnothd::ban_manager::ban(), ban_manager_, disconnect_player(), wesnothd::ban_manager::get_ban_help(), wesnothd::player::name(), wesnothd::ban_manager::parse_time(), player_connections_, utils::trim(), and utils::wildcard_string_match().
Referenced by setup_handlers().
|
private |
Parse the server config into local variables.
Definition at line 426 of file server.cpp.
References accepted_versions_, simple_wml::node::add_child_at(), admin_passwd_, allow_remote_shutdown_, announcements_, ban_manager_, cfg_, config::child_range(), client_sources_, concurrent_connections_, default_max_messages_, default_time_period_, deny_unregistered_login_, disallowed_names_, dummy_player_timer_interval_, config::empty(), ERR_SERVER, failed_login_ban_, failed_login_buffer_size_, failed_login_limit_, FIFODIR, games_and_users_list_, i, information_, server_base::input_, input_path_, lan_server_, wesnothd::ban_manager::load_config(), server_base::load_tls_config(), max_ip_log_size_, motd_, config::optional_child(), proxy_versions_, filesystem::read_file(), recommended_version_, redirect, redirected_versions_, replay_save_path_, restart_command, simple_wml::document::root(), save_replays_, server_id_, simple_wml::node::set_attr_dup(), simple_wml::node::set_attr_int(), setup_fifo(), utils::split(), start_dummy_player_updates(), tor_ip_list_, tournaments_, user_handler_, uuid_, and game_config::wesnoth_version.
Referenced by handle_sighup(), and server().
|
private |
Definition at line 2397 of file server.cpp.
References LOG_SERVER, and send_server_message_to_lobby().
|
private |
Definition at line 686 of file server.cpp.
References accepted_versions_, simple_wml::node::add_child(), server_base::async_send_doc_queued(), server_base::async_send_error(), simple_wml::string_span::begin(), simple_wml::node::child(), campaignd::client_address(), server_base::coro_receive_doc(), server_base::coro_send_doc(), default_max_messages_, default_time_period_, e, simple_wml::string_span::end(), games_and_users_list_, handle_player(), server_base::io_service_, ip_log_, is_login_allowed(), utils::join(), log_address(), LOG_SERVER, login_response, login_response_, max_ip_log_size_, MP_MUST_LOGIN, player_connections_, redirect, redirected_versions_, simple_wml::document::root(), simple_wml::node::set_attr(), simple_wml::node::set_attr_dup(), simple_wml::document::set_attr_dup(), user_handler_, version_query_response_, and utils::wildcard_string_match().
Referenced by handle_new_client().
|
private |
|
private |
|
private |
Definition at line 2375 of file server.cpp.
References LOG_SERVER, and send_server_message_to_all().
Referenced by setup_handlers().
|
inline |
Definition at line 88 of file server.hpp.
Referenced by handle_player().
|
private |
Definition at line 2333 of file server.cpp.
References data, wfl::msg(), wesnothd::player::name(), player_connections_, send_to_player(), and utils::trim().
Referenced by setup_handlers().
|
private |
Process commands from admins and users.
Definition at line 2048 of file server.cpp.
References cmd_handlers_, e, ERR_SERVER, wesnothd::help_msg, i, utf8::lowercase(), wfl::msg(), and utils::trim().
Referenced by handle_graceful_timeout(), handle_query(), handle_read_from_fifo(), is_login_allowed(), restart_handler(), shut_down_handler(), and status_handler().
|
private |
Read the server config from file 'config_file_'.
Definition at line 405 of file server.cpp.
References config_file_, e, ERR_CONFIG, LOG_SERVER, preprocess_file(), read(), and filesystem::set_user_data_dir().
Referenced by handle_sighup().
|
private |
Definition at line 655 of file server.cpp.
References ERR_SERVER, start_tournaments_timer(), tournaments_, and user_handler_.
Referenced by start_tournaments_timer().
|
private |
Definition at line 1959 of file server.cpp.
References simple_wml::node::children(), delete_game(), g, games_and_users_list_, i, utf8::index(), ip_log_, lan_server_, LOG_SERVER, wesnothd::make_delete_diff(), player_connections_, simple_wml::node::remove_child(), simple_wml::document::root(), send_to_lobby(), start_lan_server_timer(), and user_handler_.
Referenced by handle_player().
|
private |
Definition at line 2218 of file server.cpp.
References metrics_, and metrics::requests().
Referenced by setup_handlers().
|
private |
Definition at line 2134 of file server.cpp.
References server_base::acceptor_v4_, server_base::acceptor_v6_, allow_remote_shutdown_, wesnothd::denied_msg, graceful_restart, handle_graceful_timeout(), process_command(), restart_command, start_new_server(), and timer_.
Referenced by setup_handlers().
|
private |
Definition at line 2227 of file server.cpp.
References die_, and player_connections_.
Referenced by setup_handlers().
|
private |
Definition at line 2169 of file server.cpp.
References wesnothd::denied_msg, and wesnothd::request_sample_frequency.
Referenced by setup_handlers().
|
private |
Definition at line 2845 of file server.cpp.
References lg::get_timestamp(), i, ip_log_, utf8::lowercase(), player_connections_, wesnothd::player_status(), utils::to_sql_wildcards(), user_handler_, and utils::wildcard_string_match().
Referenced by setup_handlers().
|
private |
Definition at line 1051 of file server.cpp.
References simple_wml::node::add_child(), server_base::async_send_doc_queued(), e, wfl::msg(), and simple_wml::document::root().
Referenced by authenticate().
|
inline |
Definition at line 72 of file server.hpp.
References send_server_message().
void wesnothd::server::send_server_message | ( | SocketPtr | socket, |
const std::string & | message, | ||
const std::string & | type | ||
) |
Definition at line 1935 of file server.cpp.
References server_base::async_send_doc_queued(), and wfl::msg().
Referenced by handle_create_game(), handle_join_game(), handle_message(), handle_nickserv(), handle_player(), handle_player_in_game(), handle_query(), handle_whisper(), is_login_allowed(), send_server_message(), send_server_message_to_all(), and send_server_message_to_lobby().
void wesnothd::server::send_server_message_to_all | ( | const std::string & | message, |
utils::optional< player_iterator > | exclude = {} |
||
) |
Definition at line 2023 of file server.cpp.
References player_connections_, and send_server_message().
Referenced by msg_handler().
void wesnothd::server::send_server_message_to_lobby | ( | const std::string & | message, |
utils::optional< player_iterator > | exclude = {} |
||
) |
Definition at line 2013 of file server.cpp.
References p, player_connections_, and send_server_message().
Referenced by lobbymsg_handler().
void wesnothd::server::send_to_lobby | ( | simple_wml::document & | data, |
utils::optional< player_iterator > | exclude = {} |
||
) |
Definition at line 2003 of file server.cpp.
References data, p, player_connections_, and send_to_player().
Referenced by cleanup_game(), delete_game(), dummy_player_updates(), handle_join_game(), handle_message(), handle_player(), handle_player_in_game(), remove_player(), and update_game_in_lobby().
|
inline |
Definition at line 79 of file server.hpp.
References server_base::async_send_doc_queued(), and data.
Referenced by wesnothd::game::add_player(), adminmsg_handler(), wesnothd::game::change_controller(), delete_game(), wesnothd::game::handle_controller_choice(), handle_create_game(), handle_join_game(), handle_player_in_game(), handle_whisper(), wesnothd::game::load_next_scenario(), wesnothd::game::notify_new_host(), pm_handler(), wesnothd::game::remove_player(), wesnothd::game::send_chat_history(), wesnothd::game::send_history(), wesnothd::game::send_leave_game(), wesnothd::game::send_observerjoins(), wesnothd::game::send_server_message(), wesnothd::game::send_taken_side(), send_to_lobby(), and wesnothd::game::send_to_players().
|
private |
Definition at line 316 of file server.cpp.
References ERR_SERVER, server_base::input_, input_path_, LOG_SERVER, and server_base::read_from_fifo().
Referenced by load_config().
|
private |
Definition at line 362 of file server.cpp.
References adminmsg_handler(), ban_handler(), bans_handler(), clones_handler(), dul_handler(), games_handler(), gban_handler(), help_handler(), kick_handler(), kickban_handler(), metrics_handler(), motd_handler(), msg_handler(), pm_handler(), requests_handler(), restart_handler(), roll_handler(), sample_handler(), searchlog_handler(), SETUP_HANDLER, shut_down_handler(), stats_handler(), status_handler(), stopgame(), unban_handler(), ungban_handler(), version_handler(), and wml_handler().
Referenced by server().
|
private |
Definition at line 2103 of file server.cpp.
References server_base::acceptor_v4_, server_base::acceptor_v6_, allow_remote_shutdown_, wesnothd::denied_msg, graceful_restart, handle_graceful_timeout(), process_command(), and timer_.
Referenced by setup_handlers().
|
private |
Definition at line 606 of file server.cpp.
References dummy_player_timer_, dummy_player_timer_interval_, and dummy_player_updates().
Referenced by dummy_player_updates(), and load_config().
|
private |
Definition at line 588 of file server.cpp.
References dump_stats(), and dump_stats_timer_.
Referenced by dump_stats(), and server().
|
private |
Definition at line 297 of file server.cpp.
References handle_lan_server_shutdown(), lan_server_, and lan_server_timer_.
Referenced by remove_player().
|
private |
Definition at line 2032 of file server.cpp.
References ERR_SERVER, LOG_SERVER, and restart_command.
Referenced by restart_handler().
|
private |
Definition at line 649 of file server.cpp.
References refresh_tournaments(), and tournaments_timer_.
Referenced by refresh_tournaments(), and server().
|
private |
Definition at line 2199 of file server.cpp.
References games(), and player_connections_.
Referenced by setup_handlers().
|
private |
Definition at line 2438 of file server.cpp.
References utils::isvalid_username(), utf8::lowercase(), wesnothd::player::name(), player_connections_, wesnothd::player_status(), process_command(), and utils::wildcard_string_match().
Referenced by setup_handlers().
|
private |
Definition at line 2918 of file server.cpp.
References delete_game(), g, and player_connections_.
Referenced by setup_handlers().
|
private |
Definition at line 2743 of file server.cpp.
References ban_manager_, and wesnothd::ban_manager::unban().
Referenced by setup_handlers().
|
private |
Definition at line 2758 of file server.cpp.
References ban_manager_, and wesnothd::ban_manager::unban_group().
Referenced by setup_handlers().
|
private |
Definition at line 2984 of file server.cpp.
References simple_wml::document::child(), g, games_and_users_list_, wesnothd::make_change_diff(), and send_to_lobby().
Referenced by handle_player_in_game().
|
private |
Definition at line 2418 of file server.cpp.
References wesnothd::player::name(), player_connections_, version_info::str(), wesnothd::player::version(), and game_config::wesnoth_version.
Referenced by setup_handlers().
|
private |
Definition at line 2279 of file server.cpp.
References simple_wml::document::stats().
Referenced by setup_handlers().
|
private |
Definition at line 142 of file server.hpp.
Referenced by load_config(), and login_client().
|
private |
Definition at line 147 of file server.hpp.
Referenced by handle_query(), and load_config().
|
private |
Definition at line 164 of file server.hpp.
Referenced by load_config(), restart_handler(), and shut_down_handler().
|
private |
Definition at line 149 of file server.hpp.
Referenced by handle_player(), and load_config().
|
private |
Definition at line 93 of file server.hpp.
Referenced by authenticate(), ban_handler(), bans_handler(), gban_handler(), is_ip_banned(), kickban_handler(), load_config(), server(), unban_handler(), and ungban_handler().
|
private |
Definition at line 136 of file server.hpp.
Referenced by handle_sighup(), and load_config().
|
private |
Definition at line 165 of file server.hpp.
Referenced by handle_player_in_game(), and load_config().
|
private |
Definition at line 226 of file server.hpp.
Referenced by process_command().
|
private |
Definition at line 155 of file server.hpp.
Referenced by ip_exceeds_connection_limit(), and load_config().
|
private |
Definition at line 135 of file server.hpp.
Referenced by read_config().
|
private |
Definition at line 153 of file server.hpp.
Referenced by load_config(), and login_client().
|
private |
Definition at line 154 of file server.hpp.
Referenced by load_config(), and login_client().
|
private |
Definition at line 161 of file server.hpp.
Referenced by dul_handler(), is_login_allowed(), and load_config().
bool wesnothd::server::destructed = false |
Definition at line 42 of file server.hpp.
Referenced by cleanup_game(), handle_player(), and ~server().
|
private |
Definition at line 126 of file server.hpp.
Referenced by roll_handler().
|
private |
Definition at line 146 of file server.hpp.
Referenced by is_login_allowed(), and load_config().
|
private |
Definition at line 269 of file server.hpp.
Referenced by start_dummy_player_updates().
|
private |
Definition at line 270 of file server.hpp.
Referenced by load_config(), and start_dummy_player_updates().
|
private |
Definition at line 202 of file server.hpp.
Referenced by start_dump_stats().
|
private |
Definition at line 168 of file server.hpp.
Referenced by authenticate(), and load_config().
|
private |
Definition at line 169 of file server.hpp.
Referenced by authenticate(), and load_config().
|
private |
Definition at line 167 of file server.hpp.
Referenced by authenticate(), and load_config().
|
private |
Definition at line 122 of file server.hpp.
Referenced by authenticate().
|
private |
Definition at line 179 of file server.hpp.
Referenced by cleanup_game(), delete_game(), dummy_player_updates(), handle_create_game(), handle_join_game(), handle_player(), handle_player_in_game(), load_config(), login_client(), remove_player(), and update_game_in_lobby().
|
private |
Definition at line 156 of file server.hpp.
Referenced by accepting_connections(), handle_create_game(), restart_handler(), and shut_down_handler().
|
private |
Definition at line 152 of file server.hpp.
Referenced by handle_player(), and load_config().
|
private |
server socket/fifo.
Definition at line 130 of file server.hpp.
Referenced by load_config(), and setup_fifo().
|
private |
Definition at line 107 of file server.hpp.
Referenced by login_client(), remove_player(), and searchlog_handler().
|
private |
Definition at line 157 of file server.hpp.
Referenced by handle_player(), load_config(), remove_player(), and start_lan_server_timer().
|
private |
Definition at line 264 of file server.hpp.
Referenced by abort_lan_server_timer(), and start_lan_server_timer().
|
private |
Definition at line 158 of file server.hpp.
|
private |
Definition at line 178 of file server.hpp.
Referenced by login_client().
|
private |
Definition at line 160 of file server.hpp.
Referenced by load_config(), and login_client().
|
private |
Definition at line 181 of file server.hpp.
Referenced by cleanup_game(), games_handler(), metrics_handler(), and requests_handler().
|
private |
Definition at line 148 of file server.hpp.
Referenced by handle_player(), load_config(), and motd_handler().
|
private |
Definition at line 183 of file server.hpp.
Referenced by adminmsg_handler(), ban_handler(), clones_handler(), delete_game(), dump_stats(), games(), gban_handler(), handle_create_game(), handle_join_game(), handle_player_in_game(), handle_player_in_lobby(), handle_whisper(), ip_exceeds_connection_limit(), is_login_allowed(), kick_handler(), kickban_handler(), login_client(), pm_handler(), remove_player(), roll_handler(), searchlog_handler(), send_server_message_to_all(), send_server_message_to_lobby(), send_to_lobby(), stats_handler(), status_handler(), stopgame(), and version_handler().
|
private |
Definition at line 145 of file server.hpp.
Referenced by load_config().
|
private |
Definition at line 143 of file server.hpp.
Referenced by handle_player(), and load_config().
|
private |
Definition at line 144 of file server.hpp.
Referenced by load_config(), and login_client().
|
private |
Definition at line 163 of file server.hpp.
Referenced by handle_create_game(), and load_config().
|
private |
Definition at line 159 of file server.hpp.
Referenced by load_config(), restart_handler(), and start_new_server().
|
private |
Definition at line 162 of file server.hpp.
Referenced by handle_create_game(), and load_config().
|
private |
Definition at line 150 of file server.hpp.
Referenced by handle_player_in_game(), and load_config().
|
private |
Definition at line 261 of file server.hpp.
Referenced by handle_graceful_timeout(), restart_handler(), and shut_down_handler().
|
private |
Definition at line 166 of file server.hpp.
Referenced by is_ip_banned(), and load_config().
|
private |
Definition at line 151 of file server.hpp.
Referenced by handle_player(), load_config(), and refresh_tournaments().
|
private |
Definition at line 206 of file server.hpp.
Referenced by start_tournaments_timer().
|
private |
Definition at line 124 of file server.hpp.
Referenced by authenticate(), cleanup_game(), handle_nickserv(), handle_player_in_game(), handle_player_in_lobby(), handle_query(), is_login_allowed(), load_config(), login_client(), refresh_tournaments(), remove_player(), and searchlog_handler().
|
private |
Definition at line 133 of file server.hpp.
Referenced by cleanup_game(), handle_player_in_game(), and load_config().
|
private |
Definition at line 177 of file server.hpp.
Referenced by login_client().