The Editor crashed in a Tag duel at a turn change: field::remove_card erased list_extra past its end (memcpy off the vector) from move_to_field. Reproduced outside Unity with the four real decks: Zane's Time Fusion (810000954) picks a Fusion from the Extra Deck on his turn and Summons it "during your next Standby Phase"; by then the partners have swapped, the Fusion sits in tag_list_extra (still LOCATION_EXTRA, sequence into THAT list), and remove_card erased the ACTIVE Extra Deck at that sequence: Adrian's is empty, so the erase ran past the end. With a longer active list it silently dropped the wrong card. The core is upstream's here; the fork's swap order (core patch 0015) only decides which turn it lands on. - field::tag_list_holding(card*): the tag_list_main / hand / extra of the card's controller that holds it, else null (Tag duels only). - remove_card: such a card is erased from that list, the list's sequences are renumbered, STATUS_TO_HAND_WITHOUT_CONFIRM and tag_extra_p_count are kept honest; move_card never treats it as a same-location reorder, so it goes through remove_card + add_card like any other move. - Probe: tag_across_swap_suite hosts a Tag room where seat 3's "Probe Time Fusion" (a workspace script) picks its Fusion on turn 4 and seat 2, with an empty Extra Deck, reaches its Standby Phase on turn 6: the Fusion is Summoned, the duel plays on, no MSG_RETRY, and turn 8's MSG_TAG_SWAP brings seat 3 back with an empty Extra Deck. The shipped v1.4.0 engine dies in this case. - CHANGELOG v1.4.1 row; contract note on MSG_TAG_SWAP (the next swap lists one card fewer; MSG_MOVE's from-sequence counts into the waiting list). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
12 KiB
Changelog
Every change to the engine contract (contract/engine-contract.md) is one row here: the C API, the
wire protocol, the engine message stream, the setup pairs and the Lua API. A row names the date the
change first shipped in the Unity repo, the ticket, and the contract part it touched. Rows 0001-0024
are the fork patches replayed into this repo as commits (git log --oneline -- server/gframe core).
v1.4.1 — 2026-10-16
Tag: a card the waiting partner holds can be moved. No new export or capability bit: exports 335 / 856 /
850, protocol 9, capabilities 0x27FF.
| Date | Change | Ticket | Contract part |
|---|---|---|---|
| 2026-10-16 | Fix in the core's tag lists (upstream code, reached through core patch 0015's swap order): an effect that keeps a card across the tag swap and moves it later (Time Fusion: the Fusion picked from the Extra Deck at activation, Summoned at the team's next Standby Phase, when the partner's Extra Deck is the active one) moved a card of tag_list_main / tag_list_hand / tag_list_extra; remove_card erased the ACTIVE list at the card's sequence, past the end of a shorter list (an empty Extra Deck: memcpy crash in field::remove_card) or the wrong card. Such a card now leaves the list that holds it (field::tag_list_holding) and goes where the move says; the next MSG_TAG_SWAP lists one card fewer. Core. |
TICKET-415 | Engine message stream: MSG_TAG_SWAP (rules only) |
v1.4.0 — 2026-10-16
Life points per side: the setup pair ygol.side.b.lp=<n> gives seat side B its own start LP. No new
export or capability bit: exports 335 / 856 / 850, protocol 9, capabilities 0x27FF.
| Date | Change | Ticket | Contract part |
|---|---|---|---|
| 2026-10-16 | ygol.side.b.lp=<n>: seat side B (seat 1; Tag seats 2 and 3) starts at n LP, side A at slot 8; set_player_info per duel player, MSG_START (start and late-watcher snapshot) carries lp[0], lp[1] in duel player order through the first-turn swap, and the replay gets flag 0x20000000 + i32 lp[0], i32 lp[1] after opt when the two differ. Single, Match, Tag. Server. |
- | Setup pair ygol.side.b.lp; engine message stream MSG_START; replay flag 0x20000000 |
v1.3.0 — 2026-10-16
Spectators with Show all get the Tag partner cards of both teams. Same message, same payload, no new
export or capability bit: exports 335 / 856 / 850, protocol 9, capabilities 0x27FF.
| Date | Change | Ticket | Contract part |
|---|---|---|---|
| 2026-10-16 | STOC_TAG_PARTNER_CARDS 0x5F also goes to every observer, both sides, when spectators see all (no ygol.room.spectatorview=hidden): after start_duel, after every MSG_TAG_SWAP, and both sides in an observer's field resync and the late-watcher snapshot. Hidden rooms and seated duelists unchanged. Server. |
TICKET-412 | Wire: STOC 0x5F recipients; join snapshot |
v1.2.0 — 2026-10-15
Tag partner cards: the waiting teammate's hand, Extra Deck and deck reach that team's two seats. One new
export (Windows 335, Linux 856, Android 850), one new message, capability 0x2000, protocol 9 (capabilities
0x27FF).
| Date | Change | Ticket | Contract part |
|---|---|---|---|
| 2026-10-15 | ygol_query_tag_cards(pduel, playerid, out): the waiting tag partner's hand, Extra Deck (bit 31 = face-up) and deck codes (sorted) of one side, read only; returns the byte length, 0 when not a tag duel. Core. |
TICKET-405 | C API: 1 export |
| 2026-10-15 | STOC_TAG_PARTNER_CARDS 0x5F = u8 side + the export's bytes, no stamp, to that side's two seats only (never the other team, never an observer): after start_duel, after every MSG_TAG_SWAP, and in a seated duelist's field resync. FEATURE_TAG_PARTNER_CARDS 0x2000 (0x800 and 0x1000 stay reserved for proposals 44 and 45), protocol 8 -> 9. Server. |
TICKET-405 | Wire: STOC 0x5F, capability bit 0x2000, protocol 9 |
| 2026-10-15 | Binding: StocMessage.TagPartnerCards, FeatureFlags.TagPartnerCards, the TagPartnerCards record + StocCodecs.TagPartnerCards, EngineApi.ygol_query_tag_cards, Capability.ProtocolVersion 9. |
TICKET-405 | (e) C# binding |
v1.1.1 — 2026-10-15
A rules fix in the core only. No contract change: same exports, protocol 8, capabilities 0x7FF.
| Date | Change | Ticket | Contract part |
|---|---|---|---|
| 2026-10-15 | Tag duel opening turns: no Battle Phase on turns 1, 2 and 3 (duelists 1A, 2A, 1B); the fourth duelist (2B) is the first who can battle, as the official Tag Duel rules say. Single duels keep turn 1 only. DUEL_ATTACK_FIRST_TURN still lifts the block. Core (field::is_opening_turn_without_bp, used by the idle command and Duel.IsAbleToEnterBP). |
- | Rules only; no contract change |
v1.1.0 — 2026-10-15
The C# binding joins the release: ygol-engine-binding.zip (YGOLegacy.Engine.dll + .pdb) beside
the five assets of v1.0.0, and engine.json names it in binding. The native libraries are
unchanged in content (same exports, protocol 8, capabilities 0x7FF); only ygol_engine_version()
answers the new tag.
| Date | Change | Ticket | Contract part |
|---|---|---|---|
| 2026-10-15 | binding/YGOLegacy.Engine (netstandard2.1) carries the wire protocol, namespaces YGOLegacy.Protocol.* unchanged, with its NUnit fixtures; the windows job builds and tests it and ships ygol-engine-binding.zip; engine.json gains binding. |
TICKET-397 | (e) C# binding: new |
| 2026-10-15 | Namespace YGOLegacy.Engine: EngineApi (all 45 exports of contract/ocgapi.h, one typed extern each, header parity test), MessageScan (the message-layout scanner, moved from the Unity bot host), GameMessage (one enum from the 84 MSG_* defines, header parity test), EngineBinding (Version, CheckNative()); contract section (e) written. |
TICKET-398 | (e) C# binding: the four types; engine.json: binding documented |
v1.0.0 — 2026-10-15
The first release: one library per platform behind the written contract, built and gated in this
repo's CI, fetched by version. Windows ygol-engine.dll (334 exports), Linux x64
libygol-engine.so (855) + the ygoserver executable, Android arm64 libygol-engine.so (849).
| Date | Change | Ticket | Contract part |
|---|---|---|---|
| 2026-10-14 | ygol_engine_version(): returns the version string the build was given (build/windows.ps1 -Version), local when none. Windows export gate 333 -> 334. |
TICKET-388 | C API: 1 export |
| 2026-10-15 | Linux x64 and Android arm64 builds in Docker with the same gates; #include <algorithm> in netserver.cpp for GCC. |
TICKET-389 | Builds only; no contract change |
| 2026-10-15 | Release workflow: a v* tag builds every platform, gates each, and publishes one release with engine.json. |
TICKET-390 | Builds only; no contract change |
Replayed fork patches (before the first tag)
| Patch | Date | Change | Ticket | Contract part |
|---|---|---|---|---|
| 0001 | 2026-08-24 | Face-down Tokens opt in by setcode 0xFDF (SETCODE_FACEDOWN_TOKEN); a Token without it behaves as stock. Core. |
- | Rules only; no contract change |
| 0002 | 2026-08-24 | Tag duel: teammates share one visible hand. Server. | - | Rules only; no contract change |
| 0003 | 2026-08-26 | YGOPRO_MAX_EXTRA 15 -> 99: the server no longer truncates the extra deck while receiving it. Server. |
TICKET-059 | Deck limits (wire: CTOS_UPDATE_DECK accepts 99 extra) |
| 0004 | 2026-08-31 | core.attacker null guards in the battle command so a damage step resumed after its battle ended does not crash. Core. |
- | Rules only; no contract change |
| 0005 | 2026-09-23 | The server keeps listening after the duel starts; a late observer gets STOC_DUEL_START and a field resync. Server. |
TICKET-152 | Wire (join during a duel) |
| 0006 | 2026-09-24 | Capability / Appearance / Dialogue as real messages 0x40-0x42, sender stamped by the server, appearance replayed in the join snapshot. Server. |
TICKET-170 | Wire: CTOS/STOC 0x40-0x42, capability bits 0x1, 0x2, protocol 1 |
| 0008 | 2026-09-26 | Sandbox god mode: ygol_sb_add, ygol_sb_move, ygol_sb_remove, ygol_sb_set_position, ygol_sb_set_lp, ygol_sb_reask. Core. |
- | C API: 6 exports |
| 0009 | 2026-10-03 | Setup pairs: ygol.<key>=<value> tokens after slot 11 of the host string go into the duel registry before special.lua, into the replay (flag 0x40000000) and to every joiner as STOC 0x43; argv sized from the token count. Server. |
TICKET-258 | Wire: STOC 0x43, capability bit 0x4; setup pairs; replay |
| 0011 | 2026-10-06 | Host seats: the host plans every seat Open / Cpu (0x50), a bot claims its Cpu seat with a token before JoinGame (0x51), host swap 0x52 and move 0x53. Server. |
TICKET-285 | Wire: CTOS 0x50-0x53, STOC 0x50, capability bit 0x8, protocol 2 |
| 0012 | 2026-10-06 | Rules restart: Prepare / Ack / Commit barrier (0x54-0x56), seat resume 0x57, a replacement server opened by the bootstrap secret (0x58), Reserved seats with tokens and a deadline; ygol.room.watchers=0 refuses observers. Server. |
TICKET-286 | Wire: CTOS/STOC 0x54-0x58, capability bit 0x10; setup pair ygol.room.watchers |
| 0013 | 2026-10-06 | Seat state 0x59 (4 bytes): what a seated duelist is doing; stored per seat, replayed in the join snapshot, cleared on leave / move / start. Server. |
- | Wire: CTOS/STOC 0x59, capability bit 0x20, protocol 3 |
| 0014 | 2026-10-06 | Lobby after match: a match end returns the server to the lobby on the same connections; STOC_MATCH_OVER 0x5A after the stock DUEL_END. Server. |
TICKET-299 | Wire: STOC 0x5A, capability bit 0x40, protocol 4 |
| 0015 | 2026-10-08 | Tag: no tag swap on a team's first turn, so the first seat holds the hand from turn 1. Core. | - | Engine message stream: the first MSG_TAG_SWAP comes later (rules only) |
| 0016 | 2026-10-08 | Tag: team B loads seat 2 as the main deck and seat 3 as the tag deck; the prompt owner starts at seat 2. Server. | - | Rules only; no contract change |
| 0017 | 2026-10-09 | Coin toss: no STOC_SELECT_HAND; on START the server rolls, sends STOC_COIN_TOSS 0x5B to everyone, SELECT_TP to the chooser, and answers FIRST for them after 10 s. Server. |
TICKET-328 | Wire: STOC 0x5B, capability bit 0x80, protocol 5; STOC_SELECT_HAND never sent |
| 0018 | 2026-10-10 | Spectators see all: every observer gets the unmasked stream unless the setup pair ygol.room.spectatorview=hidden is present. Server. |
TICKET-326 | Setup pair ygol.room.spectatorview; observer stream |
| 0019 | 2026-10-10 | Deck lists STOC_DECK_LIST 0x5C: kind 0 sorted to the owner, kinds 1 (real order) and 2 (submitted main deck) to observers when spectators see all. Server. |
TICKET-338 | Wire: STOC 0x5C, capability bit 0x100, protocol 6 |
| 0020 | 2026-10-11 | Profile 0x5D (98 bytes): a seated human's avatar id and frame id, stored per seat, in the join snapshot, swapped with the seat. Server. |
TICKET-360 | Wire: CTOS/STOC 0x5D, capability bit 0x200, protocol 7 |
| 0021 | 2026-10-12 | Fix for 0012: START stops the lobby clock so a reservation window still open after a rules restart no longer ends the duel at once. Server. | - | No contract change |
| 0022 | 2026-10-13 | ygol_preview_attack: a read-only dry run of the damage step for one attacker and one target, 24-byte answer. Core. |
TICKET-374 | C API: 1 export |
| 0023 | 2026-10-13 | Attack preview over the wire: CTOS/STOC 0x5E, answered to the asker alone from the host's embedded core. Server. |
TICKET-378 | Wire: CTOS/STOC 0x5E, capability bit 0x400, protocol 8 |
| 0024 | 2026-10-13 | ygol_preview_attack asks field::get_attack_target first; a pair the battle menu would not offer answers flag bit 5 illegal alone. Core. |
TICKET-379 | C API: same export, flag bit 5 defined |