aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/commands/internal/socketreply.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/commands/internal/socketreply.js')
-rw-r--r--server/src/commands/internal/socketreply.js15
1 files changed, 8 insertions, 7 deletions
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',
};