CtrlK
BlogDocsLog inGet started
Tessl Logo

pantheon-ai/colyseus-multiplayer

Build authoritative real-time multiplayer servers with Colyseus 0.17+. Use when implementing rooms, schema state sync, client message validation, matchmaking, authentication, reconnection handling, or server-side anti-cheat constraints. Keywords: colyseus, room lifecycle, schema, multiplayer, websocket, matchmaking, onJoin, onLeave, onDrop, allowReconnection.

Overall
score

99%

Does it follow best practices?

Validation for skill structure

Overview
Skills
Evals
Files

message-validation-and-security.mdreferences/

Message Validation and Security

Use this reference when defining room message handlers.

Validation Pattern

  1. Parse payload with schema validation (for example Zod).
  2. Enforce role or ownership constraints.
  3. Enforce gameplay constraints (cooldowns, ranges, turn order).
  4. Apply validated mutation to server state.

Handler Skeleton

room.onMessage("move", (client, payload) => {
  const parsed = moveSchema.safeParse(payload);
  if (!parsed.success) return;

  const player = room.state.players.get(client.sessionId);
  if (!player) return;

  if (!isValidDelta(player, parsed.data)) return;
  player.x = parsed.data.x;
  player.y = parsed.data.y;
});

Security Rules

  • Never trust client-derived score, inventory, or authority flags.
  • Keep anti-cheat checks on server.
  • Rate-limit spam-prone message types.

Install with Tessl CLI

npx tessl i pantheon-ai/colyseus-multiplayer@0.1.0

references

matchmaking-and-reconnection.md

message-validation-and-security.md

room-lifecycle-and-state.md

SKILL.md

tile.json