From c719020e17cb1c98da55be6cc7efe0e50ab51ffa Mon Sep 17 00:00:00 2001 From: marzavec Date: Sat, 29 Sep 2018 23:44:36 -0700 Subject: Added hooks, modules and cleaned up code --- server/src/commands/mod/unban.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'server/src/commands/mod/unban.js') diff --git a/server/src/commands/mod/unban.js b/server/src/commands/mod/unban.js index 9115dbd..0cd8ca7 100644 --- a/server/src/commands/mod/unban.js +++ b/server/src/commands/mod/unban.js @@ -2,22 +2,19 @@ Description: Removes a target ip from the ratelimiter */ +// module main exports.run = async (core, server, socket, data) => { // increase rate limit chance and ignore if not admin or mod - if (socket.uType == 'user') { - server._police.frisk(socket.remoteAddress, 10); - - return; + if (socket.uType === 'user') { + return server._police.frisk(socket.remoteAddress, 10); } // check user input if (typeof data.ip !== 'string' && typeof data.hash !== 'string') { - server.reply({ + return server.reply({ cmd: 'warn', text: "hash:'targethash' or ip:'1.2.3.4' is required" }, socket); - - return; } // find target @@ -55,8 +52,10 @@ exports.run = async (core, server, socket, data) => { core.managers.stats.decrement('users-banned'); }; +// module meta exports.info = { name: 'unban', - usage: 'unban {[ip || hash]}', - description: 'Removes target ip from the ratelimiter' + description: 'Removes target ip from the ratelimiter', + usage: ` + API: { cmd: 'unban', ip/hash: '' }` }; -- cgit v1.2.1