JustArchiNET / ArchiSteamFarm

C# application with primary purpose of farming Steam cards from multiple accounts simultaneously.
Apache License 2.0
11.25k stars 1.05k forks source link

Utilities.GetUnixTime() leads to System.MissingMethodException #2601

Closed maxisoft closed 2 years ago

maxisoft commented 2 years ago

Checklist

ASF version

Latest pre-release

ASF variant

win-x64

Bug description

Using latest pre-release ASF-win-x64.zip V5.2.7.1 and https://github.com/maxisoft/ASFFreeGames makes asf program crash due to System.MissingMethodException (https://github.com/maxisoft/ASFFreeGames/issues/2).

The root cause is that the asf method ArchiSteamFarm.Core.Utilities.GetUnixTime() got trimmed out in the release.

https://github.com/JustArchiNET/ArchiSteamFarm/blob/8948817d552ed0f000cc4b4b86e9051f0b9efb3a/ArchiSteamFarm/Core/Utilities.cs#L96-L97

While I've already added a workaround on my plugin code, it seems the missing method is annoted with [PublicAPI]. It seems odd that a PublicAPI method got trimmed out (hence I made this bug report).

Expected behavior

I'm not expecting that a [PublicAPI] call leads to a System.MissingMethodException.

Actual behavior

System.MissingMethodException crash on Utilities.GetUnixTime()

Steps to reproduce

Possible reason/solution

Up to the Assignees. IMO the two straithforward solutions are:

Note: It seems this method is somehow internally inlined or discarded during compilation/trim phase as there's calls on MobileAuthenticator.cs

Can you help us with this bug report?

Somehow, I can test and offer feedback, but can't code

Full log.txt recorded during reproducing the problem

2022-06-09 13:32:56|ArchiSteamFarm-12082|INFO|ASF|InitCore() Copyright © 2015-2022 JustArchiNET
2022-06-09 13:32:56|ArchiSteamFarm-12082|INFO|ASF|InitPlugins() Initializing Plugins...
2022-06-09 13:32:57|ArchiSteamFarm-12082|INFO|ASF|InitPlugins() Loading ASFEnhance V1.6.4.469...
2022-06-09 13:32:57|ArchiSteamFarm-12082|INFO|ASF|OnLoaded() 
==========================================
 █████╗ ███████╗███████╗███████╗███╗   ██╗██╗  ██╗ █████╗ ███╗   ██╗ ██████╗███████╗
██╔══██╗██╔════╝██╔════╝██╔════╝████╗  ██║██║  ██║██╔══██╗████╗  ██║██╔════╝██╔════╝
███████║███████╗█████╗  █████╗  ██╔██╗ ██║███████║███████║██╔██╗ ██║██║     █████╗  
██╔══██║╚════██║██╔══╝  ██╔══╝  ██║╚██╗██║██╔══██║██╔══██║██║╚██╗██║██║     ██╔══╝  
██║  ██║███████║██║     ███████╗██║ ╚████║██║  ██║██║  ██║██║ ╚████║╚██████╗███████╗
╚═╝  ╚═╝╚══════╝╚═╝     ╚══════╝╚═╝  ╚═══╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═══╝ ╚═════╝╚══════╝
ASFEnhance Version 1.6.4.469
Developed by Chr_, email chr@chrxw.com
https://afdian.net/@chr233
==========================================
Use Command "ASFEVERSION" / "AV" to check the plugin's latest version
Use Command "ASFEUPDATE" / "AU" to update the plugin
==========================================

