From e35fff59ba30e78046c9212e74fce9aef56c6e93 Mon Sep 17 00:00:00 2001 From: marzavec Date: Mon, 4 Jun 2018 00:07:24 -0700 Subject: cleaned up and commented modules --- server/src/commands/core/stats.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'server/src/commands/core/stats.js') diff --git a/server/src/commands/core/stats.js b/server/src/commands/core/stats.js index b9dc002..74bd4a5 100644 --- a/server/src/commands/core/stats.js +++ b/server/src/commands/core/stats.js @@ -3,6 +3,7 @@ */ exports.run = async (core, server, socket, data) => { + // gather connection and channel count let ips = {}; let channels = {}; for (let client of server.clients) { @@ -18,15 +19,17 @@ exports.run = async (core, server, socket, data) => { ips = null; channels = null; + // dispatch info server.reply({ cmd: 'info', text: `${uniqueClientCount} unique IPs in ${uniqueChannels} channels` }, socket); + // stats are fun core.managers.stats.increment('stats-requested'); }; exports.info = { name: 'stats', description: 'Sends back legacy server stats to the calling client' -}; \ No newline at end of file +}; -- cgit v1.2.1