*** VERSION 5.6.0 ***
[NeonServV5.git] / src / modules / stats.mod / module.c
index ee8a20d98b2436156e845b4d196eb277262e8ff1..ff5f8f6afb344de0ca14775ae62be0fe8c149662 100644 (file)
@@ -1,4 +1,4 @@
-/* module.c - NeonServ v5.4
+/* module.c - NeonServ v5.6
  * Copyright (C) 2011-2012  Philipp Kreil (pk910)
  * 
  * This program is free software: you can redistribute it and/or modify
@@ -39,10 +39,6 @@ static void module_start(int type) {
         timeq_add_name("stats", 60, module_id, stats_timer_callback, NULL);
 }
 
-static void module_loop() {
-    
-}
-
 static void module_stop(int type) {
     timeq_del_name("stats");
 }
@@ -114,7 +110,7 @@ static TIMEQ_CALLBACK(stats_timer_callback) {
         else
             bot = bot3;
         if(bot) {
-            pkgpos += sprintf(pkgbuf + pkgpos, "%s!%s@%s %d\n", bot->user->nick, bot->user->ident, bot->host, bot->port);
+            pkgpos += sprintf(pkgbuf + pkgpos, "%s!%s@%s %d\n", (bot->user ? bot->user->nick : "*"), (bot->user ? bot->user->ident : "*"), (bot->host ? bot->host : "*"), bot->port);
         } else
             pkgpos += sprintf(pkgbuf + pkgpos, "?\n");
     }
@@ -164,4 +160,4 @@ static TIMEQ_CALLBACK(stats_timer_callback) {
     close(sock);
 }
 
-MODULE_HEADER(module_initialize, module_start, module_loop, module_stop);
+MODULE_HEADER(module_initialize, module_start, module_stop);