#include <player.hpp>
Public Types | |
enum | STATUS { LOBBY , PLAYING , OBSERVING } |
Public Member Functions | |
player (const std::string &n, simple_wml::node &cfg, long id, bool registered, const std::string &version, const std::string &source, unsigned long long login_id, const std::size_t max_messages=4, const std::chrono::seconds &time_period=std::chrono::seconds{10}, const bool moderator=false) | |
void | set_status (STATUS status) |
void | mark_available (const int game_id=0, const std::string &location="") |
void | mark_registered (bool registered=true) |
bool | registered () const |
const std::string & | name () const |
const std::string & | version () const |
const std::string & | source () const |
const simple_wml::node * | config_address () const |
bool | is_message_flooding () |
void | set_moderator (bool moderator) |
bool | is_moderator () const |
unsigned long long | get_login_id () const |
Private Attributes | |
const std::string | name_ |
std::string | version_ |
std::string | source_ |
simple_wml::node & | cfg_ |
bool | registered_ |
std::chrono::steady_clock::time_point | flood_start_ |
unsigned int | messages_since_flood_start_ |
const std::size_t | MaxMessages |
const std::chrono::seconds | TimePeriod |
STATUS | status_ |
bool | moderator_ |
unsigned long long | login_id_ |
Definition at line 25 of file player.hpp.
Enumerator | |
---|---|
LOBBY | |
PLAYING | |
OBSERVING |
Definition at line 28 of file player.hpp.
wesnothd::player::player | ( | const std::string & | n, |
simple_wml::node & | cfg, | ||
long | id, | ||
bool | registered, | ||
const std::string & | version, | ||
const std::string & | source, | ||
unsigned long long | login_id, | ||
const std::size_t | max_messages = 4 , |
||
const std::chrono::seconds & | time_period = std::chrono::seconds{10} , |
||
const bool | moderator = false |
||
) |
Definition at line 18 of file player.cpp.
References cfg_, mark_available(), n, registered(), simple_wml::node::set_attr(), simple_wml::node::set_attr_dup(), and simple_wml::node::set_attr_int().
|
inline |
Definition at line 51 of file player.hpp.
References cfg_.
Referenced by wesnothd::server::handle_join_game(), and wesnothd::server::handle_player_in_game().
|
inline |
Definition at line 58 of file player.hpp.
References login_id_.
bool wesnothd::player::is_message_flooding | ( | ) |
Definition at line 81 of file player.cpp.
|
inline |
Definition at line 56 of file player.hpp.
References moderator_.
Referenced by wesnothd::server::adminmsg_handler(), wesnothd::server::handle_join_game(), and wesnothd::server::handle_query().
void wesnothd::player::mark_available | ( | const int | game_id = 0 , |
const std::string & | location = "" |
||
) |
Definition at line 62 of file player.cpp.
Referenced by player().
void wesnothd::player::mark_registered | ( | bool | registered = true | ) |
Definition at line 75 of file player.cpp.
|
inline |
Definition at line 48 of file player.hpp.
References name_.
Referenced by wesnothd::game::add_player(), wesnothd::server::adminmsg_handler(), wesnothd::server::ban_handler(), wesnothd::server::gban_handler(), wesnothd::server::handle_create_game(), wesnothd::server::handle_join_game(), wesnothd::server::handle_player_in_game(), wesnothd::server::handle_player_in_lobby(), wesnothd::server::handle_query(), wesnothd::server::handle_whisper(), wesnothd::server::kick_handler(), wesnothd::server::kickban_handler(), wesnothd::player_record::name(), wesnothd::player_status(), wesnothd::server::pm_handler(), wesnothd::server::status_handler(), and wesnothd::server::version_handler().
|
inline |
|
inline |
Definition at line 55 of file player.hpp.
References moderator_.
Referenced by wesnothd::server::handle_query().
void wesnothd::player::set_status | ( | STATUS | status | ) |
Definition at line 42 of file player.cpp.
|
inline |
Definition at line 50 of file player.hpp.
References source_.
Referenced by wesnothd::server::handle_player_in_game().
|
inline |
Definition at line 49 of file player.hpp.
References version_.
Referenced by wesnothd::server::handle_player(), wesnothd::server::handle_player_in_game(), and wesnothd::server::version_handler().
|
private |
Definition at line 64 of file player.hpp.
Referenced by config_address(), and player().
|
private |
Definition at line 68 of file player.hpp.
|
private |
Definition at line 74 of file player.hpp.
Referenced by get_login_id().
|
private |
Definition at line 70 of file player.hpp.
|
private |
Definition at line 69 of file player.hpp.
|
private |
Definition at line 73 of file player.hpp.
Referenced by is_moderator(), and set_moderator().
|
private |
Definition at line 61 of file player.hpp.
Referenced by name().
|
private |
Definition at line 66 of file player.hpp.
Referenced by registered().
|
private |
Definition at line 63 of file player.hpp.
Referenced by source().
|
private |
Definition at line 72 of file player.hpp.
|
private |
Definition at line 71 of file player.hpp.
|
private |
Definition at line 62 of file player.hpp.
Referenced by version().