diff options
author | marzavec <admin@marzavec.com> | 2018-06-04 09:07:24 +0200 |
---|---|---|
committer | marzavec <admin@marzavec.com> | 2018-06-04 09:07:24 +0200 |
commit | e35fff59ba30e78046c9212e74fce9aef56c6e93 (patch) | |
tree | c7d3e0cd75f5a6063d629d4295952488907e9562 /server/src/commands/admin/shout.js | |
parent | Completed protocol decoupling (diff) | |
download | hackchat-e35fff59ba30e78046c9212e74fce9aef56c6e93.tar.gz hackchat-e35fff59ba30e78046c9212e74fce9aef56c6e93.zip |
cleaned up and commented modules
Diffstat (limited to 'server/src/commands/admin/shout.js')
-rw-r--r-- | server/src/commands/admin/shout.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/server/src/commands/admin/shout.js b/server/src/commands/admin/shout.js index 1358dd9..80a6470 100644 --- a/server/src/commands/admin/shout.js +++ b/server/src/commands/admin/shout.js @@ -3,12 +3,15 @@ */ exports.run = async (core, server, socket, data) => { + // increase rate limit chance and ignore if not admin if (socket.uType != 'admin') { - // ignore if not admin + server._police.frisk(socket.remoteAddress, 20); + return; } - server.broadcast( { + // send text to all channels + server.broadcast({ cmd: 'info', text: `Server Notice: ${data.text}` }, {}); @@ -20,4 +23,4 @@ exports.info = { name: 'shout', usage: 'shout {text}', description: 'Displays passed text to every client connected' -};
\ No newline at end of file +}; |