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
DtContactReportUpdateSender Class Reference

DtContactReportUpdateSender - Encapsulates all contact-report-specific WebLVC message building and sending logic.

Unlike entity/aggregate/TG senders, this class does not accept a processor parameter. Contact report data is sourced from the global role-based spot-report perspective system via DtVrfManager::contactReportsForRoles().

Only Player sessions with at least one assigned role that has a configured contact-report perspective will receive messages. All other sessions (anonymous, Observer, roles without a perspective) receive nothing.

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)
 
void sendPeriodicUpdates (const oatpp::websocket::WebSocket &conn, DtWebLvcClientSession &session)
 

Private Member Functions

Json::Value buildUpdateMultipleMessage (DtWebLvcClientSession &session, std::vector< DtChangedItem< DtDatasource::DtContactReportSnapshot >> &items)
 
void sendObjectsDeleted (const oatpp::websocket::WebSocket &conn, DtWebLvcClientSession &session, const std::vector< std::string > &uuids)
 
bool hasPlayerRoles (const DtWebLvcClientSession &session, std::vector< std::string > &outRoles) const
 

Member Function Documentation

void DtContactReportUpdateSender::sendInitialState ( const oatpp::websocket::WebSocket &  conn,
DtWebLvcClientSession &  session 
)

Send initial state of all contact reports visible to the session's roles. Builds and sends a single ContactReportAttributeUpdateMultiple message. Does nothing for sessions without Player roles. Caller must NOT hold session->mutex.

void DtContactReportUpdateSender::sendPeriodicUpdates ( const oatpp::websocket::WebSocket &  conn,
DtWebLvcClientSession &  session 
)

Query all contact reports visible to the session's roles, detect changes against the session cache, send a batch ContactReportAttributeUpdateMultiple for changed reports, and send ObjectDeletedMultiple for any that have disappeared. Does nothing for sessions without Player roles (also sends deletions if roles were removed mid-session). Caller must NOT hold session->mutex.

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

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

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

Send an ObjectDeletedMultiple message for contact reports that have disappeared. Clears each report's cache entry. Caller must NOT hold session.mutex.

bool DtContactReportUpdateSender::hasPlayerRoles ( const DtWebLvcClientSession &  session,
std::vector< std::string > &  outRoles 
) const
private

If the session is a Player session with assigned roles, populate outRoles and return true. Returns false for anonymous sessions, non-Player sessions, or sessions with no assigned roles.


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)