add server mspt (+procotol format)

This commit is contained in:
2023-01-02 15:07:34 +01:00
parent 5a547b6514
commit 512fb23d0e
7 changed files with 43 additions and 32 deletions

View File

@@ -12,6 +12,7 @@ private:
std::uint8_t m_ConnectionID;
std::string m_DisconnectReason;
float m_ServerTPS;
float m_ServerMSPT;
int m_Ping = 0;
public:
ClientConnexion();
@@ -25,6 +26,7 @@ public:
const std::string& GetDisconnectReason() const { return m_DisconnectReason; }
float GetServerTPS() const { return m_ServerTPS; }
float GetServerMSPT() const { return m_ServerMSPT; }
int GetServerPing() const { return m_Ping; }
REMOVE_COPY(ClientConnexion);

View File

@@ -22,6 +22,7 @@ typedef std::map<std::uint8_t, ServerConnexion> ConnexionMap;
class TickCounter {
private:
float m_TPS;
float m_MSPT;
std::uint64_t m_LastTPSTime;
std::uint8_t m_TickCount;
public:
@@ -46,6 +47,9 @@ public:
}
float GetTPS() const { return m_TPS; }
float GetMSPT() const { return m_MSPT; }
void SetMSPT(float mspt) { m_MSPT = mspt; }
};
class Server {