You are viewing documentation for v1.1. Switch to current version โ†’

๐ŸŒ Object Variable Networking

Short Description

Root network stacks coordinate channel subscriptions and access control for Object Variable replication.

Long Description

Object Variables can opt into networking and route through a root network stack to enforce channel-based access. The root network stack tracks subscribed controllers, validates access policy, and helps AutoReplication determine who should receive property updates.

๐Ÿš€ Features

  • Channel-based subscription lists for controllers.
  • Access policy checks per variable and per property.
  • Helper APIs for subscribing and unsubscribing at runtime.

๐Ÿ“š Usage Examples

UGorgeousRootNetworkStackSubsystem* Stack = UGorgeousRootNetworkStackSubsystem::Get(World);
Stack->SubscribeControllerToChannel(PlayerController, TEXT("Inventory"));

Use Subscribe Controller To Channel to opt a player into a replicated data stream.

SubscribeControllerToChannel

Adds a controller to a channel subscription so it can receive Object Variable payloads routed through that channel.

Parameter Name Type Description
Controller AController* Controller to subscribe.
ChannelName FName Channel identifier to subscribe to.
Stack->SubscribeControllerToChannel(Controller, TEXT("Gameplay"));

IsControllerSubscribedToChannel

Checks whether the controller is currently subscribed to the specified channel.

Parameter Name Type Description
Controller AController* Controller to query.
ChannelName FName Channel identifier.
if (Stack->IsControllerSubscribedToChannel(Controller, TEXT("Gameplay")))
{
    // safe to send data
}

Best Practices

  • Keep channel names consistent with your AutoReplication stream config.
  • Use access policies to guard sensitive data, then subscribe only trusted controllers.
  • Clear subscriptions when controllers disconnect to avoid stale state.

Troubleshooting

  • If a controller does not receive updates, confirm it is subscribed to the correct channel.
  • If access checks fail, verify the Object Variable's access policy and any overrides.