Commit Graph
61 Commits
Author SHA1 Message Date
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>
v1.6.0
2026-11-03 00:54:35 -07:00
donnyandClaude Opus 5.5 c0dfa8ef19 binding: FeatureFlags.TagSharedExtra, protocol 11 (TICKET-433, v1.6.0)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 00:54:35 -07:00
donnyandClaude Opus 5.5 fa14698115 server: ygol.tag.extra=shared, FEATURE_TAG_SHARED_EXTRA 0x4000, protocol 11 (TICKET-433, v1.6.0)
The fourth server-read pair. TagDuel sets the option in opt, sends the sum of
both partners' Extra Decks in the opening MSG_START, runs the opening
RefreshExtra after start_duel, and adds QUERY_TAG_MEMBER in RefreshExtra. A Tag
room refuses a joiner without the bit; a Single room keeps it. Without the pair
every stream is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 00:54:35 -07:00
donnyandClaude Opus 5.5 8a73120dbb core: a Tag team can share one Extra Deck, each card keeps its partner (TICKET-433, v1.6.0)
Option DUEL_TAG_SHARED_EXTRA 0x200: start_duel moves tag_list_extra into
list_extra and renumbers, for both teams; tag_swap skips its Extra block.
card::tag_member is 0 from new_card and 1 from new_tag_card. QUERY_TAG_MEMBER
0x1000000 is written last in get_infos. Bit 0x100000 stays unused: old flags
(0xf81fff, 0x181fff, 0xFFFFFF) set it with no value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 00:54:34 -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>
v1.5.0
2026-10-24 18:35:21 -07:00
donnyandClaude Fable 5.1 bcd19c9cd0 core: a Tag team on Master Rule 4/5 has a Field slot per partner (TICKET-384, v1.5.0)
Proposal 45. field::has_two_fields() (DUEL_TAG_MODE on Master Rule 4 or 5) gives
each team Spell/Trap sequence 5 for the partner who plays the team's first turn and
6 for the other; player_info::tag_partner flips in tag_swap and get_szone_size is 7
there. A Field Spell lands in the playing partner's slot (get_fzone_landing) and
replaces only that card; a control change takes the free slot when the playing
partner's is taken; a Set offers only the landing slot's bit. LOCATION_FZONE covers
both slots in card_state::is_location, filter_matching_card, filter_field_card,
is_location_useable and Duel.IsEnvironment; get_field_card(p, LOCATION_FZONE, 0) is
the playing partner's field, else the other, and 1 the remaining one. Singles, Match
and Master Rule 3 (slot 6 = a Pendulum Zone) are unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-24 18:35:20 -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>
v1.4.2
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>
v1.4.1
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>
v1.4.0
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>
v1.3.0
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>
v1.2.0
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>
v1.1.1
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
v1.1.0
2026-10-15 16:30:24 -07:00
donnyandClaude Fable 5.1 7ec61d18e6 binding: YGOLegacy.Engine carries the wire protocol; CI builds, tests and ships ygol-engine-binding.zip (TICKET-397)
Release / linux (push) Successful in 1m8s
Release / release (push) Skipped
Release / attach-windows (push) Skipped
Release / windows (push) Successful in 33s
Release / android (push) Successful in 41s
binding/YGOLegacy.Engine (netstandard2.1, LangVersion 9, unsafe, no package, no Unity
reference) holds the Unity repo's Assets/YGOLegacy/Scripts/Protocol/ as
Protocol/{Contracts,Codecs,Framing,Routing}: 12 files copied byte-identical (LF), namespaces
YGOLegacy.Protocol.* unchanged. EngineVersion (default local) is stamped as the informational
version, so the DLL's ProductVersion is the tag it was built for.

binding/YGOLegacy.Engine.Tests (net8.0, NUnit 3.14) holds the six fixtures. 114 tests pass,
the Unity Edit Mode count. Two deviations from "as-is", lead-approved 2026-10-15:
LegacyReaders.cs is a frozen test-only copy of the legacy MDPro3 / YGOSharp readers and enums
the parity tests compare against (they live only in the Unity repo), and FrameCodecTests.cs
line 35 casts (short) instead of (byte): BitConverter.GetBytes((byte)) is ambiguous on
net8.0 (the Half overload), same bytes written.

