24 #define ERR_ROOM LOG_STREAM(err, log_server)
25 #define LOG_ROOM LOG_STREAM(info, log_server)
26 #define DBG_ROOM LOG_STREAM(debug, log_server)
42 , persistent_(wml[
"persistent"].to_bool())
43 , topic_(wml[
"topic"])
44 , logged_(wml[
"logged"].to_bool())
94 ERR_ROOM <<
"ERROR: Player is already in this room. (socket: "
109 ERR_ROOM <<
"ERROR: Player is not in this room. (socket: "
119 wesnothd::send_to_many(data,
members(), exclude, packet_type);
133 if(docptr ==
nullptr) {
143 send_to_one(doc, sock,
"message");
node & add_child(const char *name)
static lg::log_domain log_server("server")
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.
node & set_attr(const char *key, const char *value)
GLint GLenum GLsizei GLint GLsizei const GLvoid * data
Definitions for the interface to Wesnoth Markup Language (WML).
void remove_player(network::connection player)
Leaving the room.
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.
connection_vector members_
Templates and utility-routines for strings and numbers.
void set_persistent(bool v)
Set the persistent flag for this room.
std::map< std::string, tfilter >::iterator itor
node & set_attr_dup(const char *key, const char *value)
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
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.
Standard logging facilities (interface).
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.
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.