mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-14 19:51:29 +00:00
[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:
parent
832bffa811
commit
77c3841a49
@ -105,11 +105,17 @@ int main(int argc, char *argv[]) {
|
|||||||
Log(Logs::Detail, Logs::Launcher, "Starting main loop...");
|
Log(Logs::Detail, Logs::Launcher, "Starting main loop...");
|
||||||
|
|
||||||
ProcLauncher *launch = ProcLauncher::get();
|
ProcLauncher *launch = ProcLauncher::get();
|
||||||
|
|
||||||
RunLoops = true;
|
RunLoops = true;
|
||||||
while(RunLoops) {
|
auto loop_fn = [&](EQ::Timer* t) {
|
||||||
//Advance the timer to our current point in time
|
//Advance the timer to our current point in time
|
||||||
Timer::SetCurrentTime();
|
Timer::SetCurrentTime();
|
||||||
|
|
||||||
|
if (!RunLoops) {
|
||||||
|
EQ::EventLoop::Get().Shutdown();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Let the process manager look for dead children
|
* Let the process manager look for dead children
|
||||||
*/
|
*/
|
||||||
@ -139,10 +145,12 @@ int main(int argc, char *argv[]) {
|
|||||||
delete zone->second;
|
delete zone->second;
|
||||||
zones.erase(rem);
|
zones.erase(rem);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
EQ::EventLoop::Get().Process();
|
EQ::Timer process_timer(loop_fn);
|
||||||
Sleep(5);
|
process_timer.Start(32, true);
|
||||||
}
|
|
||||||
|
EQ::EventLoop::Get().Run();
|
||||||
|
|
||||||
//try to be semi-nice about this... without waiting too long
|
//try to be semi-nice about this... without waiting too long
|
||||||
zone = zones.begin();
|
zone = zones.begin();
|
||||||
|
|||||||
@ -289,14 +289,22 @@ int main(int argc, char **argv)
|
|||||||
LogInfo("[Config] [Security] IsPasswordLoginAllowed [{0}]", server.options.IsPasswordLoginAllowed());
|
LogInfo("[Config] [Security] IsPasswordLoginAllowed [{0}]", server.options.IsPasswordLoginAllowed());
|
||||||
LogInfo("[Config] [Security] IsUpdatingInsecurePasswords [{0}]", server.options.IsUpdatingInsecurePasswords());
|
LogInfo("[Config] [Security] IsUpdatingInsecurePasswords [{0}]", server.options.IsUpdatingInsecurePasswords());
|
||||||
|
|
||||||
while (run_server) {
|
auto loop_fn = [&](EQ::Timer* t) {
|
||||||
Timer::SetCurrentTime();
|
Timer::SetCurrentTime();
|
||||||
server.client_manager->Process();
|
|
||||||
EQ::EventLoop::Get().Process();
|
|
||||||
|
|
||||||
Sleep(5);
|
if (!run_server) {
|
||||||
|
EQ::EventLoop::Get().Shutdown();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
server.client_manager->Process();
|
||||||
|
};
|
||||||
|
|
||||||
|
EQ::Timer process_timer(loop_fn);
|
||||||
|
process_timer.Start(32, true);
|
||||||
|
|
||||||
|
EQ::EventLoop::Get().Run();
|
||||||
|
|
||||||
LogInfo("Server Shutdown");
|
LogInfo("Server Shutdown");
|
||||||
|
|
||||||
LogInfo("Client Manager Shutdown");
|
LogInfo("Client Manager Shutdown");
|
||||||
|
|||||||
@ -104,15 +104,24 @@ int main()
|
|||||||
/* Load Looking For Guild Manager */
|
/* Load Looking For Guild Manager */
|
||||||
lfguildmanager.LoadDatabase();
|
lfguildmanager.LoadDatabase();
|
||||||
|
|
||||||
while (RunLoops) {
|
auto loop_fn = [&](EQ::Timer* t) {
|
||||||
Timer::SetCurrentTime();
|
Timer::SetCurrentTime();
|
||||||
|
|
||||||
|
if (!RunLoops) {
|
||||||
|
EQ::EventLoop::Get().Shutdown();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (LFGuildExpireTimer.Check()) {
|
if (LFGuildExpireTimer.Check()) {
|
||||||
lfguildmanager.ExpireEntries();
|
lfguildmanager.ExpireEntries();
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
EQ::Timer process_timer(loop_fn);
|
||||||
|
process_timer.Start(32, true);
|
||||||
|
|
||||||
|
EQ::EventLoop::Get().Run();
|
||||||
|
|
||||||
EQ::EventLoop::Get().Process();
|
|
||||||
Sleep(5);
|
|
||||||
}
|
|
||||||
LogSys.CloseFileLogs();
|
LogSys.CloseFileLogs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -371,8 +371,14 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
while (RunLoops) {
|
auto loop_fn = [&](EQ::Timer* t) {
|
||||||
Timer::SetCurrentTime();
|
Timer::SetCurrentTime();
|
||||||
|
|
||||||
|
if (!RunLoops) {
|
||||||
|
EQ::EventLoop::Get().Shutdown();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
eqs = nullptr;
|
eqs = nullptr;
|
||||||
|
|
||||||
//give the stream identifier a chance to do its work....
|
//give the stream identifier a chance to do its work....
|
||||||
@ -447,10 +453,13 @@ int main(int argc, char **argv)
|
|||||||
);
|
);
|
||||||
UpdateWindowTitle(window_title);
|
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("World main loop completed");
|
||||||
LogInfo("Shutting down zone connections (if any)");
|
LogInfo("Shutting down zone connections (if any)");
|
||||||
zoneserver_list.KillAll();
|
zoneserver_list.KillAll();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user