From ce4fdd14e3ae6f7da3a2900a70ce8ab362512e63 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Fri, 31 Jul 2020 12:56:39 -0700 Subject: [PATCH] Agent now sends session messages on each server reconnect. --- agents/meshcore.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/agents/meshcore.js b/agents/meshcore.js index 384772f4..6f8f8962 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -2393,7 +2393,7 @@ function createMeshCore(agent) { if (args['_'].length != 1) { response = "Proper usage: addagentmsg \"Alert Message\""; // Display usage } else { - tunnelUserCount.msg[args['_']] = 1; + tunnelUserCount.msg[args['_'][0]] = 1; try { mesh.SendCommand({ action: 'sessions', type: 'msg', value: tunnelUserCount.msg }); } catch (ex) { } } break; @@ -3444,6 +3444,11 @@ function createMeshCore(agent) { meInfoStr = null; sendPeriodicServerUpdate(); if (selfInfoUpdateTimer == null) { selfInfoUpdateTimer = setInterval(sendPeriodicServerUpdate, 1200000); } // 20 minutes + + // Send any state messages + if (Object.keys(tunnelUserCount.msg).length > 0) { + try { mesh.SendCommand({ action: 'sessions', type: 'msg', value: tunnelUserCount.msg }); } catch (ex) { } + } } }