![]() |
VR-Forces Developer's Guide
|
WebLVC Client Session - Tracks state for each connected client per SISO-STD-017-2022 Section 5.3.
Thread Safety: Each client has its own mutex for independent parallel access. Lock this mutex when reading or modifying any client-specific data.
Public Member Functions | |
| bool | isSubscribed (DtWeblvc::DtMessageCategory cat) const |
| void | resetObjects (const std::vector< std::string > &uuids) |
| void | resetAllObjects () |
| void | setSubscriptions (const std::set< DtWeblvc::DtMessageCategory > &newCategories, bool newSuppressSpatial) |
| void | addLog (const std::string &message) |
| std::string | connectedAtISO8601 () const |
Static Public Member Functions | |
| static std::set < DtWeblvc::DtMessageCategory > | allCategories () |
Public Attributes | |
| tbb::mutex | mutex |
| bool | connected = false |
| std::string | clientName |
| std::string | wsUserName |
| std::string | hostname |
| std::string | sessionKey |
| double | webLVCVersion = 1.0 |
| std::chrono::system_clock::time_point | connectedAt |
| DtWeblvc::DtTimestampFormat | timestampFormat = DtWeblvc::DtTimestampFormat::HexASCII |
| double | updateFrequencyHz = 1.0 |
| bool | onChangeOnly = false |
| std::set< std::string > | knownObjects |
| std::set< std::string > | knownTacticalGraphics |
| std::map< std::string, Json::Value > | lastSentAttributes |
| std::map< std::string, Json::Value > | lastSentTGAttributes |
| std::set< std::string > | knownAggregates |
| std::map< std::string, Json::Value > | lastSentAggregateAttributes |
| std::set< std::string > | knownContactReports |
| std::map< std::string, Json::Value > | lastSentContactReportAttributes |
| std::set < DtWeblvc::DtMessageCategory > | subscribedCategories = allCategories() |
| bool | suppressSpatial = false |
| std::vector< DtWeblvc::DtLogEntry > | logEntries |
| uint64_t | messagesSent = 0 |
| uint64_t | messagesReceived = 0 |
| uint64_t | bytesSent = 0 |
| uint64_t | bytesReceived = 0 |
| std::chrono::steady_clock::time_point | statsStartTime {std::chrono::steady_clock::now()} |
| uint64_t | lastStatsSent = 0 |
| uint64_t | lastStatsReceived = 0 |
| uint64_t | lastBytesSent = 0 |
| uint64_t | lastBytesReceived = 0 |
| std::chrono::steady_clock::time_point | lastStatsTime {std::chrono::steady_clock::now()} |
|
inlinestatic |
|
inline |
Return true if the client wants to receive messages of the given category. Always true when subscribedCategories contains DtMessageCategory::Unknown (which is never normally added — all standard categories are present by default).
References subscribedCategories.
Referenced by setSubscriptions().
|
inline |
Erase the diff cache for the specified UUIDs across all object families (entities, tactical graphics, aggregates). On the next update tick the server will re-send full attribute state for each UUID as if it were new. Caller must hold this session's mutex.
References knownAggregates, knownContactReports, knownObjects, knownTacticalGraphics, lastSentAggregateAttributes, lastSentAttributes, lastSentContactReportAttributes, and lastSentTGAttributes.
|
inline |
Erase the diff cache for every tracked object across all object families. On the next update tick the server will re-send full attribute state for all objects as if they were newly discovered. Caller must hold this session's mutex.
References knownAggregates, knownContactReports, knownObjects, knownTacticalGraphics, lastSentAggregateAttributes, lastSentAttributes, lastSentContactReportAttributes, and lastSentTGAttributes.
|
inline |
Replace the subscription set. Categories that are removed have their corresponding known-object sets and attribute caches cleared so that re-subscribing triggers a full initial-state burst rather than stale deltas. newSuppressSpatial replaces the current SuppressSpatial flag; toggling it clears all four object-family caches so the next tick sends a fresh full-attribute burst.
References DtWeblvc::Aggregates, DtWeblvc::ContactReports, DtWeblvc::Entities, isSubscribed(), knownAggregates, knownContactReports, knownObjects, knownTacticalGraphics, lastSentAggregateAttributes, lastSentAttributes, lastSentContactReportAttributes, lastSentTGAttributes, subscribedCategories, suppressSpatial, and DtWeblvc::TacticalGraphics.
|
inline |
References DtWeblvc::getISO8601Timestamp(), logEntries, DtWeblvc::DtLogEntry::message, and DtWeblvc::DtLogEntry::timestamp.
Referenced by DtWebLvcSendJson().
|
inline |
References connectedAt.
|
mutable |
Referenced by DtWebLvcSendJson().
| bool DtWebLvcClientSession::connected = false |
Referenced by DtWebLvcSendJson().
| std::string DtWebLvcClientSession::clientName |
| std::string DtWebLvcClientSession::wsUserName |
| std::string DtWebLvcClientSession::hostname |
| std::string DtWebLvcClientSession::sessionKey |
| double DtWebLvcClientSession::webLVCVersion = 1.0 |
| std::chrono::system_clock::time_point DtWebLvcClientSession::connectedAt |
Referenced by connectedAtISO8601().
| DtWeblvc::DtTimestampFormat DtWebLvcClientSession::timestampFormat = DtWeblvc::DtTimestampFormat::HexASCII |
| double DtWebLvcClientSession::updateFrequencyHz = 1.0 |
| bool DtWebLvcClientSession::onChangeOnly = false |
| std::set<std::string> DtWebLvcClientSession::knownObjects |
Referenced by resetAllObjects(), resetObjects(), and setSubscriptions().
| std::set<std::string> DtWebLvcClientSession::knownTacticalGraphics |
Referenced by resetAllObjects(), resetObjects(), and setSubscriptions().
| std::map<std::string, Json::Value> DtWebLvcClientSession::lastSentAttributes |
Referenced by resetAllObjects(), resetObjects(), and setSubscriptions().
| std::map<std::string, Json::Value> DtWebLvcClientSession::lastSentTGAttributes |
Referenced by resetAllObjects(), resetObjects(), and setSubscriptions().
| std::set<std::string> DtWebLvcClientSession::knownAggregates |
Referenced by resetAllObjects(), resetObjects(), and setSubscriptions().
| std::map<std::string, Json::Value> DtWebLvcClientSession::lastSentAggregateAttributes |
Referenced by resetAllObjects(), resetObjects(), and setSubscriptions().
| std::set<std::string> DtWebLvcClientSession::knownContactReports |
Referenced by resetAllObjects(), resetObjects(), and setSubscriptions().
| std::map<std::string, Json::Value> DtWebLvcClientSession::lastSentContactReportAttributes |
Referenced by resetAllObjects(), resetObjects(), and setSubscriptions().
| std::set<DtWeblvc::DtMessageCategory> DtWebLvcClientSession::subscribedCategories = allCategories() |
Referenced by isSubscribed(), and setSubscriptions().
| bool DtWebLvcClientSession::suppressSpatial = false |
Suppress spatial/dynamic attributes across all object updates when true (set via SubscribeMessageTypes.SuppressSpatial).
Referenced by setSubscriptions().
| std::vector<DtWeblvc::DtLogEntry> DtWebLvcClientSession::logEntries |
Referenced by addLog().
| uint64_t DtWebLvcClientSession::messagesSent = 0 |
Referenced by DtWebLvcSendJson().
| uint64_t DtWebLvcClientSession::messagesReceived = 0 |
| uint64_t DtWebLvcClientSession::bytesSent = 0 |
Referenced by DtWebLvcSendJson().
| uint64_t DtWebLvcClientSession::bytesReceived = 0 |
| std::chrono::steady_clock::time_point DtWebLvcClientSession::statsStartTime {std::chrono::steady_clock::now()} |
| uint64_t DtWebLvcClientSession::lastStatsSent = 0 |
| uint64_t DtWebLvcClientSession::lastStatsReceived = 0 |
| uint64_t DtWebLvcClientSession::lastBytesSent = 0 |
| uint64_t DtWebLvcClientSession::lastBytesReceived = 0 |
| std::chrono::steady_clock::time_point DtWebLvcClientSession::lastStatsTime {std::chrono::steady_clock::now()} |