VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions
DtTacticalGraphicUpdateSender Class Reference

DtTacticalGraphicUpdateSender - Encapsulates all tactical-graphic-specific WebLVC message building and sending logic.

This class is stateless with respect to individual clients. All per-client state lives in DtWebLvcClientSession and is passed by reference. The class may be instantiated once on the controller and reused for every connection.

Thread safety: methods are re-entrant as long as callers pass distinct session references. Callers are responsible for session locking as described per method.

Public Member Functions

void sendInitialState (const oatpp::websocket::WebSocket &conn, DtWebLvcClientSession &session, DtTacticalGraphicProcessor &processor)
 
void sendPeriodicUpdates (const oatpp::websocket::WebSocket &conn, DtWebLvcClientSession &session, DtTacticalGraphicProcessor &processor)
 

Private Member Functions

void sendObjectsDeleted (const oatpp::websocket::WebSocket &conn, DtWebLvcClientSession &session, const std::vector< std::string > &objectNames)
 
Json::Value buildUpdateMultipleMessage (DtWebLvcClientSession &session, std::vector< DtChangedItem< DtDatasource::DtTacticalGraphicSnapshot >> &items)
 
bool matchesSubscription (const DtDatasource::DtTacticalGraphicSnapshot &snapshot, const DtWebLvcClientSession &session)
 
DtDatasource::DtTacticalGraphicSnapshot applyRoleModifications (const DtDatasource::DtTacticalGraphicSnapshot &snapshot, const DtWebLvcClientSession &session)
 

Member Function Documentation

void DtTacticalGraphicUpdateSender::sendInitialState ( const oatpp::websocket::WebSocket &  conn,
DtWebLvcClientSession &  session,
DtTacticalGraphicProcessor &  processor 
)

Send initial state of all tactical graphics to a newly connected client. Builds and sends a single TacticalGraphicAttributeUpdateMultiple message. Caller must NOT hold session->mutex.

void DtTacticalGraphicUpdateSender::sendPeriodicUpdates ( const oatpp::websocket::WebSocket &  conn,
DtWebLvcClientSession &  session,
DtTacticalGraphicProcessor &  processor 
)

Query all tactical graphics from the processor, detect changes against the session cache, send a batch TacticalGraphicAttributeUpdateMultiple for changed graphics, and send ObjectDeleted for any that have disappeared. Caller must NOT hold session->mutex.

void DtTacticalGraphicUpdateSender::sendObjectsDeleted ( const oatpp::websocket::WebSocket &  conn,
DtWebLvcClientSession &  session,
const std::vector< std::string > &  objectNames 
)
private

Send an ObjectDeletedMultiple message for a set of tactical graphics that have disappeared. Clears each object's cache entry and stats. Caller must NOT hold session.mutex.

Json::Value DtTacticalGraphicUpdateSender::buildUpdateMultipleMessage ( DtWebLvcClientSession &  session,
std::vector< DtChangedItem< DtDatasource::DtTacticalGraphicSnapshot >> &  items 
)
private

Build a TacticalGraphicAttributeUpdateMultiple message from a list of snapshots. Updates session.lastSentTGAttributes for each snapshot included. Caller must hold session.mutex.

bool DtTacticalGraphicUpdateSender::matchesSubscription ( const DtDatasource::DtTacticalGraphicSnapshot &  snapshot,
const DtWebLvcClientSession &  session 
)
private

Return true if snapshot should be sent to this client.

DtDatasource::DtTacticalGraphicSnapshot DtTacticalGraphicUpdateSender::applyRoleModifications ( const DtDatasource::DtTacticalGraphicSnapshot &  snapshot,
const DtWebLvcClientSession &  session 
)
private

Return a copy of snapshot with role-based field modifications applied (e.g. availableCommands cleared when the graphic is not editable by the session's roles). Pass-through for non-Player sessions.


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

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)