OCCN Protocol
Binary TCP protocol for game data
The OCCN (OC Communication Network) protocol is a binary TCP protocol used for real-time game data synchronization.
Note: This documentation is a work in progress. The OCCN protocol is under active development.
Overview
OCCN handles:
- Player position and rotation updates
- World state synchronization
- Voice chat audio streams
- Physics object updates
- Instance management
Connection
Connect to the OCCN endpoint provided by the game client SDK. Connection details are handled automatically by the SDK.
Packet Structure
All packets follow this structure:
+--------+--------+------------------+
| Length | OpCode | Payload |
| 2 bytes| 1 byte | Variable |
+--------+--------+------------------+
- Length: Total packet length including header (little-endian uint16)
- OpCode: Operation code identifying the packet type
- Payload: Packet-specific data
Authentication
After TCP connection, client must authenticate:
- Client sends
AUTH_REQUESTwith session token - Server responds with
AUTH_RESPONSE(success/failure) - On success, client can join instances
Common Operations
Join Instance
Request to join a game instance (world).
Player Update
Position, rotation, and animation state updates (sent frequently).
Voice Chunk
Opus-encoded audio data for voice chat.
Full Specification
The complete OCCN specification will be documented here as the protocol stabilizes.
For now, reference the octcp handler code in the repository for implementation details.