[Cleanup] Make use of AccountStatus constants wherever status is checked or used. (#1764)

* [Cleanup] Make use of AccountStatus constants wherever status is checked or used.
- Cleanup all instances of SendEmoteMessage.
- Cleanup all instances of SendEmoteMessageRaw.
- Cleanup all instances of MessageStatus.
- Convert Quest API method defaults to use constants.

* Cleanup constant names.
This commit is contained in:
Kinglykrab
2021-11-14 22:01:13 -05:00
committed by GitHub
parent 5d75b7b365
commit 293361a1f7
38 changed files with 1369 additions and 870 deletions
+41 -9
View File
@@ -4756,7 +4756,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) {
MakeSpawnUpdate(position_update);
if (gm_hide_me) {
entity_list.QueueClientsStatus(this, outapp, true, Admin(), 255);
entity_list.QueueClientsStatus(this, outapp, true, Admin(), AccountStatus::Max);
} else {
entity_list.QueueCloseClients(this, outapp, true, RuleI(Range, ClientPositionUpdates), nullptr, true);
}
@@ -6667,7 +6667,7 @@ void Client::Handle_OP_GMZoneRequest(const EQApplicationPacket *app)
GMZoneRequest_Struct* gmzr = (GMZoneRequest_Struct*)app->pBuffer;
float target_x = -1, target_y = -1, target_z = -1, target_heading;
int16 min_status = 0;
int16 min_status = AccountStatus::Player;
uint8 min_level = 0;
char target_zone[32];
uint16 zone_id = gmzr->zone_id;
@@ -7797,16 +7797,30 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app)
{
//dont care if the check fails (since we dont know the rank), just want to clear the entry.
guild_mgr.VerifyAndClearInvite(CharacterID(), gj->guildeqid, gj->response);
worldserver.SendEmoteMessage(gj->inviter, 0, 0, "%s has declined to join the guild.", this->GetName());
worldserver.SendEmoteMessage(
gj->inviter,
0,
Chat::White,
fmt::format(
"{} has declined to join the guild.",
GetCleanName()
).c_str()
);
return;
}
}
if (gj->response == 5 || gj->response == 4) {
//dont care if the check fails (since we dont know the rank), just want to clear the entry.
guild_mgr.VerifyAndClearInvite(CharacterID(), gj->guildeqid, gj->response);
worldserver.SendEmoteMessage(gj->inviter, 0, 0, "%s has declined to join the guild.", this->GetName());
worldserver.SendEmoteMessage(
gj->inviter,
0,
Chat::White,
fmt::format(
"{} has declined to join the guild.",
GetCleanName()
).c_str()
);
return;
}
@@ -7838,7 +7852,15 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app)
//we dont really care a lot about what this packet means, as long as
//it has been authorized with the guild manager
if (!guild_mgr.VerifyAndClearInvite(CharacterID(), gj->guildeqid, guildrank)) {
worldserver.SendEmoteMessage(gj->inviter, 0, 0, "%s has sent an invalid response to your invite!", GetName());
worldserver.SendEmoteMessage(
gj->inviter,
0,
Chat::White,
fmt::format(
"{} has sent an invalid response to your invite!",
GetCleanName()
).c_str()
);
Message(Chat::Red, "Invalid invite response packet!");
return;
}
@@ -10913,7 +10935,17 @@ void Client::Handle_OP_Petition(const EQApplicationPacket *app)
database.InsertPetitionToDB(pet);
petition_list.UpdateGMQueue();
petition_list.UpdateZoneListQueue();
worldserver.SendEmoteMessage(0, 0, 80, 15, "%s has made a petition. #%i", GetName(), pet->GetID());
worldserver.SendEmoteMessage(
0,
0,
AccountStatus::QuestTroupe,
Chat::Yellow,
fmt::format(
"{} has made a petition. ID: {}",
GetCleanName(),
pet->GetID()
).c_str()
);
}
return;
}
@@ -15300,7 +15332,7 @@ void Client::Handle_OP_YellForHelp(const EQApplicationPacket *app)
void Client::Handle_OP_ResetAA(const EQApplicationPacket *app)
{
if (Admin() >= 50) {
if (Admin() >= AccountStatus::Guide) {
Message(0, "Resetting AA points.");
ResetAA();
}