]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/opserv.c
fixed registration process (uncommitted code from afternets x3 applied)
[irc/evilnet/x3.git] / src / opserv.c
index d924e9efe077804e538ba47a720361a10a160075..c12de17fe07de889050a4ea8a08689ea2cd64e25 100644 (file)
@@ -1,7 +1,7 @@
 /* opserv.c - IRC Operator assistance service
  * Copyright 2000-2004 srvx Development Team
  *
- * This file is part of srvx.
+ * This file is part of x3.
  *
  * srvx is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -233,7 +233,6 @@ static const struct message_entry msgtab[] = {
     { "OSMSG_WARN_LISTSTART", "Channel activity warnings:" },
     { "OSMSG_WARN_LISTENTRY", "%s (%s)" },
     { "OSMSG_WARN_LISTEND", "End of activity warning list." },
-    { "OSMSG_STATS_MEMORY", "%u allocations totalling %u bytes." },
     { "OSMSG_UPLINK_CONNECTING", "Establishing connection with %s (%s:%d)." },
     { "OSMSG_CURRENT_UPLINK", "$b%s$b is already the current uplink." },
     { "OSMSG_INVALID_UPLINK", "$b%s$b is not a valid uplink name." },
@@ -1709,7 +1708,21 @@ static MODCMD_FUNC(cmd_stats_warn) {
 #if defined(WITH_MALLOC_SRVX)
 static MODCMD_FUNC(cmd_stats_memory) {
     extern unsigned long alloc_count, alloc_size;
-    reply("OSMSG_STATS_MEMORY", alloc_count, alloc_size);
+    send_message_type(MSG_TYPE_NOXLATE, user, cmd->parent->bot,
+                      "%u allocations totalling %u bytes.",
+                      alloc_count, alloc_size);
+    return 1;
+}
+#elif defined(WITH_MALLOC_SLAB)
+static MODCMD_FUNC(cmd_stats_memory) {
+    extern unsigned long slab_alloc_count, slab_count, slab_alloc_size;
+    extern unsigned long big_alloc_count, big_alloc_size;
+    send_message_type(MSG_TYPE_NOXLATE, user, cmd->parent->bot,
+                      "%u allocations in %u slabs totalling %u bytes.",
+                      slab_alloc_count, slab_count, slab_alloc_size);
+    send_message_type(MSG_TYPE_NOXLATE, user, cmd->parent->bot,
+                      "%u big allocations totalling %u bytes.",
+  
     return 1;
 }
 #endif
@@ -4265,7 +4278,7 @@ init_opserv(const char *nick)
     opserv_define_func("STATS UPLINK", cmd_stats_uplink, 0, 0, 0);
     opserv_define_func("STATS UPTIME", cmd_stats_uptime, 0, 0, 0);
     opserv_define_func("STATS WARN", cmd_stats_warn, 0, 0, 0);
-#if defined(WITH_MALLOC_SRVX)
+#if defined(WITH_MALLOC_SRVX) || defined(WITH_MALLOC_SLAB)
     opserv_define_func("STATS MEMORY", cmd_stats_memory, 0, 0, 0);
 #endif
     opserv_define_func("TRACE", cmd_trace, 100, 0, 3);