1
0
mirror of https://github.com/hack-chat/main.git synced 2024-03-22 13:20:33 +08:00
hack-chat-main/server/src/commands/internal/socketreply.js

24 lines
588 B
JavaScript
Raw Normal View History

2018-06-04 02:08:35 +08:00
/*
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;
}
2018-06-04 15:07:24 +08:00
// send warning to target socket
2018-06-04 02:08:35 +08:00
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'
};