mirror of
https://github.com/SantaSpeen/BeamMP-Server.git
synced 2026-06-17 23:30:53 +00:00
fix pps dying on startup :^)
This commit is contained in:
committed by
Anonymous275
parent
c7f8b2b131
commit
c15046f8b1
+2
-2
@@ -23,10 +23,11 @@ void TPPSMonitor::operator()() {
|
|||||||
info("PPSMonitor starting");
|
info("PPSMonitor starting");
|
||||||
std::vector<std::shared_ptr<TClient>> TimedOutClients;
|
std::vector<std::shared_ptr<TClient>> TimedOutClients;
|
||||||
while (!mShutdown) {
|
while (!mShutdown) {
|
||||||
|
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||||
int C = 0, V = 0;
|
int C = 0, V = 0;
|
||||||
if (mServer.ClientCount() == 0) {
|
if (mServer.ClientCount() == 0) {
|
||||||
Application::SetPPS("-");
|
Application::SetPPS("-");
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
mServer.ForEachClient([&](std::weak_ptr<TClient> ClientPtr) -> bool {
|
mServer.ForEachClient([&](std::weak_ptr<TClient> ClientPtr) -> bool {
|
||||||
if (!ClientPtr.expired()) {
|
if (!ClientPtr.expired()) {
|
||||||
@@ -53,6 +54,5 @@ void TPPSMonitor::operator()() {
|
|||||||
Application::SetPPS(std::to_string(R));
|
Application::SetPPS(std::to_string(R));
|
||||||
}
|
}
|
||||||
mInternalPPS = 0;
|
mInternalPPS = 0;
|
||||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user