From 63e07d12c8df3d182ab15e1f1baab758dc5acbef Mon Sep 17 00:00:00 2001 From: Astra Date: Wed, 7 Oct 2026 09:36:08 +0100 Subject: [PATCH] 0.2.1: don't read the player list in OnAllPluginsLoaded at server start It isn't readable before the server has set up (Global Variables not initialized yet). Online players' blocks are only read there on a hot reload; at start everyone's load as they join. --- Whisper.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Whisper.cs b/Whisper.cs index adb9440..6a72d31 100644 --- a/Whisper.cs +++ b/Whisper.cs @@ -34,7 +34,7 @@ namespace Whisper; public class Whisper : BasePlugin, IPluginConfig { public override string ModuleName => "Whisper"; - public override string ModuleVersion => "0.2.0"; + public override string ModuleVersion => "0.2.1"; public override string ModuleAuthor => "astra"; public override string ModuleDescription => "Private messages between players"; @@ -116,8 +116,11 @@ public class Whisper : BasePlugin, IPluginConfig _writer.Start(); } - foreach (var player in Humans()) - LoadBlocks(player.SteamID); + // Only on a hot reload: at server start nobody's connected yet, and the player list can't be + // read before the server has set up (it throws). Everyone's blocks load as they join. + if (hotReload) + foreach (var player in Humans()) + LoadBlocks(player.SteamID); } public override void Unload(bool hotReload)