21 #include <boost/multi_index/hashed_index.hpp>
22 #include <boost/multi_index/mem_fun.hpp>
23 #include <boost/multi_index/ordered_index.hpp>
24 #include <boost/multi_index_container.hpp>
33 template<
class SocketPtr>
58 const std::string&
name()
const
63 const std::shared_ptr<game>
get_game()
const;
69 void set_game(std::shared_ptr<game> new_game);
86 namespace bmi = boost::multi_index;
89 bmi::ordered_unique<bmi::tag<socket_t>,
90 bmi::const_mem_fun<player_record, const any_socket_ptr, &player_record::socket>>,
91 bmi::hashed_unique<bmi::tag<name_t>,
92 bmi::const_mem_fun<player_record, const std::string&, &player_record::name>>,
93 bmi::ordered_non_unique<bmi::tag<game_t>,
94 bmi::const_mem_fun<player_record, int, &player_record::game_id>>
std::string client_ip() const
const std::chrono::steady_clock::time_point login_time
const any_socket_ptr socket() const
void set_game(std::shared_ptr< game > new_game)
const std::string & name() const
std::shared_ptr< game > game_
const std::shared_ptr< game > get_game() const
player_record(const SocketPtr socket, const player &player)
const any_socket_ptr socket_
const std::string & name() const
std::string client_address(const any_socket_ptr &sock)
player_connections::const_iterator player_iterator
bmi::multi_index_container< player_record, bmi::indexed_by< bmi::ordered_unique< bmi::tag< socket_t >, bmi::const_mem_fun< player_record, const any_socket_ptr, &player_record::socket > >, bmi::hashed_unique< bmi::tag< name_t >, bmi::const_mem_fun< player_record, const std::string &, &player_record::name > >, bmi::ordered_non_unique< bmi::tag< game_t >, bmi::const_mem_fun< player_record, int, &player_record::game_id > > > > player_connections
Base class for servers using Wesnoth's WML over TCP protocol.
utils::variant< socket_ptr, tls_socket_ptr > any_socket_ptr