mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
[Quest API] Add $client->SetGMStatus() (#1465)
* add $client->SetGMStatus() * add UpdateAdmin after setting status
This commit is contained in:
parent
fe7cb764b2
commit
b401404227
@ -10130,7 +10130,6 @@ void Client::SetAFK(uint8 afk_flag) {
|
||||
safe_delete(outapp);
|
||||
}
|
||||
|
||||
|
||||
void Client::SendToInstance(std::string instance_type, std::string zone_short_name, uint32 instance_version, float x, float y, float z, float heading, std::string instance_identifier, uint32 duration) {
|
||||
uint32 zone_id = ZoneID(zone_short_name);
|
||||
std::string current_instance_type = str_tolower(instance_type);
|
||||
@ -10241,3 +10240,10 @@ void Client::RemoveItem(uint32 item_id, uint32 quantity)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Client::SetAdminStatus(int newStatus) {
|
||||
if (this->Admin() != newStatus)
|
||||
database.UpdateGMStatus(this->AccountID(), newStatus);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1523,6 +1523,7 @@ public:
|
||||
void LoadAccountFlags();
|
||||
void SetAccountFlag(std::string flag, std::string val);
|
||||
std::string GetAccountFlag(std::string flag);
|
||||
void SetAdminStatus(int newStatus);
|
||||
float GetDamageMultiplier(EQ::skills::SkillType how_long_has_this_been_missing);
|
||||
void Consume(const EQ::ItemData *item, uint8 type, int16 slot, bool auto_consume);
|
||||
void PlayMP3(const char* fname);
|
||||
|
||||
@ -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, "$$$$;$");
|
||||
|
||||
@ -4977,3 +4977,21 @@ void ZoneDatabase::SetEXPModifier(uint32 character_id, uint32 zone_id, double ex
|
||||
);
|
||||
database.QueryDatabase(query);
|
||||
}
|
||||
|
||||
void ZoneDatabase::UpdateGMStatus(uint32 accID, int newStatus)
|
||||
{
|
||||
if (accID) {
|
||||
std::string query = fmt::format(
|
||||
SQL(
|
||||
UPDATE
|
||||
`account`
|
||||
SET `status` = {}
|
||||
WHERE
|
||||
`id` = {}
|
||||
),
|
||||
newStatus,
|
||||
accID
|
||||
);
|
||||
database.QueryDatabase(query);
|
||||
}
|
||||
}
|
||||
|
||||
@ -289,6 +289,9 @@ public:
|
||||
void DeleteBuyLines(uint32 CharID);
|
||||
void UpdateBuyLine(uint32 CharID, uint32 BuySlot, uint32 Quantity);
|
||||
|
||||
|
||||
void UpdateGMStatus(uint32 accID, int newStatus);
|
||||
|
||||
/**
|
||||
************************************************
|
||||
* Character
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user