2022-06-09 13:32:55|ArchiSteamFarm-12082|INFO|ASF|InitPlugins() ASFEnhance has been loaded successfully!
2022-06-09 13:32:57|ArchiSteamFarm-12082|INFO|ASF|InitPlugins() Loading SteamTokenDumperPlugin V5.2.7.1...
2022-06-09 13:32:57|ArchiSteamFarm-12082|INFO|ASF|InitPlugins() SteamTokenDumperPlugin has been loaded successfully!
2022-06-09 13:32:57|ArchiSteamFarm-12082|INFO|ASF|InitPlugins() Loading CaseInsensitiveASF V0.4.1.0...
2022-06-09 13:32:57|ArchiSteamFarm-12082|INFO|ASF|OnLoaded() Case Insensitive ASF Plugin by Ryzhehvost, powered by ginger cats
2022-06-09 13:32:57|ArchiSteamFarm-12082|INFO|ASF|InitPlugins() CaseInsensitiveASF has been loaded successfully!
2022-06-09 13:32:57|ArchiSteamFarm-12082|INFO|ASF|InitPlugins() Loading ASFFreeGamesPlugin V1.2.1.0...
2022-06-09 13:32:57|ArchiSteamFarm-12082|INFO|ASF|InitPlugins() ASFFreeGamesPlugin has been loaded successfully!
2022-06-09 13:32:57|ArchiSteamFarm-12082|INFO|ASF|InitPlugins() You've loaded one or multiple custom plugins into ASF. Since we're unable to offer support for modded setups, please contact the appropriate developers of the plugins that you decided to use in case of any issues.
2022-06-09 13:32:57|ArchiSteamFarm-12082|INFO|ASF|UpdateAndRestart() ASF will automatically check for new versions every 12 hours.
2022-06-09 13:32:57|ArchiSteamFarm-12082|INFO|ASF|Update() Checking for new version...
2022-06-09 13:32:57|ArchiSteamFarm-12082|INFO|ASF|Update() Local version: 5.2.7.1 | Remote version: 5.2.7.1
2022-06-09 13:32:57|ArchiSteamFarm-12082|INFO|ASF|OnASFInit() SteamTokenDumperPlugin is currently disabled according to your configuration. If you'd like to help SteamDB in data submission, please check out our wiki.
2022-06-09 13:32:57|ArchiSteamFarm-12082|WARN|ASF|RegisterBots() You're running more personal bot accounts than our upper recommended limit (10). Be advised that this setup is not supported and might cause various Steam-related issues, including account suspensions. Check out the FAQ for more details.
2022-06-09 13:33:08|ArchiSteamFarm-12082|INFO|bot1|Start() Starting...
2022-06-09 13:33:08|ArchiSteamFarm-12082|INFO|bot1|Connect() Connecting...
2022-06-09 13:33:08|ArchiSteamFarm-12082|INFO|bot10|Start() Starting...
2022-06-09 13:33:08|ArchiSteamFarm-12082|INFO|bot2|Start() Starting...
2022-06-09 13:33:08|ArchiSteamFarm-12082|INFO|bot5|Start() Starting...
2022-06-09 13:33:08|ArchiSteamFarm-12082|INFO|bot2|Start() Starting...
2022-06-09 13:33:08|ArchiSteamFarm-12082|INFO|bot7|Start() Starting...
2022-06-09 13:33:08|ArchiSteamFarm-12082|INFO|bot9|Start() Starting...
2022-06-09 13:33:08|ArchiSteamFarm-12082|INFO|bot15|Start() Starting...
2022-06-09 13:33:08|ArchiSteamFarm-12082|INFO|bot12|Start() Starting...
2022-06-09 13:33:08|ArchiSteamFarm-12082|INFO|bot11|Start() Starting...
2022-06-09 13:33:08|ArchiSteamFarm-12082|INFO|bot13|Start() Starting...
2022-06-09 13:33:08|ArchiSteamFarm-12082|INFO|bot3|Start() Starting...
2022-06-09 13:33:08|ArchiSteamFarm-12082|INFO|bot6|Start() Starting...
2022-06-09 13:33:09|ArchiSteamFarm-12082|INFO|bot8|Start() Starting...
2022-06-09 13:33:09|ArchiSteamFarm-12082|INFO|bot14|Start() Starting...
2022-06-09 13:33:09|ArchiSteamFarm-12082|INFO|bot1|OnConnected() Connected to Steam!
2022-06-09 13:33:09|ArchiSteamFarm-12082|INFO|bot1|OnConnected() Logging in...
2022-06-09 13:33:09|ArchiSteamFarm-12082|INFO|bot1|OnLoggedOn() Successfully logged on as *****************/bot1.
2022-06-09 13:33:10|ArchiSteamFarm-12082|INFO|bot1|Init() Logging in to ISteamUserAuth...
2022-06-09 13:33:10|ArchiSteamFarm-12082|INFO|bot1|Init() Success!
!2022-06-09 13:33:10|ArchiSteamFarm-12082|ERROR|ASF|LoadFromFile() Unable to load previous completed app dict
2022-06-09 13:33:11|ArchiSteamFarm-12082|INFO|bot1|IsAnythingToFarm() Checking first badge page...
2022-06-09 13:33:11|ArchiSteamFarm-12082|INFO|bot1|StartFarming() We don't have anything to farm on this account!
2022-06-09 13:33:18|ArchiSteamFarm-12082|INFO|bot10|Connect() Connecting...
2022-06-09 13:33:18|ArchiSteamFarm-12082|INFO|bot10|OnConnected() Connected to Steam!
2022-06-09 13:33:18|ArchiSteamFarm-12082|INFO|bot10|OnConnected() Logging in...
2022-06-09 13:33:19|ArchiSteamFarm-12082|INFO|bot10|OnLoggedOn() Successfully logged on as *****************/smurfgeneratorcom.
2022-06-09 13:33:19|ArchiSteamFarm-12082|INFO|bot10|Init() Logging in to ISteamUserAuth...
2022-06-09 13:33:19|ArchiSteamFarm-12082|INFO|bot10|IsAnythingToFarm() Checking first badge page...
2022-06-09 13:33:19|ArchiSteamFarm-12082|INFO|bot10|Init() Success!
! 2022-06-09 13:33:19|ArchiSteamFarm-12082|ERROR|ASF|LoadFromFile() Unable to load previous completed app dict
2022-06-09 13:33:20|ArchiSteamFarm-12082|INFO|bot10|StartFarming() We don't have anything to farm on this account!
2022-06-09 13:33:28|ArchiSteamFarm-12082|INFO|bot2|Connect() Connecting...
2022-06-09 13:33:28|ArchiSteamFarm-12082|INFO|bot2|OnConnected() Connected to Steam!
2022-06-09 13:33:28|ArchiSteamFarm-12082|INFO|bot2|OnConnected() Logging in...
2022-06-09 13:33:29|ArchiSteamFarm-12082|INFO|bot2|OnLoggedOn() Successfully logged on as *****************/bot2.
2022-06-09 13:33:29|ArchiSteamFarm-12082|INFO|bot2|Init() Logging in to ISteamUserAuth...
2022-06-09 13:33:29|ArchiSteamFarm-12082|INFO|bot2|IsAnythingToFarm() Checking first badge page...
2022-06-09 13:33:30|ArchiSteamFarm-12082|INFO|bot2|Init() Success!
!2022-06-09 13:33:30|ArchiSteamFarm-12082|ERROR|ASF|LoadFromFile() Unable to load previous completed app dict
2022-06-09 13:33:31|ArchiSteamFarm-12082|INFO|bot2|IsAnythingToFarm() Checking other badge pages...
2022-06-09 13:33:33|ArchiSteamFarm-12082|INFO|bot2|Farm() We have a total of 6 games (21 cards) left to farm (~10 hours, 30 minutes remaining)...
2022-06-09 13:33:33|ArchiSteamFarm-12082|INFO|bot2|Farm() Chosen farming algorithm: Simple
2022-06-09 13:33:33|ArchiSteamFarm-12082|INFO|bot2|IsPlayableGame() Farming 960990 (Beyond: Two Souls) is temporarily disabled, as ASF is not able to play that game at the moment.
2022-06-09 13:33:33|ArchiSteamFarm-12082|INFO|bot2|IsPlayableGame() Farming 1283190 (Neighbours back From Hell) is temporarily disabled, as ASF is not able to play that game at the moment.
2022-06-09 13:33:33|ArchiSteamFarm-12082|INFO|bot2|IsPlayableGame() Farming 537800 (Bomber Crew) is temporarily disabled, as ASF is not able to play that game at the moment.
2022-06-09 13:33:33|ArchiSteamFarm-12082|INFO|bot2|IsPlayableGame() Farming 527230 (For The King) is temporarily disabled, as ASF is not able to play that game at the moment.
2022-06-09 13:33:33|ArchiSteamFarm-12082|INFO|bot2|IsPlayableGame() Farming 555510 (MachiaVillain) is temporarily disabled, as ASF is not able to play that game at the moment.
2022-06-09 13:33:33|ArchiSteamFarm-12082|INFO|bot2|IsPlayableGame() Farming 675010 (MudRunner) is temporarily disabled, as ASF is not able to play that game at the moment.
2022-06-09 13:33:33|ArchiSteamFarm-12082|INFO|bot2|IsAnythingToFarm() Checking first badge page...
2022-06-09 13:33:34|ArchiSteamFarm-12082|INFO|bot2|IsAnythingToFarm() Checking other badge pages...
2022-06-09 13:33:35|ArchiSteamFarm-12082|INFO|bot2|Farm() Farming finished!
2022-06-09 13:33:38|ArchiSteamFarm-12082|INFO|bot5|Connect() Connecting...
2022-06-09 13:33:38|ArchiSteamFarm-12082|INFO|bot5|OnConnected() Connected to Steam!
2022-06-09 13:33:38|ArchiSteamFarm-12082|INFO|bot5|OnConnected() Logging in...
2022-06-09 13:33:39|ArchiSteamFarm-12082|INFO|bot5|OnLoggedOn() Successfully logged on as *****************/bot5.
2022-06-09 13:33:39|ArchiSteamFarm-12082|WARN|bot5|OnLoggedOn() This account is limited, farming process is unavailable until the restriction is removed!
2022-06-09 13:33:39|ArchiSteamFarm-12082|INFO|bot5|Init() Logging in to ISteamUserAuth...
2022-06-09 13:33:39|ArchiSteamFarm-12082|INFO|bot5|StartFarming() We don't have anything to farm on this account!
2022-06-09 13:33:39|ArchiSteamFarm-12082|INFO|bot5|Init() Success!
!2022-06-09 13:33:39|ArchiSteamFarm-12082|ERROR|ASF|LoadFromFile() Unable to load previous completed app dict
-2022-06-09 13:33:40|ArchiSteamFarm-12082|FATAL|ASF|OnUnhandledException() System.MissingMethodException: Method not found: 'UInt32 ArchiSteamFarm.Core.Utilities.GetUnixTime()'.
-   at Maxisoft.ASF.ASFFreeGamesPlugin.CollectGames(IEnumerable`1 bots, CancellationToken cancellationToken)
-   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& )
-   at Maxisoft.ASF.ASFFreeGamesPlugin.CollectGames(IEnumerable`1 bots, CancellationToken cancellationToken)
-   at Maxisoft.ASF.ASFFreeGamesPlugin.CollectGamesOnClock(Object source)
-   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object )
-   at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
-   at System.Threading.ThreadPoolWorkQueue.Dispatch()
-   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
-  at System.Threading.Thread.StartCallback()
-2022-06-09 13:33:40|ArchiSteamFarm-12082|ERROR|ASF|Exit() Exiting with nonzero error code!
2022-06-09 13:33:40|ArchiSteamFarm-12082|INFO|bot8|Stop() Stopping...
2022-06-09 13:33:40|ArchiSteamFarm-12082|INFO|bot1|Stop() Stopping...
2022-06-09 13:33:40|ArchiSteamFarm-12082|INFO|bot9|Stop() Stopping...
2022-06-09 13:33:40|ArchiSteamFarm-12082|INFO|bot7|Stop() Stopping...
2022-06-09 13:33:40|ArchiSteamFarm-12082|INFO|bot6|Stop() Stopping...
2022-06-09 13:33:40|ArchiSteamFarm-12082|INFO|bot2|Stop() Stopping...
2022-06-09 13:33:40|ArchiSteamFarm-12082|INFO|bot4|Stop() Stopping...
2022-06-09 13:33:40|ArchiSteamFarm-12082|INFO|bot3|Stop() Stopping...
2022-06-09 13:33:40|ArchiSteamFarm-12082|INFO|bot5|Stop() Stopping...

Global ASF.json config file

No response

BotName.json config of all affected bot instances

No response

Additional info

Thank you.

maxisoft commented 2 years ago

As per https://github.com/JustArchiNET/ArchiSteamFarm/discussions/2602#discussioncomment-2920710 it seems the issue was due to https://github.com/JustArchiNET/ArchiSteamFarm/pull/2594 and release / pre-release unsync for now.

JustArchi commented 2 years ago

I'm not using custom plugins

obraz

JustArchi commented 2 years ago

To leave some meaningful answer: I most likely forgot to mention it in the release notes, so I'll update those because indeed it's important to let plugin creators know, but it's not a bug per-se.

// And done.