Commit Graph
25 Commits
Author SHA1 Message Date
donnyandClaude Opus 5.5 d1df1ffd67 server: no Side Deck limit, YGOPRO_MAX_SIDE 99 (TICKET-465, v1.7.3)
Release / linux (push) Successful in 2m35s
Release / windows (push) Successful in 44s
Release / android (push) Successful in 2m14s
Release / release (push) Successful in 6s
Release / attach-windows (push) Successful in 1s
LoadDeck dropped Side Deck cards past 15 while it received the deck, with no
error. The cap is 99 now, like the Extra Deck; DECKCOUNT_SIDE too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 11:31:37 -07:00
donnyandClaude Opus 5.5 d31b7b62d8 core: a Tag Field Spell takes the team's free Field slot (v1.7.2)
Release / release (push) Successful in 9s
Release / windows (push) Successful in 33s
Release / linux (push) Successful in 1m19s
Release / android (push) Successful in 59s
Release / attach-windows (push) Successful in 1s
get_fzone_landing sent a Field Spell to the playing partner's slot and
replaced the card there even when the other partner's slot was free; only
a control change took the free slot. A partner who got both of the team's
Fields back with Giant Trunade and played them one after the other lost
the first. Now a Field Spell takes the free slot whenever the playing
partner's is taken; with both taken it replaces the playing partner's.

