ztavern/node-server-manager/Lib/RconCommandPrefixes/T4.js
2024-10-18 00:19:19 +00:00

40 lines
No EOL
1.4 KiB
JavaScript

module.exports = {
Rcon: {
prefix: '\xff\xff\xff\xffrcon %PASSWORD% %COMMAND%',
status: 'status',
getDvar: '%DVAR%',
setDvar: 'set %DVAR% %VALUE%',
clientKick: `clientkick %CLIENT% "%REASON%"`,
Tell: `tell %CLIENT% "%MESSAGE%"`,
Say: `say "%MESSAGE%"`,
statusRegex: /^ +([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+) +(.{0,32}) +([0-9]+) +(\d+\.\d+\.\d+.\d+\:-*\d{1,5}|0+.0+:-*\d{1,5}|loopback|unknown|bot) +(-*[0-9]+) +([0-9]+) *$/g,
dvarRegex: /\"(.*?)\" +(is:|is) +\"(.*?)\"/g,
commandDelay: 500,
parseStatus: (match) => {
return {
num: match[1],
score: match[2],
bot: '0',
ping: match[3],
guid: match[4],
name: match[5].replace(new RegExp(/\^([0-9]|\:|\;)/g, 'g'), ``),
lastmgs: match[6],
address: match[7],
qport: match[8],
rate: match[9]
}
}
},
getInfo: '\xff\xff\xff\xffgetinfo',
getStatus: '\xff\xff\xff\xffgetstatus',
Dvars: {
maxclients: 'sv_maxClients',
mapname: 'mapname',
hostname: 'sv_hostname',
gametype: 'g_gametype',
gamename: 'gamename',
maprotation: 'sv_mapRotation',
messagelength: 999999999,
maxSayLength: 150
}
}