diff --git a/src/core/Evergine.Xrv.Core/Networking/Participants/SessionParticipantsObserver.cs b/src/core/Evergine.Xrv.Core/Networking/Participants/SessionParticipantsObserver.cs index 7573ca33..2bee0285 100644 --- a/src/core/Evergine.Xrv.Core/Networking/Participants/SessionParticipantsObserver.cs +++ b/src/core/Evergine.Xrv.Core/Networking/Participants/SessionParticipantsObserver.cs @@ -73,7 +73,7 @@ protected override void Update(TimeSpan gameTime) { this.queueProcessingTcs?.Cancel(); this.queueProcessingTcs = new CancellationTokenSource(); - this.queueProcessingTask = Task.Run(async () => await this.ProcessQueueAsync(this.queueProcessingTcs.Token) + this.queueProcessingTask = EvergineBackgroundTask.Run(async () => await this.ProcessQueueAsync(this.queueProcessingTcs.Token)) .ContinueWith(t => { this.queueProcessingTask = null; @@ -82,7 +82,7 @@ protected override void Update(TimeSpan gameTime) { this.logger?.LogError(t.Exception, "Error processing participants queue"); } - })); + }); } } @@ -112,15 +112,6 @@ await this.AddParticipantHierarchyAsync(action.ParticipantInfo, cancellation) await EvergineForegroundTask.Run(() => this.RemoveParticipantHierarchy(action.ParticipantInfo.ClientId)) .ConfigureAwait(false); } - - // It looks like Android-based devices are under "pressure" when processing - // avatar parts load in different threads (maybe related with AssetsService not - // being thread-safe?). We give it some extra time, that seems to reduce the number - // of crashes in Quest 2 devices. - if (Platform.DeviceInfo.PlatformType == Common.PlatformType.Android) - { - await Task.Delay(100).ConfigureAwait(false); - } } }