fix/connections tracking
This commit is contained in:
3 files changed
+4
-3
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "dayzr-bot",
|
||||
"version": "12.0.5",
|
||||
"version": "12.0.6",
|
||||
"description": "A General Purpose Discord Bot for DayZ Nitrado Servers.",
|
||||
"main": "index.js",
|
||||
"nodemonConfig": {
|
||||
|
||||
+2
-2
@@ -346,8 +346,8 @@ class DayzRBot extends Client {
|
||||
}
|
||||
}
|
||||
|
||||
exists(n) { return null != n && undefined != n && "" != n }
|
||||
|
||||
exists(n) { return null != n && undefined != n && "" != n && NaN != n }
|
||||
|
||||
secondsToDhms(seconds) {
|
||||
seconds = Number(seconds);
|
||||
const d = Math.floor(seconds / (3600 * 24));
|
||||
|
||||
@@ -35,6 +35,7 @@ module.exports = {
|
||||
|
||||
playerStat.lastConnectionDate = newDt;
|
||||
playerStat.connected = true;
|
||||
if (!client.exists(playerStat.connections)) playerStat.connections = 0;
|
||||
playerStat.connections++;
|
||||
|
||||
// Track adjusted sessions this instance has handled (e.g. no bot crashes or restarts).
|
||||
|
||||
Reference in new issue
Block a user