Namespaces | |
Classes | |
class | ban_manager |
class | banned |
struct | banned_compare |
We want to move the lowest value to the top. More... | |
struct | banned_compare_subnet |
class | game |
struct | game_id_matches |
struct | game_is_member |
struct | game_t |
struct | handle_doc |
struct | handle_receive_doc |
struct | name_t |
class | player |
class | player_record |
class | room |
A room is a group of players that can communicate via messages. More... | |
class | room_manager |
The room manager manages the lobby and other rooms in the server, and related client message processing. More... | |
class | server |
struct | socket_t |
Typedefs | |
typedef boost::shared_ptr< banned > | banned_ptr |
typedef std::set< banned_ptr, banned_compare_subnet > | ban_set |
typedef std::list< banned_ptr > | deleted_ban_list |
typedef std::priority_queue < banned_ptr, std::vector < banned_ptr >, banned_compare > | ban_time_queue |
typedef std::map< std::string, size_t > | default_ban_times |
typedef std::pair< unsigned int, unsigned int > | ip_mask |
typedef std::vector< socket_ptr > | user_vector |
typedef std::vector< socket_ptr > | side_vector |
typedef boost::shared_ptr < boost::asio::ip::tcp::socket > | socket_ptr |
typedef multi_index_container < player_record, indexed_by < ordered_unique< tag < socket_t > , BOOST_MULTI_INDEX_CONST_MEM_FUN(player_record, const socket_ptr, socket)> , hashed_unique< tag< name_t > , BOOST_MULTI_INDEX_CONST_MEM_FUN(player_record, const std::string &, name)> , ordered_non_unique< tag < game_t > , BOOST_MULTI_INDEX_CONST_MEM_FUN(player_record, int, game_id)> >> | player_connections |
typedef std::vector < network::connection > | connection_vector |
typedef std::map < network::connection, player > | player_map |
typedef std::map< socket_ptr, std::deque< boost::shared_ptr < simple_wml::document > > > | SendQueue |
Functions | |
std::ostream & | operator<< (std::ostream &o, const banned &n) |
ip_mask | parse_ip (const std::string &ip) |
static const simple_wml::node & | get_multiplayer (const simple_wml::node &root) |
returns const so that operator [] won't create empty keys if not existent More... | |
static bool | is_invalid_filename_char (char c) |
void | send_to_player (socket_ptr socket, simple_wml::document &doc) |
template<typename Container > | |
void | send_to_players (simple_wml::document &data, const Container &players, socket_ptr exclude=socket_ptr()) |
void | send_server_message (socket_ptr socket, const std::string &message) |
std::string | client_address (socket_ptr socket) |
void | async_send_error (socket_ptr socket, const std::string &msg, const char *error_code="") |
static bool | check_error (const boost::system::error_code &error, socket_ptr socket) |
template<typename Handler , typename ErrorHandler > | |
void | async_send_doc (socket_ptr socket, simple_wml::document &doc, Handler handler, ErrorHandler error_handler) |
static void | null_handler (socket_ptr) |
template<typename Handler > | |
void | async_send_doc (socket_ptr socket, simple_wml::document &doc, Handler handler) |
static void | async_send_doc (socket_ptr socket, simple_wml::document &doc) |
template<typename Handler , typename ErrorHandler > | |
void | async_receive_doc (socket_ptr socket, Handler handler, ErrorHandler error_handler) |
template<typename Handler > | |
void | async_receive_doc (socket_ptr socket, Handler handler) |
static void | make_add_diff (const simple_wml::node &src, const char *gamelist, const char *type, simple_wml::document &out, int index=-1) |
static bool | 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 | 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 | player_status (const wesnothd::player_record &player) |
static void | async_send_warning (socket_ptr socket, const std::string &msg, const char *warning_code) |
void | handle_send_to_player (socket_ptr socket) |
Variables | |
static lg::log_domain | log_server ("server") |
int | request_sample_frequency = 1 |
const std::string | denied_msg = "You're not allowed to execute this command." |
const std::string | help_msg |
SendQueue | send_queue |
typedef std::set<banned_ptr,banned_compare_subnet > wesnothd::ban_set |
typedef std::priority_queue<banned_ptr,std::vector<banned_ptr>, banned_compare> wesnothd::ban_time_queue |
typedef boost::shared_ptr<banned> wesnothd::banned_ptr |
typedef std::vector<network::connection> wesnothd::connection_vector |
typedef std::map<std::string, size_t> wesnothd::default_ban_times |
typedef std::list<banned_ptr> wesnothd::deleted_ban_list |
typedef std::pair<unsigned int, unsigned int> wesnothd::ip_mask |
typedef multi_index_container< player_record, indexed_by< ordered_unique< tag<socket_t>, BOOST_MULTI_INDEX_CONST_MEM_FUN(player_record,const socket_ptr,socket)>, hashed_unique< tag<name_t>, BOOST_MULTI_INDEX_CONST_MEM_FUN(player_record,const std::string&,name)>, ordered_non_unique< tag<game_t>, BOOST_MULTI_INDEX_CONST_MEM_FUN(player_record,int,game_id)> >> wesnothd::player_connections |
Definition at line 75 of file player_connection.hpp.
typedef std::map<network::connection,player> wesnothd::player_map |
typedef std::map<socket_ptr, std::deque<boost::shared_ptr<simple_wml::document> > > wesnothd::SendQueue |
Definition at line 1842 of file server.cpp.
typedef std::vector<socket_ptr> wesnothd::side_vector |
typedef boost::shared_ptr<boost::asio::ip::tcp::socket> wesnothd::socket_ptr |
Definition at line 37 of file player_connection.hpp.
typedef std::vector<socket_ptr> wesnothd::user_vector |
void wesnothd::async_receive_doc | ( | socket_ptr | socket, |
Handler | handler, | ||
ErrorHandler | error_handler | ||
) |
Definition at line 232 of file server.cpp.
References wesnothd::handle_doc< Handler, ErrorHandler >::data_size.
Referenced by async_receive_doc(), wesnothd::server::handle_version(), wesnothd::server::login(), and wesnothd::server::read_from_player().
void wesnothd::async_receive_doc | ( | socket_ptr | socket, |
Handler | handler | ||
) |
Definition at line 239 of file server.cpp.
References async_receive_doc(), and null_handler().
void wesnothd::async_send_doc | ( | socket_ptr | socket, |
simple_wml::document & | doc, | ||
Handler | handler, | ||
ErrorHandler | error_handler | ||
) |
Definition at line 164 of file server.cpp.
References simple_wml::document::clone(), e, game::error::message, and WRN_CONFIG.
Referenced by async_send_doc(), async_send_error(), async_send_warning(), wesnothd::server::handle_join_game(), wesnothd::server::handle_login(), handle_send_to_player(), wesnothd::server::read_version(), wesnothd::server::request_version(), wesnothd::server::send_password_request(), and send_to_player().
void wesnothd::async_send_doc | ( | socket_ptr | socket, |
simple_wml::document & | doc, | ||
Handler | handler | ||
) |
Definition at line 185 of file server.cpp.
References async_send_doc(), and null_handler().
|
static |
Definition at line 190 of file server.cpp.
References async_send_doc(), and null_handler().
void wesnothd::async_send_error | ( | socket_ptr | socket, |
const std::string & | msg, | ||
const char * | error_code = "" |
||
) |
Definition at line 554 of file server.cpp.
References simple_wml::node::add_child(), async_send_doc(), simple_wml::document::child(), simple_wml::document::root(), simple_wml::node::set_attr(), and simple_wml::node::set_attr_dup().
Referenced by wesnothd::server::accept_connection(), wesnothd::server::handle_login(), wesnothd::server::kick_handler(), wesnothd::server::kickban_handler(), wesnothd::handle_receive_doc< Handler, ErrorHandler >::operator()(), and wesnothd::server::send_password_request().
|
static |
Definition at line 565 of file server.cpp.
References simple_wml::node::add_child(), async_send_doc(), simple_wml::document::child(), simple_wml::document::root(), simple_wml::node::set_attr(), and simple_wml::node::set_attr_dup().
Referenced by wesnothd::server::handle_login().
|
static |
Definition at line 121 of file server.cpp.
References client_address(), and ERR_SERVER.
Referenced by wesnothd::server::handle_handshake(), wesnothd::handle_doc< Handler, ErrorHandler >::operator()(), wesnothd::handle_receive_doc< Handler, ErrorHandler >::operator()(), and wesnothd::server::request_version().
std::string wesnothd::client_address | ( | socket_ptr | socket | ) |
Definition at line 108 of file server.cpp.
References error().
Referenced by wesnothd::server::accept_connection(), wesnothd::game::add_player(), wesnothd::server::ban_handler(), wesnothd::game::ban_user(), check_error(), wesnothd::server::clones_handler(), wesnothd::server::create_game(), wesnothd::server::gban_handler(), wesnothd::server::handle_handshake(), wesnothd::server::handle_join_game(), wesnothd::server::handle_login(), wesnothd::server::handle_player_in_game(), wesnothd::server::handle_query(), wesnothd::game::has_same_ip(), wesnothd::server::kick_handler(), wesnothd::game::kick_member(), wesnothd::server::kickban_handler(), wesnothd::game::mute_observer(), wesnothd::handle_receive_doc< Handler, ErrorHandler >::operator()(), wesnothd::game::player_is_banned(), player_status(), wesnothd::server::read_version(), wesnothd::server::remove_player(), wesnothd::game::remove_player(), wesnothd::server::searchlog_handler(), wesnothd::game::start_game(), wesnothd::server::status_handler(), wesnothd::game::unban_user(), and wesnothd::game::unmute_observer().
|
static |
returns const so that operator [] won't create empty keys if not existent
Definition at line 134 of file game.cpp.
References simple_wml::node::child(), and ERR_GAME.
Referenced by wesnothd::game::allow_observers(), wesnothd::game::registered_users_only(), and wesnothd::game::start_game().
void wesnothd::handle_send_to_player | ( | socket_ptr | socket | ) |
Definition at line 1860 of file server.cpp.
References async_send_doc().
Referenced by send_to_player().
|
static |
Definition at line 1498 of file game.cpp.
Referenced by wesnothd::game::save_replay().
|
static |
Definition at line 244 of file server.cpp.
References simple_wml::node::add_child(), simple_wml::document::child(), simple_wml::node::children(), simple_wml::node::copy_into(), utf8::insert(), simple_wml::document::root(), and simple_wml::node::set_attr_int().
Referenced by wesnothd::server::add_player(), and wesnothd::server::handle_player_in_game().
|
static |
Definition at line 301 of file server.cpp.
References simple_wml::node::add_child(), simple_wml::document::child(), simple_wml::node::children(), simple_wml::node::copy_into(), gui2::event::find(), utf8::insert(), itor, simple_wml::document::root(), and simple_wml::node::set_attr_int().
Referenced by wesnothd::server::delete_game(), wesnothd::server::handle_create_game(), wesnothd::server::handle_join_game(), wesnothd::server::handle_nickserv(), wesnothd::server::handle_player_in_game(), and wesnothd::server::update_game_in_lobby().
|
static |
Definition at line 271 of file server.cpp.
References simple_wml::node::add_child(), simple_wml::document::child(), simple_wml::node::children(), gui2::event::find(), itor, simple_wml::document::root(), and simple_wml::node::set_attr_int().
Referenced by wesnothd::server::cleanup_game(), and wesnothd::server::remove_player().
|
static |
Definition at line 180 of file server.cpp.
Referenced by async_receive_doc(), and async_send_doc().
std::ostream & wesnothd::operator<< | ( | std::ostream & | o, |
const banned & | n | ||
) |
Definition at line 36 of file ban.cpp.
References wesnothd::banned::get_human_end_time(), wesnothd::banned::get_human_start_time(), wesnothd::banned::get_ip(), wesnothd::banned::get_nick(), wesnothd::banned::get_reason(), and wesnothd::banned::get_who_banned().
ip_mask wesnothd::parse_ip | ( | const std::string & | ip | ) |
Definition at line 122 of file ban.cpp.
References error(), and utils::split().
Referenced by wesnothd::banned::banned(), wesnothd::ban_manager::is_ip_banned(), wesnothd::ban_manager::list_bans(), wesnothd::ban_manager::list_deleted_bans(), and wesnothd::banned::read().
|
static |
Definition at line 338 of file server.cpp.
References client_address(), wesnothd::player_record::name(), and wesnothd::player_record::socket().
Referenced by wesnothd::server::clones_handler(), wesnothd::server::searchlog_handler(), and wesnothd::server::status_handler().
void wesnothd::send_server_message | ( | socket_ptr | socket, |
const std::string & | message | ||
) |
Definition at line 1873 of file server.cpp.
References simple_wml::node::add_child(), game_logic::msg(), simple_wml::document::root(), send_to_player(), game_config::sounds::server_message, simple_wml::node::set_attr(), and simple_wml::node::set_attr_dup().
Referenced by wesnothd::server::add_player(), wesnothd::server::handle_create_game(), wesnothd::server::handle_join_game(), wesnothd::server::handle_login(), wesnothd::server::handle_nickserv(), wesnothd::server::handle_player_in_game(), wesnothd::server::handle_query(), wesnothd::server::handle_whisper(), wesnothd::server::send_server_message_to_all(), and wesnothd::server::send_server_message_to_lobby().
void wesnothd::send_to_player | ( | socket_ptr | socket, |
simple_wml::document & | doc | ||
) |
Definition at line 1846 of file server.cpp.
References async_send_doc(), simple_wml::document::clone(), and handle_send_to_player().
Referenced by wesnothd::server::add_player(), wesnothd::game::add_player(), wesnothd::server::adminmsg_handler(), wesnothd::game::change_controller(), wesnothd::game::handle_controller_choice(), wesnothd::server::handle_create_game(), wesnothd::server::handle_player_in_game(), wesnothd::server::handle_read_from_player(), wesnothd::server::handle_whisper(), wesnothd::game::load_next_scenario(), wesnothd::game::notify_new_host(), wesnothd::server::pm_handler(), wesnothd::server::read_version(), wesnothd::game::remove_player(), wesnothd::game::send_history(), wesnothd::game::send_leave_game(), wesnothd::game::send_observerjoins(), send_server_message(), wesnothd::game::send_server_message(), wesnothd::game::send_taken_side(), wesnothd::server::send_to_lobby(), and send_to_players().
void wesnothd::send_to_players | ( | simple_wml::document & | data, |
const Container & | players, | ||
socket_ptr | exclude = socket_ptr() |
||
) |
Definition at line 80 of file player_connection.hpp.
References send_to_player().
Referenced by wesnothd::game::process_turn(), wesnothd::game::send_data(), and wesnothd::game::send_data_sides().
const std::string wesnothd::denied_msg = "You're not allowed to execute this command." |
Definition at line 352 of file server.cpp.
Referenced by wesnothd::server::restart_handler(), wesnothd::server::sample_handler(), and wesnothd::server::shut_down_handler().
const std::string wesnothd::help_msg |
Definition at line 353 of file server.cpp.
Referenced by wesnothd::server::handle_query(), wesnothd::server::help_handler(), and wesnothd::server::process_command().
|
static |
int wesnothd::request_sample_frequency = 1 |
Definition at line 119 of file server.cpp.
Referenced by main(), and wesnothd::server::sample_handler().
SendQueue wesnothd::send_queue |
Definition at line 1843 of file server.cpp.