Skip to content

Commit 8c5b2e2

Browse files
author
rain
committed
docs: clarify Unreal connection ticking
1 parent b955d39 commit 8c5b2e2

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

docs/docs/00200-core-concepts/00600-clients/00800-unreal-reference.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ A connection to a remote database is represented by the `UDbConnection` class. T
5858
| Name | Description |
5959
| ---------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
6060
| [Connect to a database](#connect-to-a-database) | Construct a UDbConnection instance. |
61-
| [Advance the connection](#advance-the-connection-and-process-messages) | The connection processes messages automatically via WebSocket callbacks. |
61+
| [Advance the connection](#advance-the-connection-and-process-messages) | Process queued messages by ticking the connection. |
6262
| [Access tables and reducers](#access-tables-and-reducers) | Access the client cache, request reducer invocations, and register callbacks. |
6363

6464
### Connect to a database
@@ -186,7 +186,29 @@ Finalize configuration and open the connection. This creates a WebSocket connect
186186
187187
### Advance the connection and process messages
188188
189-
The Unreal SDK processes messages automatically via WebSocket callbacks and with UDbConnection which ultimately inherits from FTickableGameObject. No manual polling or advancement is required. Events are dispatched through the registered delegates.
189+
The Unreal SDK queues incoming messages and dispatches callbacks when the connection is ticked. If the connection is never ticked, subscription updates and reducer callbacks will not be applied to your client cache.
190+
191+
You can tick the connection manually from an actor's `Tick` method:
192+
193+
```cpp
194+
void AGameManager::Tick(float DeltaTime)
195+
{
196+
Super::Tick(DeltaTime);
197+
198+
if (Conn && Conn->IsActive())
199+
{
200+
Conn->FrameTick();
201+
}
202+
}
203+
```
204+
205+
Or enable automatic ticking once after the connection is created:
206+
207+
```cpp
208+
Conn->SetAutoTicking(true);
209+
```
210+
211+
Both approaches process queued messages on the game thread and dispatch events through the delegates registered on the connection.
190212
191213
### Access tables and reducers
192214

0 commit comments

Comments
 (0)