add server mspt (+procotol format)
This commit is contained in:
@@ -373,10 +373,11 @@ public:
|
||||
class ServerTpsPacket : public Packet {
|
||||
private:
|
||||
float m_TPS;
|
||||
float m_MSPT;
|
||||
std::uint64_t m_PacketSendTime; // used to calculate ping
|
||||
public:
|
||||
ServerTpsPacket() {}
|
||||
ServerTpsPacket(float tps, std::uint64_t sendTime) : m_TPS(tps), m_PacketSendTime(sendTime) {}
|
||||
ServerTpsPacket(float tps, float mspt, std::uint64_t sendTime) : m_TPS(tps), m_MSPT(mspt), m_PacketSendTime(sendTime) {}
|
||||
virtual ~ServerTpsPacket() {}
|
||||
|
||||
virtual DataBuffer Serialize(bool packetID = true) const;
|
||||
@@ -384,6 +385,7 @@ public:
|
||||
virtual void Dispatch(PacketHandler* handler) const;
|
||||
|
||||
float GetTPS() const { return m_TPS; }
|
||||
float GetMSPT() const { return m_MSPT; }
|
||||
std::uint64_t GetPacketSendTime() const { return m_PacketSendTime; }
|
||||
|
||||
virtual PacketType GetType() const { return PacketType::ServerTps; }
|
||||
|
||||
Reference in New Issue
Block a user