[Quest API] Add $client->SetGMStatus() (#1465)

* add $client->SetGMStatus()

* add UpdateAdmin after setting status
This commit is contained in:
splose
2021-07-26 12:21:06 -04:00
committed by GitHub
parent fe7cb764b2
commit b401404227
5 changed files with 46 additions and 1 deletions
+17
View File
@@ -3413,6 +3413,22 @@ XS(XS_Client_ReadBook) {
XSRETURN_EMPTY;
}
XS(XS_Client_SetGMStatus); /* prototype to pass -Wmissing-prototypes */
XS(XS_Client_SetGMStatus) {
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Client::SetGMStatus(THIS, int newStatus)"); // @categories Script Utility
{
Client *THIS;
uint32 accID = THIS->AccountID();
int newStatus = (int)SvIV(ST(1));
VALIDATE_THIS_IS_CLIENT;
THIS->SetAdminStatus(newStatus);
THIS->UpdateAdmin(true);
}
XSRETURN_EMPTY;
}
XS(XS_Client_UpdateGroupAAs); /* prototype to pass -Wmissing-prototypes */
XS(XS_Client_UpdateGroupAAs) {
dXSARGS;
@@ -5706,6 +5722,7 @@ XS(boot_Client) {
newXSproto(strcpy(buf, "UntrainDisc"), XS_Client_UntrainDisc, file, "$$;$");
newXSproto(strcpy(buf, "UntrainDiscAll"), XS_Client_UntrainDiscAll, file, "$;$");
newXSproto(strcpy(buf, "UpdateAdmin"), XS_Client_UpdateAdmin, file, "$;$");
newXSproto(strcpy(buf, "SetGMStatus"), XS_Client_SetGMStatus, file, "$$");
newXSproto(strcpy(buf, "UpdateGroupAAs"), XS_Client_UpdateGroupAAs, file, "$$$");
newXSproto(strcpy(buf, "UpdateLDoNPoints"), XS_Client_UpdateLDoNPoints, file, "$$$");
newXSproto(strcpy(buf, "UpdateTaskActivity"), XS_Client_UpdateTaskActivity, file, "$$$$;$");