aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/commands/mod
diff options
context:
space:
mode:
authormarzavec <admin@marzavec.com>2019-04-08 02:04:10 +0200
committermarzavec <admin@marzavec.com>2019-04-08 02:04:10 +0200
commitf353ecbd9e9e8e409303bb4f5c5590e95f579869 (patch)
tree3345967ae59a46f59fe86c0d6fda432115594927 /server/src/commands/mod
parentrefactoring 1 of 2 (diff)
downloadhackchat-f353ecbd9e9e8e409303bb4f5c5590e95f579869.tar.gz
hackchat-f353ecbd9e9e8e409303bb4f5c5590e95f579869.zip
refactoring 2 of 2
Diffstat (limited to 'server/src/commands/mod')
-rw-r--r--server/src/commands/mod/ban.js4
-rw-r--r--server/src/commands/mod/dumb.js4
-rw-r--r--server/src/commands/mod/kick.js2
-rw-r--r--server/src/commands/mod/moveuser.js2
-rw-r--r--server/src/commands/mod/speak.js2
-rw-r--r--server/src/commands/mod/unban.js4
-rw-r--r--server/src/commands/mod/unbanall.js4
7 files changed, 11 insertions, 11 deletions
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`);