Browse Source

include gateways into nodecount (for !status as well as for highscore)

Helge Jung 9 years ago
parent
commit
9bec631836
1 changed files with 6 additions and 2 deletions
  1. 6 2
      modules/ffpb_netstatus.py

+ 6 - 2
modules/ffpb_netstatus.py

@@ -56,6 +56,7 @@ def ffpb_get_stats(bot):
 
     (nodes_active, clients_count) = \
         (status['nodes_active'], status['clients_unique'])
+    nodes_active += status.get('gateways_active', 0)
 
     highscore_changed = False
     if nodes_active > highscores['nodes']:
@@ -97,8 +98,11 @@ def ffpb_status(bot, trigger):
         bot.say('Uff, kein Plan wo der Zettel ist. Fragst du später nochmal?')
         return
 
-    bot.say('Es sind {0} Knoten und ca. {1} Clients online.'.format(
-            stats["nodes_active"], stats["clients_unique"]))
+    gwactive = stats.get('gateways_active', 0)
+    bot.say('Es sind {0} Knoten (inkl. {1} Gateways) und ca. {2} Clients online.'.format(
+            stats["nodes_active"] + gwactive,
+            gwactive,
+            stats["clients_unique"]))
 
 
 @willie.module.commands('raw-status')