[Cleanup] Remove hard-coded Status Checks (#3727)

* [Cleanup] Remove hard-coded Status Checks

# Notes
- Removed the hard-coded GM status checks since if you have access to the command we can now limit access to subcommands if necessary.

* Update client_packet.cpp
This commit is contained in:
Alex King
2023-12-03 11:44:30 -05:00
committed by GitHub
parent 22994e3264
commit e719aa43cf
13 changed files with 649 additions and 862 deletions
+19 -39
View File
@@ -15,20 +15,13 @@ void command_interrogateinv(Client *c, const Seperator *sep)
// same or not.
if (strcasecmp(sep->arg[1], "help") == 0) {
if (c->Admin() < commandInterrogateInv) {
c->Message(Chat::White, "Usage: #interrogateinv");
c->Message(Chat::White, " Displays your inventory's current in-memory nested storage references");
}
else {
c->Message(Chat::White, "Usage: #interrogateinv [log] [silent]");
c->Message(
Chat::White,
" Displays your or your Player target inventory's current in-memory nested storage references"
);
c->Message(Chat::White, " [log] - Logs interrogation to file");
c->Message(Chat::White, " [silent] - Omits the in-game message portion of the interrogation");
}
return;
c->Message(Chat::White, "Usage: #interrogateinv [log] [silent]");
c->Message(
Chat::White,
" Displays your or your Player target inventory's current in-memory nested storage references"
);
c->Message(Chat::White, " [log] - Logs interrogation to file");
c->Message(Chat::White, " [silent] - Omits the in-game message portion of the interrogation");
}
Client *target = nullptr;
@@ -38,33 +31,20 @@ void command_interrogateinv(Client *c, const Seperator *sep)
bool error = false;
bool allowtrip = false;
if (c->Admin() < commandInterrogateInv) {
if (c->GetInterrogateInvState()) {
c->Message(Chat::Red, "The last use of #interrogateinv on this inventory instance discovered an error...");
c->Message(Chat::Red, "Logging out, zoning or re-arranging items at this point will result in item loss!");
return;
}
target = c;
allowtrip = true;
if (c->GetTarget() == nullptr) {
target = c;
} else if (c->GetTarget()->IsClient()) {
target = c->GetTarget()->CastToClient();
} else {
c->Message(Chat::Default, "Use of this command is limited to Client entities");
return;
}
else {
if (c->GetTarget() == nullptr) {
target = c;
}
else if (c->GetTarget()->IsClient()) {
target = c->GetTarget()->CastToClient();
}
else {
c->Message(Chat::Default, "Use of this command is limited to Client entities");
return;
}
if (strcasecmp(sep->arg[1], "log") == 0) {
log = true;
}
if (strcasecmp(sep->arg[2], "silent") == 0) {
silent = true;
}
if (strcasecmp(sep->arg[1], "log") == 0) {
log = true;
}
if (strcasecmp(sep->arg[2], "silent") == 0) {
silent = true;
}
bool success = target->InterrogateInventory(c, log, silent, allowtrip, error);