mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-01 15:26:59 +00:00
24 lines
696 B
C++
24 lines
696 B
C++
#pragma once
|
|
|
|
#include "Common.h"
|
|
#include "TServer.h"
|
|
#include <optional>
|
|
class TPPSMonitor : public IThreaded {
|
|
public:
|
|
explicit TPPSMonitor(TServer& Server);
|
|
|
|
void operator()() override;
|
|
|
|
void SetInternalPPS(int NewPPS) { mInternalPPS = NewPPS; }
|
|
void IncrementInternalPPS() { ++mInternalPPS; }
|
|
[[nodiscard]] int InternalPPS() const { return mInternalPPS; }
|
|
void SetTCPServer(TTCPServer& Server) { mTCPServer = std::ref(Server); }
|
|
|
|
private:
|
|
TTCPServer& TCPServer() { return mTCPServer->get(); }
|
|
|
|
TServer& mServer;
|
|
std::optional<std::reference_wrapper<TTCPServer>> mTCPServer { std::nullopt };
|
|
bool mShutdown { false };
|
|
int mInternalPPS { 0 };
|
|
}; |