You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2024-05-09 14:43:18|ArchiSteamFarm-23364|INFO|ASF|CollectGames() [FreeGames] found potentially 22 free games on reddit 2024-05-09 14:43:18|ArchiSteamFarm-23364|FATAL|ASF|OnUnhandledException() System.Collections.Generic.KeyNotFoundException: The given key 'Terreus' was not present in the dictionary. at System.Collections.Generic.Dictionary2.get_Item(TKey)
at ASFFreeGames.Commands.FreeGamesCommand.<>c__DisplayClass14_0.b__2(String botName)
at System.Linq.Enumerable.SelectListPartitionIterator2.MoveNext() at ASFFreeGames.Commands.FreeGamesCommand.CollectGames(IEnumerable1 bots, ECollectGameRequestSource requestSource, CancellationToken cancellationToken)
at ASFFreeGames.Commands.FreeGamesCommand.HandleInternalCollectCommand(Bot bot, String[] args, CancellationToken cancellationToken)
at ASFFreeGames.Commands.FreeGamesCommand.Execute(Bot bot, String message, String[] args, UInt64 steamID, CancellationToken cancellationToken)
at ASFFreeGames.Commands.CommandDispatcher.Execute(Bot bot, String message, String[] args, UInt64 steamID, CancellationToken cancellationToken)
at Maxisoft.ASF.ASFFreeGamesPlugin.OnBotCommand(Bot bot, EAccess access, String message, String[] args, UInt64 steamID)
at Maxisoft.ASF.ASFFreeGamesPlugin.CollectGamesOnClock(Object source)
at System.Threading.Tasks.Task.<>c.b__128_1(Object state)
at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi)
at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext, Action1, TState& ) at System.Threading.QueueUserWorkItemCallback.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() at System.Threading.Thread.StartCallback() 2024-05-09 14:43:18|ArchiSteamFarm-23364|ERROR|ASF|Exit() Exiting with 1 error code! 2024-05-09 14:43:18|ArchiSteamFarm-23364|INFO|Microsoft.Hosting.Lifetime|Application is shutting down... Unhandled exception. System.Collections.Generic.KeyNotFoundException: The given key 'Terreus' was not present in the dictionary. at System.Collections.Generic.Dictionary2.get_Item(TKey)
at ASFFreeGames.Commands.FreeGamesCommand.<>c__DisplayClass14_0.b__2(String botName)
at System.Linq.Enumerable.SelectListPartitionIterator2.MoveNext() at ASFFreeGames.Commands.FreeGamesCommand.CollectGames(IEnumerable1 bots, ECollectGameRequestSource requestSource, CancellationToken cancellationToken)
at ASFFreeGames.Commands.FreeGamesCommand.HandleInternalCollectCommand(Bot bot, String[] args, CancellationToken cancellationToken)
at ASFFreeGames.Commands.FreeGamesCommand.Execute(Bot bot, String message, String[] args, UInt64 steamID, CancellationToken cancellationToken)
at ASFFreeGames.Commands.CommandDispatcher.Execute(Bot bot, String message, String[] args, UInt64 steamID, CancellationToken cancellationToken)
at Maxisoft.ASF.ASFFreeGamesPlugin.OnBotCommand(Bot bot, EAccess access, String message, String[] args, UInt64 steamID)
at Maxisoft.ASF.ASFFreeGamesPlugin.CollectGamesOnClock(Object source)
at System.Threading.Tasks.Task.<>c.b__128_1(Object state)
at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi)
at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext, Action1, TState& ) at System.Threading.QueueUserWorkItemCallback.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() at System.Threading.Thread.StartCallback() zsh: abort /Users/********/*******/ASF-osx-x64/ArchiSteamFarm
Desktop:
OS: mcOS Sonoma
The text was updated successfully, but these errors were encountered:
This commit resolves the `KeyNotFoundException` encountered during the scheduled free game collection process. The issue was caused by an attempt to access a non-existent key in the bot dictionary, as reported in issue #70.
Changes include:
- Added a check in `ASFFreeGamesPlugin.cs` to ensure there are viable bots before proceeding with the free game collection command.
- Modified `FreeGamesCommand.cs` to handle bot collections more robustly, trimming bot names to prevent whitespace issues and using `GetValueOrDefault` to avoid exceptions when a bot name is not found.
- Updated the `HandleInternalCollectCommand` method to return a more informative response, indicating the number of collected games and the bots involved in the operation.
These updates aim to enhance the stability and reliability of the free game collection feature in ASF.
The upcoming release will include a fix for the KeyNotFoundException you've encountered. This fix will prevent ASF from crashing under similar circumstances, but it's important to note that the ASFFreeGames plugin might still not claim the games for the specific account that triggered the issue.
To help us pinpoint the root cause, could you provide more information? For example:
Did you add, edit, or remove a bot while the plugin was running? If so, restarting the app might resolve the issue.
Does your bot name contain any special or unusual characters that might not be handled correctly?
Any additional details you can provide would be greatly appreciated to ensure a comprehensive solution.
2024-05-09 14:43:18|ArchiSteamFarm-23364|INFO|ASF|CollectGames() [FreeGames] found potentially 22 free games on reddit 2024-05-09 14:43:18|ArchiSteamFarm-23364|FATAL|ASF|OnUnhandledException() System.Collections.Generic.KeyNotFoundException: The given key 'Terreus' was not present in the dictionary. at System.Collections.Generic.Dictionary
2.get_Item(TKey)at ASFFreeGames.Commands.FreeGamesCommand.<>c__DisplayClass14_0.b__2(String botName)
at System.Linq.Enumerable.SelectListPartitionIterator
2.MoveNext() at ASFFreeGames.Commands.FreeGamesCommand.CollectGames(IEnumerable
1 bots, ECollectGameRequestSource requestSource, CancellationToken cancellationToken)at ASFFreeGames.Commands.FreeGamesCommand.HandleInternalCollectCommand(Bot bot, String[] args, CancellationToken cancellationToken)
at ASFFreeGames.Commands.FreeGamesCommand.Execute(Bot bot, String message, String[] args, UInt64 steamID, CancellationToken cancellationToken)
at ASFFreeGames.Commands.CommandDispatcher.Execute(Bot bot, String message, String[] args, UInt64 steamID, CancellationToken cancellationToken)
at Maxisoft.ASF.ASFFreeGamesPlugin.OnBotCommand(Bot bot, EAccess access, String message, String[] args, UInt64 steamID)
at Maxisoft.ASF.ASFFreeGamesPlugin.CollectGamesOnClock(Object source)
at System.Threading.Tasks.Task.<>c.b__128_1(Object state)
at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi)
at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext, Action
1, TState& ) at System.Threading.QueueUserWorkItemCallback.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() at System.Threading.Thread.StartCallback() 2024-05-09 14:43:18|ArchiSteamFarm-23364|ERROR|ASF|Exit() Exiting with 1 error code! 2024-05-09 14:43:18|ArchiSteamFarm-23364|INFO|Microsoft.Hosting.Lifetime|Application is shutting down... Unhandled exception. System.Collections.Generic.KeyNotFoundException: The given key 'Terreus' was not present in the dictionary. at System.Collections.Generic.Dictionary
2.get_Item(TKey)at ASFFreeGames.Commands.FreeGamesCommand.<>c__DisplayClass14_0.b__2(String botName)
at System.Linq.Enumerable.SelectListPartitionIterator
2.MoveNext() at ASFFreeGames.Commands.FreeGamesCommand.CollectGames(IEnumerable
1 bots, ECollectGameRequestSource requestSource, CancellationToken cancellationToken)at ASFFreeGames.Commands.FreeGamesCommand.HandleInternalCollectCommand(Bot bot, String[] args, CancellationToken cancellationToken)
at ASFFreeGames.Commands.FreeGamesCommand.Execute(Bot bot, String message, String[] args, UInt64 steamID, CancellationToken cancellationToken)
at ASFFreeGames.Commands.CommandDispatcher.Execute(Bot bot, String message, String[] args, UInt64 steamID, CancellationToken cancellationToken)
at Maxisoft.ASF.ASFFreeGamesPlugin.OnBotCommand(Bot bot, EAccess access, String message, String[] args, UInt64 steamID)
at Maxisoft.ASF.ASFFreeGamesPlugin.CollectGamesOnClock(Object source)
at System.Threading.Tasks.Task.<>c.b__128_1(Object state)
at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi)
at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext, Action
1, TState& ) at System.Threading.QueueUserWorkItemCallback.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() at System.Threading.Thread.StartCallback() zsh: abort /Users/********/*******/ASF-osx-x64/ArchiSteamFarm
Desktop:
The text was updated successfully, but these errors were encountered: