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'
|
|
|
|
};
|