From f353ecbd9e9e8e409303bb4f5c5590e95f579869 Mon Sep 17 00:00:00 2001 From: marzavec Date: Sun, 7 Apr 2019 17:04:10 -0700 Subject: refactoring 2 of 2 --- server/src/commands/mod/ban.js | 4 ++-- server/src/commands/mod/dumb.js | 4 ++-- server/src/commands/mod/kick.js | 2 +- server/src/commands/mod/moveuser.js | 2 +- server/src/commands/mod/speak.js | 2 +- server/src/commands/mod/unban.js | 4 ++-- server/src/commands/mod/unbanall.js | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) (limited to 'server/src/commands/mod') diff --git a/server/src/commands/mod/ban.js b/server/src/commands/mod/ban.js index 93c536b..9c8eb4f 100644 --- a/server/src/commands/mod/ban.js +++ b/server/src/commands/mod/ban.js @@ -6,7 +6,7 @@ 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); + return server.police.frisk(socket.remoteAddress, 10); } // check user input @@ -36,7 +36,7 @@ exports.run = async (core, server, socket, data) => { } // commit arrest record - server._police.arrest(badClient.remoteAddress, badClient.hash); + server.police.arrest(badClient.remoteAddress, badClient.hash); console.log(`${socket.nick} [${socket.trip}] banned ${targetNick} in ${socket.channel}`); diff --git a/server/src/commands/mod/dumb.js b/server/src/commands/mod/dumb.js index d64c746..d5e8fee 100644 --- a/server/src/commands/mod/dumb.js +++ b/server/src/commands/mod/dumb.js @@ -14,7 +14,7 @@ exports.init = (core) => { 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); + return server.police.frisk(socket.remoteAddress, 10); } // check user input @@ -93,7 +93,7 @@ exports.chatCheck = (core, server, socket, payload) => { } // blanket "spam" protection, may expose the ratelimiting lines from `chat` and use that, TODO: one day #lazydev - server._police.frisk(socket.remoteAddress, 9); + server.police.frisk(socket.remoteAddress, 9); return false; } diff --git a/server/src/commands/mod/kick.js b/server/src/commands/mod/kick.js index 808defa..f3bc7ca 100644 --- a/server/src/commands/mod/kick.js +++ b/server/src/commands/mod/kick.js @@ -6,7 +6,7 @@ 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); + return server.police.frisk(socket.remoteAddress, 10); } // check user input diff --git a/server/src/commands/mod/moveuser.js b/server/src/commands/mod/moveuser.js index e4f6c22..c7fc4bf 100644 --- a/server/src/commands/mod/moveuser.js +++ b/server/src/commands/mod/moveuser.js @@ -6,7 +6,7 @@ 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); + return server.police.frisk(socket.remoteAddress, 10); } // check user input diff --git a/server/src/commands/mod/speak.js b/server/src/commands/mod/speak.js index e2a3ef7..23fc4de 100644 --- a/server/src/commands/mod/speak.js +++ b/server/src/commands/mod/speak.js @@ -14,7 +14,7 @@ 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); + return server.police.frisk(socket.remoteAddress, 10); } // check user input diff --git a/server/src/commands/mod/unban.js b/server/src/commands/mod/unban.js index 71be9bb..6744d9d 100644 --- a/server/src/commands/mod/unban.js +++ b/server/src/commands/mod/unban.js @@ -6,7 +6,7 @@ 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); + return server.police.frisk(socket.remoteAddress, 10); } // check user input @@ -28,7 +28,7 @@ exports.run = async (core, server, socket, data) => { } // remove arrest record - server._police.pardon(target); + server.police.pardon(target); // mask ip if used if (mode === 'ip') { diff --git a/server/src/commands/mod/unbanall.js b/server/src/commands/mod/unbanall.js index a9cf682..c285b80 100644 --- a/server/src/commands/mod/unbanall.js +++ b/server/src/commands/mod/unbanall.js @@ -6,11 +6,11 @@ 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); + return server.police.frisk(socket.remoteAddress, 10); } // remove arrest records - server._police._records = {}; + server.police.records = {}; console.log(`${socket.nick} [${socket.trip}] unbanned all`); -- cgit v1.2.1