server: 0012-rules-restart

TICKET-286: the rules restart (0x54-0x58): Prepare / ack / Commit barrier, a replacement server opened by the bootstrap secret, Reserved seats with tokens and a deadline.

Replayed from Tools/YGOLegacy/patches/0012-rules-restart.patch in the Unity repo.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
donnyandClaude Fable 5.1 committed 2026-10-14 20:58:57 -07:00
1 parent 9dbe0437f6
commit cea91450f2
7 files changed
+906 -48

No files matched your search

+6
View File
@@ -145,6 +145,8 @@ int main(int argc, char* argv[]) {
std::memset(ygo::pre_seed, 0, sizeof(ygo::pre_seed));
std::memset(ygo::pre_seed_specified, 0, sizeof(ygo::pre_seed_specified));
ygo::setup_pairs.clear(); // YGOL setup pairs
ygo::bootstrap_closed = false; // YGOL rules restart
std::memset(ygo::bootstrap_secret, 0, sizeof ygo::bootstrap_secret);
if (argc == 2) {
int code = atoi(argv[1]);
ygo::mainGame = &_game;
@@ -190,6 +192,10 @@ int main(int argc, char* argv[]) {
// YGOL setup pairs: ygol.* tokens never reach the seeds; the n-th other token is seed n, as before
for (int i = 13, seed = 0; i < argc; ++i)
{
if (ygo::IsBootstrapToken(argv[i])) { // YGOL rules restart: private, never a pair, never a seed
ygo::SetBootstrapSecret(argv[i]);
continue;
}
if (ygo::IsSetupPairToken(argv[i])) {
if (!ygo::AddSetupPair(argv[i]))
std::fprintf(stderr, "Dropped setup pair: %s\n", argv[i]);