The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Private Attributes | List of all members
wesnothd::player Class Reference

#include <player.hpp>

Public Types

enum  STATUS { LOBBY, PLAYING, OBSERVING }
 

Public Member Functions

 player (const std::string &n, simple_wml::node &cfg, bool registered, const size_t max_messages=4, const size_t time_period=10, const bool sp=false, 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::stringname () const
 
bool selective_ping () const
 
const simple_wml::nodeconfig_address () const
 
bool is_message_flooding ()
 
bool in_game () const
 
const gameget_game () const
 
void set_game (game *g)
 
void set_moderator (bool moderator)
 
bool is_moderator () const
 

Private Attributes

const std::string name_
 
simple_wml::nodecfg_
 
const bool selective_ping_
 
bool registered_
 
time_t flood_start_
 
unsigned int messages_since_flood_start_
 
const size_t MaxMessages
 
const time_t TimePeriod
 
STATUS status_
 
bool moderator_
 

Detailed Description

Definition at line 28 of file player.hpp.

Member Enumeration Documentation

Enumerator
LOBBY 
PLAYING 
OBSERVING 

Definition at line 31 of file player.hpp.

Constructor & Destructor Documentation

wesnothd::player::player ( const std::string n,
simple_wml::node cfg,
bool  registered,
const size_t  max_messages = 4,
const size_t  time_period = 10,
const bool  sp = false,
const bool  moderator = false 
)

Member Function Documentation

const simple_wml::node* wesnothd::player::config_address ( ) const
inline

Definition at line 54 of file player.hpp.

References cfg_.

Referenced by wesnothd::server::handle_player_in_game().

const game* wesnothd::player::get_game ( ) const
Returns
a pointer to the game the player is in, or nullptr if he/she is not in a game at the moment

Referenced by in_game().

bool wesnothd::player::in_game ( ) const
inline
Returns
true iff the player is in a game

Definition at line 61 of file player.hpp.

References get_game().

bool wesnothd::player::is_message_flooding ( )

Definition at line 81 of file player.cpp.

bool wesnothd::player::is_moderator ( ) const
inline

Definition at line 72 of file player.hpp.

References moderator_.

Referenced by wesnothd::server::adminmsg_handler(), 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.

const std::string& wesnothd::player::name ( ) const
inline
bool wesnothd::player::registered ( ) const
inline

Definition at line 48 of file player.hpp.

References registered_.

bool wesnothd::player::selective_ping ( ) const
inline

Definition at line 52 of file player.hpp.

References selective_ping_.

void wesnothd::player::set_game ( game g)
void wesnothd::player::set_moderator ( bool  moderator)
inline

Definition at line 71 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.

References LOBBY, OBSERVING, and PLAYING.

Member Data Documentation

simple_wml::node& wesnothd::player::cfg_
private

Definition at line 76 of file player.hpp.

Referenced by config_address(), and player().

time_t wesnothd::player::flood_start_
private

Definition at line 81 of file player.hpp.

const size_t wesnothd::player::MaxMessages
private

Definition at line 83 of file player.hpp.

unsigned int wesnothd::player::messages_since_flood_start_
private

Definition at line 82 of file player.hpp.

bool wesnothd::player::moderator_
private

Definition at line 86 of file player.hpp.

Referenced by is_moderator(), and set_moderator().

const std::string wesnothd::player::name_
private

Definition at line 75 of file player.hpp.

Referenced by name().

bool wesnothd::player::registered_
private

Definition at line 79 of file player.hpp.

Referenced by registered().

const bool wesnothd::player::selective_ping_
private

Definition at line 77 of file player.hpp.

Referenced by selective_ping().

STATUS wesnothd::player::status_
private

Definition at line 85 of file player.hpp.

const time_t wesnothd::player::TimePeriod
private

Definition at line 84 of file player.hpp.


The documentation for this class was generated from the following files: