Ensure Queue operations on DummyAPIAccess are performed on the update thread

This commit is contained in:
Dean Herbert 2022-05-30 16:32:44 +09:00
parent a2a057440e
commit c18dd8c8fb

View File

@ -63,10 +63,13 @@ namespace osu.Game.Online.API
public virtual void Queue(APIRequest request)
{
if (HandleRequest?.Invoke(request) != true)
Schedule(() =>
{
request.Fail(new InvalidOperationException($@"{nameof(DummyAPIAccess)} cannot process this request."));
}
if (HandleRequest?.Invoke(request) != true)
{
request.Fail(new InvalidOperationException($@"{nameof(DummyAPIAccess)} cannot process this request."));
}
});
}
public void Perform(APIRequest request) => HandleRequest?.Invoke(request);