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/internal/disconnect.js | 2 ++ server/src/commands/internal/socketreply.js | 1 + 2 files changed, 3 insertions(+) (limited to 'server/src/commands/internal') diff --git a/server/src/commands/internal/disconnect.js b/server/src/commands/internal/disconnect.js index bb3981b..7b9b299 100644 --- a/server/src/commands/internal/disconnect.js +++ b/server/src/commands/internal/disconnect.js @@ -11,6 +11,7 @@ exports.run = async (core, server, socket, data) => { return; } + // send leave notice to client peers if (socket.channel) { server.broadcast({ cmd: 'onlineRemove', @@ -18,6 +19,7 @@ exports.run = async (core, server, socket, data) => { }, { channel: socket.channel }); } + // commit close just in case socket.terminate(); }; diff --git a/server/src/commands/internal/socketreply.js b/server/src/commands/internal/socketreply.js index 82834b7..e77d080 100644 --- a/server/src/commands/internal/socketreply.js +++ b/server/src/commands/internal/socketreply.js @@ -10,6 +10,7 @@ exports.run = async (core, server, socket, data) => { return; } + // send warning to target socket server.reply({ cmd: 'warn', text: data.text }, socket); }; -- cgit v1.2.1