mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Rename User
to APIUser
and move to correct namespace
This commit is contained in:
@ -18,7 +18,7 @@ using osu.Game.Online.Multiplayer;
|
||||
using osu.Game.Online.Multiplayer.MatchTypes.TeamVersus;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Users;
|
||||
using APIUser = osu.Game.Online.API.Requests.Responses.APIUser;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
@ -51,7 +51,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
public void Disconnect() => isConnected.Value = false;
|
||||
|
||||
public MultiplayerRoomUser AddUser(User user, bool markAsPlaying = false)
|
||||
public MultiplayerRoomUser AddUser(APIUser user, bool markAsPlaying = false)
|
||||
{
|
||||
var roomUser = new MultiplayerRoomUser(user.Id) { User = user };
|
||||
|
||||
@ -73,7 +73,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
Scheduler.Update();
|
||||
}
|
||||
|
||||
public void RemoveUser(User user)
|
||||
public void RemoveUser(APIUser user)
|
||||
{
|
||||
Debug.Assert(Room != null);
|
||||
((IMultiplayerClient)this).UserLeft(new MultiplayerRoomUser(user.Id));
|
||||
|
@ -3,10 +3,10 @@
|
||||
|
||||
using System;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Screens.OnlinePlay.Components;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.OnlinePlay
|
||||
{
|
||||
@ -33,7 +33,7 @@ namespace osu.Game.Tests.Visual.OnlinePlay
|
||||
{
|
||||
RoomID = { Value = -currentRoomId },
|
||||
Name = { Value = $@"Room {currentRoomId}" },
|
||||
Host = { Value = new User { Username = @"Host" } },
|
||||
Host = { Value = new APIUser { Username = @"Host" } },
|
||||
EndDate = { Value = DateTimeOffset.Now + TimeSpan.FromSeconds(10) },
|
||||
Category = { Value = i % 2 == 0 ? RoomCategory.Spotlight : RoomCategory.Normal },
|
||||
};
|
||||
|
@ -7,11 +7,11 @@ using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens.OnlinePlay.Components;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.OnlinePlay
|
||||
{
|
||||
@ -37,7 +37,7 @@ namespace osu.Game.Tests.Visual.OnlinePlay
|
||||
/// <param name="localUser">The local user to store in responses where required.</param>
|
||||
/// <param name="game">The game base for cases where actual online requests need to be sent.</param>
|
||||
/// <returns>Whether the request was successfully handled.</returns>
|
||||
public bool HandleRequest(APIRequest request, User localUser, OsuGameBase game)
|
||||
public bool HandleRequest(APIRequest request, APIUser localUser, OsuGameBase game)
|
||||
{
|
||||
switch (request)
|
||||
{
|
||||
|
@ -4,24 +4,24 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Users;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Tests.Visual
|
||||
{
|
||||
public class TestUserLookupCache : UserLookupCache
|
||||
{
|
||||
/// <summary>
|
||||
/// A special user ID which <see cref="ComputeValueAsync"/> would return a <see langword="null"/> <see cref="User"/> for.
|
||||
/// A special user ID which <see cref="ComputeValueAsync"/> would return a <see langword="null"/> <see cref="APIUser"/> for.
|
||||
/// As a simulation to what a regular <see cref="UserLookupCache"/> would return in the case of failing to fetch the user.
|
||||
/// </summary>
|
||||
public const int UNRESOLVED_USER_ID = -1;
|
||||
|
||||
protected override Task<User> ComputeValueAsync(int lookup, CancellationToken token = default)
|
||||
protected override Task<APIUser> ComputeValueAsync(int lookup, CancellationToken token = default)
|
||||
{
|
||||
if (lookup == UNRESOLVED_USER_ID)
|
||||
return Task.FromResult((User)null);
|
||||
return Task.FromResult((APIUser)null);
|
||||
|
||||
return Task.FromResult(new User
|
||||
return Task.FromResult(new APIUser
|
||||
{
|
||||
Id = lookup,
|
||||
Username = $"User {lookup}"
|
||||
|
Reference in New Issue
Block a user