[Process Management] Change all executables to use the default event loop run (#2471)

* Loginserver change to event loop run.

* eqlaunch, loginserver, queryserv, world
This commit is contained in:
Alex
2022-10-10 20:55:39 -07:00
committed by GitHub
parent 832bffa811
commit 77c3841a49
4 changed files with 56 additions and 22 deletions
+14 -5
View File
@@ -371,8 +371,14 @@ int main(int argc, char **argv)
}
);
while (RunLoops) {
auto loop_fn = [&](EQ::Timer* t) {
Timer::SetCurrentTime();
if (!RunLoops) {
EQ::EventLoop::Get().Shutdown();
return;
}
eqs = nullptr;
//give the stream identifier a chance to do its work....
@@ -381,7 +387,7 @@ int main(int argc, char **argv)
//check the stream identifier for any now-identified streams
while ((eqsi = stream_identifier.PopIdentified())) {
//now that we know what patch they are running, start up their client object
struct in_addr in{};
struct in_addr in {};
in.s_addr = eqsi->GetRemoteIP();
if (RuleB(World, UseBannedIPsTable)) { //Lieka: Check to see if we have the responsibility for blocking IPs.
LogInfo("Checking inbound connection [{}] against BannedIPs table", inet_ntoa(in));
@@ -447,10 +453,13 @@ int main(int argc, char **argv)
);
UpdateWindowTitle(window_title);
}
};
EQ::Timer process_timer(loop_fn);
process_timer.Start(32, true);
EQ::EventLoop::Get().Run();
EQ::EventLoop::Get().Process();
Sleep(5);
}
LogInfo("World main loop completed");
LogInfo("Shutting down zone connections (if any)");
zoneserver_list.KillAll();