Open imkoi opened 2 years ago
In the ContinueWith
you may need to add TaskScheduler.FromCurrentSynchronizationContext()
as second param to stay on the main thread.
Currently if your ContinueWith
ends up on another thread, then unity won't get those changes in the original Awake
and it will look like infinite loading - since the answer never arrives. Your failure rate may be coincidental with amount of threads you have available.
var task = SteamMatchmaking.LobbyList.RequestAsync()
.ContinueWith(resultTask =>
{
// ...
}, cancellationToken, TaskScheduler.FromCurrentSynchronizationContext());
We had to do something similar with the Workshop Editor.SubmitAsync
calls.
@imkoi Did you find a fix? (weird this doesnt happen in my other project, I'm using same facepunch.Steamworks version in both, the latest release one).
Edit.-Nvm. I wasnt calling the callbacks manually in this project :p
Describe the bug If we don`t use async callbacks - SteamMatchmaking.LobbyList.RequestAsync will be completed just first time when we call it. If we try to make lobby refresh through this api - await of task will be infinity and never return completed task.
To Reproduce Steps to reproduce the behavior:
Calling Code
Expected behavior Every await of SteamMatchmaking.LobbyList.RequestAsync() will be finished with result or exception
Desktop (please complete the following information):