Implementation Notes
Implementing a new server
To implement this protocol from scratch:
- Wire framing: 4-byte big-endian length prefix + 2-byte big-endian header + body.
- Type codec: Use the type table in §1. All integers are signed big-endian.
- Policy check: On first connection byte, if
0x3C(<), send Flash policy XML + close. - No auth check: Messages
4000,3110,773,2419must be handled without authentication. Mark all others as requiring an authenticated session. - Login flow: On
2419(Authenticate), validate SSO token, then send the full post-login burst (§3–§4). - Room entry: On
2312(RequestRoomLoad), stage the room for entry. Only complete entry and send heightmap/users/items when3898(RequestHeightmap) arrives. - Keepalive: Send
3928(Ping) after login. Client responds with2596(Pong). No other keepalive exchange is required. - Broadcast vs unicast: Room events (movement, chat, items) must be broadcast to all users in the room. Login events are unicast to the connecting client only.
Security notes
- RC4 is optional and disabled by default. Do not rely on it for security.
- SSO tickets are single-use tokens validated against the database. Expire them after first use to prevent replay attacks.
- Rate limiting: Arcturus applies per-message rate limits (
getRateLimit()in MessageHandler). Chat events default to 750ms min interval. Navigator search 500ms. - Max frame size: 417 792 bytes. Reject frames exceeding →this.
- Flood mute: Server tracks chat rate per user. Sends
S→C 566 FloodCounterwhen limit exceeded.