VR-Engage  2.3
Loading...
Searching...
No Matches
vreMessages Library API Changes

This page covers generated message APIs and handwritten message helpers. Update custom producers and consumers together when message payloads change. Generated headers are installed under vreMessages/.

Breaking changes

Separate joystick and role control

VrfTakeControlOfMessage and VrfReleaseControlOfMessage now carry only joystick function-group control. Their roles and stationId fields were removed. The stationName field in VrfTakeControlOfMessage was also removed. Use VrfSetVreControlledMessage separately to set or clear VR-Engage role occupancy. It carries string stationId and roleName fields, a roleTypes list, and a boolean controlled flag.

For acquisition, send both the joystick request and the role-control request:

auto* joystick = VrfTakeControlOfMessage::create();
joystick->setEntityId(entityId);
joystick->setFunctionGroups(functionGroups);
DtVreMessageManager::instance().queueMessage(joystick);
auto* roleControl = VrfSetVreControlledMessage::create();
roleControl->setEntityId(entityId);
roleControl->setStationId(stationId);
roleControl->setRoleName(roleName);
roleControl->setRoleTypes(roleTypes);
roleControl->setControlled(true);
DtVreMessageManager::instance().queueMessage(roleControl);

For release, send VrfReleaseControlOfMessage and a matching role-control request with controlled set to false. These messages control joystick channels and role occupancy; they do not transfer simulation ownership. The joystick messages retain the generated headers vrfTakeControlOf.h and vrfReleaseControlOf.h. The new role-control header is vrfSetVreControlled.h.

Removed extended-state and station-status messages

The following generated messages were removed:

Removed messages Migration action
ExtendedStateMonitorInitMessage, ExtendedStateRequestMessage Read reflected entity attributes instead of requesting the old extended-state message stream
EntityStateBoolMessage, EntityStateIntMessage, EntityStateFloatMessage, EntityStateStringMessage, EntityStateAmmoClipMessage Replace message handlers with attribute callbacks on the corresponding entity state
VreStatusMessage Read App.vreStatus.local and App.vreStatus.stations

Use DtPlayerStation::ownshipState() for the current ownship. DtExtendedStateLogic now aliases extendedData and stateProperties attributes into the player attribute store. See Reflected entity attributes for the shared entity tree.

Changed generated fields

Update calls to the generated getters and setters for these field changes:

Message 2.2 field 2.3 field or action
PlayerCreatedMessage roles roleTypes; use getRoleTypes() and setRoleTypes()
VreAssignRolePlayerMessage Numeric id String stationId; use getStationId() and setStationId()
VreUnassignRolePlayerMessage Numeric id String stationId; use getStationId() and setStationId()
VrfSetEmbarkMessage station Removed; identify the destination through parentEntityId and the slot fields

VreAssignRolePlayerMessage also adds entityUuid and isReengagement. Supply the entity UUID in custom assignments. isReengagement defaults to false; use it to identify automatic reengagement after rewind or snapshot rollback.

Additions

Ownership-transfer messages

Message Use
OwnershipTransferRequestMessage Request ACQUIRE or RELEASE using an entity ID, entity UUID, and request ID
OwnershipTransferResponseMessage Receive the result and match it to the originating requestId
VreOwnershipTransferStatusMessage Observe non-terminal transfer progress without treating it as completion
OwnershipPlayerEngagedMessage, OwnershipPlayerDisengagedMessage Notify the coordinator when engagement changes so it can manage idle divest
OwnershipDivestStartedMessage Observe the start of an ownership hand-back

Custom consumers must match response request IDs and inspect the response status before continuing. Use these messages for simulation ownership, not joystick function-group control. See Ownership transfer for the manager and policy configuration.

Deployable-object view and missile messages

Message Use
OpenDroneRemoteViewMessage, CloseDroneRemoteViewMessage Open or close a drone view for an entity
SetDroneRemoteViewVisibilityMessage Show or hide the drone viewport
BlankDroneRemoteViewMessage Blank the drone view for an entity
OpenLauncherRemoteViewMessage, CloseLauncherRemoteViewMessage Open or close a launcher view for an entity
FireMissileMessage Request a launcher missile shot with an optional range ID

Added DetachFromMissileMessage. Set its entityId and missileId to identify the launcher entity and the missile to detach.

Vector state properties

VrfSetStatePropertyMessage adds PropertyType_Vector3d. Its value field remains a string; format the vector with DtVector::string():

// Excerpt from queueStatePropertyVector(); value is its const DtVector& parameter.
msg->setType(VrfSetStatePropertyMessage::PropertyType_Vector3d);
msg->setName(propertyName);
msg->setValue(value.string().c_str());

The full helper creates the message, sets its entity ID, and queues it. See vreMessages/vrfSetStateProperty.h.

Typed local messages

DtLocalMessage in vreMessages/localMessage.h carries typed values between handlers in one process. It does not support network replication. Continue to use generated messages for frontend-to-backend traffic.

Script-task location references

VrfScriptedEntityTaskMessage adds the LOCATION_REFERENCE attribute type. Call addAttribute<DtRwLocationReference>() to supply a location reference to a scripted task. VrfScriptedEntitySetMessage inherits this support. See vreMessages/vrfTaskEntityScript.h.