mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
Merge branch 'master' of https://github.com/EQEmu/Server
This commit is contained in:
commit
720d314bb8
@ -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:
|
||||
|
||||
@ -4252,10 +4252,15 @@ void command_corpsefix(Client *c, const Seperator *sep)
|
||||
|
||||
void command_reloadworld(Client *c, const Seperator *sep)
|
||||
{
|
||||
c->Message(Chat::White, "Reloading quest cache and repopping zones worldwide.");
|
||||
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);
|
||||
}
|
||||
|
||||
@ -548,29 +548,9 @@ int main(int argc, char** argv) {
|
||||
};
|
||||
|
||||
EQ::Timer process_timer(loop_fn);
|
||||
process_timer.Start(1000, true);
|
||||
process_timer.Start(32, 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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user