mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 05:21:29 +00:00
command_repop converted to QueryDatabase
This commit is contained in:
parent
f1039ab0e9
commit
e2382137e6
@ -4148,25 +4148,24 @@ void command_repop(Client *c, const Seperator *sep)
|
||||
|
||||
LinkedListIterator<Spawn2*> iterator(zone->spawn2_list);
|
||||
iterator.Reset();
|
||||
while (iterator.MoreElements())
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
database.RunQuery(query, MakeAnyLenString(&query, "DELETE FROM respawn_times WHERE id=%lu"
|
||||
" AND instance_id=%lu",(unsigned long)iterator.GetData()->GetID(), (unsigned long)zone->GetInstanceID()), errbuf);
|
||||
safe_delete_array(query);
|
||||
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(0, "Zone depop: Force resetting spawn timers.");
|
||||
}
|
||||
if (sep->IsNumber(timearg)) {
|
||||
c->Message(0, "Zone depoped. Repop in %i seconds", atoi(sep->arg[timearg]));
|
||||
zone->Repop(atoi(sep->arg[timearg])*1000);
|
||||
}
|
||||
else {
|
||||
|
||||
if (!sep->IsNumber(timearg)) {
|
||||
c->Message(0, "Zone depoped. Repoping now.");
|
||||
zone->Repop();
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(0, "Zone depoped. Repop in %i seconds", atoi(sep->arg[timearg]));
|
||||
zone->Repop(atoi(sep->arg[timearg])*1000);
|
||||
}
|
||||
|
||||
void command_spawnstatus(Client *c, const Seperator *sep)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user