The windows job builds and tests the binding after the native gates (both with
-p:EngineVersion so the test's project reference does not restamp the DLL as local), checks
the ProductVersion and stages ygol-engine-binding.zip (YGOLegacy.Engine.dll + .pdb) beside
ygol-engine-win64.zip; attach-windows attaches both. engine.json gains "binding": "<version>"
on every platform (windows.ps1 and the Dockerfile's export-gate, the only writers) and the
release job's agreement check includes it. README gains the Binding section and the asset row;
.gitignore ignores binding/**/bin and obj.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DJUFwdiGCHipsxLkgxssSR
2026-10-15 16:14:17 -07:00
donnyandClaude Fable 5.1 b8bdb0f20c README: engine.json asset = the Linux copy; exports is per platform
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DJUFwdiGCHipsxLkgxssSR
2026-10-15 11:36:01 -07:00
donnyandClaude Fable 5.1 e5e3c10280 ci: workflow_dispatch, so a tag run can be started by hand
Release / windows (push) Successful in 31s
Release / android (push) Successful in 36s
Release / release (push) Successful in 14s
Release / attach-windows (push) Successful in 2s
Release / linux (push) Successful in 1m5s
Gitea made no run for the main push and the v1.0.0 tag: their commit had
already run on the test branch. A new commit moves the tag.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DJUFwdiGCHipsxLkgxssSR
v1.0.0
2026-10-15 11:15:11 -07:00
donnyandClaude Fable 5.1 9a3f737f08 ci: artifact actions v3 (this Gitea rejects v4: "not currently supported on GHES")
Release / android (push) Successful in 16s
Release / linux (push) Successful in 17s
Release / windows (push) Successful in 34s
Release / release (push) Skipped
Release / attach-windows (push) Skipped
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DJUFwdiGCHipsxLkgxssSR
2026-10-15 10:59:24 -07:00
donnyandClaude Fable 5.1 0d7051d88e README: how to release (tag, push, wait) and how a consumer fetches the assets
Release / linux (push) Failing after 1m41s
Release / android (push) Failing after 1m43s
Release / windows (push) Canceled after 0s
Release / release (push) Canceled after 0s
Release / attach-windows (push) Canceled after 0s
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DJUFwdiGCHipsxLkgxssSR
2026-10-15 10:56:50 -07:00
donnyandClaude Fable 5.1 09b85f0f3c CHANGELOG: v1.0.0 section (the first release), rows for 389 and 390
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DJUFwdiGCHipsxLkgxssSR
2026-10-15 10:56:50 -07:00
donnyandClaude Fable 5.1 5f25c6de7a ci: release workflow (TICKET-390)
.gitea/workflows/release.yml: every push and pull request runs the
three builds with their gates (windows on the self-hosted unity-windows
runner through build/windows.ps1; linux and android in Docker on
ubuntu-latest through build/linux.sh and build/android.sh) and publishes
nothing. A v* tag adds the release job: every platform's engine.json
must name the tag and agree on protocol and capabilities, the Windows
DLL's ygol_engine_version() must return the tag, the release must not
exist yet; then one release named after the tag with
ygol-engine-win64.zip, ygol-engine-linux-x64.tar.gz,
ygoserver-linux-x64.tar.gz, ygol-engine-android-arm64.tar.gz and
engine.json, the CHANGELOG section for the tag as its body.

The Windows runner runs no JavaScript action (the Unity repo's pipeline
never did): its bundle is staged on the runner's disk and attached by
the last job; its engine.json travels as a job output. The token is the
run's own GITHUB_TOKEN (the release is in this repo).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DJUFwdiGCHipsxLkgxssSR
2026-10-15 10:56:50 -07:00
donnyandClaude Fable 5.1 3f2e2c3e72 README: how to build Linux and Android, the 855 / 849 gates, 45 contract exports
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 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 548d5c859e build: Linux x64 and Android arm64 in Docker (TICKET-389)
build/Dockerfile, targets linux and android; build/linux.sh and
build/android.sh run them with docker build -o into out/linux-x64 and
out/android-arm64. The host needs Docker and nothing else.

- Base: Ubuntu 22.04 pinned by digest (glibc 2.35 is the floor of the
  outputs; a bookworm build needed 2.36 and did not start on the Linux
  box; bullseye is end of life and its package pool is gone). premake
  5.0.0-beta8 bootstrapped from its tag, Android NDK r23b pinned by sha1
  (23.1.7779620, the build id of the shipped .so), API level 26.
- Same contract-header check as windows.ps1 before the build, same
  export gate after it: the plain C export count (dynamic, defined, no
  leading underscore) must be exactly Linux 855 / Android 849 and every
  name declared in contract/ocgapi.h must be exported; then engine.json
  with protocol and capabilities read from the server source.
- Linux builds the tree twice: the library (SERVER_PRO3_SUPPORT,
  libygol-engine.so) and the plain server executable (project ygopro
  with zip support and tag surrender confirm, the same rules), renamed
  ygoserver for the server repo's duel-server. Every dependency from the
  vendored sources (BUILD_ALL); libevent configured by its own
  configure. obj/ bin/ build/ wiped before every compile.
- Android: upstream's exec_android_pro3 job, one library; libocgcore.so
  is not built any more. Verified against the shipped
  Assets/Plugins/Android/libygoserver.so: all 5886 dynamic symbols kept,
  7 added (the six ygol_sb_* and ygol_engine_version).

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 2e8b60ca33 server: include <algorithm> in netserver.cpp (GCC)
Patch 0023's attack preview handler calls std::find. MSVC's headers
include <algorithm> transitively, GCC's do not, so the Linux build
failed on the first compile. No behaviour change.

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 ae5f03c620 server: put libevent's build-aux/ back (its generated configure needs it)
The vendored libevent 2.1.13-stable had its autotools helpers trimmed, so
./configure could not run on Linux or Android (config.guess, config.sub,
install-sh, ltmain.sh ... are looked up in build-aux/). These are the
tarball's own files, unchanged (ltmain.sh 2.5.4, the version configure
was generated with). Needed by TICKET-389's Docker builds.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DJUFwdiGCHipsxLkgxssSR
2026-10-15 10:34:58 -07:00
donnyandClaude Fable 5.1 806c92a106 README: the contract, the 334 gate, -Version, the header check, engine.json, the probe's new home
Lead-approved README row for TICKET-388 (2026-10-14).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DJUFwdiGCHipsxLkgxssSR
2026-10-14 22:45:37 -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
donnyandClaude Fable 5.1 173df5d8e6 server: export ygol_engine_version; the Windows gate is 334
TICKET-388. ygol_engine_version() returns the string the build was given (build/windows.ps1 -Version, env YGOL_ENGINE_VERSION into a define by gframe/premake5.lua), "local" when none; static storage, no allocation. One new export, so the Windows export gate moves 333 -> 334 and the changelog gets its Unreleased row, all in this commit.

Verified: build -Version v0.0.1 prints exports: 334 (expected 334); ctypes call prints v0.0.1.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 22:38:18 -07:00
donnyandClaude Fable 5.1 c51ea6b4ed CHANGELOG: one row per replayed fork patch 0001-0024
Each row: the date the patch first shipped in the Unity repo, the ticket, and the contract part it touched. Rules-only patches say so.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 22:36:51 -07:00
donnyandClaude Fable 5.1 aa0e91a3b0 README: layout, the two source commits, what is vendored, build and gate
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 21:08:08 -07:00
donnyandClaude Fable 5.1 b2e88060a4 Ignore build output and libevent's prebuild copies
server/build, server/obj, server/bin and out/ are generated; so are the
files libevent's Windows prebuild step copies from WIN32-Code into
event/include. Upstream's own .gitignore is not carried over: it ignores
the dependency folders this repo vendors.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 21:08:08 -07:00
donnyandClaude Fable 5.1 58d97a36b3 build: windows.ps1 builds ygol-engine.dll with a 333-export gate
premake vs2022 in server/ (SERVER_PRO3_SUPPORT, LOG_IN_CHAT, USE_SIMD=best),
MSBuild on build\YGOPro.sln target ygoserver, Release x64, always from a
wiped obj/bin/build; refuses a repo path with a space (libevent's unquoted
xcopy); copies the result to out/win64/ and FAILS unless dumpbin counts
exactly 333 exports: start_server, stop_server and the core's C API with
ygol_sb_* and ygol_preview_attack. The old ygoserver.dll had 327 because its
own core copy never carried patch 0008; one core means one export list.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 21:08:08 -07:00
donnyandClaude Fable 5.1 ff665ea99f server: gframe includes the core from ../../core
Six literal "../ocgcore/" includes (config.h, data_manager.h, netserver.h,
replay.h, single_duel.cpp, tag_duel.cpp) pointed at the submodule this repo
does not have. They now name ../../core, the one copy.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 21:07:06 -07:00
donnyandClaude Fable 5.1 2387be1f16 build: the library is ygol-engine
Proposal 47, Rule 1: the one native library ships as ygol-engine
(ygol-engine.dll on Windows). The premake project keeps its name,
ygoserver, so build targets do not change.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 20:59:35 -07:00
donnyandClaude Fable 5.1 8945edc9e2 build: the server workspace builds the core from ../core
There is one copy of the core in this repo. The server's premake includes
../core instead of its old ocgcore submodule, gframe takes its headers
from there, and the core's premake takes the Lua include dir the server
workspace resolves (LUA_INCLUDE_DIR) instead of assuming a sibling lua/.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 20:59:29 -07:00
donnyandClaude Fable 5.1 3993b8c5e5 server: 0023-attack-preview-server
TICKET-378: the attack preview over the wire. CTOS/STOC 0x5E: the seat whose battle prompt is open asks for pairs, the host answers from its embedded core (ygol_preview_attack). Capability bit 0x400, protocol 8.

Replayed from Tools/YGOLegacy/patches/0023-attack-preview-server.patch in the Unity repo.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 20:59:00 -07:00
donnyandClaude Fable 5.1 b7c5cb2467 server: 0021-restart-clock-stops-at-start
Fix for 0012: START stops the lobby clock (it shares the duel timer), so a reservation window still open after a rules restart no longer ends the duel at once on time limit up.

Replayed from Tools/YGOLegacy/patches/0021-restart-clock-stops-at-start.patch in the Unity repo.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 20:58:59 -07:00
donnyandClaude Fable 5.1 27c35b81bd server: 0020-profile
TICKET-360: profile. CTOS/STOC 0x5D (98 bytes): a seated human's avatar id and frame id, stored per seat, in the join snapshot, swapped with the seat. Capability bit 0x200, protocol 7.

Replayed from Tools/YGOLegacy/patches/0020-profile.patch in the Unity repo.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 20:58:59 -07:00
donnyandClaude Fable 5.1 980228945e server: 0019-deck-lists
TICKET-338: deck lists. STOC 0x5C: the owner gets its remaining cards sorted, observers the real order and the submitted Main Deck only when SpectatorsSeeAll(). Capability bit 0x100, protocol 6.

Replayed from Tools/YGOLegacy/patches/0019-deck-lists.patch in the Unity repo.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 20:58:59 -07:00
donnyandClaude Fable 5.1 a9e5f2d5eb server: 0018-spectators-see-all
TICKET-326: spectators see everything. Without the pair ygol.room.spectatorview=hidden every observer gets the unmasked stream, the late-watcher snapshot included; with it the stock masked stream.

Replayed from Tools/YGOLegacy/patches/0018-spectators-see-all.patch in the Unity repo.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 20:58:59 -07:00
donnyandClaude Fable 5.1 2c081162ff server: 0017-coin-toss
TICKET-328: the server rolls the coin: STOC 0x5B to every seat and watcher, the stock SELECT_TP to the chooser, a one-shot 10 s timer that answers FIRST for them; game 2+ sends face 0xFF. Capability bit 0x80, protocol 5.

Replayed from Tools/YGOLegacy/patches/0017-coin-toss.patch in the Unity repo.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 20:58:58 -07:00
donnyandClaude Fable 5.1 06391120b5 server: 0016-tag-first-seat-holds-hand-server
Tag: the first seat of each team holds the hand from turn 1. Team B loads seat 2 as its main deck and seat 3 as the tag deck; the prompt owner starts at seat 2. Pairs with core patch 0015.

Replayed from Tools/YGOLegacy/patches/0016-tag-first-seat-holds-hand-server.patch in the Unity repo.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-14 20:58:58 -07:00