Network Types
This page documents the core enumerations, structs, and configuration types used throughout the networking plugin.
plNetworkRoleEnum
Defines the role of the local machine in the network session.
Value | Description |
|---|---|
| No role assigned yet |
| Dedicated server (no local player) |
| Connected to a remote server |
| Server and client combined (listen server) |
| Alias for Host |
plNetworkModeEnum
High-level network mode.
Value | Description |
|---|---|
| No networking active |
| Running as a client |
| Running as a server |
plNetworkChannelTypeEnum
Controls the delivery guarantee for a message or component replication.
Value | Description |
|---|---|
| Invalid channel |
| Message may be lost or arrive out of order |
| Message may be lost but will arrive in order |
| Message will always be received but may be out of order |
| Message will always be received and will be in order |
Guidance: Use Unreliable for frequent state updates (transforms, positions) where only the latest value matters. Use ReliableOrdered for important events (RPCs, spawn/despawn, game state changes).
plNetworkObjectRole
Defines the authority model for a networked object.
Value | Description |
|---|---|
| Not a networked object |
| The owning client has full authority over this object |
| The server has authority; clients receive read-only state |
| Server-authoritative with client-side prediction |
plNetworkConnectionState
The connection lifecycle state.
Value | Description |
|---|---|
| Not connected |
| Connection attempt in progress |
| Successfully connected |
| Disconnect in progress |
| Connection terminated |
plNetworkDisconnectReason
Reason codes for disconnection, used with Stop() and KickClient().
Value | Description |
|---|---|
| No specific reason |
| Client initiated graceful disconnect |
| Server is shutting down |
| Client was kicked by the server |
| Connection timed out |
| Protocol or game version mismatch |
| Authentication failure |
| Server has no available slots |
| Client exceeded rate limits |
| Client is banned |
plNetworkConfig
Configuration struct for network connections. Set this on the plNetworkWorldModule before calling StartServer(), StartClient(), or StartHost().
Property | Type | Default | Description |
|---|---|---|---|
|
|
| Network transport driver |
|
|
| Maximum number of connections |
|
|
| Server address to connect to |
|
|
| Server port |
|
|
| Maximum message size in bytes |
|
|
| Size of the internal message pool |
plNetworkMessageIDs
Defines the message ID ranges for the network protocol.
Core Protocol (0 - 63)
ID | Name | Description |
|---|---|---|
0 |
| Invalid |
1 |
| Client connection request |
2 |
| Server response to handshake |
3 |
| Component state replication |
4 |
| Partial replication (large objects) |
5 |
| Spawn a networked object |
6 |
| Partial spawn data |
7 |
| Despawn a networked object |
8 |
| Authority/ownership change |
9 |
| Remote procedure call |
10 |
| Client requests time synchronization |
11 |
| Server time sync response |
12 |
| Graceful disconnect with reason |
13 |
| Client reconnection attempt |
14 |
| Server reconnection response |
15 |
| Lag compensation rewind request |
16 |
| Server tells clients to load a level |
17 |
| Client reports level load finished |
18 |
| Server signals gameplay can begin |
Engine Component Messages (64 - 127)
Reserved for built-in engine component communication.
ID | Name | Description |
|---|---|---|
64 |
| Replicated transform state (used by |
User/Game Messages (128 - 255)
Reserved for game-specific messages. Use plNetworkMessageIDs::UserMessageStart (128) as the starting point for your custom message IDs, and register a handler via SetUserMessageCallback() on the world module.
plNetworkConnection
Represents a network connection with a unique ID:
plNetworkStats
Network statistics for a connection:
Field | Type | Description |
|---|---|---|
|
| Current round-trip time in seconds |
|
| Packets lost in the current period |
|
| Total packets sent since connection |
|
| Total packets lost since connection |
|
| Total bytes sent |
|
| Total bytes received |