[Quest API] Add SendGMCommand() to Perl/Lua. (#2527)

* [Quest API] Add SendGMCommand() to Perl/Lua.

# Perl
- Add `$client->SendGMCommand(message)` to Perl.
- Add `$client->SendGMCommand(message, ignore_status)` to Perl.

# Lua
- Add `client:SendGMCommand(message)` to Lua.
- Add `client:SendGMCommand(message, ignore_status)` to Lua.

# Notes
- `ignore_status` allows you to have players use GM commands that they are not the required status level for through the Quest API.
- `ignore_status` is default false, so if you don't send it, it checks and makes sure the player can use the command you're sending before allowing it.

* Typo.

* Formatting.
This commit is contained in:
Kinglykrab
2022-11-14 16:47:02 -05:00
committed by GitHub
parent 36887203d3
commit f668949c24
7 changed files with 41 additions and 8 deletions
+5 -1
View File
@@ -1118,7 +1118,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
}
case ChatChannel_Say: { /* Say */
if (message[0] == COMMAND_CHAR) {
if (command_dispatch(this, message) == -2) {
if (command_dispatch(this, message, false) == -2) {
if (parse->PlayerHasQuestSub(EVENT_COMMAND)) {
int i = parse->EventPlayer(EVENT_COMMAND, this, message, 0);
if (i == 0 && !RuleB(Chat, SuppressCommandErrors)) {
@@ -11751,3 +11751,7 @@ void Client::AddAAPoints(uint32 points)
SendAlternateAdvancementStats();
}
bool Client::SendGMCommand(std::string message, bool ignore_status) {
return command_dispatch(this, message, ignore_status) >= 0 ? true : false;
}