[Commands] Cleanup #reloadtitles Command. (#2125)

* [Commands] Cleanup #reloadtitles Command.
- Cleanup messages;

* Update worldserver.cpp
This commit is contained in:
Kinglykrab 2022-05-06 20:20:42 -04:00 committed by GitHub
parent 3091a84540
commit 6beb220e93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 2 deletions

View File

@ -5,10 +5,9 @@ extern WorldServer worldserver;
void command_reloadtitles(Client *c, const Seperator *sep)
{
c->Message(Chat::White, "Attempting to reload titles globally.");
auto pack = new ServerPacket(ServerOP_ReloadTitles, 0);
worldserver.SendPacket(pack);
safe_delete(pack);
c->Message(Chat::Yellow, "Player Titles Reloaded.");
}

View File

@ -1721,6 +1721,31 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
case ServerOP_ReloadTitles:
{
if (zone) {
worldserver.SendEmoteMessage(
0,
0,
AccountStatus::GMAdmin,
Chat::Yellow,
fmt::format(
"Titles reloaded for {}{}.",
fmt::format(
"{} ({})",
zone->GetLongName(),
zone->GetZoneID()
),
(
zone->GetInstanceID() ?
fmt::format(
" (Instance ID {})",
zone->GetInstanceID()
) :
""
)
).c_str()
);
}
title_manager.LoadTitles();
break;
}