mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-01 19:56:38 +00:00
[GM Commands] Split GM Commands Into Separate Files (#1766)
* Split GM commands into their own files * Code cleanup
This commit is contained in:
Executable
+40
@@ -0,0 +1,40 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_repop(Client *c, const Seperator *sep)
|
||||
{
|
||||
int timearg = 1;
|
||||
int delay = 0;
|
||||
|
||||
if (sep->arg[1] && strcasecmp(sep->arg[1], "force") == 0) {
|
||||
timearg++;
|
||||
|
||||
LinkedListIterator<Spawn2 *> iterator(zone->spawn2_list);
|
||||
iterator.Reset();
|
||||
while (iterator.MoreElements()) {
|
||||
std::string query = StringFormat(
|
||||
"DELETE FROM respawn_times WHERE id = %lu AND instance_id = %lu",
|
||||
(unsigned long) iterator.GetData()->GetID(),
|
||||
(unsigned long) zone->GetInstanceID()
|
||||
);
|
||||
auto results = database.QueryDatabase(query);
|
||||
iterator.Advance();
|
||||
}
|
||||
c->Message(Chat::White, "Zone depop: Force resetting spawn timers.");
|
||||
}
|
||||
|
||||
if (!sep->IsNumber(timearg)) {
|
||||
c->Message(Chat::White, "Zone depopped - repopping now.");
|
||||
|
||||
zone->Repop();
|
||||
|
||||
/* Force a spawn2 timer trigger so we don't delay actually spawning the NPC's */
|
||||
zone->spawn2_timer.Trigger();
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(Chat::White, "Zone depoped. Repop in %i seconds", atoi(sep->arg[timearg]));
|
||||
zone->Repop(atoi(sep->arg[timearg]) * 1000);
|
||||
|
||||
zone->spawn2_timer.Trigger();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user