15 #ifndef SERVER_ROOM_HPP_INCLUDED
16 #define SERVER_ROOM_HPP_INCLUDED
101 const std::vector<network::connection>&
members()
const {
void set_logged(bool v)
Set the room's logged flag.
const std::string & topic() const
This room's topic/motd, sent to all joining players.
bool is_member(network::connection player) const
Membership checker.
const std::string & name() const
The name of this room.
void send_server_message(const char *message, network::connection sock, simple_wml::document *docptr=nullptr) const
Prepare a text message and/or send it to a player.
size_t size() const
Return the number of players in this room.
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
std::map< network::connection, player > player_map
void remove_player(network::connection player)
Leaving the room.
A room is a group of players that can communicate via messages.
void send_data(simple_wml::document &data, const network::connection exclude=0, std::string packet_type="") const
Convenience function for sending a wml document to all (or all except one) members.
bool add_player(network::connection player)
Joining the room.
void send_server_message(const std::string &message, network::connection sock, simple_wml::document *docptr=nullptr) const
void send_server_message_to_all(const std::string &message, network::connection exclude=0) const
connection_vector members_
std::vector< network::connection > connection_vector
void set_persistent(bool v)
Set the persistent flag for this room.
void write(config &cfg) const
Write room info to a config.
void process_message(simple_wml::document &data, const player_map::iterator user)
Chat message processing.
GLuint const GLchar * name
bool find(E event, F functor)
Tests whether an event handler is available.
bool persistent() const
Whether this room should be 'persistent', i.e.
GLsizei GLenum GLuint GLuint GLsizei char * message
room(const std::string &name)
Construct a room with just a name and default settings.
A config object defines a single node in a WML file, with access to child nodes.
bool logged() const
Whether the room is logged (and might end up in e.g.
bool empty() const
Return true iif the room is empty.
void send_server_message_to_all(const char *message, network::connection exclude=0) const
Send a text message to all members.
void set_topic(const std::string &v)
Set the topic for this room.
GLsizei const GLcharARB ** string
const std::vector< network::connection > & members() const
Return the members of this room.