mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 17:51:28 +00:00
* [Commands] Cleanup #reloadworld Command. - Cleanup messages and logic. * [Commands] Cleanup #reloadworld and #repop Command. - Cleanup messages and logic. - Add #reloadworld 2 option to forcefully repop all mobs globally as well as reset quest timers and reload quests. - Remove delay argument from #repop as it isn't used for anything. * Typos.
41 lines
869 B
C++
Executable File
41 lines
869 B
C++
Executable File
#include "../client.h"
|
|
#include "../worldserver.h"
|
|
|
|
extern WorldServer worldserver;
|
|
|
|
void command_reloadworld(Client *c, const Seperator *sep)
|
|
{
|
|
uint8 global_repop = ReloadWorld::NoRepop;
|
|
|
|
if (sep->IsNumber(1)) {
|
|
global_repop = static_cast<uint8>(std::stoul(sep->arg[1]));
|
|
|
|
if (global_repop > ReloadWorld::ForceRepop) {
|
|
global_repop = ReloadWorld::ForceRepop;
|
|
}
|
|
}
|
|
|
|
c->Message(
|
|
Chat::White,
|
|
fmt::format(
|
|
"Attempting to reload quests {}worldwide.",
|
|
(
|
|
global_repop ?
|
|
(
|
|
global_repop == ReloadWorld::Repop ?
|
|
"and repop NPCs " :
|
|
"and forcefully repop NPCs "
|
|
) :
|
|
""
|
|
)
|
|
).c_str()
|
|
);
|
|
|
|
auto pack = new ServerPacket(ServerOP_ReloadWorld, sizeof(ReloadWorld_Struct));
|
|
ReloadWorld_Struct *RW = (ReloadWorld_Struct *) pack->pBuffer;
|
|
RW->global_repop = global_repop;
|
|
worldserver.SendPacket(pack);
|
|
safe_delete(pack);
|
|
}
|
|
|