Bomberman Multiplayer
Authoritative multiplayer networking layer for Bomberman.
Loading...
Searching...
No Matches
bomberman::net::ClientDiagnostics Class Reference

Client-side multiplayer diagnostics recorder owned by NetClient. More...

#include <ClientDiagnostics.h>

Public Member Functions

 ClientDiagnostics (bool enabled=true)
 Constructs a recorder with diagnostics enabled or disabled by default.
 
void beginSession (std::string_view ownerTag, bool enabled, bool predictionEnabled, bool remoteSmoothingEnabled)
 Starts a fresh diagnostics session and captures static client/session configuration.
 
void endSession ()
 Finalizes the active diagnostics session and stamps its end time.
 
void recordWelcome (uint8_t assignedPlayerId, uint16_t serverTickRate, uint64_t handshakeDurationMs, uint32_t transportPeerId)
 Records handshake success details from the authoritative Welcome message.
 
void recordFinalState (EConnectState finalState, uint64_t connectedDurationMs)
 Records the final connection state and how long the session stayed connected.
 
void recordPacketSent (EMsgType type, uint8_t channelId, std::size_t bytes, NetPacketResult result=NetPacketResult::Ok)
 Records one outgoing packet attempt, including failures if the send was rejected.
 
void recordPacketRecv (EMsgType type, uint8_t channelId, std::size_t bytes, NetPacketResult result=NetPacketResult::Ok)
 Records one incoming packet observation, including malformed or rejected packets.
 
void recordMalformedPacket (uint8_t channelId, std::size_t bytes, std::string_view note={})
 Records one malformed inbound packet incident.
 
void recordPeerLifecycle (NetPeerLifecycleType type, std::optional< uint8_t > playerId, uint32_t transportPeerId, std::string_view note={})
 Records one peer/session lifecycle event such as connect, accept, reject, or disconnect.
 
void sampleTransport (uint32_t rttMs, uint32_t rttVarianceMs, uint32_t lossPermille)
 Samples live transport quality from ENet state.
 
void sampleInputSendGap (uint32_t gapMs)
 Tracks the longest gap between local input sends.
 
void sampleLobbySilence (uint32_t lobbySilenceMs)
 Tracks lobby-message silence while the client is waiting in lobby flow.
 
void sampleGameplaySilence (uint32_t gameplaySilenceMs)
 Tracks gameplay-message silence while the client is in-match.
 
void recordStaleSnapshotIgnored (uint32_t serverTick)
 Records one stale snapshot rejected by the client.
 
void recordStaleCorrectionIgnored (uint32_t serverTick, uint32_t lastProcessedInputSeq)
 Records one stale correction rejected by the client.
 
void recordBrokenGameplayEventStream (uint32_t matchId)
 Records a broken authoritative gameplay-event stream for the active match.
 
void samplePendingGameplayEventDepth (std::size_t depth)
 Tracks the deepest queued reliable gameplay-event backlog seen so far.
 
void feedPredictionStats (const PredictionStats &stats, bool reachedActive, bool everRecovered)
 Merges the latest prediction helper stats into the session summary.
 
void recordEvent (const NetEvent &event)
 Records one recent high-level diagnostics event in the bounded event buffer.
 
const ClientSessionSummary & summary () const
 Returns the current aggregate session summary.
 
const ClientSessionConfig & config () const
 Returns the static configuration captured for the current or last session.
 
nlohmann::json toJson () const
 Serializes the current diagnostics session to JSON.
 
bool writeJsonReport (std::string_view filePath) const
 Writes the current diagnostics session as a JSON report file.
 

Detailed Description

Client-side multiplayer diagnostics recorder owned by NetClient.


The documentation for this class was generated from the following files: