![]() |
Cockatrice 2026-09-01-Development-3.1.0-beta.10
A virtual tabletop for multiplayer card games
|
CommandContainer is the client-to-server message envelope used for all client requests in the Cockatrice protocol.
Every client-initiated action is transmitted as a CommandContainer. The server never sends CommandContainer messages.
This is a protocol-level abstraction and should not be confused with the generated protobuf accessors or wire-level encoding.
A container may generate:
The cmd_id field is a client-assigned identifier used to correlate responses with requests.
Rules:
cmd_id is optional but strongly recommendedcmd_id only in RESPONSE messagescmd_id The server does not enforce uniqueness of cmd_id values.
Certain command domains require additional context:
room_id game_id Context fields are ignored for command domains that do not require them.
If a required context field is missing or invalid, the server responds with RespContextError.
The following rules are enforced by the server:
Violations of these rules result in RespInvalidCommand.
CommandContainer supports the following mutually exclusive command domains:
A CommandContainer may contain multiple commands of the same domain.
Batching guarantees:
Partial failure behavior is implementation-defined and may vary by domain.
CommandContainers are dispatched by Server_ProtocolHandler::processCommandContainer().
Dispatch is performed by inspecting which command domain is populated. Only the first populated domain is considered.
Common error responses include:
RespLoginNeeded – client is not authenticatedRespInvalidCommand – malformed container or invalid domain usageRespContextError – missing or invalid room/game context