diff options
author | marzavec <admin@marzavec.com> | 2020-03-06 18:00:30 +0100 |
---|---|---|
committer | marzavec <admin@marzavec.com> | 2020-03-06 18:00:30 +0100 |
commit | da9cbe3dbb799b7b668c895367c7d3778f1d0e16 (patch) | |
tree | 026aebaf1c24e82043c658d29afc8cc9b0bce121 /server/src/commands/mod | |
parent | Merge pull request #89 from MinusGix/nul_initial2 (diff) | |
download | hackchat-da9cbe3dbb799b7b668c895367c7d3778f1d0e16.tar.gz hackchat-da9cbe3dbb799b7b668c895367c7d3778f1d0e16.zip |
Minor UAC tweaks
Added an underscore to the uac info lib which prevents the server from attempting to use the file as a command module, allowing removal of the 'info' property and empty 'run' command
Diffstat (limited to 'server/src/commands/mod')
-rw-r--r-- | server/src/commands/mod/ban.js | 2 | ||||
-rw-r--r-- | server/src/commands/mod/dumb.js | 2 | ||||
-rw-r--r-- | server/src/commands/mod/kick.js | 10 | ||||
-rw-r--r-- | server/src/commands/mod/moveuser.js | 2 | ||||
-rw-r--r-- | server/src/commands/mod/speak.js | 2 | ||||
-rw-r--r-- | server/src/commands/mod/unban.js | 2 | ||||
-rw-r--r-- | server/src/commands/mod/unbanall.js | 2 |
7 files changed, 11 insertions, 11 deletions
diff --git a/server/src/commands/mod/ban.js b/server/src/commands/mod/ban.js index 982c380..abc02d7 100644 --- a/server/src/commands/mod/ban.js +++ b/server/src/commands/mod/ban.js @@ -2,7 +2,7 @@ Description: Adds the target socket's ip to the ratelimiter */ -import * as UAC from "../utility/UAC/info"; +import * as UAC from '../utility/UAC/_info'; // module main export async function run(core, server, socket, data) { diff --git a/server/src/commands/mod/dumb.js b/server/src/commands/mod/dumb.js index 5693df2..125660c 100644 --- a/server/src/commands/mod/dumb.js +++ b/server/src/commands/mod/dumb.js @@ -3,7 +3,7 @@ * Author: simple */ -import * as UAC from "../utility/UAC/info"; +import * as UAC from '../utility/UAC/_info'; // module constructor export function init(core) { diff --git a/server/src/commands/mod/kick.js b/server/src/commands/mod/kick.js index 0a94c6d..ec5696b 100644 --- a/server/src/commands/mod/kick.js +++ b/server/src/commands/mod/kick.js @@ -2,7 +2,7 @@ Description: Forces a change on the target(s) socket's channel, then broadcasts event */ -import * as UAC from "../utility/UAC/info"; +import * as UAC from '../utility/UAC/_info'; // module main export async function run(core, server, socket, data) { @@ -54,17 +54,17 @@ export async function run(core, server, socket, data) { // Announce the kicked clients arrival in destChannel and that they were kicked // Before they arrive, so they don't see they got moved - for (let i = 0; i < kicked.length; i++) { + for (let i = 0; i < kicked.length; i += 1) { server.broadcast({ cmd: 'onlineAdd', nick: kicked[i].nick, trip: kicked[i].trip || 'null', - hash: kicked[i].userHash + hash: kicked[i].userHash, }, { channel: destChannel }); } // Move all kicked clients to the new channel - for (let i = 0; i < kicked.length; i++) { + for (let i = 0; i < kicked.length; i += 1) { kicked[i].channel = destChannel; server.broadcast({ @@ -87,7 +87,7 @@ export async function run(core, server, socket, data) { // publicly broadcast kick event server.broadcast({ cmd: 'info', - text: `Kicked ${kicked.map(k => k.nick).join(', ')}`, + text: `Kicked ${kicked.map((k) => k.nick).join(', ')}`, }, { channel: socket.channel, level: (level) => level < UAC.levels.moderator }); // stats are fun diff --git a/server/src/commands/mod/moveuser.js b/server/src/commands/mod/moveuser.js index 7eb6d83..6b25d07 100644 --- a/server/src/commands/mod/moveuser.js +++ b/server/src/commands/mod/moveuser.js @@ -2,7 +2,7 @@ Description: Removes the target socket from the current channel and forces a join event in another */ -import * as UAC from "../utility/UAC/info"; +import * as UAC from '../utility/UAC/_info'; // module main export async function run(core, server, socket, data) { diff --git a/server/src/commands/mod/speak.js b/server/src/commands/mod/speak.js index 48d38c6..7dada13 100644 --- a/server/src/commands/mod/speak.js +++ b/server/src/commands/mod/speak.js @@ -3,7 +3,7 @@ * Author: simple */ -import * as UAC from "../utility/UAC/info"; +import * as UAC from '../utility/UAC/_info'; // module constructor export function init(core) { diff --git a/server/src/commands/mod/unban.js b/server/src/commands/mod/unban.js index b8506f3..dd14a3a 100644 --- a/server/src/commands/mod/unban.js +++ b/server/src/commands/mod/unban.js @@ -2,7 +2,7 @@ Description: Removes a target ip from the ratelimiter */ -import * as UAC from "../utility/UAC/info"; +import * as UAC from '../utility/UAC/_info'; // module main export async function run(core, server, socket, data) { diff --git a/server/src/commands/mod/unbanall.js b/server/src/commands/mod/unbanall.js index e6affc4..750c322 100644 --- a/server/src/commands/mod/unbanall.js +++ b/server/src/commands/mod/unbanall.js @@ -2,7 +2,7 @@ Description: Clears all bans and ratelimits */ -import * as UAC from "../utility/UAC/info"; +import * as UAC from '../utility/UAC/_info'; // module main export async function run(core, server, socket) { |