MAke server respond to WS events even if running behind

This commit is contained in:
tovjemam 2026-03-01 18:20:29 +01:00
parent a7d8fd1845
commit 52766c3715

View File

@ -32,12 +32,11 @@ void sv::Server::Run()
bool exit = false; bool exit = false;
while (!exit) while (!exit)
{ {
PollWSEvents();
auto t_now = std::chrono::steady_clock::now(); auto t_now = std::chrono::steady_clock::now();
while (t_now > t_next && !exit_) while (t_now > t_next && !exit_)
{ {
time_ += 40; time_ += 40;
PollWSEvents();
Update(); Update();
// std::cout << "Time: " << time_ << " ms, Clients: " << clients_.size() << std::endl; // std::cout << "Time: " << time_ << " ms, Clients: " << clients_.size() << std::endl;
t_next += 40ms; t_next += 40ms;