private static async Task <UserInfo> InternalGetUserAsync() { UserInfo userInfo = await _platformUserModel.GetUserInfo(); if (userInfo != null) { Logger.log.Debug($"UserInfo found: {userInfo.platformUserId}: {userInfo.userName} on {userInfo.platform}"); userName = userInfo.userName; userID = userInfo.platformUserId; platform = userInfo.platform; if (userInfo.platform == UserInfo.Platform.Steam) { GetSteamAvatar(); } else if (userInfo.platform == UserInfo.Platform.Oculus) { userAvatar = LoadTextureFromResources("BS_Utils.Resources.oculus.png"); } } else { throw new InvalidOperationException("UserInfo is null."); } return(userInfo); }
public static Platform ToPlatform(this UserInfo.Platform platform) { return(platform switch { UserInfo.Platform.Test => Platform.Unknown, UserInfo.Platform.Steam => Platform.Steam, UserInfo.Platform.Oculus => Platform.OculusPC, UserInfo.Platform.PS4 => Platform.PS4, _ => Platform.Unknown });
private static async Task <UserInfo> InternalGetUserAsync() { UserInfo userInfo = await _platformUserModel.GetUserInfo(); if (userInfo != null) { Logger.log.Debug($"UserInfo found: {userInfo.platformUserId}: {userInfo.userName}"); userName = userInfo.userName; userID = userInfo.platformUserId; platform = userInfo.platform; } else { throw new InvalidOperationException("UserInfo is null."); } return(userInfo); }