server: tag partner cards are sent again whenever they change (TICKET-424, v1.4.2)
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>
This commit is contained in:
1 parent
5286cb2bfd
commit
10ade7fc41
5 files changed
+54
-3
No files matched your search
@@ -5,6 +5,15 @@ 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.4.2 — 2026-10-24
|
||||
|
||||
Tag partner cards follow every change. 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-24 | `STOC_TAG_PARTNER_CARDS 0x5F` has a fourth send point: after every engine batch (beside `FlushDeckLists`, not when the duel ended) `TagDuel::FlushTagPartnerCards` queries `ygol_query_tag_cards` per side and broadcasts it when the bytes differ from the last broadcast for that side (a Summon out of the waiting member's Extra Deck, Time Fusion), to the same receivers. Every broadcast (start, swap, change) records its bytes; a resync to one player does not. Server. | TICKET-424 | Wire `0x5F` |
|
||||
|
||||
## 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 /
|
||||
|
||||
@@ -214,7 +214,7 @@ duelist's own side (v1.2.0), both sides for an observer when spectators see all
|
||||
| `0x5C` | `STOC_DECK_LIST` | `STOC_DeckList` (5): `u8 version` (1), `u8 side`, `u8 kind`, `u16 count`, then `u32 codes[count]` | No | Kind 0 (the deck's remaining cards, SORTED) to its owner (both teammates in Tag); kind 1 (real order, top first) and kind 2 (the submitted Main Deck of the duelist whose deck is in the zone, sorted) to observers only when spectators see all. Sent when a list differs from the last one that audience got; in the late-watcher snapshot | `0x100` | 6 | 0019 |
|
||||
| `0x5D` | `STOC_PROFILE` | `u16 sender` + `CTOS_Profile` (100) | Yes | Everyone; stored per seat, in the snapshot after APPEARANCE, swapped with the seat, kept across the 0014 lobby reset, cleared when the seat empties | `0x200` | 7 | 0020 |
|
||||
| `0x5E` | `STOC_ATTACK_PREVIEW` | `u8 version` (1), `u8 count`, then per pair the 4 ask bytes echoed + the 24-byte `ygol_preview_attack` answer | No | The asker only. Only attackers the open prompt listed; a pair the engine refuses is left out (the count shrinks); a valid ask whose every pair is left out still gets count 0 | `0x400` | 8 | 0023 |
|
||||
| `0x5F` | `STOC_TAG_PARTNER_CARDS` | `u8 side` + the `ygol_query_tag_cards` bytes (7 + 4 x the three counts) | No | The two seats of `side`, never the other team. Sent after `start_duel` (the waiting members' opening hands), after every `MSG_TAG_SWAP` for the side that swapped (the member that just left is the waiting one), and to a seated duelist in its field resync (`CTOS_REQUEST_FIELD`, after the `MSG_RELOAD_FIELD`). **v1.3.0 (TICKET-412): when spectators see all (no `ygol.room.spectatorview=hidden`), every observer gets the same bytes for BOTH sides at the start and after every swap, and an observer's field resync and a late watcher's snapshot carry both sides (after the deck lists); with the pair, an observer never gets one.** Tag rooms only; a Single / Match room never sends it | `0x2000` | 9 | v1.2.0, v1.3.0 |
|
||||
| `0x5F` | `STOC_TAG_PARTNER_CARDS` | `u8 side` + the `ygol_query_tag_cards` bytes (7 + 4 x the three counts) | No | The two seats of `side`, never the other team. Sent after `start_duel` (the waiting members' opening hands), after every `MSG_TAG_SWAP` for the side that swapped (the member that just left is the waiting one), and to a seated duelist in its field resync (`CTOS_REQUEST_FIELD`, after the `MSG_RELOAD_FIELD`). **v1.3.0 (TICKET-412): when spectators see all (no `ygol.room.spectatorview=hidden`), every observer gets the same bytes for BOTH sides at the start and after every swap, and an observer's field resync and a late watcher's snapshot carry both sides (after the deck lists); with the pair, an observer never gets one.** **v1.4.2 (TICKET-424): after every engine batch (beside the deck lists, not when the duel ended), a side whose bytes differ from the last ones broadcast for it is sent again to the same receivers (an effect that moves a waiting member's card mid-turn); every broadcast records its bytes, so a swap is never sent twice; a resync to one player does not record.** Tag rooms only; a Single / Match room never sends it | `0x2000` | 9 | v1.2.0, v1.3.0, v1.4.2 |
|
||||
|
||||
### Capability bits and protocol numbers
|
||||
|
||||
|
||||
@@ -143,6 +143,12 @@
|
||||
# side B won the toss), and the replay has flag 0x20000000 with the same two
|
||||
# values after opt. Every other room's replay has no such flag.
|
||||
#
|
||||
# With --dll it also gates v1.4.2 (TICKET-424, tag partner cards on change): in
|
||||
# the TICKET-415 room the Fusion seat 3 picked leaves seat 3's Extra Deck in
|
||||
# seat 2's Standby Phase of turn 6, while seat 3 waits; between that
|
||||
# MSG_SPSUMMONING and the next MSG_TAG_SWAP seats 2 and 3 get exactly one
|
||||
# TAG_PARTNER_CARDS, for side 1 with an empty Extra Deck, and seats 0 and 1 none.
|
||||
#
|
||||
# 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
|
||||
@@ -2958,6 +2964,18 @@ def tag_across_swap_room(dll_path, port, label):
|
||||
check(state["retries"] == 0, "%s: no answer was refused (MSG_RETRY x%d)" % (label, state["retries"]))
|
||||
ok = play(lambda: state["swap8"] is not None, limit=20)
|
||||
check(ok and state["swap8"] is not None and state["swap8"][3] == 0, "%s: the swap of turn 8 brings seat 3 back with an empty Extra Deck: the Fusion left the list that held it (%s)" % (label, None if state["swap8"] is None else state["swap8"][3]))
|
||||
for c in seated:
|
||||
# TICKET-424: the waiting member's Extra Deck changed mid-turn, so its side's seats get the new bytes once
|
||||
log = c.log
|
||||
start = next((i for i, (p, d) in enumerate(log) if p == 0x01 and d and d[0] == MSG_SPSUMMONING and struct.unpack_from("<I", d, 1)[0] == PROBE_FUSION), None)
|
||||
if not check(start is not None, "%s: seat %d saw the Fusion's MSG_SPSUMMONING" % (label, c.seat)):
|
||||
continue
|
||||
end = next((i for i in range(start + 1, len(log)) if log[i][0] == 0x01 and log[i][1] and log[i][1][0] == MSG_TAG_SWAP), len(log))
|
||||
got = partner_cards(log[start + 1:end])
|
||||
if c.seat >= 2:
|
||||
check(len(got) == 1 and got[0][0] == 1 and got[0][3] == [], "%s: seat %d got exactly one TAG_PARTNER_CARDS after the Summon out of the waiting partner's Extra Deck, side 1 with an empty Extra Deck (%s)" % (label, c.seat, [(g[0], g[3]) for g in got]))
|
||||
else:
|
||||
check(not got, "%s: seat %d (the other team) got no TAG_PARTNER_CARDS for the change (%d)" % (label, c.seat, len(got)))
|
||||
check(all(not c.closed for c in seated), "%s: every seat is still connected" % label)
|
||||
marks = marks_of(seated)
|
||||
for c in seated[:2]:
|
||||
|
||||
@@ -1384,6 +1384,7 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
|
||||
RefreshExtra(0);
|
||||
RefreshExtra(1);
|
||||
start_duel(pduel, opt);
|
||||
tag_cards_known[0] = tag_cards_known[1] = false;
|
||||
SendTagPartnerCards(0); // YGOL tag partner cards: the waiting members' opening hands
|
||||
SendTagPartnerCards(1);
|
||||
if(host_info.time_limit) {
|
||||
@@ -1420,8 +1421,10 @@ void TagDuel::Process() {
|
||||
stop = Analyze(engineBuffer.data(), engLen);
|
||||
}
|
||||
}
|
||||
if(stop != 2) // YGOL deck lists: after every engine batch, before a prompt waits
|
||||
if(stop != 2) { // YGOL deck lists + tag partner cards: after every engine batch, before a prompt waits
|
||||
FlushDeckLists();
|
||||
FlushTagPartnerCards();
|
||||
}
|
||||
if(stop == 2)
|
||||
DuelEndProc();
|
||||
}
|
||||
@@ -3050,7 +3053,9 @@ void TagDuel::FlushDeckLists() {
|
||||
}
|
||||
// YGOL tag partner cards: STOC_TAG_PARTNER_CARDS 0x5F = uint8_t side + the ygol_query_tag_cards bytes, to that side's two
|
||||
// seats (never the other team) and, when spectators see all, to every observer: after start_duel, after every
|
||||
// MSG_TAG_SWAP, in a seat's field resync (its side) and in an observer's resync / late-watcher snapshot (both sides).
|
||||
// MSG_TAG_SWAP, after any engine batch that changed the side's bytes (TICKET-424), in a seat's field resync (its side)
|
||||
// and in an observer's resync / late-watcher snapshot (both sides). A broadcast records the bytes it sent; a send to
|
||||
// one player (a resync) does not, so it never hides a change the others have not had.
|
||||
void TagDuel::SendTagPartnerCards(int side, DuelPlayer* dp) {
|
||||
if(!pduel)
|
||||
return;
|
||||
@@ -3063,6 +3068,8 @@ void TagDuel::SendTagPartnerCards(int side, DuelPlayer* dp) {
|
||||
NetServer::SendBufferToPlayer(dp, STOC_TAG_PARTNER_CARDS, buf, 1 + len);
|
||||
return;
|
||||
}
|
||||
tag_cards_sent[side].assign(buf + 1, buf + 1 + len);
|
||||
tag_cards_known[side] = true;
|
||||
for(int seat = side * 2; seat < side * 2 + 2; ++seat)
|
||||
if(players[seat])
|
||||
NetServer::SendBufferToPlayer(players[seat], STOC_TAG_PARTNER_CARDS, buf, 1 + len);
|
||||
@@ -3070,6 +3077,20 @@ void TagDuel::SendTagPartnerCards(int side, DuelPlayer* dp) {
|
||||
for(auto oit = observers.begin(); oit != observers.end(); ++oit)
|
||||
NetServer::SendBufferToPlayer(*oit, STOC_TAG_PARTNER_CARDS, buf, 1 + len);
|
||||
}
|
||||
void TagDuel::FlushTagPartnerCards() {
|
||||
if(!pduel)
|
||||
return;
|
||||
unsigned char buf[1 + 6 + (2 * UINT8_MAX + MAINC_MAX) * sizeof(uint32_t)];
|
||||
for(int side = 0; side < 2; ++side) {
|
||||
const int len = ygol_query_tag_cards(pduel, (uint8_t)side, buf);
|
||||
if(len <= 0)
|
||||
continue;
|
||||
if(tag_cards_known[side] && tag_cards_sent[side].size() == (size_t)len
|
||||
&& std::equal(tag_cards_sent[side].begin(), tag_cards_sent[side].end(), buf))
|
||||
continue;
|
||||
SendTagPartnerCards(side);
|
||||
}
|
||||
}
|
||||
void TagDuel::TimeConfirm(DuelPlayer* dp) {
|
||||
if(host_info.time_limit == 0)
|
||||
return;
|
||||
|
||||
@@ -100,6 +100,9 @@ protected:
|
||||
CTOS_Profile profile[4]{};
|
||||
std::vector<uint16_t> preview_attackers; // YGOL attack preview: location << 8 | sequence of every attacker the open battle prompt lists
|
||||
void SendTagPartnerCards(int side, DuelPlayer* dp = nullptr); // YGOL tag partner cards: STOC 0x5F to the side's two seats (+ every observer when they see all), or to dp alone
|
||||
void FlushTagPartnerCards(); // YGOL tag partner cards: after every engine batch, a side whose bytes changed since its last broadcast sends again (TICKET-424)
|
||||
std::vector<unsigned char> tag_cards_sent[2];
|
||||
bool tag_cards_known[2]{};
|
||||
// YGOL coin toss
|
||||
void BeginChoose(int chooser, uint8_t face);
|
||||
int choose_seat{};
|
||||
|
||||
Reference in new issue
Block a user