Open D4n2021 opened 4 months ago
I will try to submit a PR about this if I finally figure it out how
If you want to try it, here's what I changed in the mount
function
async mount() {
for (const command of this.options.commands) {
const commands = Array.isArray(command.command) ? command.command : [command.command];
for (const cmd of commands) {
this.server.on(`CHAT_COMMAND:${cmd.toLowerCase()}`, async (data) => {
if (command.ignoreChats.includes(data.chat)) return;
if (command.type === 'broadcast') {
await this.server.rcon.broadcast(command.response);
} else if (command.type === 'warn') {
await this.server.rcon.warn(data.player.steamID, command.response);
}
});
}
}
}
This way I don't have to reconfigure the existing config and must convert each existing command one I made. As an example:
{
"command": "clear",
"type": "broadcast",
"response": "Please clear the chat. Thank you!.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n ",
"ignoreChats": [
"ChatAll",
"ChatTeam",
"ChatSquad"
]
},
{
"command": [
"nomaincamp",
"maincamp",
"main",
"mainbase",
"nomain",
"nocamp",
"mainbasecamp"
],
"type": "broadcast",
"response": "Main Camping violates the server rules. Please keep a safe distance from the enemy's main base.",
"ignoreChats": [
"ChatAll",
"ChatTeam",
"ChatSquad"
]
}
If not I can attempt to push one for you. All we ask is not to modify flags as they are tied to GitHub actions.
If not I can attempt to push one for you. All we ask is not to modify flags as they are tied to GitHub actions.
Please do thank you!
If not I can attempt to push one for you. All we ask is not to modify flags as they are tied to GitHub actions.
Please do thank you!
Haven’t forgotten still plan on doing this. Going to make a branch here for it.
What is the issue, e.g. map voting, you would like to solve?
Currently only supports "command", and not "command2", "command3" for example.
How would you like us to solve this issue?
To make this work like this (example words "version" and "website". Project Reality servers also support those commands iirc)
Additional Info
It currently outright ignores command2 and command3 variables.
I'm not sure I get what is being suggested here. Do you mean you want aliases for the same command? For example, !web
and !website
return the same response?
What is the issue, e.g. map voting, you would like to solve?
Currently only supports "command", and not "command2", "command3" for example.
How would you like us to solve this issue?
To make this work like this (example words "version" and "website". Project Reality servers also support those commands iirc)
Additional Info
It currently outright ignores command2 and command3 variables.
I'm not sure I get what is being suggested here. Do you mean you want aliases for the same command? For example,
!web
and!website
return the same response?
Now that I see Thomas' comment, would it be better to add another option called aliases
instead of my suggestion of modifying the command
option? @werewolfboy13
What is the issue, e.g. map voting, you would like to solve?
Currently only supports "command", and not "command2", "command3" for example.
How would you like us to solve this issue?
To make this work like this (example words "version" and "website". Project Reality servers also support those commands iirc)
Additional Info
It currently outright ignores command2 and command3 variables.