FabianTerhorst / coreclr-module

Old alt:V CoreClr (.NET Core Common Language Runtime) community made module. New: https://github.com/altmp/coreclr-module
MIT License
72 stars 68 forks source link

AltAsync.WaitFor crashes #819

Closed dGxxxx closed 10 months ago

dGxxxx commented 10 months ago
[18:36:03][Error] FATAL EXCEPTION:
[18:36:03][Error] System.TimeoutException: Failed to wait for callback

   at AltV.Net.Client.Async.AltAsync.WaitFor(Func`1 fn, UInt32 timeout, UInt32 interval)

   at Client.Controllers.CharacterController.StartCharacterCreator() in E:\...\...\dotnet\Project\Client\...\....cs:line 84

   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)

   at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()

   at System.Threading.ThreadPoolWorkQueue.Dispatch()

   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()

   at System.Threading.Thread.StartCallback() 

This is the code:

       await AltAsync.WaitFor(() => Alt.Natives.IsScreenblurFadeRunning() == false);

        First();
        FirstOne();

I tried setting interval / timeout to like 10 seconds, and it doesn't crash, but when it's lower, it crashes.

I try to remove the blur with this native: TriggerScreenblurFadeOut(3000).

This doesn't crash: await AltAsync.WaitFor(() => Alt.Natives.IsScreenblurFadeRunning() == false, interval: 3200);

An interval less than 3200, crashes.

Just for context: Alt.Natives.IsScreenblurFadeRunning() is True for 3 seconds when the WaitFor, and after the 3 seconds, it turns to False.

dGxxxx commented 10 months ago

I just had to increase the timeout. There was no problem.