mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-19 22:50:19 +00:00
rework UDP recv loop, add packet statistics tracking
The UDPServerMain was badly designed and had multiple potential bugs and unexpected & silent failures. The changes simplify the code here, and tracks those unexpected failures in app-wide statistics. Also added, while at that, some more tracking of how many packets and bytes are sent & received per client
This commit is contained in:
@@ -148,6 +148,14 @@ public:
|
||||
|
||||
static std::string SettingToString(const SettingValue& Value);
|
||||
|
||||
// Keeps track of how many packets we dropped on UDP due to fundamentally being malformed
|
||||
static inline std::atomic_size_t MalformedUdpPackets { 0 };
|
||||
// Keeps track of how many packets we dropped on UDP due to
|
||||
// 1) not having a valid (known) player id
|
||||
// 2) player disconnecting
|
||||
// 3) packet failing to parse
|
||||
static inline std::atomic_size_t InvalidUdpPackets { 0 };
|
||||
|
||||
private:
|
||||
static void SetShutdown(bool Val);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user