aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/commands/internal
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/commands/internal')
-rw-r--r--server/src/commands/internal/disconnect.js17
-rw-r--r--server/src/commands/internal/legacylayer.js19
-rw-r--r--server/src/commands/internal/socketreply.js15
3 files changed, 27 insertions, 24 deletions
diff --git a/server/src/commands/internal/disconnect.js b/server/src/commands/internal/disconnect.js
index 520f8cb..07a125e 100644
--- a/server/src/commands/internal/disconnect.js
+++ b/server/src/commands/internal/disconnect.js
@@ -4,28 +4,29 @@
*/
// module main
-exports.run = async (core, server, socket, data) => {
+export async function run(core, server, socket, data) {
if (data.cmdKey !== server.cmdKey) {
// internal command attempt by client, increase rate limit chance and ignore
- return server.police.frisk(socket.remoteAddress, 20);
+ return server.police.frisk(socket.address, 20);
}
// send leave notice to client peers
if (socket.channel) {
server.broadcast({
cmd: 'onlineRemove',
- nick: socket.nick
+ nick: socket.nick,
}, { channel: socket.channel });
}
// commit close just in case
socket.terminate();
-};
-// module meta
-exports.requiredData = ['cmdKey'];
-exports.info = {
+ return true;
+}
+
+export const requiredData = ['cmdKey'];
+export const info = {
name: 'disconnect',
usage: 'Internal Use Only',
- description: 'Internally used to relay `onlineRemove` event to clients'
+ description: 'Internally used to relay `onlineRemove` event to clients',
};
diff --git a/server/src/commands/internal/legacylayer.js b/server/src/commands/internal/legacylayer.js
index 50f5fd7..c0daa13 100644
--- a/server/src/commands/internal/legacylayer.js
+++ b/server/src/commands/internal/legacylayer.js
@@ -3,18 +3,19 @@
*/
// module main
-exports.run = async (core, server, socket, data) => {
- return;
-};
+export async function run(core, server, socket, data) {
+ /**
+ * @todo
+ */
+}
// module hook functions
-exports.initHooks = (server) => {
+export function initHooks(server) {
// module is only a placeholder
- //server.registerHook('out', '', this.);
-};
+ // server.registerHook('out', '', this.);
+}
-// module meta
-exports.info = {
+export const info = {
name: 'legacylayer',
- description: 'This module adjusts outgoing data, making it compatible with legacy clients'
+ description: 'This module adjusts outgoing data, making it compatible with legacy clients',
};
diff --git a/server/src/commands/internal/socketreply.js b/server/src/commands/internal/socketreply.js
index 5dadaf6..1ba8df2 100644
--- a/server/src/commands/internal/socketreply.js
+++ b/server/src/commands/internal/socketreply.js
@@ -3,20 +3,21 @@
*/
// module main
-exports.run = async (core, server, socket, data) => {
+export async function run(core, server, socket, data) {
if (data.cmdKey !== server.cmdKey) {
// internal command attempt by client, increase rate limit chance and ignore
- return server.police.frisk(socket.remoteAddress, 20);
+ return server.police.frisk(socket.address, 20);
}
// send warning to target socket
server.reply({ cmd: 'warn', text: data.text }, socket);
-};
-// module meta
-exports.requiredData = ['cmdKey', 'text'];
-exports.info = {
+ return true;
+}
+
+export const requiredData = ['cmdKey', 'text'];
+export const info = {
name: 'socketreply',
usage: 'Internal Use Only',
- description: 'Internally used to relay warnings to clients'
+ description: 'Internally used to relay warnings to clients',
};