aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/commands/internal/socketreply.js
blob: 82834b7c94a97fb07ba9ba1ce5570f42cc2d52ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
  Description: Used to relay warnings to clients internally
*/

exports.run = async (core, server, socket, data) => {
  if (data.cmdKey !== server._cmdKey) {
    // internal command attempt by client, increase rate limit chance and ignore
    server._police.frisk(socket.remoteAddress, 20);

    return;
  }

  server.reply({ cmd: 'warn', text: data.text }, socket);
};

exports.requiredData = ['cmdKey', 'text'];

exports.info = {
  name: 'socketreply',
  usage: 'Internal Use Only',
  description: 'Internally used to relay warnings to clients'
};