From 4cd908d7af81a3a56e050f2f490c581f5df75de3 Mon Sep 17 00:00:00 2001 From: donnyjang Date: Tue, 3 Nov 2026 00:54:35 -0700 Subject: [PATCH] contract: Tag shared Extra Deck rows, changelog v1.6.0, probe suite (TICKET-433) 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 --- CHANGELOG.md | 11 + contract/engine-contract.md | 38 ++- contract/probe-feature-messages.py | 418 ++++++++++++++++++++++++++++- 3 files changed, 449 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 418a6d8..c36e1e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,17 @@ wire protocol, the engine message stream, the setup pairs and the Lua API. A row 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.6.0 — 2026-11-02 + +Tag shared Extra Deck (proposal 53): a setup pair gives a Tag team one Extra Deck, and each card keeps the partner who +brought it. No new export or message; capability `0x4000`, protocol 11: exports 335 / 856 / 850, capabilities `0x77FF`. + +| Date | Change | Ticket | Contract part | +|---|---|---|---| +| 2026-11-02 | Core: 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` (0 `new_card`, 1 `new_tag_card`), `QUERY_TAG_MEMBER` `0x1000000` written last in `get_infos`. Bit `0x100000` stays unused: old flags set it with no value. | TICKET-433 | (a) `start_duel` option; (c) Query records | +| 2026-11-02 | Server: `ygol.tag.extra=shared` is 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`. `FEATURE_TAG_SHARED_EXTRA` `0x4000` advertised by Single and Tag rooms, protocol 10 -> 11; a Tag room refuses a joiner without the bit. | TICKET-433 | Wire: capability bit `0x4000`, protocol 11; (d) setup pair `ygol.tag.extra`; `0x5F` Extra count 0 in such a duel | +| 2026-11-02 | Binding: `FeatureFlags.TagSharedExtra` (in `All`), `Capability.ProtocolVersion` 11. Probe: the tag shared Extra Deck rooms (pair present, pair absent, a Summon of the waiting partner's monster, the replay played back through the library, the Tag refusal, the Single room that keeps an old client). | TICKET-433 | (e) C# binding | + ## v1.5.0 — 2026-10-24 Tag two Field slots (proposal 45): a Tag team on Master Rule 4/5 holds one Field Spell per partner. No new diff --git a/contract/engine-contract.md b/contract/engine-contract.md index 49708c1..ddb60b1 100644 --- a/contract/engine-contract.md +++ b/contract/engine-contract.md @@ -26,8 +26,8 @@ next to the library (`out/win64/engine.json` on Windows): { "version": "v0.0.1", "exports": 335, - "protocol": 10, - "capabilities": 14335, + "protocol": 11, + "capabilities": 30719, "binding": "v0.0.1" } ``` @@ -36,8 +36,8 @@ next to the library (`out/win64/engine.json` on Windows): |---|---|---| | `version` | string | The `-Version` the build was given; `local` when none. The same string `ygol_engine_version()` returns. | | `exports` | integer | The library's export count after the gate passed (Windows: 335). | -| `protocol` | integer | `FEATURE_PROTOCOL` in `server/gframe/network.h` (10 as of 2026-10-24). | -| `capabilities` | integer | The OR of every `FEATURE_*` bit `SendServerCapability` advertises (`single_duel.cpp` and `tag_duel.cpp` must agree), as a decimal integer. 14335 = `0x37FF` = bits `0x1` to `0x400` plus `0x1000` and `0x2000` (`0x800` is reserved by proposal 44). | +| `protocol` | integer | `FEATURE_PROTOCOL` in `server/gframe/network.h` (11 as of 2026-11-02). | +| `capabilities` | integer | The OR of every `FEATURE_*` bit `SendServerCapability` advertises (`single_duel.cpp` and `tag_duel.cpp` must agree), as a decimal integer. 30719 = `0x77FF` = bits `0x1` to `0x400` plus `0x1000`, `0x2000` and `0x4000` (`0x800` is reserved by proposal 44). | | `binding` | string | The version of the C# binding released with this engine (section (e)); the same string as `version`. | The build reads `protocol` and `capabilities` from the source every time; nothing types them in. @@ -93,7 +93,7 @@ The host string is space-separated tokens, in this order (`server/gframe/gframe. | `create_duel_v2` | `intptr_t create_duel_v2(uint32_t seed_sequence[])` | Upstream (`SEED_COUNT` = 8 words) | | `create_duel_ex` | `intptr_t create_duel_ex(uint_fast32_t seed, uint32_t create_flags)` | Upstream | | `create_duel_v2_ex` | `intptr_t create_duel_v2_ex(uint32_t seed_sequence[], uint32_t create_flags)` | Upstream | -| `start_duel` | `void start_duel(intptr_t pduel, uint32_t options)` | Upstream | +| `start_duel` | `void start_duel(intptr_t pduel, uint32_t options)` | Upstream. v1.6.0: option `DUEL_TAG_SHARED_EXTRA` `0x200` with `DUEL_TAG_MODE` merges each team's Extra Decks (section (b), behaviour v1.6.0). | | `end_duel` | `void end_duel(intptr_t pduel)` | Upstream | | `set_player_info` | `void set_player_info(intptr_t pduel, int32_t playerid, int32_t lp, int32_t startcount, int32_t drawcount)` | Upstream | | `get_log_message` | `void get_log_message(intptr_t pduel, char* buf)` | Upstream | @@ -165,11 +165,11 @@ the server itself speaks. The STOC form of a relayed message is always the CTOS stamp in front. "Stamp" in the tables below says whether the STOC message carries one. **Capability.** The server sends `STOC_CAPABILITY` (stamp `0xFF`) to every connection between -`STOC_JOIN_GAME` and `STOC_TYPE_CHANGE`: `protocol` = `FEATURE_PROTOCOL` (10) and `flags` = the OR of -the bits below (`0x37FF`). A client sends its own `CTOS_CAPABILITY` after joining. A client refuses a +`STOC_JOIN_GAME` and `STOC_TYPE_CHANGE`: `protocol` = `FEATURE_PROTOCOL` (11) and `flags` = the OR of +the bits below (`0x77FF`). A client sends its own `CTOS_CAPABILITY` after joining. A client refuses a host without bit `0x4` as out of date, and without bit `0x1000` too (v1.5.0). A Tag room refuses a -client whose `CTOS_CAPABILITY` lacks `0x1000`: `STOC_ERROR_MSG` `ERRMSG_VERERROR` (code = -`FEATURE_PROTOCOL`), then the connection is closed; a Single room keeps it. +client whose `CTOS_CAPABILITY` lacks `0x1000` or `0x4000` (v1.6.0): `STOC_ERROR_MSG` `ERRMSG_VERERROR` +(code = `FEATURE_PROTOCOL`), then the connection is closed; a Single room keeps it. **Join snapshot.** A joiner gets, per occupied seat, right after that seat's `STOC_HS_PLAYER_ENTER`: the seat's stored capability, appearance (0006), seat state (0013) and profile (0020) when present, @@ -236,6 +236,7 @@ duelist's own side (v1.2.0), both sides for an observer when spectators see all | `0x800` | reserved | - | - | Proposal 44 (agreed, not shipped) | | `0x1000` | `FEATURE_TAG_TWO_FIELDS` | 10 | v1.5.0 | Tag two Field slots: Spell/Trap sequence 6 is a team's second Field Zone (no message); a Tag room refuses a joiner without it | | `0x2000` | `FEATURE_TAG_PARTNER_CARDS` | 9 | v1.2.0 | Tag partner cards (`STOC_TAG_PARTNER_CARDS`, `ygol_query_tag_cards`) | +| `0x4000` | `FEATURE_TAG_SHARED_EXTRA` | 11 | v1.6.0 | Tag shared Extra Deck: the setup pair `ygol.tag.extra=shared`, `QUERY_TAG_MEMBER` on Extra Deck refreshes; a Tag room refuses a joiner without it | `FEATURE_PROTOCOL` is bumped by every patch that adds a message a client must understand; the join list hides hosts older than the client's number. Rule 4 (proposal 47): one feature, one door. Never @@ -255,6 +256,7 @@ carry a new feature inside another feature's message. | v1.3.0 | Tag partner cards reach observers: when spectators see all, `STOC_TAG_PARTNER_CARDS` goes to every observer for both sides at every send point, plus both sides in an observer's resync and the late-watcher snapshot. Same id, same payload, no new capability bit (TICKET-412). | | v1.4.0 | Life points per side: with the setup pair `ygol.side.b.lp=` (section (d)) seat side B (seat 1; Tag seats 2 and 3) starts at `n` LP and side A at slot 8; without it both sides start at slot 8, as before. `set_player_info` gets each duel player its own LP, and `MSG_START` (the start and the late-watcher snapshot) carries `lp[0]`, `lp[1]` in duel player order: the side that goes first is player 0, so the two values swap when side B won the toss. `STOC_JOIN_GAME`'s `start_lp` stays side A's. Single, Match (every duel) and Tag; no new message, no capability bit. | | v1.5.0 | Tag two Field slots (proposal 45, TICKET-384; core `field::has_two_fields` = `DUEL_TAG_MODE` on Master Rule 4 or 5): a team has a Field slot per partner, 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`). A Field Spell that lands (activated, Set, `Duel.MoveToField` to `LOCATION_FZONE`) goes to the playing partner's slot and replaces only the card there; one that changes control while that slot is taken and the other is free takes the free one. A Set opens only the landing slot's bit in `MSG_SELECT_PLACE`. `LOCATION_FZONE` covers both slots (`Card.IsLocation`, `Duel.GetMatchingGroup` and the other filters, `Duel.IsEnvironment`, `Duel.CheckLocation(p, LOCATION_FZONE, 0/1)`), `Duel.GetFieldCard(p, LOCATION_FZONE, 0)` is the playing partner's field, else the other one, and sequence 1 the remaining one; `Duel.GetFieldCard(p, LOCATION_SZONE, 6)` works. The second field reaches a client as `MSG_MOVE` to Spell/Trap sequence 6 and in `MSG_RELOAD_FIELD`'s sixth Spell/Trap entry: no new message. Singles, Match and Master Rule 3 (where slot 6 is a Pendulum Zone) are unchanged. Scripts that name Spell/Trap sequence 5 by number see one field (the TICKET-384 closing note lists them). Capability `0x1000`, protocol 9 -> 10. | +| v1.6.0 | Tag shared Extra Deck (proposal 53, TICKET-433): with the setup pair `ygol.tag.extra=shared` (section (d)) `TagDuel` sets the duel option `DUEL_TAG_SHARED_EXTRA` `0x200`. `start_duel` moves each team's `tag_list_extra` into `list_extra` (the first partner's cards first) and renumbers the sequences, so either partner can Summon any of the cards; `tag_swap` leaves the Extra Deck alone, `MSG_TAG_SWAP` keeps its layout and sends the one list, and `ygol_query_tag_cards` / `0x5F` report an Extra count of 0. The opening `MSG_START` carries the sum of both partners' Extra Decks, and the opening Extra Deck refreshes run after `start_duel`. The core has one `owner` per team, so each card has `card::tag_member`, set once when it is loaded (0 `new_card`, 1 `new_tag_card`), and `RefreshExtra` adds `QUERY_TAG_MEMBER` to its flag in such a duel (section (c), Query records). Replays need no format change: `opt` holds the option and every reader passes `opt` to `start_duel`; a reader that writes its own `MSG_START` before `start_duel` must add the partner's Extra count. An older engine ignores the option and plays such a replay wrongly. Without the pair every stream is unchanged. Capability `0x4000`, protocol 10 -> 11. | ### Replay @@ -379,6 +381,21 @@ fork-related rows are marked. Ids 6, 7 and 34 are server-side (`network.h`); the core's `common.h` lists the rest. Any other id is an error for the consumer. +### Query records + +`query_card`, `query_field_card` and the query buffer of `MSG_UPDATE_DATA` / `MSG_UPDATE_CARD` hold one +record per card: `i32 length`, `u32 flag`, then one value per set `QUERY_*` bit in bit order, the bits +in `core/common.h`. The fork adds one bit: + +| Bit | Name | Value | Since | +|---|---|---|---| +| `0x1000000` | `QUERY_TAG_MEMBER` | `u32`, written LAST, after `QUERY_LINK`: the partner who brought the card, 0 from `new_card`, 1 from `new_tag_card`. It never changes when the card moves. The core writes it for any caller that sets the bit; the server sets it only on `RefreshExtra` in a duel with `ygol.tag.extra=shared` | v1.6.0 | + +**Bit `0x100000` stays unused.** Old flags set it with no value after it: `RefreshSingle`'s default +`0xf81fff`, the hand refresh `0x181fff` and YGOSharp's `0xFFFFFF` mask, and saved `.yrp3d` replays are +recorded streams of them. A value for that bit would shift every later field of those records, with no +error. + ## (d) Setup pairs and the Lua API ### Setup pairs (patch 0009, TICKET-258; ADR 0004 in the Unity repo) @@ -390,13 +407,14 @@ never interprets a pair: it stores the ordered list (max 64 pairs, 512 bytes eac `0x40000000`) and sends them to every joiner as `STOC_SETUP_PAIRS` (`0x43`). Values that need `,`, `=`, `%` or a space are percent-encoded by the client (`MatchSetup.cs`). -Three pairs ARE read by the server itself: +Four pairs ARE read by the server itself: | Key | Value | Read by | |---|---|---| | `ygol.room.watchers` | `0` = no observers: every observer join and HsToObserver is refused | 0012 | | `ygol.room.spectatorview` | `hidden` = the stock masked observer stream; absent = spectators see all | 0018, 0019 | | `ygol.side.b.lp` | a positive integer: seat side B's start LP (seat 1; Tag seats 2 and 3); side A keeps slot 8. Absent, `0`, negative or not a number = both sides at slot 8 | v1.4.0 | +| `ygol.tag.extra` | `shared` = a Tag team has one Extra Deck (option `0x200`, section (b) v1.6.0); anything else or absent = separate Extra Decks. A Single or Match room ignores it | v1.6.0 | Keys the Unity client sends today (`Assets/YGOLegacy/Scripts/Core/Duel/MatchSetup.cs`, `SetupPairKeys`); the rules Lua reads them from the registry: diff --git a/contract/probe-feature-messages.py b/contract/probe-feature-messages.py index 1daeab2..6402e01 100644 --- a/contract/probe-feature-messages.py +++ b/contract/probe-feature-messages.py @@ -160,6 +160,19 @@ # Duel.GetFieldCard(tp, LOCATION_FZONE, 0) is the playing partner's field and 1 # the other, Duel.IsEnvironment and Card.IsLocation see sequence 6. # +# With --dll it also gates v1.6.0 (proposal 53 / TICKET-433, Tag shared Extra Deck): +# the capability says protocol 11 + flag 0x4000 (single and tag); a Tag room +# refuses a joiner whose CTOS_CAPABILITY lacks 0x4000, a Single room keeps it. With +# ygol.tag.extra=shared MSG_START carries the sum of both partners' Extra Decks, +# the opening Extra Deck refresh lists all of them with QUERY_TAG_MEMBER 0x1000000 +# (0 from seat 0 / 2, 1 from seat 1 / 3; the other team's masked copy has flag 0), +# 0x5F reports an Extra count of 0, seat 0 Summons seat 1's monster on turn 1, +# seat 1 returns it on turn 3, and the value is still 1 in the refresh after the +# swap of turn 5; a late watcher's snapshot refresh has the values; no +# other query carries the bit; the replay has option 0x200 and plays back through +# the library to the same Summons. Without the pair the partners' lists stay +# apart and no query carries the bit. +# # Exit 0 only when every check passed. Stock DLL: the first check fails; the # 0011 DLL fails at the capability flags. import argparse, base64, ctypes, lzma, os, shutil, socket, sqlite3, struct, sys, tempfile, threading, time @@ -305,7 +318,7 @@ def check_snapshot(who, pkts, expect_seat_appearance, forbid_seat): check(len(server_caps) == 1 and j < server_caps[0][0] < t, "%s: the server's CAPABILITY(0xFF) sits between JOIN_GAME and TYPE_CHANGE" % who) if server_caps: proto, flags = struct.unpack_from("= 8: + (flag,) = struct.unpack_from("= 12 else None + member = struct.unpack_from("= 3 and d[0] == MSG_UPDATE_DATA and d[1] == side and d[2] == LOCATION_EXTRA] + + +def other_queries_with_bit(pkts): + bad = 0 + for p, d in pkts: + if p != 0x01 or len(d) < 3: + continue + if d[0] == MSG_UPDATE_DATA and d[2] != LOCATION_EXTRA: + bad += sum(1 for r in query_records(d, 3) if r[0] & QUERY_TAG_MEMBER) + elif d[0] == MSG_UPDATE_CARD: + bad += sum(1 for r in query_records(d, 4) if r[0] & QUERY_TAG_MEMBER) + return bad + + +def start_extra_counts(pkts): + # MSG_START: player, rule, i32 lp[2], u16 deck0, extra0, deck1, extra1 + return [(struct.unpack_from("= 19 and d[0] == MSG_START] + + +def members_by_code(records): + return sorted((r[1], r[2]) for r in records) + + +def replay_duel_parts(body, flag): + # the replay body up to the responses: (opt, start_lp, start_hand, draw_count, decks, responses) + at = 4 + struct.unpack_from(" len(stream): + break + (code,) = struct.unpack_from("= last_turn, limit=60) + check(ok, "%s: the duel reached turn %d (turn %d)" % (label, last_turn, state["turn"])) + check(state["retries"] == 0, "%s: no answer was refused (MSG_RETRY x%d)" % (label, state["retries"])) + for c in seated: + check(start_extra_counts(c.log) == [(3, 4) if shared else (2, 1)], "%s: seat %d's MSG_START gives the Extra Deck counts %s (%r)" % (label, c.seat, (3, 4) if shared else (2, 1), start_extra_counts(c.log))) + check(other_queries_with_bit(c.log) == 0, "%s: seat %d: no other query carries QUERY_TAG_MEMBER (%d)" % (label, c.seat, other_queries_with_bit(c.log))) + if shared: + opening = {0: [(F0, 0), (F0, 0), (F1, 1)], 1: [(F2, 0), (F3, 1), (F3, 1), (F3, 1)]} + for c in seated: + own, other = c.seat // 2, 1 - c.seat // 2 + first = extra_refreshes(c.log, own) + check(bool(first) and members_by_code(first[0]) == opening[own], "%s: seat %d's first Extra Deck refresh lists both partners' cards with the partner each came from (%r)" % (label, c.seat, members_by_code(first[0]) if first else None)) + masked = extra_refreshes(c.log, other) + check(bool(masked) and len(masked[0]) == len(opening[other]) and all(r[0] == 0 for r in masked[0]), "%s: seat %d's copy of the other team's refresh is masked, flag 0, no value (%r)" % (label, c.seat, masked[0] if masked else None)) + cards = partner_cards(c.log, own) + check(bool(cards) and all(g[3] == [] for g in cards) and len(cards[0][2]) == 5, "%s: seat %d's TAG_PARTNER_CARDS report an Extra count of 0, and the waiting hand stays (%r)" % (label, c.seat, [(g[3], len(g[2] or [])) for g in cards])) + for team in (0, 1): + first = extra_refreshes(watcher.log, team) + check(bool(first) and members_by_code(first[0]) == opening[team], "%s: the watcher's first refresh of side %d has the values too (%r)" % (label, team, members_by_code(first[0]) if first else None)) + check(state["selects"][:1] == [(1, [(0, F0), (1, F0), (2, F1)])], + "%s: on turn 1 seat 0 is offered both partners' Fusions, in sequences 0, 1, 2 (%r)" % (label, state["selects"][:1])) + check(state["summons"] == [(1, F1), (5, F0)], "%s: seat 0 Summons seat 1's monster on turn 1, its own on turn 5 (%r)" % (label, state["summons"])) + check([s[:3] for s in state["swaps"]] == [(3, 2, 0), (5, 3, 0)], + "%s: MSG_TAG_SWAP keeps the one list: 2 cards on turn 3, 3 on turn 5 when seat 1 returned the Fusion (%r)" % (label, [s[:3] for s in state["swaps"]])) + log = seated[0].log + after = extra_refreshes(log[state["swaps"][1][3]:], 0) if len(state["swaps"]) > 1 else [] + check(bool(after) and members_by_code(after[0]) == [(F0, 0), (F0, 0), (F1, 1)], "%s: after the swap of turn 5 the Fusion that moved still says partner 1 (%r)" % (label, members_by_code(after[0]) if after else None)) + late = Client("127.0.0.1", port, "se-late") + late.log = list(late.join()) + late.log += late.drain(quiet=0.6) + snapshot = extra_refreshes(late.log, 0) + check(bool(snapshot) and members_by_code(snapshot[0]) == [(F0, 0), (F1, 1)], "%s: a late watcher's snapshot refresh has the values (flag 0xefffff + the bit) (%r)" % (label, members_by_code(snapshot[0]) if snapshot else None)) + late.close() + else: + for c in seated + [watcher]: + for team in (0, 1): + records = [r for refresh in extra_refreshes(c.log, team) for r in refresh] + check(bool(records) and not any(r[0] & QUERY_TAG_MEMBER for r in records), "%s: %s: no Extra Deck refresh of side %d carries the bit" % (label, c.name, team)) + cards = partner_cards(seated[0].log, 0) + check(bool(cards) and cards[0][3] == [F1], "%s: the opening TAG_PARTNER_CARDS report the waiting partner's Extra Deck (%r)" % (label, cards[0][3] if cards else None)) + check(state["selects"][:1] == [(1, [(0, F0), (1, F0)])], "%s: on turn 1 seat 0 is offered only its own Fusions (%r)" % (label, state["selects"][:1])) + check(state["summons"] == [(1, F0)], "%s: seat 0 Summons its own monster on turn 1 (%r)" % (label, state["summons"])) + check([s[:3] for s in state["swaps"]] == [(3, 1, 0)], "%s: the swap of turn 3 brings seat 1's Extra Deck (%r)" % (label, [s[:3] for s in state["swaps"]])) + marks = marks_of(seated) + for c in seated[:2]: + c.send(CTOS_SURRENDER) + ok = pump(seated, lambda: all(match_overs(since(c, marks)) for c in seated), limit=10) + check(ok, "%s: side 0 surrendered: MATCH_OVER reached everyone" % label) + reps = replays(seated[0]) + if check(len(reps) == 1, "%s: one REPLAY arrived (%d)" % (label, len(reps))): + flag, seeds, body = reps[0] + parts = replay_duel_parts(body, flag) + check(bool(parts[0] & DUEL_TAG_SHARED_EXTRA) == shared, "%s: the replay's opt %s option 0x200 (opt 0x%x)" % (label, "has" if shared else "does not have", parts[0])) + back = play_replay_back(dll, seeds, parts, pairs) + if shared: + check(back["counts"] == (3, 4) and back["waiting"] == (0, 0), "%s: replay: start_duel merged: live Extra Decks 3 and 4, waiting lists 0 (%r, %r)" % (label, back["counts"], back["waiting"])) + check(back["opening"] == ([(F0, 0), (F0, 0), (F1, 1)], [(F2, 0), (F3, 1), (F3, 1), (F3, 1)]), "%s: replay: the query gives each card its partner (%r)" % (label, back["opening"])) + check(back["summons"] == [F1, F0], "%s: replay: the recorded answers Summon the waiting partner's monster, then seat 0's (%r)" % (label, back["summons"])) + check(back["responses_left"] == 0 and back["end_extra"] == [(F0, 0), (F1, 1)], "%s: replay: every answer was used and the Extra Deck ends as it did live (%d left, %r)" % (label, back["responses_left"], back["end_extra"])) + else: + check(back["counts"] == (2, 1) and back["waiting"] == (1, 3), "%s: replay: the lists stay apart: live 2 and 1, waiting 1 and 3 (%r, %r)" % (label, back["counts"], back["waiting"])) + check(back["summons"] == [F0] and back["responses_left"] == 0, "%s: replay: the recorded answers Summon the same monster (%r, %d left)" % (label, back["summons"], back["responses_left"])) + for c in seated + [watcher]: + c.close() + stop_dll(dll, thread, label) + finally: + os.chdir(here) + shutil.rmtree(root, ignore_errors=True) + + +def tag_shared_extra_single(dll_path, port, label): + print("== tag shared Extra Deck, %s (a Single room keeps a client without 0x4000)" % label) + root = make_workspace() + here = os.getcwd() + os.chdir(root) + try: + write_special(root, []) + dll, thread = host_dll(dll_path, port, 0) + h = Client("127.0.0.1", port, "se-host") + h.log = list(h.join()) + h.send(CTOS_CAPABILITY, capability_bytes(10, 0x37FF)) + h.log += h.drain(quiet=0.4) + check(h.seat == 0 and not error_msgs(h.log) and not h.closed, "%s: a seat whose capability lacks 0x4000 stays (errors %r, closed %r)" % (label, error_msgs(h.log), h.closed)) + h.close() + stop_dll(dll, thread, label) + finally: + os.chdir(here) + shutil.rmtree(root, ignore_errors=True) + + +def tag_shared_extra_suite(dll_path, port): + print() + print("hosting the tag shared Extra Deck rooms from %s" % dll_path) + tag_shared_extra_room(dll_path, port, "pair present", True) + tag_shared_extra_room(dll_path, port + 1, "pair absent", False) + tag_shared_extra_single(dll_path, port + 2, "single") + if __name__ == "__main__": sys.exit(main())