Probe: new room "tag, two in one turn" (seq 5 then 6 on turn 1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WoiqG2TqZQmJ8tTn8tYpgy
2026-11-12 14:54:23 -07:00
donnyandClaude Opus 5.5 00ed2796f1 core: a card with a distant alias keeps its own setcodes (v1.7.1)
Release / release (push) Successful in 5s
Release / attach-windows (push) Successful in 3s
Release / linux (push) Successful in 2m4s
Release / windows (push) Successful in 54s
Release / android (push) Successful in 1m3s
A rule_code card answered is_set_card from the named card only, so a custom
card that adds an archetype its base card lacks lost it in the duel
(Vennominon 810000878 was not a "Venom" monster for Venom Fangs).
check_code_setcode adds the card's own setcodes while it bears its own
rule_code; is_set_card, is_pre_set_card and is_special_summon_set_card use it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WoiqG2TqZQmJ8tTn8tYpgy
2026-11-11 11:48:31 -07:00
donnyandClaude Opus 5.5 954fbfc65b prompt context: announce kind byte, record 23 bytes, STOC 0x44 24 bytes (TICKET-451, v1.7.0)
u8 announce_kind after chain_link, set only while MSG_ANNOUNCE_NUMBER is
open: 1 when the script called Duel.AnnounceLevel (it passes playerid +
0x10000 to the unit), else 2 when the asking effect has CATEGORY_DICE and is
visible to the answering player, else 0. Contract, changelog, binding
PromptContext.AnnounceKind + AnnouncePlain / Level / Dice, codec 24 bytes,
probe: plain 0, AnnounceLevel 1, a dice effect's AnnounceNumber 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 16:46:05 -07:00
donnyandClaude Opus 5.5 3f84b0b50b core: prompt context phase 4, the core asks whether to use an effect (TICKET-451, v1.7.0)
The core's own "use this effect?" prompts carry the asked effect in their
PROCESSOR_SELECT_EFFECTYN / SELECT_YESNO unit (optional trigger, lone quick
trigger 221, activation 94, replacements 218 / 219 / 220, Scrap Chimera), and
the unit pushes it on core.ygol_running as phase 4 while the prompt is open.
Contract row, changelog, binding PromptContext.PhaseAsk, probe check: an
optional End Phase trigger is asked with that card, index 2, phase 4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 16:11:14 -07:00
donnyandClaude Opus 5.5 ca2004112b contract: prompt context rows, changelog v1.7.0, probe suite (TICKET-451)
Release / windows (push) Successful in 40s
Release / android (push) Successful in 53s
Release / linux (push) Successful in 1m34s
Release / release (push) Skipped
Release / attach-windows (push) Skipped
Contract: the export row (22 bytes, the stable index, the hidden rule), the
0x44 message row (23 bytes), bit 0x8000, protocol 12, binding rows. README
export counts. Probe: Single, a second Single duel with another deck order
and an opponent without the bit, Tag: a card asks in cost, target and
operation, a Fusion's material procedure asks inside that operation and the
outer context comes back, then the card hides in the deck and asks both
players.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 16:05:09 -07:00
donnyandClaude Opus 5.5 b6ef8a31bc core: ygol_query_prompt_context names the effect that asks a prompt (TICKET-451, v1.7.0)
field::execute_cost / execute_target / execute_operation push the running
effect (handler, description, stable index, phase 1 / 2 / 3, chain link) on
core.ygol_running at step 0 and pop it when the function finishes; the
innermost entry is the effect that asks. effect::ygol_script_index is stamped
in card::add_effect while the card loads (initial_effect.size()), 0xffff
otherwise. The export writes 22 bytes; a handler the asking player does not
control and that is not face-up answers code 0, index 0xffff, description 0.
Export gates 335 / 856 / 850 -> 336 / 857 / 851.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 16:05:08 -07:00
donnyandClaude Opus 5.5 4cd908d7af contract: Tag shared Extra Deck rows, changelog v1.6.0, probe suite (TICKET-433)
Release / release (push) Successful in 4s
Release / attach-windows (push) Successful in 1s
Release / linux (push) Successful in 1m19s
Release / windows (push) Successful in 41s
Release / android (push) Successful in 52s
The suite plays a pair-present and a pair-absent Tag room: a Summon of the
waiting partner's monster, the partner value across a move, and the replay
played back through the library. The contract states that bit 0x100000 stays
unused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 00:54:35 -07:00
donnyandClaude Fable 5.1 c2eca90644 server: FEATURE_TAG_TWO_FIELDS 0x1000, protocol 10, a Tag room refuses a joiner without it (TICKET-384, v1.5.0)
Release / release (push) Successful in 3s
Release / attach-windows (push) Successful in 0s
Release / linux (push) Successful in 1m27s
Release / windows (push) Successful in 36s
Release / android (push) Successful in 48s
Single and Tag rooms advertise the bit; TagDuel::Capability answers a client whose
capability lacks it with ERRMSG_VERERROR and closes the connection. Binding:
FeatureFlags.TagTwoFields (in All), Capability.ProtocolVersion 10, tests pinned.
Probe: the tag two Field slots rooms (placement on turns 1, 3 and 5 with the core's
own view reported by the Probe Field's script, the Tag refusal, the Single room that
keeps an old client); the capability pins move to 10 / 0x37FF. Contract: the 0x1000
row, the v1.5.0 behaviour row, the Lua note; CHANGELOG v1.5.0.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-24 18:35:21 -07:00
donnyandClaude Opus 5.5 10ade7fc41 server: tag partner cards are sent again whenever they change (TICKET-424, v1.4.2)
Release / release (push) Successful in 4s
Release / windows (push) Successful in 37s
Release / linux (push) Successful in 1m18s
Release / android (push) Successful in 42s
Release / attach-windows (push) Successful in 1s
After every engine batch, beside FlushDeckLists, TagDuel::FlushTagPartnerCards
queries ygol_query_tag_cards per side and broadcasts STOC_TAG_PARTNER_CARDS
0x5F when the bytes differ from the last broadcast for that side. Every
broadcast (start, swap, change) records its bytes, so a swap is never sent
twice; a resync to one player does not record. Same id and payload, no new
capability bit, protocol 9. Probe: the TICKET-415 room checks that the Summon
out of the waiting partner's Extra Deck gives side 1's seats exactly one
fresh 0x5F with an empty Extra Deck, and the other team none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 16:07:21 -07:00
donnyandClaude Fable 5.1 5286cb2bfd core: a card the waiting tag partner holds leaves its own list (TICKET-415, v1.4.1)
Release / windows (push) Successful in 38s
Release / linux (push) Successful in 1m25s
Release / android (push) Successful in 48s
Release / release (push) Successful in 6s
Release / attach-windows (push) Successful in 1s
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>
2026-10-16 13:38:08 -07:00
donnyandClaude Fable 5.1 65fcc307bb server: life points per side through the setup pair ygol.side.b.lp (v1.4.0)
Release / linux (push) Successful in 1m21s
Release / windows (push) Successful in 52s
Release / android (push) Successful in 42s
Release / release (push) Successful in 5s
Release / attach-windows (push) Successful in 1s
The room's "Life Points - Side B" field had nowhere to go: the host string
carries ONE start LP and the server gave it to both duel players. Now the
setup pair ygol.side.b.lp=<n> gives seat side B (seat 1; Tag seats 2 and 3)
its own start LP while side A keeps slot 8; absent, both sides start at
slot 8 exactly as before.

- SideBStartLp(fallback) reads the pair (positive integer, else fallback).
- single_duel / tag_duel keep player_lp[2] in DUEL PLAYER order, so the
  side that goes first keeps its own LP through the first-turn swap, in
  every duel of a Match: set_player_info per player, MSG_START at the
  start and in the late-watcher snapshot carry lp[0], lp[1].
- Replay flag REPLAY_YGOL_SIDE_LP 0x20000000: set only when the two
  differ; i32 lp[0], i32 lp[1] follow opt, before the decks. The binding
  gets ReplayFlags { SetupPairs, SideLp } for the readers.
- Probe: two more setup-pair rooms (Single and Tag) check MSG_START on
  every seat in duel player order and the replay's flag + values; every
  other room's replay must have no such flag.
- Contract: slot 8 row, the behaviour table, the Replay section, the
  server-read pairs table (three now), the binding row; CHANGELOG v1.4.0.

No new export or capability bit: exports 335 / 856 / 850, protocol 9,
capabilities 0x27FF.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-16 11:45:49 -07:00
donnyandClaude Fable 5.1 14a4f80aab tag partner cards: observers who see all get 0x5F for both sides (TICKET-412)
Release / windows (push) Successful in 33s
Release / android (push) Successful in 41s
Release / linux (push) Successful in 1m14s
Release / release (push) Successful in 4s
Release / attach-windows (push) Successful in 1s
SendTagPartnerCards also sends to every observer under SpectatorsSeeAll(), so the
start and every MSG_TAG_SWAP reach the audience; an observer's field resync and the
late-watcher snapshot carry both sides after the deck lists. Hidden rooms and seated
duelists are unchanged. Same id, same payload, no new capability bit.

Contract row 0x5F + join snapshot + MSG_TAG_SWAP note, a behaviour row; the probe's
tag partner room runs twice (see all: the watcher gets both sides at every send
point, its resync and a late snapshot; hidden: never); CHANGELOG v1.3.0.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-16 10:10:20 -07:00
donnyandClaude Fable 5.1 f52eca74ce contract: the probe's tag attack preview room battles on turn 4
Release / windows (push) Successful in 40s
Release / android (push) Successful in 40s
Release / release (push) Successful in 5s
Release / attach-windows (push) Successful in 1s
Release / linux (push) Successful in 1m22s
v1.1.1 took the Battle Phase away from tag turns 1-3, and the room still
asked the turn-2 duelist to enter it, so the probe failed there on every
run since. The room now passes turns 3 and 4 (both swaps) and the fourth
duelist asks the preview; the checks are unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-15 23:26:39 -07:00
donnyandClaude Fable 5.1 2789a82ef4 contract: the probe hosts above the OS dynamic port range (27961)
The probe's rooms sat on 7961-8071, inside this machine's dynamic port
range (1024-15000). A probe client that drew the next room's port as its
source port made that room's bind fail: the server printed "0" and the
probe died with "ended before it listened", on most runs. --port still
overrides.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-15 23:26:39 -07:00
donnyandClaude Fable 5.1 2344e5dae1 tag partner cards: ygol_query_tag_cards + STOC_TAG_PARTNER_CARDS 0x5F, capability 0x2000, protocol 9 (TICKET-405)
Core: ygol_query_tag_cards(pduel, playerid, out) reads the waiting tag
partner's tag_list_hand / tag_list_extra (bit 31 = face-up, like
MSG_TAG_SWAP) and tag_list_main sorted ascending; returns the byte length,
0 when not a tag duel. Read only.

