This commit is contained in:
Uleat 2020-01-04 01:56:45 -05:00
commit 720d314bb8
3 changed files with 13 additions and 24 deletions

View File

@ -21,6 +21,10 @@ namespace EQ
uv_run(&m_loop, UV_RUN_NOWAIT);
}
void Run() {
uv_run(&m_loop, UV_RUN_DEFAULT);
}
uv_loop_t* Handle() { return &m_loop; }
private:

View File

@ -4252,10 +4252,15 @@ void command_corpsefix(Client *c, const Seperator *sep)
void command_reloadworld(Client *c, const Seperator *sep)
{
int world_repop = atoi(sep->arg[1]);
if (world_repop == 0)
c->Message(Chat::White, "Reloading quest cache worldwide.");
else
c->Message(Chat::White, "Reloading quest cache and repopping zones worldwide.");
auto pack = new ServerPacket(ServerOP_ReloadWorld, sizeof(ReloadWorld_Struct));
ReloadWorld_Struct* RW = (ReloadWorld_Struct*) pack->pBuffer;
RW->Option = ((atoi(sep->arg[1]) == 1) ? 1 : 0);
RW->Option = world_repop;
worldserver.SendPacket(pack);
safe_delete(pack);
}

View File

@ -548,29 +548,9 @@ int main(int argc, char** argv) {
};
EQ::Timer process_timer(loop_fn);
process_timer.Start(1000, true);
while (RunLoops) {
bool previous_loaded = is_zone_loaded && numclients > 0;
EQ::EventLoop::Get().Process();
bool current_loaded = is_zone_loaded && numclients > 0;
if (previous_loaded && !current_loaded) {
process_timer.Stop();
process_timer.Start(1000, true);
}
else if (!previous_loaded && current_loaded) {
process_timer.Stop();
process_timer.Start(32, true);
}
if (current_loaded) {
Sleep(1);
}
else {
Sleep(10);
}
}
EQ::EventLoop::Get().Run();
entity_list.Clear();
entity_list.RemoveAllEncounters(); // gotta do it manually or rewrite lots of shit :P