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/unbanall.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 server/src/commands/mod/unbanall.js (limited to 'server/src/commands/mod/unbanall.js') diff --git a/server/src/commands/mod/unbanall.js b/server/src/commands/mod/unbanall.js new file mode 100644 index 0000000..a9cf682 --- /dev/null +++ b/server/src/commands/mod/unbanall.js @@ -0,0 +1,36 @@ +/* + Description: Clears all bans and ratelimits +*/ + +// module main +exports.run = async (core, server, socket, data) => { + // increase rate limit chance and ignore if not admin or mod + if (socket.uType === 'user') { + return server._police.frisk(socket.remoteAddress, 10); + } + + // remove arrest records + server._police._records = {}; + + console.log(`${socket.nick} [${socket.trip}] unbanned all`); + + // reply with success + server.reply({ + cmd: 'info', + text: `Unbanned all ip addresses` + }, socket); + + // notify mods + server.broadcast({ + cmd: 'info', + text: `${socket.nick} unbanned all ip addresses` + }, { uType: 'mod' }); +}; + +// module meta +exports.info = { + name: 'unbanall', + description: 'Clears all banned ip addresses', + usage: ` + API: { cmd: 'unbanall' }` +}; -- cgit v1.2.1