Server: STOC_TAG_PARTNER_CARDS 0x5F = u8 side + those 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 advertised by single_duel
and tag_duel; FEATURE_PROTOCOL 8 -> 9. 0x800 / 0x1000 stay reserved for
proposals 44 / 45.

Binding: StocMessage.TagPartnerCards, FeatureFlags.TagPartnerCards, the
TagPartnerCards record + StocCodecs.TagPartnerCards,
EngineApi.ygol_query_tag_cards, Capability.ProtocolVersion 9, tests.

Contract rows, CHANGELOG v1.2.0, the probe's tag partner cards room, the
export gates 334 / 855 / 849 -> 335 / 856 / 850.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-15 23:26:39 -07:00
donnyandClaude Fable 5.1 c3b5e6e13b core: Tag duel has no Battle Phase on turns 1-3; the fourth duelist battles first
Release / linux (push) Successful in 1m15s
Release / release (push) Successful in 13s
Release / attach-windows (push) Successful in 1s
Release / android (push) Successful in 35s
Release / windows (push) Successful in 41s
The official Tag Duel rules: duelists 1A, 2A and 1B cannot enter their Battle
Phase; 2B (turn 4) is the first who can. The core blocked turn 1 only, so team
B's first duelist could attack on turn 2. One helper,
field::is_opening_turn_without_bp, now decides for the idle command and for
Duel.IsAbleToEnterBP: turns 1-3 in DUEL_TAG_MODE, turn 1 otherwise,
DUEL_ATTACK_FIRST_TURN still lifts it. Rules only; no contract change.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-15 21:04:13 -07:00
donnyandClaude Fable 5.1 ffd50fa147 binding: EngineApi, MessageScan, GameMessage, EngineBinding; contract section (e); v1.1.0 changelog (TICKET-398)
Release / linux (push) Successful in 1m4s
Release / windows (push) Successful in 32s
Release / android (push) Successful in 36s
Release / release (push) Successful in 5s
Release / attach-windows (push) Successful in 1s
Namespace YGOLegacy.Engine in binding/YGOLegacy.Engine:
- EngineApi: one DllImport("ygol-engine", Cdecl) extern per export of contract/ocgapi.h (45),
  C names kept, types by the contract's type rule; delegates ScriptReader, CardReader,
  MessageHandler beside it.
