From 325af712142e8a13cb941e1e4aed163253a273b9 Mon Sep 17 00:00:00 2001 From: Robin Moeller Date: Fri, 23 Oct 2026 14:07:40 +0200 Subject: [PATCH] Plugins: the role test ticks once before asking, so the session's players are there The FakeGame test for player.role ran its console command straight after apply(), before the host had taken the session's players (Host::follow_session runs from tick), so the server copy indexed a nil player. It ticks each host once first, as plugins_server_copies_are_the_authority does; the player's copy and the plugin without server are then refused for the reasons they test. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Hs7xxJDf6SDcQUaXnzmtL5 --- Extension/Plugins/Test/plugin_tests.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Extension/Plugins/Test/plugin_tests.cpp b/Extension/Plugins/Test/plugin_tests.cpp index 5375b681..bf356d17 100644 --- a/Extension/Plugins/Test/plugin_tests.cpp +++ b/Extension/Plugins/Test/plugin_tests.cpp @@ -2134,6 +2134,10 @@ void plugins_server_copies_see_roles() { server_host.apply({roles("roles-s", R"("console", "session.read", "server")", "server")}); player_host.apply({roles("roles-p", R"("console", "session.read", "server")", "client")}); blind_host.apply({roles("roles-b", R"("console", "session.read")", "server")}); + // a tick first: the host takes the session's players then (Host::follow_session), so they are there to ask + ticks(server_host, server, 1); + ticks(player_host, player, 1); + ticks(blind_host, blind, 1); for (auto* host : {&server_host, &player_host, &blind_host}) host->run_console("roles"); check(server.logged("[roles-s] roles done"), "A server copy could not read the players' roles\n" + server.all()); check(!player.logged("roles done") && player.all().find("server copy") != std::string::npos,