diff --git a/ASFFreeGames/ASFFreeGamesPlugin.cs b/ASFFreeGames/ASFFreeGamesPlugin.cs index 4aa96dc..d29f6d0 100644 --- a/ASFFreeGames/ASFFreeGamesPlugin.cs +++ b/ASFFreeGames/ASFFreeGamesPlugin.cs @@ -40,7 +40,7 @@ internal static PluginContext Context { } // ReSharper disable once InconsistentNaming - private static readonly AsyncLocal _context = new(); + private static readonly ThreadLocal _context = new(); private static CancellationToken CancellationToken => Context.CancellationToken; public string Name => StaticName; @@ -141,7 +141,9 @@ public async void CollectGamesOnClock(object? source) { if (!cts.IsCancellationRequested) { string cmd = $"FREEGAMES {FreeGamesCommand.CollectInternalCommandString} " + string.Join(' ', reorderedBots.Select(static bot => bot.BotName)); - await OnBotCommand(null!, EAccess.None, cmd, cmd.Split()).ConfigureAwait(false); +#pragma warning disable CS1998 + OnBotCommand(null!, EAccess.None, cmd, cmd.Split()).GetAwaiter().GetResult(); // TODO use async +#pragma warning restore CS1998 } } }