1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 12:33:01 +08:00

Simplify async lookup logic in Invited handling

This commit is contained in:
Dean Herbert 2023-10-12 17:55:14 +09:00
parent 94d7a65e40
commit cde4fad610
No known key found for this signature in database

View File

@ -11,7 +11,6 @@ using Newtonsoft.Json;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Development; using osu.Framework.Development;
using osu.Framework.Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Logging; using osu.Framework.Logging;
using osu.Game.Database; using osu.Game.Database;
@ -447,13 +446,8 @@ namespace osu.Game.Online.Multiplayer
async Task IMultiplayerClient.Invited(int invitedBy, long roomID, string password) async Task IMultiplayerClient.Invited(int invitedBy, long roomID, string password)
{ {
var loadUserTask = userLookupCache.GetUserAsync(invitedBy); APIUser? apiUser = await userLookupCache.GetUserAsync(invitedBy);
var loadRoomTask = lookupRoom(roomID); Room? apiRoom = await lookupRoom(roomID);
await Task.WhenAll(loadUserTask, loadRoomTask).ConfigureAwait(false);
APIUser? apiUser = loadUserTask.GetResultSafely();
Room? apiRoom = loadRoomTask.GetResultSafely();
if (apiUser == null || apiRoom == null) return; if (apiUser == null || apiRoom == null) return;