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
This commit is contained in:
1 parent
662dc668ad
commit
806c92a106
1 file changed
+16
-10
@@ -10,8 +10,9 @@ library per platform, `ygol-engine`, behind a written contract. Proposal 47 in t
|
||||
|---|---|
|
||||
| `core/` | The rules core (C++, Lua 5.4 inside). Plain directory, no submodule. |
|
||||
| `server/` | The duel server (C++, libevent) with its third-party sources vendored inside. Its premake builds the core from `../core`. |
|
||||
| `build/windows.ps1` | Builds `out/win64/ygol-engine.dll` and runs the export gate. |
|
||||
| `contract/` | The engine contract (TICKET-388). |
|
||||
| `build/windows.ps1` | Builds `out/win64/ygol-engine.dll` (+ `engine.json`), checks the contract header, runs the export gate. |
|
||||
| `contract/` | The contract: `engine-contract.md` (the one spec), `ocgapi.h` (the public header), `probe-feature-messages.py` (the wire gate), `lua-reference/` (the generated Lua API). |
|
||||
| `CHANGELOG.md` | One row per contract change; the replayed patches 0001-0024 first. |
|
||||
|
||||
There is exactly one copy of the core in this repo. The server's old `ocgcore/` submodule is gone;
|
||||
`server/premake5.lua` includes `../core`, and the six `gframe` sources that named `../ocgcore/`
|
||||
@@ -56,7 +57,7 @@ Their `[YGOL]` markers are kept. `git log --oneline -- server/gframe` lists them
|
||||
|
||||
```powershell
|
||||
git clone https://gitea.dev.blueoceanswim.com/donny/yugioh-legacy-engine.git C:\ygol-engine
|
||||
pwsh C:\ygol-engine\build\windows.ps1
|
||||
pwsh C:\ygol-engine\build\windows.ps1 -Version v0.0.1
|
||||
```
|
||||
|
||||
- The repo path must have NO spaces: libevent's premake emits an unquoted `xcopy` prebuild step. The
|
||||
@@ -67,20 +68,25 @@ pwsh C:\ygol-engine\build\windows.ps1
|
||||
reused a stale object and the DLL still built), runs `premake5 vs2022` in `server/` with
|
||||
`SERVER_PRO3_SUPPORT=1 LOG_IN_CHAT=1 USE_SIMD=best`, then MSBuild on `build\YGOPro.sln`, target
|
||||
`ygoserver`, Release x64.
|
||||
- Output: `out/win64/ygol-engine.dll` (+ `.pdb`).
|
||||
- `-Version <tag>` is what `ygol_engine_version()` returns (`local` when not given).
|
||||
- Before building, the script checks `contract/ocgapi.h` against `core/ocgapi.h` + the server's
|
||||
`YGOSERVER_API` lines in `gframe/serverapi.h`; a drift fails the build.
|
||||
- Output: `out/win64/ygol-engine.dll` (+ `.pdb`) and `out/win64/engine.json`
|
||||
(`{ version, exports, protocol, capabilities }`; protocol and capabilities are read from
|
||||
`gframe/network.h` and the `cap.flags` line of `single_duel.cpp` / `tag_duel.cpp`, never typed in).
|
||||
|
||||
### The export gate is the truth
|
||||
|
||||
The script FAILS unless the DLL exports exactly **333** symbols: `start_server`, `stop_server`, and
|
||||
the core's whole C API re-exported, including the six `ygol_sb_*` Sandbox exports and
|
||||
`ygol_preview_attack`. A different count means the wrong tree, not "a small difference". For the
|
||||
The script FAILS unless the DLL exports exactly **334** symbols: `start_server`, `stop_server`,
|
||||
`ygol_engine_version`, and the core's whole C API re-exported, including the six `ygol_sb_*` Sandbox
|
||||
exports and `ygol_preview_attack` (44 contract exports + 289 `sqlite3_*`; see the contract). A different count means the wrong tree, not "a small difference". For the
|
||||
record: the Unity repo's old `ygoserver.dll` exported 327 because its build applied patch 0008
|
||||
(the `ygol_sb_*` six) only to `ocgcore.dll`, never to the server's own core copy; with one core they
|
||||
are in the one library.
|
||||
|
||||
The wire probe (`probe-feature-messages.py --dll out\win64\ygol-engine.dll`, in the Unity repo until
|
||||
TICKET-388 moves it to `contract/`) checks the fork's messages and capability bits against a running
|
||||
server.
|
||||
The wire probe (`python contract/probe-feature-messages.py --dll out/win64/ygol-engine.dll`, run from
|
||||
the Unity repo root because the library reads `./expansions`) checks the fork's messages and
|
||||
capability bits against a running server.
|
||||
|
||||
## Line endings
|
||||
|
||||
|
||||
Reference in new issue
Block a user