Only send stats to clients if there is a client watching them.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3846 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-02-26 21:17:15 +00:00
parent ffaaec5b37
commit 95f0b91a0e
3 changed files with 23 additions and 7 deletions

View File

@ -128,6 +128,12 @@ function socket(request, response, client) {
if (process && process.timeout > 0) {
setTimeout(ping, process.timeout);
}
} else if (message.action == 'enableStats') {
process.stats = message.enabled;
if (!gStatsTimer) {
sendStats();
gStatsTimer = true;
}
} else {
if (process && process.eventHandlers['message']) {
await invoke(process.eventHandlers['message'], [message]);