- MessageScan: MsgInfo, Scan, Blank, BlankPileCodes, PromptName moved from the Unity bot host
  (LocalDuelHost), public, bodies unchanged (+ the private FieldOffset helper and the five
  constants they read).
- GameMessage: enum : byte, one member per #define MSG_* in core/common.h (84), PascalCase names.
- EngineBinding: const Version generated at build from the EngineVersion property into
  obj/EngineBindingVersion.cs (local by default); CheckNative() compares it with
  ygol_engine_version() and throws InvalidOperationException naming both.

Tests: EngineApiParityTests (header names vs extern names, both ways; public, Cdecl, no
CharSet.Unicode, no overloads) and GameMessageParityTests (missing, extra, renumbered).
114 -> 122 tests, green.

contract/engine-contract.md: five parts; "(e) C# binding" with the 45-row extern table, the type
rule and the version rule; engine.json's binding key documented. CHANGELOG.md: Unreleased ->
v1.1.0 with the TICKET-397 and TICKET-398 rows. README.md: the Binding section names the four
types and CheckNative().

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DJUFwdiGCHipsxLkgxssSR
2026-10-15 16:30:24 -07:00
donnyandClaude Fable 5.1 73aecf9c15 contract: the export arithmetic is 3 server + 42 core = 45
The core table lists 42 exports (default_script_reader included) and the
Windows count is 334 = 45 + 289 sqlite3_*; the sentence said 41 / 44.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DJUFwdiGCHipsxLkgxssSR
2026-10-15 10:34:59 -07:00
donnyandClaude Fable 5.1 662dc668ad contract: the probe reads Data/script.zip from the cwd, not from its own path
The Unity copy found the repo three folders up from its own file (Tools/YGOLegacy/); from contract/ that resolved to C:\Data\script.zip and the 0009 room setup crashed. Every other path in the probe already uses the cwd, and every --dll run must be from the Unity repo root anyway, so the one line now uses the cwd too. The only change from the Unity copy.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DJUFwdiGCHipsxLkgxssSR
2026-10-14 22:45:36 -07:00
donnyandClaude Fable 5.1 923764242a contract: the three dead DllImport names get a table row each
So every DllImport name in CoreWrapper.cs has a literal row in section (a), the undefined ones included.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DJUFwdiGCHipsxLkgxssSR
2026-10-14 22:44:26 -07:00
donnyandClaude Fable 5.1 8b8a218946 contract: engine-contract.md, the one spec for the C API, the wire, the message stream, setup pairs and Lua
TICKET-388. Four sections, one table each, every fact read from the source (ocgapi.h, serverapi.h, network.h, netserver.cpp, single_duel.cpp, common.h, gframe.cpp): (a) every export with its signature and the patch / ticket that added it, plus the host string slots and the three dead DllImports in the Unity client; (b) every fork CTOS / STOC id 0x40-0x43, 0x50-0x5E with payload layout, sender stamp, who may send, what happens otherwise, capability bit and protocol number, plus the bits table, the no-message behaviour changes and the replay flag; (c) the MSG_* table as LocalDuelHost.Scan reads it, the fork's only effect (0015) marked; (d) the setup pairs the server reads and the ones the client sends, and the generated Lua reference. Also defines engine.json.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DJUFwdiGCHipsxLkgxssSR
2026-10-14 22:43:59 -07:00
donnyandClaude Fable 5.1 ffbfbf8522 contract: the Lua API reference, generated from core/
TICKET-388. contract/lua-reference/generate.py is a Python port of yugioh-legacy-server's duel-engine/ocgcore/lua-reference.sh (bash + awk): one api-<class>.md per luaL_Reg table in core/lib*.cpp (Card, Duel, Effect, Group, Debug; 670 functions) and api-globals.md for the 37 globals interpreter.cpp sets. Row counts match the server repo's committed reference exactly. Regenerate and commit after any core change to those files.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DJUFwdiGCHipsxLkgxssSR
2026-10-14 22:43:59 -07:00
donnyandClaude Fable 5.1 69ca3fb5b5 contract: the wire probe moves in from the Unity repo, unchanged
TICKET-388. Byte-identical copy of Tools/YGOLegacy/probe-feature-messages.py; the Unity copy stays until Phase 2. Run from the Unity repo root: python contract/probe-feature-messages.py --dll out/win64/ygol-engine.dll.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DJUFwdiGCHipsxLkgxssSR
2026-10-14 22:43:58 -07:00
donnyandClaude Fable 5.1 63bb49c0d9 build: contract/ocgapi.h is checked against its two sources; engine.json is written next to the library
TICKET-388. contract/ocgapi.h is core/ocgapi.h verbatim plus the server's YGOSERVER_API lines in a marked block. windows.ps1 refuses to build when either part differs (tested: a changed server line and a changed core line each fail; the real file passes). After the export gate it writes out/win64/engine.json { version, exports, protocol, capabilities }: protocol from FEATURE_PROTOCOL in gframe/network.h, capabilities as the OR of the FEATURE_* bits on the cap.flags line of single_duel.cpp and tag_duel.cpp (which must agree), each bit resolved from network.h. Nothing typed in. Verified: protocol 8, capabilities 0x7FF (2047), exports 334.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DJUFwdiGCHipsxLkgxssSR
2026-10-14 22:43:58 -07:00