24 #define ERR_NG LOG_STREAM(err, log_engine) 
   25 #define LOG_NG LOG_STREAM(info, log_engine) 
   43     const std::string::const_iterator j =
 
   45     if (j == 
data.end()) 
return;
 
   47     const std::string domain(j + 1, 
data.end());
 
   55         symbols[
"level"] = 
level;
 
   56         const std::string& 
msg =
 
   57             VGETTEXT(
"Unknown debug level: '$level'.", symbols);
 
   64         symbols[
"domain"] = domain;
 
   65         const std::string& 
msg =
 
   66             VGETTEXT(
"Unknown debug domain: '$domain'.", symbols);
 
   73         symbols[
"level"] = 
level;
 
   74         symbols[
"domain"] = domain;
 
   75         const std::string& 
msg =
 
   76             VGETTEXT(
"Switched domain: '$domain' to level: '$level'.", symbols);
 
   84     if (cmd == 
"muteall") {
 
   87     else if (cmd == 
"query") {
 
   88         data.add_child(cmd)[
"type"] = args;
 
   90     else if (cmd == 
"ban" || cmd == 
"unban" || cmd == 
"kick" 
   91         || cmd == 
"mute" || cmd == 
"unmute") {
 
   92         data.add_child(cmd)[
"username"] = args;
 
   94     else if (cmd == 
"ping") {
 
   96         auto now = std::chrono::steady_clock::now();
 
   97         data.add_child(
"ping")[
"requested_at"] = now.time_since_epoch();
 
   99     else if (cmd == 
"report") {
 
  100         data.add_child(
"query")[
"type"] = 
"report " + args;
 
  102     else if (cmd == 
"roll") {
 
  103         data.add_child(
"query")[
"type"] = 
"roll " + args;
 
  110     if (message.empty() || message == 
"/") {
 
  113     bool is_command = (message[0] == 
'/');
 
  114     bool quoted_command = (is_command && message[1] == 
' ');
 
  120     else if (quoted_command) {
 
  124     std::string cmd(message.begin() + 1, message.end());
 
  136         "receiver", receiver, 
"message", message, 
"sender", 
prefs::get().
login()
 
  143     symbols[
"receiver"] = receiver;
 
  150     symbols[
"sender"] = sender;
 
  155     const std::string& message)
 
  168     const std::string &speaker, 
const std::string &message)
 
static lg::log_domain log_engine("engine")
 
A config object defines a single node in a WML file, with access to child nodes.
 
virtual void add_chat_room_message_received(const std::string &room, const std::string &speaker, const std::string &message)
 
virtual void add_chat_message(const std::chrono::system_clock::time_point &time, const std::string &speaker, int side, const std::string &message, MESSAGE_TYPE type=MESSAGE_PRIVATE)=0
 
virtual void send_chat_room_message(const std::string &room, const std::string &message)
 
virtual void add_chat_room_message_sent(const std::string &room, const std::string &message)
 
virtual void user_relation_changed(const std::string &name)
Called when a processed command results in a relation (friend/ignore) change for a user whose name is...
 
virtual void add_whisper_received(const std::string &sender, const std::string &message)
 
bool do_speak(const std::string &message, bool allies_only=false)
 
virtual void add_whisper_sent(const std::string &receiver, const std::string &message)
 
void change_logging(const std::string &data)
Change the log level of a log domain.
 
virtual void send_chat_message(const std::string &message, bool allies_only=false)=0
 
virtual void send_whisper(const std::string &receiver, const std::string &message)
 
virtual void send_to_server(const config &cfg)=0
 
void send_command(const std::string &cmd, const std::string &args="")
 
bool dispatch(std::string cmd)
 
severity get_severity() const
 
static std::string _(const char *str)
 
Standard logging facilities (interface).
 
Handling of system events.
 
bool set_log_domain_severity(const std::string &name, severity severity)
 
std::map< std::string, t_string > string_map
 
auto * find(Container &container, const Value &value)
Convenience wrapper for using find on a container without needing to comare to end()
 
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")