Protocol client
Frames CTOS packets, parses STOC traffic, and follows room, ready, duel, side, catchup, and rematch flows.
Python · Old YGOPro protocol · Stage 2
A bot client that turns raw duel traffic into decisions.
Connect to compatible YGOPro servers as a normal player, parse legal actions, and route every choice through one shared model for bots, LLMs, and humans.
{
"source": "MSG_SELECT_CARD",
"state": "GameState@42",
"legal_actions": [
{ "id": 0, "card": "..." },
{ "id": 1, "card": "..." }
],
"adapter": "llm | human"
}01 / Capabilities
YGOAccess owns the network and state boundary, then exposes decisions without duplicating duel truth.
Frames CTOS packets, parses STOC traffic, and follows room, ready, duel, side, catchup, and rematch flows.
Normalizes core messages into GameState and structured legal Action choices instead of leaking packet details upward.
Projects the same decision requests into CLI and web interfaces for inspection, testing, and direct play.
Provides a shared decision boundary for deterministic fallback, review flows, and knowledge-backed LLM policies.
Captures replay, state, request, and response evidence to make protocol behavior auditable.
Associates deck-specific context with model policies while keeping legality controlled by the duel server.
02 / Architecture
Each layer has one job. GameState remains the only duel-state truth; adapters project it for different operators.
Old-protocol server traffic
→Framing, decoding, legal actions
→Canonical duel state
→Normalized decision requests
→Policy and interface adapters
!Adapters project state. They never maintain a second version of the duel.
03 / Project status
The protocol foundation works across a broad set of flows. The current focus is tightening parity and completing the shared decision layer.
YGOAccess does not implement card rules locally. The connected server and ocgcore decide legality.
04 / Quick start
Requires Python 3.11 or newer. Connect it to an existing compatible server and provide a YDK deck.
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -e .[dev]python run_bot.py --config duelbot.toml