mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 08:32:57 +08:00
Rename User
to APIUser
and move to correct namespace
This commit is contained in:
parent
25b0bccfd5
commit
b9983add15
@ -3,10 +3,10 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets.EmptyFreeform.Replays;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Rulesets.EmptyFreeform.Mods
|
||||
{
|
||||
@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.EmptyFreeform.Mods
|
||||
{
|
||||
ScoreInfo = new ScoreInfo
|
||||
{
|
||||
User = new User { Username = "sample" },
|
||||
User = new APIUser { Username = "sample" },
|
||||
},
|
||||
Replay = new EmptyFreeformAutoGenerator(beatmap).Generate(),
|
||||
};
|
||||
|
@ -3,10 +3,10 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Pippidon.Replays;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Rulesets.Pippidon.Mods
|
||||
{
|
||||
@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Pippidon.Mods
|
||||
{
|
||||
ScoreInfo = new ScoreInfo
|
||||
{
|
||||
User = new User { Username = "sample" },
|
||||
User = new APIUser { Username = "sample" },
|
||||
},
|
||||
Replay = new PippidonAutoGenerator(beatmap).Generate(),
|
||||
};
|
||||
|
@ -5,8 +5,8 @@ using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.EmptyScrolling.Replays;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Users;
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Rulesets.EmptyScrolling.Mods
|
||||
{
|
||||
@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.EmptyScrolling.Mods
|
||||
{
|
||||
ScoreInfo = new ScoreInfo
|
||||
{
|
||||
User = new User { Username = "sample" },
|
||||
User = new APIUser { Username = "sample" },
|
||||
},
|
||||
Replay = new EmptyScrollingAutoGenerator(beatmap).Generate(),
|
||||
};
|
||||
|
@ -3,10 +3,10 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Pippidon.Replays;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Rulesets.Pippidon.Mods
|
||||
{
|
||||
@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Pippidon.Mods
|
||||
{
|
||||
ScoreInfo = new ScoreInfo
|
||||
{
|
||||
User = new User { Username = "sample" },
|
||||
User = new APIUser { Username = "sample" },
|
||||
},
|
||||
Replay = new PippidonAutoGenerator(beatmap).Generate(),
|
||||
};
|
||||
|
@ -11,10 +11,10 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Users;
|
||||
using LogLevel = osu.Framework.Logging.LogLevel;
|
||||
using User = osu.Game.Users.User;
|
||||
|
||||
namespace osu.Desktop
|
||||
{
|
||||
@ -27,7 +27,7 @@ namespace osu.Desktop
|
||||
[Resolved]
|
||||
private IBindable<RulesetInfo> ruleset { get; set; }
|
||||
|
||||
private IBindable<User> user;
|
||||
private IBindable<APIUser> user;
|
||||
|
||||
private readonly IBindable<UserStatus> status = new Bindable<UserStatus>();
|
||||
private readonly IBindable<UserActivity> activity = new Bindable<UserActivity>();
|
||||
|
@ -3,10 +3,10 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets.Catch.Replays;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Mods
|
||||
{
|
||||
@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Catch.Mods
|
||||
{
|
||||
public override Score CreateReplayScore(IBeatmap beatmap, IReadOnlyList<Mod> mods) => new Score
|
||||
{
|
||||
ScoreInfo = new ScoreInfo { User = new User { Username = "osu!salad" } },
|
||||
ScoreInfo = new ScoreInfo { User = new APIUser { Username = "osu!salad" } },
|
||||
Replay = new CatchAutoGenerator(beatmap).Generate(),
|
||||
};
|
||||
}
|
||||
|
@ -3,11 +3,11 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets.Catch.Objects;
|
||||
using osu.Game.Rulesets.Catch.Replays;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Mods
|
||||
{
|
||||
@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Catch.Mods
|
||||
{
|
||||
public override Score CreateReplayScore(IBeatmap beatmap, IReadOnlyList<Mod> mods) => new Score
|
||||
{
|
||||
ScoreInfo = new ScoreInfo { User = new User { Username = "osu!salad" } },
|
||||
ScoreInfo = new ScoreInfo { User = new APIUser { Username = "osu!salad" } },
|
||||
Replay = new CatchAutoGenerator(beatmap).Generate(),
|
||||
};
|
||||
}
|
||||
|
@ -3,11 +3,11 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets.Mania.Beatmaps;
|
||||
using osu.Game.Rulesets.Mania.Replays;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.Mods
|
||||
{
|
||||
@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Mania.Mods
|
||||
{
|
||||
public override Score CreateReplayScore(IBeatmap beatmap, IReadOnlyList<Mod> mods) => new Score
|
||||
{
|
||||
ScoreInfo = new ScoreInfo { User = new User { Username = "osu!topus" } },
|
||||
ScoreInfo = new ScoreInfo { User = new APIUser { Username = "osu!topus" } },
|
||||
Replay = new ManiaAutoGenerator((ManiaBeatmap)beatmap).Generate(),
|
||||
};
|
||||
}
|
||||
|
@ -3,12 +3,12 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets.Mania.Beatmaps;
|
||||
using osu.Game.Rulesets.Mania.Objects;
|
||||
using osu.Game.Rulesets.Mania.Replays;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.Mods
|
||||
{
|
||||
@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Mania.Mods
|
||||
{
|
||||
public override Score CreateReplayScore(IBeatmap beatmap, IReadOnlyList<Mod> mods) => new Score
|
||||
{
|
||||
ScoreInfo = new ScoreInfo { User = new User { Username = "osu!topus" } },
|
||||
ScoreInfo = new ScoreInfo { User = new APIUser { Username = "osu!topus" } },
|
||||
Replay = new ManiaAutoGenerator((ManiaBeatmap)beatmap).Generate(),
|
||||
};
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
using System.Collections.Generic;
|
||||
using NUnit.Framework;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Replays;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Osu.Beatmaps;
|
||||
@ -14,7 +15,6 @@ using osu.Game.Rulesets.Osu.Scoring;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Tests.Visual;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Tests
|
||||
@ -69,7 +69,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
{
|
||||
public override Score CreateReplayScore(IBeatmap beatmap, IReadOnlyList<Mod> mods) => new Score
|
||||
{
|
||||
ScoreInfo = new ScoreInfo { User = new User { Username = "Autoplay" } },
|
||||
ScoreInfo = new ScoreInfo { User = new APIUser { Username = "Autoplay" } },
|
||||
Replay = new MissingAutoGenerator(beatmap, mods).Generate()
|
||||
};
|
||||
}
|
||||
|
@ -5,10 +5,10 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Osu.Replays;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
|
||||
public override Score CreateReplayScore(IBeatmap beatmap, IReadOnlyList<Mod> mods) => new Score
|
||||
{
|
||||
ScoreInfo = new ScoreInfo { User = new User { Username = "Autoplay" } },
|
||||
ScoreInfo = new ScoreInfo { User = new APIUser { Username = "Autoplay" } },
|
||||
Replay = new OsuAutoGenerator(beatmap, mods).Generate()
|
||||
};
|
||||
}
|
||||
|
@ -5,11 +5,11 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Rulesets.Osu.Replays;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
|
||||
public override Score CreateReplayScore(IBeatmap beatmap, IReadOnlyList<Mod> mods) => new Score
|
||||
{
|
||||
ScoreInfo = new ScoreInfo { User = new User { Username = "Autoplay" } },
|
||||
ScoreInfo = new ScoreInfo { User = new APIUser { Username = "Autoplay" } },
|
||||
Replay = new OsuAutoGenerator(beatmap, mods).Generate()
|
||||
};
|
||||
}
|
||||
|
@ -3,10 +3,10 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Taiko.Replays;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Rulesets.Taiko.Mods
|
||||
{
|
||||
@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Taiko.Mods
|
||||
{
|
||||
public override Score CreateReplayScore(IBeatmap beatmap, IReadOnlyList<Mod> mods) => new Score
|
||||
{
|
||||
ScoreInfo = new ScoreInfo { User = new User { Username = "mekkadosu!" } },
|
||||
ScoreInfo = new ScoreInfo { User = new APIUser { Username = "mekkadosu!" } },
|
||||
Replay = new TaikoAutoGenerator(beatmap).Generate(),
|
||||
};
|
||||
}
|
||||
|
@ -3,11 +3,11 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Taiko.Objects;
|
||||
using osu.Game.Rulesets.Taiko.Replays;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Rulesets.Taiko.Mods
|
||||
{
|
||||
@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Taiko.Mods
|
||||
{
|
||||
public override Score CreateReplayScore(IBeatmap beatmap, IReadOnlyList<Mod> mods) => new Score
|
||||
{
|
||||
ScoreInfo = new ScoreInfo { User = new User { Username = "mekkadosu!" } },
|
||||
ScoreInfo = new ScoreInfo { User = new APIUser { Username = "mekkadosu!" } },
|
||||
Replay = new TaikoAutoGenerator(beatmap).Generate(),
|
||||
};
|
||||
}
|
||||
|
@ -17,12 +17,12 @@ using osu.Framework.Logging;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.IO;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Tests.Resources;
|
||||
using osu.Game.Tests.Scores.IO;
|
||||
using osu.Game.Users;
|
||||
using SharpCompress.Archives;
|
||||
using SharpCompress.Archives.Zip;
|
||||
using SharpCompress.Common;
|
||||
@ -859,7 +859,7 @@ namespace osu.Game.Tests.Beatmaps.IO
|
||||
|
||||
var manager = osu.Dependencies.Get<BeatmapManager>();
|
||||
|
||||
var working = manager.CreateNew(new OsuRuleset().RulesetInfo, User.SYSTEM_USER);
|
||||
var working = manager.CreateNew(new OsuRuleset().RulesetInfo, APIUser.SYSTEM_USER);
|
||||
|
||||
var beatmap = working.Beatmap;
|
||||
|
||||
@ -892,7 +892,7 @@ namespace osu.Game.Tests.Beatmaps.IO
|
||||
var osu = LoadOsuIntoHost(host);
|
||||
var manager = osu.Dependencies.Get<BeatmapManager>();
|
||||
|
||||
var working = manager.CreateNew(new OsuRuleset().RulesetInfo, User.SYSTEM_USER);
|
||||
var working = manager.CreateNew(new OsuRuleset().RulesetInfo, APIUser.SYSTEM_USER);
|
||||
|
||||
manager.Save(working.BeatmapInfo, working.Beatmap);
|
||||
|
||||
@ -919,7 +919,7 @@ namespace osu.Game.Tests.Beatmaps.IO
|
||||
var osu = LoadOsuIntoHost(host);
|
||||
var manager = osu.Dependencies.Get<BeatmapManager>();
|
||||
|
||||
var working = manager.CreateNew(new OsuRuleset().RulesetInfo, User.SYSTEM_USER);
|
||||
var working = manager.CreateNew(new OsuRuleset().RulesetInfo, APIUser.SYSTEM_USER);
|
||||
|
||||
((Beatmap)working.Beatmap).HitObjects.Add(new HitCircle { StartTime = 5000 });
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
using NUnit.Framework;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Users;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Tests.Beatmaps
|
||||
{
|
||||
@ -34,7 +34,7 @@ namespace osu.Game.Tests.Beatmaps
|
||||
{
|
||||
Artist = "artist",
|
||||
Title = "title",
|
||||
Author = new User { Username = "creator" }
|
||||
Author = new APIUser { Username = "creator" }
|
||||
}
|
||||
};
|
||||
|
||||
@ -50,7 +50,7 @@ namespace osu.Game.Tests.Beatmaps
|
||||
{
|
||||
Artist = "artist",
|
||||
Title = "title",
|
||||
Author = new User { Username = "creator" }
|
||||
Author = new APIUser { Username = "creator" }
|
||||
},
|
||||
Version = "difficulty"
|
||||
};
|
||||
|
@ -9,9 +9,9 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Chat;
|
||||
using osu.Game.Tests.Visual;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Chat
|
||||
{
|
||||
@ -133,7 +133,7 @@ namespace osu.Game.Tests.Chat
|
||||
}
|
||||
}
|
||||
|
||||
private Channel createChannel(int id, ChannelType type) => new Channel(new User())
|
||||
private Channel createChannel(int id, ChannelType type) => new Channel(new APIUser())
|
||||
{
|
||||
Id = id,
|
||||
Name = $"Channel {id}",
|
||||
|
@ -6,10 +6,10 @@ using Humanizer;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Extensions.ObjectExtensions;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Multiplayer;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Tests.Visual.Multiplayer;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.NonVisual.Multiplayer
|
||||
{
|
||||
@ -21,7 +21,7 @@ namespace osu.Game.Tests.NonVisual.Multiplayer
|
||||
{
|
||||
int id = 2000;
|
||||
|
||||
AddRepeatStep("add some users", () => Client.AddUser(new User { Id = id++ }), 5);
|
||||
AddRepeatStep("add some users", () => Client.AddUser(new APIUser { Id = id++ }), 5);
|
||||
checkPlayingUserCount(0);
|
||||
|
||||
AddAssert("playlist item is available", () => Client.CurrentMatchPlayingItem.Value != null);
|
||||
@ -64,7 +64,7 @@ namespace osu.Game.Tests.NonVisual.Multiplayer
|
||||
room.State = MultiplayerRoomState.Playing;
|
||||
room.Users.Add(new MultiplayerRoomUser(PLAYER_1_ID)
|
||||
{
|
||||
User = new User { Id = PLAYER_1_ID },
|
||||
User = new APIUser { Id = PLAYER_1_ID },
|
||||
State = MultiplayerUserState.Playing
|
||||
});
|
||||
};
|
||||
|
@ -3,8 +3,8 @@
|
||||
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Tests.Visual.Multiplayer;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.OnlinePlay
|
||||
{
|
||||
@ -14,7 +14,7 @@ namespace osu.Game.Tests.OnlinePlay
|
||||
[Test]
|
||||
public void TestUserAddedOnJoin()
|
||||
{
|
||||
var user = new User { Id = 33 };
|
||||
var user = new APIUser { Id = 33 };
|
||||
|
||||
AddRepeatStep("add user multiple times", () => Client.AddUser(user), 3);
|
||||
AddAssert("room has 2 users", () => Client.Room?.Users.Count == 2);
|
||||
@ -23,7 +23,7 @@ namespace osu.Game.Tests.OnlinePlay
|
||||
[Test]
|
||||
public void TestUserRemovedOnLeave()
|
||||
{
|
||||
var user = new User { Id = 44 };
|
||||
var user = new APIUser { Id = 44 };
|
||||
|
||||
AddStep("add user", () => Client.AddUser(user));
|
||||
AddAssert("room has 2 users", () => Client.Room?.Users.Count == 2);
|
||||
|
@ -11,12 +11,12 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.IO.Archives;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Rulesets.Osu.Mods;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Scores.IO
|
||||
{
|
||||
@ -38,7 +38,7 @@ namespace osu.Game.Tests.Scores.IO
|
||||
Accuracy = 0.8,
|
||||
MaxCombo = 500,
|
||||
Combo = 250,
|
||||
User = new User { Username = "Test user" },
|
||||
User = new APIUser { Username = "Test user" },
|
||||
Date = DateTimeOffset.Now,
|
||||
OnlineScoreID = 12345,
|
||||
};
|
||||
|
@ -10,10 +10,10 @@ using osu.Framework.Testing;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics.Backgrounds;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Screens;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
using osu.Game.Skinning;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Background
|
||||
{
|
||||
@ -113,7 +113,7 @@ namespace osu.Game.Tests.Visual.Background
|
||||
AddStep($"set background mode to {source}", () => config.SetValue(OsuSetting.MenuBackgroundSource, source));
|
||||
|
||||
private void setSupporter(bool isSupporter) =>
|
||||
AddStep($"set supporter {isSupporter}", () => ((DummyAPIAccess)API).LocalUser.Value = new User
|
||||
AddStep($"set supporter {isSupporter}", () => ((DummyAPIAccess)API).LocalUser.Value = new APIUser
|
||||
{
|
||||
IsSupporter = isSupporter,
|
||||
Id = API.LocalUser.Value.Id + 1,
|
||||
|
@ -18,6 +18,7 @@ using osu.Game.Configuration;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Osu.Mods;
|
||||
using osu.Game.Scoring;
|
||||
@ -29,7 +30,6 @@ using osu.Game.Screens.Ranking;
|
||||
using osu.Game.Screens.Select;
|
||||
using osu.Game.Tests.Beatmaps;
|
||||
using osu.Game.Tests.Resources;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
@ -231,7 +231,7 @@ namespace osu.Game.Tests.Visual.Background
|
||||
|
||||
AddStep("Transition to Results", () => player.Push(results = new FadeAccessibleResults(new ScoreInfo
|
||||
{
|
||||
User = new User { Username = "osu!" },
|
||||
User = new APIUser { Username = "osu!" },
|
||||
BeatmapInfo = new TestBeatmap(Ruleset.Value).BeatmapInfo,
|
||||
Ruleset = Ruleset.Value,
|
||||
})));
|
||||
|
@ -13,8 +13,8 @@ using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.Drawables.Cards;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
using APIUser = osu.Game.Online.API.Requests.Responses.APIUser;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Beatmaps
|
||||
{
|
||||
@ -75,7 +75,7 @@ namespace osu.Game.Tests.Visual.Beatmaps
|
||||
Title = "undownloadable beatmap",
|
||||
Artist = "test",
|
||||
Source = "more tests",
|
||||
Author = new User
|
||||
Author = new APIUser
|
||||
{
|
||||
Username = "BanchoBot",
|
||||
Id = 3,
|
||||
@ -120,7 +120,7 @@ namespace osu.Game.Tests.Visual.Beatmaps
|
||||
OnlineID = 1,
|
||||
Title = "many difficulties beatmap",
|
||||
Artist = "test",
|
||||
Author = new User
|
||||
Author = new APIUser
|
||||
{
|
||||
Username = "BanchoBot",
|
||||
Id = 3,
|
||||
|
@ -7,8 +7,8 @@ using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Gameplay
|
||||
@ -39,7 +39,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
playerScore.Value = 1222333;
|
||||
});
|
||||
|
||||
AddStep("add local player", () => createLeaderboardScore(playerScore, new User { Username = "You", Id = 3 }, true));
|
||||
AddStep("add local player", () => createLeaderboardScore(playerScore, new APIUser { Username = "You", Id = 3 }, true));
|
||||
AddStep("toggle expanded", () => leaderboard.Expanded.Value = !leaderboard.Expanded.Value);
|
||||
AddSliderStep("set player score", 50, 5000000, 1222333, v => playerScore.Value = v);
|
||||
}
|
||||
@ -50,8 +50,8 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
var player2Score = new BindableDouble(1234567);
|
||||
var player3Score = new BindableDouble(1111111);
|
||||
|
||||
AddStep("add player 2", () => createLeaderboardScore(player2Score, new User { Username = "Player 2" }));
|
||||
AddStep("add player 3", () => createLeaderboardScore(player3Score, new User { Username = "Player 3" }));
|
||||
AddStep("add player 2", () => createLeaderboardScore(player2Score, new APIUser { Username = "Player 2" }));
|
||||
AddStep("add player 3", () => createLeaderboardScore(player3Score, new APIUser { Username = "Player 3" }));
|
||||
|
||||
AddUntilStep("is player 2 position #1", () => leaderboard.CheckPositionByUsername("Player 2", 1));
|
||||
AddUntilStep("is player position #2", () => leaderboard.CheckPositionByUsername("You", 2));
|
||||
@ -72,38 +72,38 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
public void TestRandomScores()
|
||||
{
|
||||
int playerNumber = 1;
|
||||
AddRepeatStep("add player with random score", () => createRandomScore(new User { Username = $"Player {playerNumber++}" }), 10);
|
||||
AddRepeatStep("add player with random score", () => createRandomScore(new APIUser { Username = $"Player {playerNumber++}" }), 10);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestExistingUsers()
|
||||
{
|
||||
AddStep("add peppy", () => createRandomScore(new User { Username = "peppy", Id = 2 }));
|
||||
AddStep("add smoogipoo", () => createRandomScore(new User { Username = "smoogipoo", Id = 1040328 }));
|
||||
AddStep("add flyte", () => createRandomScore(new User { Username = "flyte", Id = 3103765 }));
|
||||
AddStep("add frenzibyte", () => createRandomScore(new User { Username = "frenzibyte", Id = 14210502 }));
|
||||
AddStep("add peppy", () => createRandomScore(new APIUser { Username = "peppy", Id = 2 }));
|
||||
AddStep("add smoogipoo", () => createRandomScore(new APIUser { Username = "smoogipoo", Id = 1040328 }));
|
||||
AddStep("add flyte", () => createRandomScore(new APIUser { Username = "flyte", Id = 3103765 }));
|
||||
AddStep("add frenzibyte", () => createRandomScore(new APIUser { Username = "frenzibyte", Id = 14210502 }));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestMaxHeight()
|
||||
{
|
||||
int playerNumber = 1;
|
||||
AddRepeatStep("add 3 other players", () => createRandomScore(new User { Username = $"Player {playerNumber++}" }), 3);
|
||||
AddRepeatStep("add 3 other players", () => createRandomScore(new APIUser { Username = $"Player {playerNumber++}" }), 3);
|
||||
checkHeight(4);
|
||||
|
||||
AddRepeatStep("add 4 other players", () => createRandomScore(new User { Username = $"Player {playerNumber++}" }), 4);
|
||||
AddRepeatStep("add 4 other players", () => createRandomScore(new APIUser { Username = $"Player {playerNumber++}" }), 4);
|
||||
checkHeight(8);
|
||||
|
||||
AddRepeatStep("add 4 other players", () => createRandomScore(new User { Username = $"Player {playerNumber++}" }), 4);
|
||||
AddRepeatStep("add 4 other players", () => createRandomScore(new APIUser { Username = $"Player {playerNumber++}" }), 4);
|
||||
checkHeight(8);
|
||||
|
||||
void checkHeight(int panelCount)
|
||||
=> AddAssert($"leaderboard height is {panelCount} panels high", () => leaderboard.DrawHeight == (GameplayLeaderboardScore.PANEL_HEIGHT + leaderboard.Spacing) * panelCount);
|
||||
}
|
||||
|
||||
private void createRandomScore(User user) => createLeaderboardScore(new BindableDouble(RNG.Next(0, 5_000_000)), user);
|
||||
private void createRandomScore(APIUser user) => createLeaderboardScore(new BindableDouble(RNG.Next(0, 5_000_000)), user);
|
||||
|
||||
private void createLeaderboardScore(BindableDouble score, User user, bool isTracked = false)
|
||||
private void createLeaderboardScore(BindableDouble score, APIUser user, bool isTracked = false)
|
||||
{
|
||||
var leaderboardScore = leaderboard.Add(user, isTracked);
|
||||
leaderboardScore.TotalScore.BindTo(score);
|
||||
|
@ -7,7 +7,6 @@ using osu.Framework.Graphics;
|
||||
using osu.Game.Online;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Users;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Testing;
|
||||
@ -16,6 +15,7 @@ using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Screens.Ranking;
|
||||
using osuTK.Input;
|
||||
using APIUser = osu.Game.Online.API.Requests.Responses.APIUser;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Gameplay
|
||||
{
|
||||
@ -139,7 +139,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
RulesetID = 0,
|
||||
Beatmap = CreateAPIBeatmapSet(new OsuRuleset().RulesetInfo).Beatmaps.First(),
|
||||
HasReplay = replayAvailable,
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 39828,
|
||||
Username = @"WubWoofWolf",
|
||||
|
@ -9,6 +9,7 @@ using osu.Framework.Screens;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Spectator;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Rulesets.Osu.Replays;
|
||||
@ -18,13 +19,12 @@ using osu.Game.Screens.Play;
|
||||
using osu.Game.Tests.Beatmaps.IO;
|
||||
using osu.Game.Tests.Visual.Multiplayer;
|
||||
using osu.Game.Tests.Visual.Spectator;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Gameplay
|
||||
{
|
||||
public class TestSceneSpectator : ScreenTestScene
|
||||
{
|
||||
private readonly User streamingUser = new User { Id = MultiplayerTestScene.PLAYER_1_ID, Username = "Test user" };
|
||||
private readonly APIUser streamingUser = new APIUser { Id = MultiplayerTestScene.PLAYER_1_ID, Username = "Test user" };
|
||||
|
||||
[Cached(typeof(UserLookupCache))]
|
||||
private UserLookupCache lookupCache = new TestUserLookupCache();
|
||||
|
@ -4,11 +4,11 @@
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Spectator;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Mania;
|
||||
using osu.Game.Tests.Visual.Spectator;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Gameplay
|
||||
{
|
||||
@ -24,7 +24,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
|
||||
public override void SetUpSteps()
|
||||
{
|
||||
AddStep("set dummy user", () => dummyAPIAccess.LocalUser.Value = new User
|
||||
AddStep("set dummy user", () => dummyAPIAccess.LocalUser.Value = new APIUser
|
||||
{
|
||||
Id = dummy_user_id,
|
||||
Username = "DummyUser"
|
||||
|
@ -3,8 +3,8 @@
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Screens.Menu;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Menus
|
||||
{
|
||||
@ -17,7 +17,7 @@ namespace osu.Game.Tests.Visual.Menus
|
||||
|
||||
AddStep("toggle support", () =>
|
||||
{
|
||||
((DummyAPIAccess)API).LocalUser.Value = new User
|
||||
((DummyAPIAccess)API).LocalUser.Value = new APIUser
|
||||
{
|
||||
Username = API.LocalUser.Value.Username,
|
||||
Id = API.LocalUser.Value.Id + 1,
|
||||
|
@ -10,6 +10,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Online.Rooms.RoomStatuses;
|
||||
using osu.Game.Overlays;
|
||||
@ -17,7 +18,6 @@ using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Screens.OnlinePlay.Lounge;
|
||||
using osu.Game.Screens.OnlinePlay.Lounge.Components;
|
||||
using osu.Game.Tests.Beatmaps;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Multiplayer
|
||||
@ -174,11 +174,11 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
private DrawableRoom createLoungeRoom(Room room)
|
||||
{
|
||||
room.Host.Value ??= new User { Username = "peppy", Id = 2 };
|
||||
room.Host.Value ??= new APIUser { Username = "peppy", Id = 2 };
|
||||
|
||||
if (room.RecentParticipants.Count == 0)
|
||||
{
|
||||
room.RecentParticipants.AddRange(Enumerable.Range(0, 20).Select(i => new User
|
||||
room.RecentParticipants.AddRange(Enumerable.Range(0, 20).Select(i => new APIUser
|
||||
{
|
||||
Id = i,
|
||||
Username = $"User {i}"
|
||||
|
@ -5,10 +5,10 @@ using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Screens.OnlinePlay.Lounge.Components;
|
||||
using osu.Game.Tests.Visual.OnlinePlay;
|
||||
using osu.Game.Users;
|
||||
using osu.Game.Users.Drawables;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Multiplayer
|
||||
@ -25,7 +25,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
Name = { Value = "test room" },
|
||||
Host =
|
||||
{
|
||||
Value = new User
|
||||
Value = new APIUser
|
||||
{
|
||||
Id = 2,
|
||||
Username = "peppy",
|
||||
@ -137,7 +137,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
private void addUser(int id)
|
||||
{
|
||||
SelectedRoom.Value.RecentParticipants.Add(new User
|
||||
SelectedRoom.Value.RecentParticipants.Add(new APIUser
|
||||
{
|
||||
Id = id,
|
||||
Username = $"User {id}"
|
||||
|
@ -14,6 +14,7 @@ using osu.Framework.Testing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.Drawables;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Overlays.BeatmapListing.Panels;
|
||||
using osu.Game.Rulesets;
|
||||
@ -21,7 +22,6 @@ using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Rulesets.Osu.Mods;
|
||||
using osu.Game.Screens.OnlinePlay;
|
||||
using osu.Game.Tests.Beatmaps;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
using osuTK.Input;
|
||||
|
||||
@ -294,7 +294,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
Metadata = new BeatmapMetadata
|
||||
{
|
||||
Artist = "Artist",
|
||||
Author = new User { Username = "Creator name here" },
|
||||
Author = new APIUser { Username = "Creator name here" },
|
||||
Title = "Long title used to check background colour",
|
||||
},
|
||||
BeatmapSet = new BeatmapSetInfo()
|
||||
|
@ -10,8 +10,8 @@ using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Screens.OnlinePlay.Match.Components;
|
||||
using osu.Game.Tests.Visual.OnlinePlay;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
using APIUser = osu.Game.Online.API.Requests.Responses.APIUser;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
@ -32,7 +32,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
new APIUserScoreAggregate
|
||||
{
|
||||
UserID = 2,
|
||||
User = new User { Id = 2, Username = "peppy" },
|
||||
User = new APIUser { Id = 2, Username = "peppy" },
|
||||
TotalScore = 995533,
|
||||
RoomID = 3,
|
||||
CompletedBeatmaps = 1,
|
||||
@ -42,7 +42,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
new APIUserScoreAggregate
|
||||
{
|
||||
UserID = 1040328,
|
||||
User = new User { Id = 1040328, Username = "smoogipoo" },
|
||||
User = new APIUser { Id = 1040328, Username = "smoogipoo" },
|
||||
TotalScore = 981100,
|
||||
RoomID = 3,
|
||||
CompletedBeatmaps = 1,
|
||||
|
@ -6,11 +6,11 @@ using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Multiplayer;
|
||||
using osu.Game.Rulesets.Osu.Scoring;
|
||||
using osu.Game.Screens.OnlinePlay.Multiplayer.Spectate;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
@ -35,7 +35,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
foreach ((int userId, var _) in clocks)
|
||||
{
|
||||
SpectatorClient.StartPlay(userId, 0);
|
||||
OnlinePlayDependencies.Client.AddUser(new User { Id = userId });
|
||||
OnlinePlayDependencies.Client.AddUser(new APIUser { Id = userId });
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -11,6 +11,7 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Multiplayer;
|
||||
using osu.Game.Online.Multiplayer.MatchTypes.TeamVersus;
|
||||
using osu.Game.Rulesets.UI;
|
||||
@ -19,7 +20,6 @@ using osu.Game.Screens.Play;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
using osu.Game.Screens.Play.PlayerSettings;
|
||||
using osu.Game.Tests.Beatmaps.IO;
|
||||
using osu.Game.Users;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Multiplayer
|
||||
@ -59,8 +59,8 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
AddStep("start players silently", () =>
|
||||
{
|
||||
OnlinePlayDependencies.Client.AddUser(new User { Id = PLAYER_1_ID }, true);
|
||||
OnlinePlayDependencies.Client.AddUser(new User { Id = PLAYER_2_ID }, true);
|
||||
OnlinePlayDependencies.Client.AddUser(new APIUser { Id = PLAYER_1_ID }, true);
|
||||
OnlinePlayDependencies.Client.AddUser(new APIUser { Id = PLAYER_2_ID }, true);
|
||||
|
||||
playingUsers.Add(new MultiplayerRoomUser(PLAYER_1_ID));
|
||||
playingUsers.Add(new MultiplayerRoomUser(PLAYER_2_ID));
|
||||
@ -120,13 +120,13 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
AddStep("start players", () =>
|
||||
{
|
||||
var player1 = OnlinePlayDependencies.Client.AddUser(new User { Id = PLAYER_1_ID }, true);
|
||||
var player1 = OnlinePlayDependencies.Client.AddUser(new APIUser { Id = PLAYER_1_ID }, true);
|
||||
player1.MatchState = new TeamVersusUserState
|
||||
{
|
||||
TeamID = 0,
|
||||
};
|
||||
|
||||
var player2 = OnlinePlayDependencies.Client.AddUser(new User { Id = PLAYER_2_ID }, true);
|
||||
var player2 = OnlinePlayDependencies.Client.AddUser(new APIUser { Id = PLAYER_2_ID }, true);
|
||||
player2.MatchState = new TeamVersusUserState
|
||||
{
|
||||
TeamID = 1,
|
||||
@ -367,7 +367,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
var user = new MultiplayerRoomUser(id)
|
||||
{
|
||||
User = new User { Id = id },
|
||||
User = new APIUser { Id = id },
|
||||
};
|
||||
|
||||
OnlinePlayDependencies.Client.AddUser(user.User, true);
|
||||
|
@ -17,6 +17,7 @@ using osu.Framework.Utils;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Multiplayer;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Overlays.Mods;
|
||||
@ -32,7 +33,6 @@ using osu.Game.Screens.Play;
|
||||
using osu.Game.Screens.Ranking;
|
||||
using osu.Game.Screens.Spectate;
|
||||
using osu.Game.Tests.Resources;
|
||||
using osu.Game.Users;
|
||||
using osuTK.Input;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Multiplayer
|
||||
@ -129,12 +129,12 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
private void addRandomPlayer()
|
||||
{
|
||||
int randomUser = RNG.Next(200000, 500000);
|
||||
client.AddUser(new User { Id = randomUser, Username = $"user {randomUser}" });
|
||||
client.AddUser(new APIUser { Id = randomUser, Username = $"user {randomUser}" });
|
||||
}
|
||||
|
||||
private void removeLastUser()
|
||||
{
|
||||
User lastUser = client.Room?.Users.Last().User;
|
||||
APIUser lastUser = client.Room?.Users.Last().User;
|
||||
|
||||
if (lastUser == null || lastUser == client.LocalUser?.User)
|
||||
return;
|
||||
@ -144,7 +144,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
private void kickLastUser()
|
||||
{
|
||||
User lastUser = client.Room?.Users.Last().User;
|
||||
APIUser lastUser = client.Room?.Users.Last().User;
|
||||
|
||||
if (lastUser == null || lastUser == client.LocalUser?.User)
|
||||
return;
|
||||
@ -414,7 +414,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
AddStep("join other user (ready, host)", () =>
|
||||
{
|
||||
client.AddUser(new User { Id = MultiplayerTestScene.PLAYER_1_ID, Username = "Other" });
|
||||
client.AddUser(new APIUser { Id = MultiplayerTestScene.PLAYER_1_ID, Username = "Other" });
|
||||
client.TransferHost(MultiplayerTestScene.PLAYER_1_ID);
|
||||
client.ChangeUserState(MultiplayerTestScene.PLAYER_1_ID, MultiplayerUserState.Ready);
|
||||
});
|
||||
@ -454,7 +454,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
AddStep("join other user (ready, host)", () =>
|
||||
{
|
||||
client.AddUser(new User { Id = MultiplayerTestScene.PLAYER_1_ID, Username = "Other" });
|
||||
client.AddUser(new APIUser { Id = MultiplayerTestScene.PLAYER_1_ID, Username = "Other" });
|
||||
client.TransferHost(MultiplayerTestScene.PLAYER_1_ID);
|
||||
client.ChangeUserState(MultiplayerTestScene.PLAYER_1_ID, MultiplayerUserState.Ready);
|
||||
});
|
||||
|
@ -11,6 +11,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Multiplayer;
|
||||
using osu.Game.Online.Spectator;
|
||||
using osu.Game.Replays.Legacy;
|
||||
@ -20,7 +21,6 @@ using osu.Game.Scoring;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
using osu.Game.Tests.Visual.OnlinePlay;
|
||||
using osu.Game.Tests.Visual.Spectator;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
@ -58,7 +58,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
foreach (int user in users)
|
||||
{
|
||||
SpectatorClient.StartPlay(user, Beatmap.Value.BeatmapInfo.OnlineBeatmapID ?? 0);
|
||||
multiplayerUsers.Add(OnlinePlayDependencies.Client.AddUser(new User { Id = user }, true));
|
||||
multiplayerUsers.Add(OnlinePlayDependencies.Client.AddUser(new APIUser { Id = user }, true));
|
||||
}
|
||||
|
||||
Children = new Drawable[]
|
||||
|
@ -7,6 +7,7 @@ using NUnit.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Multiplayer;
|
||||
using osu.Game.Online.Multiplayer.MatchTypes.TeamVersus;
|
||||
using osu.Game.Online.Rooms;
|
||||
@ -15,7 +16,6 @@ using osu.Game.Screens.OnlinePlay.Multiplayer;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
using osu.Game.Tests.Visual.OnlinePlay;
|
||||
using osu.Game.Tests.Visual.Spectator;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
@ -62,7 +62,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
foreach (int user in users)
|
||||
{
|
||||
SpectatorClient.StartPlay(user, Beatmap.Value.BeatmapInfo.OnlineBeatmapID ?? 0);
|
||||
var roomUser = OnlinePlayDependencies.Client.AddUser(new User { Id = user }, true);
|
||||
var roomUser = OnlinePlayDependencies.Client.AddUser(new APIUser { Id = user }, true);
|
||||
|
||||
roomUser.MatchState = new TeamVersusUserState
|
||||
{
|
||||
|
@ -9,6 +9,7 @@ using osu.Framework.Platform;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Multiplayer;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Rulesets;
|
||||
@ -18,7 +19,6 @@ using osu.Game.Screens.OnlinePlay.Multiplayer;
|
||||
using osu.Game.Screens.OnlinePlay.Multiplayer.Match;
|
||||
using osu.Game.Tests.Beatmaps;
|
||||
using osu.Game.Tests.Resources;
|
||||
using osu.Game.Users;
|
||||
using osuTK.Input;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Multiplayer
|
||||
@ -119,7 +119,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
AddStep("join other user (ready)", () =>
|
||||
{
|
||||
Client.AddUser(new User { Id = PLAYER_1_ID });
|
||||
Client.AddUser(new APIUser { Id = PLAYER_1_ID });
|
||||
Client.ChangeUserState(PLAYER_1_ID, MultiplayerUserState.Ready);
|
||||
});
|
||||
|
||||
|
@ -11,6 +11,7 @@ using osu.Framework.Testing;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Multiplayer;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
@ -34,7 +35,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
AddAssert("one unique panel", () => this.ChildrenOfType<ParticipantPanel>().Select(p => p.User).Distinct().Count() == 1);
|
||||
|
||||
AddStep("add user", () => Client.AddUser(new User
|
||||
AddStep("add user", () => Client.AddUser(new APIUser
|
||||
{
|
||||
Id = 3,
|
||||
Username = "Second",
|
||||
@ -63,11 +64,11 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
[Test]
|
||||
public void TestRemoveUser()
|
||||
{
|
||||
User secondUser = null;
|
||||
APIUser secondUser = null;
|
||||
|
||||
AddStep("add a user", () =>
|
||||
{
|
||||
Client.AddUser(secondUser = new User
|
||||
Client.AddUser(secondUser = new APIUser
|
||||
{
|
||||
Id = 3,
|
||||
Username = "Second",
|
||||
@ -146,7 +147,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
[Test]
|
||||
public void TestCrownChangesStateWhenHostTransferred()
|
||||
{
|
||||
AddStep("add user", () => Client.AddUser(new User
|
||||
AddStep("add user", () => Client.AddUser(new APIUser
|
||||
{
|
||||
Id = 3,
|
||||
Username = "Second",
|
||||
@ -165,7 +166,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
[Test]
|
||||
public void TestKickButtonOnlyPresentWhenHost()
|
||||
{
|
||||
AddStep("add user", () => Client.AddUser(new User
|
||||
AddStep("add user", () => Client.AddUser(new APIUser
|
||||
{
|
||||
Id = 3,
|
||||
Username = "Second",
|
||||
@ -186,7 +187,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
[Test]
|
||||
public void TestKickButtonKicks()
|
||||
{
|
||||
AddStep("add user", () => Client.AddUser(new User
|
||||
AddStep("add user", () => Client.AddUser(new APIUser
|
||||
{
|
||||
Id = 3,
|
||||
Username = "Second",
|
||||
@ -205,7 +206,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
Client.AddUser(new User
|
||||
Client.AddUser(new APIUser
|
||||
{
|
||||
Id = i,
|
||||
Username = $"User {i}",
|
||||
@ -249,7 +250,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
AddStep("add user", () =>
|
||||
{
|
||||
Client.AddUser(new User
|
||||
Client.AddUser(new APIUser
|
||||
{
|
||||
Id = 0,
|
||||
Username = "User 0",
|
||||
@ -295,7 +296,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
AddStep("add user with mods", () =>
|
||||
{
|
||||
Client.AddUser(new User
|
||||
Client.AddUser(new APIUser
|
||||
{
|
||||
Id = 0,
|
||||
Username = "Baka",
|
||||
|
@ -14,12 +14,12 @@ using osu.Framework.Testing;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Multiplayer;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Screens.OnlinePlay.Multiplayer.Match;
|
||||
using osu.Game.Tests.Resources;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
using osuTK.Input;
|
||||
|
||||
@ -108,7 +108,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
AddStep("add second user as host", () =>
|
||||
{
|
||||
Client.AddUser(new User { Id = 2, Username = "Another user" });
|
||||
Client.AddUser(new APIUser { Id = 2, Username = "Another user" });
|
||||
Client.TransferHost(2);
|
||||
});
|
||||
|
||||
@ -128,7 +128,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
Client.TransferHost(Client.Room?.Users[0].UserID ?? 0);
|
||||
|
||||
if (!allReady)
|
||||
Client.AddUser(new User { Id = 2, Username = "Another user" });
|
||||
Client.AddUser(new APIUser { Id = 2, Username = "Another user" });
|
||||
});
|
||||
|
||||
addClickButtonStep();
|
||||
@ -142,7 +142,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
AddStep("add host", () =>
|
||||
{
|
||||
Client.AddUser(new User { Id = 2, Username = "Another user" });
|
||||
Client.AddUser(new APIUser { Id = 2, Username = "Another user" });
|
||||
Client.TransferHost(2);
|
||||
});
|
||||
|
||||
@ -158,7 +158,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
AddStep("setup", () =>
|
||||
{
|
||||
Client.TransferHost(Client.Room?.Users[0].UserID ?? 0);
|
||||
Client.AddUser(new User { Id = 2, Username = "Another user" });
|
||||
Client.AddUser(new APIUser { Id = 2, Username = "Another user" });
|
||||
});
|
||||
|
||||
addClickButtonStep();
|
||||
@ -177,7 +177,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
Client.TransferHost(Client.Room?.Users[0].UserID ?? 0);
|
||||
for (int i = 0; i < users; i++)
|
||||
Client.AddUser(new User { Id = i, Username = "Another user" });
|
||||
Client.AddUser(new APIUser { Id = i, Username = "Another user" });
|
||||
});
|
||||
|
||||
if (!isHost)
|
||||
|
@ -3,11 +3,11 @@
|
||||
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens.OnlinePlay.Multiplayer;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
@ -31,7 +31,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
MaxCombo = 500,
|
||||
Combo = 250,
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User { Username = "Test user" },
|
||||
User = new APIUser { Username = "Test user" },
|
||||
Date = DateTimeOffset.Now,
|
||||
OnlineScoreID = 12345,
|
||||
Ruleset = rulesetInfo,
|
||||
|
@ -14,12 +14,12 @@ using osu.Framework.Platform;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Multiplayer;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Screens.OnlinePlay.Multiplayer.Match;
|
||||
using osu.Game.Tests.Resources;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
using osuTK.Input;
|
||||
|
||||
@ -145,7 +145,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
[Test]
|
||||
public void TestReadyButtonEnabledWhenHostAndUsersReady()
|
||||
{
|
||||
AddStep("add user", () => Client.AddUser(new User { Id = PLAYER_1_ID }));
|
||||
AddStep("add user", () => Client.AddUser(new APIUser { Id = PLAYER_1_ID }));
|
||||
AddStep("set user ready", () => Client.ChangeUserState(PLAYER_1_ID, MultiplayerUserState.Ready));
|
||||
|
||||
addClickSpectateButtonStep();
|
||||
@ -157,7 +157,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
AddStep("add user and transfer host", () =>
|
||||
{
|
||||
Client.AddUser(new User { Id = PLAYER_1_ID });
|
||||
Client.AddUser(new APIUser { Id = PLAYER_1_ID });
|
||||
Client.TransferHost(PLAYER_1_ID);
|
||||
});
|
||||
|
||||
|
@ -5,11 +5,11 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens.OnlinePlay.Multiplayer;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
@ -35,7 +35,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
MaxCombo = 500,
|
||||
Combo = 250,
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User { Username = "Test user" },
|
||||
User = new APIUser { Username = "Test user" },
|
||||
Date = DateTimeOffset.Now,
|
||||
OnlineScoreID = 12345,
|
||||
Ruleset = rulesetInfo,
|
||||
|
@ -3,8 +3,8 @@
|
||||
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Screens.OnlinePlay.Lounge.Components;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
@ -25,7 +25,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
AddStep("add user", () =>
|
||||
{
|
||||
Client.AddUser(new User
|
||||
Client.AddUser(new APIUser
|
||||
{
|
||||
Id = 2,
|
||||
Statistics = { GlobalRank = 1234 }
|
||||
@ -41,19 +41,19 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
AddStep("add users", () =>
|
||||
{
|
||||
Client.AddUser(new User
|
||||
Client.AddUser(new APIUser
|
||||
{
|
||||
Id = 2,
|
||||
Statistics = { GlobalRank = 1234 }
|
||||
});
|
||||
|
||||
Client.AddUser(new User
|
||||
Client.AddUser(new APIUser
|
||||
{
|
||||
Id = 3,
|
||||
Statistics = { GlobalRank = 3333 }
|
||||
});
|
||||
|
||||
Client.AddUser(new User
|
||||
Client.AddUser(new APIUser
|
||||
{
|
||||
Id = 4,
|
||||
Statistics = { GlobalRank = 4321 }
|
||||
@ -75,13 +75,13 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
AddStep("add users", () =>
|
||||
{
|
||||
Client.AddUser(new User
|
||||
Client.AddUser(new APIUser
|
||||
{
|
||||
Id = 2,
|
||||
Statistics = { GlobalRank = min }
|
||||
});
|
||||
|
||||
Client.AddUser(new User
|
||||
Client.AddUser(new APIUser
|
||||
{
|
||||
Id = 3,
|
||||
Statistics = { GlobalRank = max }
|
||||
|
@ -8,6 +8,7 @@ using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.AccountCreation;
|
||||
using osu.Game.Overlays.Settings;
|
||||
@ -20,7 +21,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
private readonly Container userPanelArea;
|
||||
private readonly AccountCreationOverlay accountCreation;
|
||||
|
||||
private IBindable<User> localUser;
|
||||
private IBindable<APIUser> localUser;
|
||||
|
||||
public TestSceneAccountCreationOverlay()
|
||||
{
|
||||
|
@ -14,8 +14,8 @@ using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.BeatmapListing;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Users;
|
||||
using osuTK.Input;
|
||||
using APIUser = osu.Game.Online.API.Requests.Responses.APIUser;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
@ -53,7 +53,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
};
|
||||
|
||||
// non-supporter user
|
||||
api.LocalUser.Value = new User
|
||||
api.LocalUser.Value = new APIUser
|
||||
{
|
||||
Username = "TestBot",
|
||||
Id = API.LocalUser.Value.Id + 1,
|
||||
|
@ -7,11 +7,11 @@ using osu.Game.Beatmaps;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.BeatmapSet;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Users;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using APIUser = osu.Game.Online.API.Requests.Responses.APIUser;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
@ -56,7 +56,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
Artist = @"naru narusegawa",
|
||||
Source = @"hinata sou",
|
||||
Tags = @"test tag tag more tag",
|
||||
Author = new User
|
||||
Author = new APIUser
|
||||
{
|
||||
Username = @"BanchoBot",
|
||||
Id = 3,
|
||||
|
@ -11,9 +11,9 @@ using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Chat;
|
||||
using osu.Game.Overlays.Chat.Tabs;
|
||||
using osu.Game.Users;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
@ -108,7 +108,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
}
|
||||
|
||||
private void addRandomPrivateChannel() =>
|
||||
channelTabControl.AddChannel(new Channel(new User
|
||||
channelTabControl.AddChannel(new Channel(new APIUser
|
||||
{
|
||||
Id = RNG.Next(1000, 10000000),
|
||||
Username = "Test User " + RNG.Next(1000)
|
||||
|
@ -6,9 +6,9 @@ using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Chat;
|
||||
using osu.Game.Overlays.Chat;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
@ -55,14 +55,14 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
private static long messageCounter;
|
||||
|
||||
internal static readonly User TEST_SENDER_BACKGROUND = new User
|
||||
internal static readonly APIUser TEST_SENDER_BACKGROUND = new APIUser
|
||||
{
|
||||
Username = @"i-am-important",
|
||||
Id = 42,
|
||||
Colour = "#250cc9",
|
||||
};
|
||||
|
||||
internal static readonly User TEST_SENDER = new User
|
||||
internal static readonly APIUser TEST_SENDER = new APIUser
|
||||
{
|
||||
Username = @"Somebody",
|
||||
Id = 1,
|
||||
@ -75,7 +75,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
Content = text;
|
||||
IsAction = isAction;
|
||||
Sender = new User
|
||||
Sender = new APIUser
|
||||
{
|
||||
Username = username ?? $"user {number}",
|
||||
Id = number,
|
||||
|
@ -10,10 +10,10 @@ using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Chat;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Chat;
|
||||
using osu.Game.Users;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
@ -168,14 +168,14 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
private static long messageCounter;
|
||||
|
||||
internal static readonly User TEST_SENDER_BACKGROUND = new User
|
||||
internal static readonly APIUser TEST_SENDER_BACKGROUND = new APIUser
|
||||
{
|
||||
Username = @"i-am-important",
|
||||
Id = 42,
|
||||
Colour = "#250cc9",
|
||||
};
|
||||
|
||||
internal static readonly User TEST_SENDER = new User
|
||||
internal static readonly APIUser TEST_SENDER = new APIUser
|
||||
{
|
||||
Username = @"Somebody",
|
||||
Id = 1,
|
||||
@ -188,7 +188,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
Content = text;
|
||||
IsAction = isAction;
|
||||
Sender = new User
|
||||
Sender = new APIUser
|
||||
{
|
||||
Username = $"User {number}",
|
||||
Id = number,
|
||||
|
@ -18,12 +18,12 @@ using osu.Framework.Testing;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Chat;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Chat;
|
||||
using osu.Game.Overlays.Chat.Selection;
|
||||
using osu.Game.Overlays.Chat.Tabs;
|
||||
using osu.Game.Users;
|
||||
using osuTK.Input;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
@ -53,7 +53,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
public TestSceneChatOverlay()
|
||||
{
|
||||
channels = Enumerable.Range(1, 10)
|
||||
.Select(index => new Channel(new User())
|
||||
.Select(index => new Channel(new APIUser())
|
||||
{
|
||||
Name = $"Channel no. {index}",
|
||||
Topic = index == 3 ? null : $"We talk about the number {index} here",
|
||||
@ -98,7 +98,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
case GetUserRequest getUser:
|
||||
if (getUser.Lookup.Equals("some body", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
getUser.TriggerSuccess(new User
|
||||
getUser.TriggerSuccess(new APIUser
|
||||
{
|
||||
Username = "some body",
|
||||
Id = 1,
|
||||
@ -149,7 +149,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
ChannelId = channel1.Id,
|
||||
Content = "hello from channel 1!",
|
||||
Sender = new User
|
||||
Sender = new APIUser
|
||||
{
|
||||
Id = 2,
|
||||
Username = "test_user"
|
||||
|
@ -9,6 +9,7 @@ using NUnit.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Spectator;
|
||||
using osu.Game.Overlays.Dashboard;
|
||||
using osu.Game.Tests.Visual.Spectator;
|
||||
@ -18,7 +19,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
public class TestSceneCurrentlyPlayingDisplay : OsuTestScene
|
||||
{
|
||||
private readonly User streamingUser = new User { Id = 2, Username = "Test user" };
|
||||
private readonly APIUser streamingUser = new APIUser { Id = 2, Username = "Test user" };
|
||||
|
||||
private TestSpectatorClient spectatorClient;
|
||||
private CurrentlyPlayingDisplay currentlyPlaying;
|
||||
@ -83,13 +84,13 @@ namespace osu.Game.Tests.Visual.Online
|
||||
"pishifat"
|
||||
};
|
||||
|
||||
protected override Task<User> ComputeValueAsync(int lookup, CancellationToken token = default)
|
||||
protected override Task<APIUser> ComputeValueAsync(int lookup, CancellationToken token = default)
|
||||
{
|
||||
// tests against failed lookups
|
||||
if (lookup == 13)
|
||||
return Task.FromResult<User>(null);
|
||||
return Task.FromResult<APIUser>(null);
|
||||
|
||||
return Task.FromResult(new User
|
||||
return Task.FromResult(new APIUser
|
||||
{
|
||||
Id = lookup,
|
||||
Username = usernames[lookup % usernames.Length],
|
||||
|
@ -10,8 +10,8 @@ using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays.BeatmapListing.Panels;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
using APIUser = osu.Game.Online.API.Requests.Responses.APIUser;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
@ -74,7 +74,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
Title = "undownloadable beatmap",
|
||||
Artist = "test",
|
||||
Source = "more tests",
|
||||
Author = new User
|
||||
Author = new APIUser
|
||||
{
|
||||
Username = "BanchoBot",
|
||||
Id = 3,
|
||||
@ -121,7 +121,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
Title = "undownloadable beatmap",
|
||||
Artist = "test",
|
||||
Source = "more tests",
|
||||
Author = new User
|
||||
Author = new APIUser
|
||||
{
|
||||
Username = "BanchoBot",
|
||||
Id = 3,
|
||||
|
@ -7,6 +7,7 @@ using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Dashboard.Friends;
|
||||
using osu.Game.Users;
|
||||
@ -44,9 +45,9 @@ namespace osu.Game.Tests.Visual.Online
|
||||
// No need to do anything, fetch is performed automatically.
|
||||
}
|
||||
|
||||
private List<User> getUsers() => new List<User>
|
||||
private List<APIUser> getUsers() => new List<APIUser>
|
||||
{
|
||||
new User
|
||||
new APIUser
|
||||
{
|
||||
Username = "flyte",
|
||||
Id = 3103765,
|
||||
@ -55,7 +56,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
Country = new Country { FlagName = "JP" },
|
||||
CoverUrl = "https://osu.ppy.sh/images/headers/profile-covers/c6.jpg"
|
||||
},
|
||||
new User
|
||||
new APIUser
|
||||
{
|
||||
Username = "peppy",
|
||||
Id = 2,
|
||||
@ -66,7 +67,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
IsSupporter = true,
|
||||
SupportLevel = 3,
|
||||
},
|
||||
new User
|
||||
new APIUser
|
||||
{
|
||||
Username = "Evast",
|
||||
Id = 8195163,
|
||||
|
@ -7,9 +7,9 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Profile.Sections;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
@ -37,8 +37,8 @@ namespace osu.Game.Tests.Visual.Online
|
||||
Child = section = new HistoricalSection(),
|
||||
});
|
||||
|
||||
AddStep("Show peppy", () => section.User.Value = new User { Id = 2 });
|
||||
AddStep("Show WubWoofWolf", () => section.User.Value = new User { Id = 39828 });
|
||||
AddStep("Show peppy", () => section.User.Value = new APIUser { Id = 2 });
|
||||
AddStep("Show WubWoofWolf", () => section.User.Value = new APIUser { Id = 39828 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,14 +15,14 @@ using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Chat;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Notifications;
|
||||
using osu.Game.Users;
|
||||
using osuTK.Input;
|
||||
using APIUser = osu.Game.Online.API.Requests.Responses.APIUser;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
public class TestSceneMessageNotifier : OsuManualInputManagerTestScene
|
||||
{
|
||||
private User friend;
|
||||
private APIUser friend;
|
||||
private Channel publicChannel;
|
||||
private Channel privateMessageChannel;
|
||||
private TestContainer testContainer;
|
||||
@ -37,7 +37,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
daa.HandleRequest = dummyAPIHandleRequest;
|
||||
}
|
||||
|
||||
friend = new User { Id = 0, Username = "Friend" };
|
||||
friend = new APIUser { Id = 0, Username = "Friend" };
|
||||
publicChannel = new Channel { Id = 1, Name = "osu" };
|
||||
privateMessageChannel = new Channel(friend) { Id = 2, Name = friend.Username, Type = ChannelType.PM };
|
||||
|
||||
@ -178,9 +178,9 @@ namespace osu.Game.Tests.Visual.Online
|
||||
AddAssert("1 notification fired", () => testContainer.NotificationOverlay.UnreadCount.Value == 1);
|
||||
}
|
||||
|
||||
private void receiveMessage(User sender, Channel channel, string content) => channel.AddNewMessages(createMessage(sender, channel, content));
|
||||
private void receiveMessage(APIUser sender, Channel channel, string content) => channel.AddNewMessages(createMessage(sender, channel, content));
|
||||
|
||||
private Message createMessage(User sender, Channel channel, string content) => new Message(messageIdCounter++)
|
||||
private Message createMessage(APIUser sender, Channel channel, string content) => new Message(messageIdCounter++)
|
||||
{
|
||||
Content = content,
|
||||
Sender = sender,
|
||||
|
@ -11,9 +11,9 @@ using osu.Game.Overlays.Comments;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Users;
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Testing;
|
||||
using APIUser = osu.Game.Online.API.Requests.Responses.APIUser;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
@ -154,9 +154,9 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
5
|
||||
},
|
||||
Users = new List<User>
|
||||
Users = new List<APIUser>
|
||||
{
|
||||
new User
|
||||
new APIUser
|
||||
{
|
||||
Id = 1,
|
||||
Username = "Good_Admin"
|
||||
|
@ -4,7 +4,6 @@
|
||||
using osu.Game.Overlays.Profile.Sections.Historical;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Users;
|
||||
using NUnit.Framework;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Framework.Allocation;
|
||||
@ -12,7 +11,7 @@ using System;
|
||||
using System.Linq;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using static osu.Game.Users.User;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
@ -21,7 +20,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
[Cached]
|
||||
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Red);
|
||||
|
||||
private readonly Bindable<User> user = new Bindable<User>();
|
||||
private readonly Bindable<APIUser> user = new Bindable<APIUser>();
|
||||
private readonly PlayHistorySubsection section;
|
||||
|
||||
public TestScenePlayHistorySubsection()
|
||||
@ -101,80 +100,80 @@ namespace osu.Game.Tests.Visual.Online
|
||||
|
||||
private int getChartValuesLength() => this.ChildrenOfType<ProfileLineChart>().Single().Values.Length;
|
||||
|
||||
private static readonly User user_with_null_values = new User
|
||||
private static readonly APIUser user_with_null_values = new APIUser
|
||||
{
|
||||
Id = 1
|
||||
};
|
||||
|
||||
private static readonly User user_with_empty_values = new User
|
||||
private static readonly APIUser user_with_empty_values = new APIUser
|
||||
{
|
||||
Id = 2,
|
||||
MonthlyPlaycounts = Array.Empty<UserHistoryCount>()
|
||||
MonthlyPlaycounts = Array.Empty<APIUserHistoryCount>()
|
||||
};
|
||||
|
||||
private static readonly User user_with_one_value = new User
|
||||
private static readonly APIUser user_with_one_value = new APIUser
|
||||
{
|
||||
Id = 3,
|
||||
MonthlyPlaycounts = new[]
|
||||
{
|
||||
new UserHistoryCount { Date = new DateTime(2010, 5, 1), Count = 100 }
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 5, 1), Count = 100 }
|
||||
}
|
||||
};
|
||||
|
||||
private static readonly User user_with_two_values = new User
|
||||
private static readonly APIUser user_with_two_values = new APIUser
|
||||
{
|
||||
Id = 4,
|
||||
MonthlyPlaycounts = new[]
|
||||
{
|
||||
new UserHistoryCount { Date = new DateTime(2010, 5, 1), Count = 1 },
|
||||
new UserHistoryCount { Date = new DateTime(2010, 6, 1), Count = 2 }
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 5, 1), Count = 1 },
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 6, 1), Count = 2 }
|
||||
}
|
||||
};
|
||||
|
||||
private static readonly User user_with_constant_values = new User
|
||||
private static readonly APIUser user_with_constant_values = new APIUser
|
||||
{
|
||||
Id = 5,
|
||||
MonthlyPlaycounts = new[]
|
||||
{
|
||||
new UserHistoryCount { Date = new DateTime(2010, 5, 1), Count = 5 },
|
||||
new UserHistoryCount { Date = new DateTime(2010, 6, 1), Count = 5 },
|
||||
new UserHistoryCount { Date = new DateTime(2010, 7, 1), Count = 5 }
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 5, 1), Count = 5 },
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 6, 1), Count = 5 },
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 7, 1), Count = 5 }
|
||||
}
|
||||
};
|
||||
|
||||
private static readonly User user_with_zero_values = new User
|
||||
private static readonly APIUser user_with_zero_values = new APIUser
|
||||
{
|
||||
Id = 6,
|
||||
MonthlyPlaycounts = new[]
|
||||
{
|
||||
new UserHistoryCount { Date = new DateTime(2010, 5, 1), Count = 0 },
|
||||
new UserHistoryCount { Date = new DateTime(2010, 6, 1), Count = 0 },
|
||||
new UserHistoryCount { Date = new DateTime(2010, 7, 1), Count = 0 }
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 5, 1), Count = 0 },
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 6, 1), Count = 0 },
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 7, 1), Count = 0 }
|
||||
}
|
||||
};
|
||||
|
||||
private static readonly User user_with_filled_values = new User
|
||||
private static readonly APIUser user_with_filled_values = new APIUser
|
||||
{
|
||||
Id = 7,
|
||||
MonthlyPlaycounts = new[]
|
||||
{
|
||||
new UserHistoryCount { Date = new DateTime(2010, 5, 1), Count = 1000 },
|
||||
new UserHistoryCount { Date = new DateTime(2010, 6, 1), Count = 20 },
|
||||
new UserHistoryCount { Date = new DateTime(2010, 7, 1), Count = 20000 },
|
||||
new UserHistoryCount { Date = new DateTime(2010, 8, 1), Count = 30 },
|
||||
new UserHistoryCount { Date = new DateTime(2010, 9, 1), Count = 50 },
|
||||
new UserHistoryCount { Date = new DateTime(2010, 10, 1), Count = 2000 },
|
||||
new UserHistoryCount { Date = new DateTime(2010, 11, 1), Count = 2100 }
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 5, 1), Count = 1000 },
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 6, 1), Count = 20 },
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 7, 1), Count = 20000 },
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 8, 1), Count = 30 },
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 9, 1), Count = 50 },
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 10, 1), Count = 2000 },
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 11, 1), Count = 2100 }
|
||||
}
|
||||
};
|
||||
|
||||
private static readonly User user_with_missing_values = new User
|
||||
private static readonly APIUser user_with_missing_values = new APIUser
|
||||
{
|
||||
Id = 8,
|
||||
MonthlyPlaycounts = new[]
|
||||
{
|
||||
new UserHistoryCount { Date = new DateTime(2020, 1, 1), Count = 100 },
|
||||
new UserHistoryCount { Date = new DateTime(2020, 7, 1), Count = 200 }
|
||||
new APIUserHistoryCount { Date = new DateTime(2020, 1, 1), Count = 100 },
|
||||
new APIUserHistoryCount { Date = new DateTime(2020, 7, 1), Count = 200 }
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -7,10 +7,10 @@ using osu.Game.Rulesets.Catch;
|
||||
using osu.Game.Rulesets.Mania;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Rulesets.Taiko;
|
||||
using osu.Game.Users;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
@ -22,7 +22,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
public TestSceneProfileRulesetSelector()
|
||||
{
|
||||
ProfileRulesetSelector selector;
|
||||
var user = new Bindable<User>();
|
||||
var user = new Bindable<APIUser>();
|
||||
|
||||
Child = selector = new ProfileRulesetSelector
|
||||
{
|
||||
@ -36,10 +36,10 @@ namespace osu.Game.Tests.Visual.Online
|
||||
AddStep("set taiko as default", () => selector.SetDefaultRuleset(new TaikoRuleset().RulesetInfo));
|
||||
AddStep("set catch as default", () => selector.SetDefaultRuleset(new CatchRuleset().RulesetInfo));
|
||||
|
||||
AddStep("User with osu as default", () => user.Value = new User { PlayMode = "osu" });
|
||||
AddStep("User with mania as default", () => user.Value = new User { PlayMode = "mania" });
|
||||
AddStep("User with taiko as default", () => user.Value = new User { PlayMode = "taiko" });
|
||||
AddStep("User with catch as default", () => user.Value = new User { PlayMode = "fruits" });
|
||||
AddStep("User with osu as default", () => user.Value = new APIUser { PlayMode = "osu" });
|
||||
AddStep("User with mania as default", () => user.Value = new APIUser { PlayMode = "mania" });
|
||||
AddStep("User with taiko as default", () => user.Value = new APIUser { PlayMode = "taiko" });
|
||||
AddStep("User with catch as default", () => user.Value = new APIUser { PlayMode = "fruits" });
|
||||
AddStep("null user", () => user.Value = null);
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Profile.Header.Components;
|
||||
using osu.Game.Users;
|
||||
@ -81,7 +82,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
GlobalRank = 89000,
|
||||
PP = 12345,
|
||||
RankHistory = new User.RankHistoryData
|
||||
RankHistory = new APIUser.RankHistoryData
|
||||
{
|
||||
Data = data,
|
||||
}
|
||||
@ -94,7 +95,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
GlobalRank = 89000,
|
||||
PP = 12345,
|
||||
RankHistory = new User.RankHistoryData
|
||||
RankHistory = new APIUser.RankHistoryData
|
||||
{
|
||||
Data = dataWithZeros,
|
||||
}
|
||||
@ -107,7 +108,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
GlobalRank = 12000,
|
||||
PP = 12345,
|
||||
RankHistory = new User.RankHistoryData
|
||||
RankHistory = new APIUser.RankHistoryData
|
||||
{
|
||||
Data = smallData,
|
||||
}
|
||||
@ -120,7 +121,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
GlobalRank = 12000,
|
||||
PP = 12345,
|
||||
RankHistory = new User.RankHistoryData
|
||||
RankHistory = new APIUser.RankHistoryData
|
||||
{
|
||||
Data = edgyData,
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ using osu.Game.Rulesets.Osu.Mods;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Users;
|
||||
using osuTK.Graphics;
|
||||
using APIUser = osu.Game.Online.API.Requests.Responses.APIUser;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
@ -50,7 +51,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
new APIScoreInfo
|
||||
{
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 6602580,
|
||||
Username = @"waaiiru",
|
||||
@ -75,7 +76,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
},
|
||||
new APIScoreInfo
|
||||
{
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 4608074,
|
||||
Username = @"Skycries",
|
||||
@ -99,7 +100,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
},
|
||||
new APIScoreInfo
|
||||
{
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 1014222,
|
||||
Username = @"eLy",
|
||||
@ -122,7 +123,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
},
|
||||
new APIScoreInfo
|
||||
{
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 1541390,
|
||||
Username = @"Toukai",
|
||||
@ -144,7 +145,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
},
|
||||
new APIScoreInfo
|
||||
{
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 7151382,
|
||||
Username = @"Mayuri Hana",
|
||||
@ -167,7 +168,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
Score = new APIScoreInfo
|
||||
{
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 7151382,
|
||||
Username = @"Mayuri Hana",
|
||||
@ -190,7 +191,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
Score = new APIScoreInfo
|
||||
{
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 7151382,
|
||||
Username = @"Mayuri Hana",
|
||||
@ -215,7 +216,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
new APIScoreInfo
|
||||
{
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 6602580,
|
||||
Username = @"waaiiru",
|
||||
|
@ -4,13 +4,13 @@
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Online.Chat;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays.Chat;
|
||||
using osuTK.Input;
|
||||
|
||||
@ -18,26 +18,26 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
public class TestSceneStandAloneChatDisplay : OsuManualInputManagerTestScene
|
||||
{
|
||||
private readonly User admin = new User
|
||||
private readonly APIUser admin = new APIUser
|
||||
{
|
||||
Username = "HappyStick",
|
||||
Id = 2,
|
||||
Colour = "f2ca34"
|
||||
};
|
||||
|
||||
private readonly User redUser = new User
|
||||
private readonly APIUser redUser = new APIUser
|
||||
{
|
||||
Username = "BanchoBot",
|
||||
Id = 3,
|
||||
};
|
||||
|
||||
private readonly User blueUser = new User
|
||||
private readonly APIUser blueUser = new APIUser
|
||||
{
|
||||
Username = "Zallius",
|
||||
Id = 4,
|
||||
};
|
||||
|
||||
private readonly User longUsernameUser = new User
|
||||
private readonly APIUser longUsernameUser = new APIUser
|
||||
{
|
||||
Username = "Very Long Long Username",
|
||||
Id = 5,
|
||||
|
@ -2,11 +2,11 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using osu.Game.Overlays.Profile.Sections.Historical;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Framework.Allocation;
|
||||
using static osu.Game.Users.User;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Profile.Sections.Historical;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
@ -29,28 +29,28 @@ namespace osu.Game.Tests.Visual.Online
|
||||
|
||||
var values = new[]
|
||||
{
|
||||
new UserHistoryCount { Date = new DateTime(2000, 1, 1), Count = 10 },
|
||||
new UserHistoryCount { Date = new DateTime(2000, 2, 1), Count = 20 },
|
||||
new UserHistoryCount { Date = new DateTime(2000, 3, 1), Count = 100 },
|
||||
new UserHistoryCount { Date = new DateTime(2000, 4, 1), Count = 15 },
|
||||
new UserHistoryCount { Date = new DateTime(2000, 5, 1), Count = 30 }
|
||||
new APIUserHistoryCount { Date = new DateTime(2000, 1, 1), Count = 10 },
|
||||
new APIUserHistoryCount { Date = new DateTime(2000, 2, 1), Count = 20 },
|
||||
new APIUserHistoryCount { Date = new DateTime(2000, 3, 1), Count = 100 },
|
||||
new APIUserHistoryCount { Date = new DateTime(2000, 4, 1), Count = 15 },
|
||||
new APIUserHistoryCount { Date = new DateTime(2000, 5, 1), Count = 30 }
|
||||
};
|
||||
|
||||
var moreValues = new[]
|
||||
{
|
||||
new UserHistoryCount { Date = new DateTime(2010, 5, 1), Count = 1000 },
|
||||
new UserHistoryCount { Date = new DateTime(2010, 6, 1), Count = 20 },
|
||||
new UserHistoryCount { Date = new DateTime(2010, 7, 1), Count = 20000 },
|
||||
new UserHistoryCount { Date = new DateTime(2010, 8, 1), Count = 30 },
|
||||
new UserHistoryCount { Date = new DateTime(2010, 9, 1), Count = 50 },
|
||||
new UserHistoryCount { Date = new DateTime(2010, 10, 1), Count = 2000 },
|
||||
new UserHistoryCount { Date = new DateTime(2010, 11, 1), Count = 2100 }
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 5, 1), Count = 1000 },
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 6, 1), Count = 20 },
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 7, 1), Count = 20000 },
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 8, 1), Count = 30 },
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 9, 1), Count = 50 },
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 10, 1), Count = 2000 },
|
||||
new APIUserHistoryCount { Date = new DateTime(2010, 11, 1), Count = 2100 }
|
||||
};
|
||||
|
||||
AddStep("Set fake values", () => graph.Values = values);
|
||||
AddStep("Set more values", () => graph.Values = moreValues);
|
||||
AddStep("Set null values", () => graph.Values = null);
|
||||
AddStep("Set empty values", () => graph.Values = Array.Empty<UserHistoryCount>());
|
||||
AddStep("Set empty values", () => graph.Values = Array.Empty<APIUserHistoryCount>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
@ -42,27 +43,27 @@ namespace osu.Game.Tests.Visual.Online
|
||||
Spacing = new Vector2(10f),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new UserBrickPanel(new User
|
||||
new UserBrickPanel(new APIUser
|
||||
{
|
||||
Username = @"flyte",
|
||||
Id = 3103765,
|
||||
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c6.jpg"
|
||||
}),
|
||||
new UserBrickPanel(new User
|
||||
new UserBrickPanel(new APIUser
|
||||
{
|
||||
Username = @"peppy",
|
||||
Id = 2,
|
||||
Colour = "99EB47",
|
||||
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg",
|
||||
}),
|
||||
flyte = new UserGridPanel(new User
|
||||
flyte = new UserGridPanel(new APIUser
|
||||
{
|
||||
Username = @"flyte",
|
||||
Id = 3103765,
|
||||
Country = new Country { FlagName = @"JP" },
|
||||
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c6.jpg"
|
||||
}) { Width = 300 },
|
||||
peppy = new UserGridPanel(new User
|
||||
peppy = new UserGridPanel(new APIUser
|
||||
{
|
||||
Username = @"peppy",
|
||||
Id = 2,
|
||||
@ -71,7 +72,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
IsSupporter = true,
|
||||
SupportLevel = 3,
|
||||
}) { Width = 300 },
|
||||
evast = new TestUserListPanel(new User
|
||||
evast = new TestUserListPanel(new APIUser
|
||||
{
|
||||
Username = @"Evast",
|
||||
Id = 8195163,
|
||||
@ -134,7 +135,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
|
||||
private class TestUserListPanel : UserListPanel
|
||||
{
|
||||
public TestUserListPanel(User user)
|
||||
public TestUserListPanel(APIUser user)
|
||||
: base(user)
|
||||
{
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ using System;
|
||||
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.Overlays;
|
||||
using osu.Game.Overlays.Profile;
|
||||
using osu.Game.Users;
|
||||
@ -30,26 +31,26 @@ namespace osu.Game.Tests.Visual.Online
|
||||
|
||||
AddStep("Show test dummy", () => header.User.Value = TestSceneUserProfileOverlay.TEST_USER);
|
||||
|
||||
AddStep("Show null dummy", () => header.User.Value = new User
|
||||
AddStep("Show null dummy", () => header.User.Value = new APIUser
|
||||
{
|
||||
Username = "Null"
|
||||
});
|
||||
|
||||
AddStep("Show online dummy", () => header.User.Value = new User
|
||||
AddStep("Show online dummy", () => header.User.Value = new APIUser
|
||||
{
|
||||
Username = "IAmOnline",
|
||||
LastVisit = DateTimeOffset.Now,
|
||||
IsOnline = true,
|
||||
});
|
||||
|
||||
AddStep("Show offline dummy", () => header.User.Value = new User
|
||||
AddStep("Show offline dummy", () => header.User.Value = new APIUser
|
||||
{
|
||||
Username = "IAmOffline",
|
||||
LastVisit = DateTimeOffset.Now,
|
||||
IsOnline = false,
|
||||
});
|
||||
|
||||
addOnlineStep("Show ppy", new User
|
||||
addOnlineStep("Show ppy", new APIUser
|
||||
{
|
||||
Username = @"peppy",
|
||||
Id = 2,
|
||||
@ -58,7 +59,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg"
|
||||
});
|
||||
|
||||
addOnlineStep("Show flyte", new User
|
||||
addOnlineStep("Show flyte", new APIUser
|
||||
{
|
||||
Username = @"flyte",
|
||||
Id = 3103765,
|
||||
@ -67,7 +68,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
});
|
||||
}
|
||||
|
||||
private void addOnlineStep(string name, User fallback)
|
||||
private void addOnlineStep(string name, APIUser fallback)
|
||||
{
|
||||
AddStep(name, () =>
|
||||
{
|
||||
|
@ -6,6 +6,7 @@ using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Profile;
|
||||
using osu.Game.Users;
|
||||
@ -22,7 +23,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
[Resolved]
|
||||
private IAPIProvider api { get; set; }
|
||||
|
||||
public static readonly User TEST_USER = new User
|
||||
public static readonly APIUser TEST_USER = new APIUser
|
||||
{
|
||||
Username = @"Somebody",
|
||||
Id = 1,
|
||||
@ -41,7 +42,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
Current = 727,
|
||||
Progress = 69,
|
||||
},
|
||||
RankHistory = new User.RankHistoryData
|
||||
RankHistory = new APIUser.RankHistoryData
|
||||
{
|
||||
Mode = @"osu",
|
||||
Data = Enumerable.Range(2345, 45).Concat(Enumerable.Range(2109, 40)).ToArray()
|
||||
@ -58,7 +59,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
},
|
||||
Title = "osu!volunteer",
|
||||
Colour = "ff0000",
|
||||
Achievements = Array.Empty<User.UserAchievement>(),
|
||||
Achievements = Array.Empty<APIUser.UserAchievement>(),
|
||||
};
|
||||
|
||||
public TestSceneUserProfileOverlay()
|
||||
@ -72,13 +73,13 @@ namespace osu.Game.Tests.Visual.Online
|
||||
|
||||
AddStep("Show offline dummy", () => profile.ShowUser(TEST_USER, false));
|
||||
|
||||
AddStep("Show null dummy", () => profile.ShowUser(new User
|
||||
AddStep("Show null dummy", () => profile.ShowUser(new APIUser
|
||||
{
|
||||
Username = @"Null",
|
||||
Id = 1,
|
||||
}, false));
|
||||
|
||||
AddStep("Show ppy", () => profile.ShowUser(new User
|
||||
AddStep("Show ppy", () => profile.ShowUser(new APIUser
|
||||
{
|
||||
Username = @"peppy",
|
||||
Id = 2,
|
||||
@ -87,7 +88,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg"
|
||||
}, api.IsLoggedIn));
|
||||
|
||||
AddStep("Show flyte", () => profile.ShowUser(new User
|
||||
AddStep("Show flyte", () => profile.ShowUser(new APIUser
|
||||
{
|
||||
Username = @"flyte",
|
||||
Id = 3103765,
|
||||
@ -95,7 +96,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c6.jpg"
|
||||
}, api.IsLoggedIn));
|
||||
|
||||
AddStep("Show bancho", () => profile.ShowUser(new User
|
||||
AddStep("Show bancho", () => profile.ShowUser(new APIUser
|
||||
{
|
||||
Username = @"BanchoBot",
|
||||
Id = 3,
|
||||
|
@ -4,8 +4,8 @@
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays.Profile.Header.Components;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
@ -48,13 +48,13 @@ namespace osu.Game.Tests.Visual.Online
|
||||
AddUntilStep("Is hidden", () => container.Alpha == 0);
|
||||
}
|
||||
|
||||
private static readonly User[] users =
|
||||
private static readonly APIUser[] users =
|
||||
{
|
||||
new User { Id = 1, PreviousUsernames = new[] { "username1" } },
|
||||
new User { Id = 2, PreviousUsernames = new[] { "longusername", "longerusername" } },
|
||||
new User { Id = 3, PreviousUsernames = new[] { "test", "angelsim", "verylongusername" } },
|
||||
new User { Id = 4, PreviousUsernames = new[] { "ihavenoidea", "howcani", "makethistext", "anylonger" } },
|
||||
new User { Id = 5, PreviousUsernames = Array.Empty<string>() },
|
||||
new APIUser { Id = 1, PreviousUsernames = new[] { "username1" } },
|
||||
new APIUser { Id = 2, PreviousUsernames = new[] { "longusername", "longerusername" } },
|
||||
new APIUser { Id = 3, PreviousUsernames = new[] { "test", "angelsim", "verylongusername" } },
|
||||
new APIUser { Id = 4, PreviousUsernames = new[] { "ihavenoidea", "howcani", "makethistext", "anylonger" } },
|
||||
new APIUser { Id = 5, PreviousUsernames = Array.Empty<string>() },
|
||||
null
|
||||
};
|
||||
}
|
||||
|
@ -8,9 +8,9 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Profile.Sections;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
@ -44,7 +44,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
}
|
||||
});
|
||||
|
||||
AddStep("Show cookiezi", () => ranks.User.Value = new User { Id = 124493 });
|
||||
AddStep("Show cookiezi", () => ranks.User.Value = new APIUser { Id = 124493 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,10 +9,10 @@ using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Mania;
|
||||
using osu.Game.Users;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets.Taiko;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
@ -23,7 +23,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
[Resolved]
|
||||
private IAPIProvider api { get; set; }
|
||||
|
||||
private readonly Bindable<User> user = new Bindable<User>();
|
||||
private readonly Bindable<APIUser> user = new Bindable<APIUser>();
|
||||
private GetUserRequest request;
|
||||
private readonly LoadingLayer loading;
|
||||
|
||||
@ -71,7 +71,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
|
||||
private class UserTestContainer : FillFlowContainer
|
||||
{
|
||||
public readonly Bindable<User> User = new Bindable<User>();
|
||||
public readonly Bindable<APIUser> User = new Bindable<APIUser>();
|
||||
|
||||
public UserTestContainer()
|
||||
{
|
||||
@ -85,7 +85,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
User.BindValueChanged(onUserUpdate, true);
|
||||
}
|
||||
|
||||
private void onUserUpdate(ValueChangedEvent<User> user)
|
||||
private void onUserUpdate(ValueChangedEvent<APIUser> user)
|
||||
{
|
||||
Clear();
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Screens.OnlinePlay.Components;
|
||||
using osu.Game.Tests.Visual.OnlinePlay;
|
||||
@ -19,7 +20,7 @@ namespace osu.Game.Tests.Visual.Playlists
|
||||
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
SelectedRoom.Value.RecentParticipants.Add(new User
|
||||
SelectedRoom.Value.RecentParticipants.Add(new APIUser
|
||||
{
|
||||
Username = "peppy",
|
||||
Statistics = new UserStatistics { GlobalRank = 1234 },
|
||||
|
@ -14,6 +14,7 @@ using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
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.Osu;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
@ -21,7 +22,6 @@ using osu.Game.Scoring;
|
||||
using osu.Game.Screens.OnlinePlay.Playlists;
|
||||
using osu.Game.Screens.Ranking;
|
||||
using osu.Game.Tests.Beatmaps;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Playlists
|
||||
{
|
||||
@ -260,7 +260,7 @@ namespace osu.Game.Tests.Visual.Playlists
|
||||
Rank = userScore.Rank,
|
||||
MaxCombo = userScore.MaxCombo,
|
||||
TotalScore = userScore.TotalScore - i,
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 2,
|
||||
Username = $"peppy{i}",
|
||||
@ -278,7 +278,7 @@ namespace osu.Game.Tests.Visual.Playlists
|
||||
Rank = userScore.Rank,
|
||||
MaxCombo = userScore.MaxCombo,
|
||||
TotalScore = userScore.TotalScore + i,
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 2,
|
||||
Username = $"peppy{i}",
|
||||
@ -314,7 +314,7 @@ namespace osu.Game.Tests.Visual.Playlists
|
||||
Rank = ScoreRank.X,
|
||||
MaxCombo = 1000,
|
||||
TotalScore = startTotalScore + (sort == "score_asc" ? i : -i),
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 2,
|
||||
Username = $"peppy{i}",
|
||||
|
@ -8,6 +8,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Rulesets.Osu.Mods;
|
||||
@ -15,7 +16,6 @@ using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens.Ranking.Expanded.Accuracy;
|
||||
using osu.Game.Tests.Beatmaps;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Ranking
|
||||
@ -66,7 +66,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
|
||||
private ScoreInfo createScore(double accuracy, ScoreRank rank) => new ScoreInfo
|
||||
{
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 2,
|
||||
Username = "peppy",
|
||||
|
@ -11,6 +11,7 @@ using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
@ -18,7 +19,6 @@ using osu.Game.Scoring;
|
||||
using osu.Game.Screens.Ranking;
|
||||
using osu.Game.Screens.Ranking.Expanded;
|
||||
using osu.Game.Tests.Beatmaps;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Ranking
|
||||
@ -31,7 +31,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
[Test]
|
||||
public void TestMapWithKnownMapper()
|
||||
{
|
||||
var author = new User { Username = "mapper_name" };
|
||||
var author = new APIUser { Username = "mapper_name" };
|
||||
|
||||
AddStep("show example score", () => showPanel(new TestScoreInfo(new OsuRuleset().RulesetInfo)
|
||||
{
|
||||
@ -42,7 +42,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
[Test]
|
||||
public void TestExcessMods()
|
||||
{
|
||||
var author = new User { Username = "mapper_name" };
|
||||
var author = new APIUser { Username = "mapper_name" };
|
||||
|
||||
AddStep("show excess mods score", () => showPanel(new TestScoreInfo(new OsuRuleset().RulesetInfo, true)
|
||||
{
|
||||
@ -90,7 +90,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
private void showPanel(ScoreInfo score) =>
|
||||
Child = new ExpandedPanelMiddleContentContainer(score);
|
||||
|
||||
private BeatmapInfo createTestBeatmap(User author)
|
||||
private BeatmapInfo createTestBeatmap(APIUser author)
|
||||
{
|
||||
var beatmap = new TestBeatmap(rulesetStore.GetRuleset(0)).BeatmapInfo;
|
||||
|
||||
|
@ -10,6 +10,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Leaderboards;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Rulesets;
|
||||
@ -133,7 +134,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
MaxCombo = 244,
|
||||
TotalScore = 1707827,
|
||||
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock() },
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 6602580,
|
||||
Username = @"waaiiru",
|
||||
@ -156,7 +157,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
MaxCombo = 244,
|
||||
TotalScore = 1707827,
|
||||
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 6602580,
|
||||
Username = @"waaiiru",
|
||||
@ -198,7 +199,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
TotalScore = 1707827,
|
||||
//Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 6602580,
|
||||
Username = @"waaiiru",
|
||||
@ -217,7 +218,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
TotalScore = 1707827,
|
||||
//Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 4608074,
|
||||
Username = @"Skycries",
|
||||
@ -236,7 +237,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
TotalScore = 1707827,
|
||||
//Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 1014222,
|
||||
Username = @"eLy",
|
||||
@ -255,7 +256,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
TotalScore = 1707827,
|
||||
//Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 1541390,
|
||||
Username = @"Toukai",
|
||||
@ -274,7 +275,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
TotalScore = 1707827,
|
||||
//Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 2243452,
|
||||
Username = @"Satoruu",
|
||||
@ -293,7 +294,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
TotalScore = 1707827,
|
||||
//Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 2705430,
|
||||
Username = @"Mooha",
|
||||
@ -312,7 +313,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
TotalScore = 1707827,
|
||||
//Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 7151382,
|
||||
Username = @"Mayuri Hana",
|
||||
@ -331,7 +332,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
TotalScore = 1707827,
|
||||
//Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 2051389,
|
||||
Username = @"FunOrange",
|
||||
@ -350,7 +351,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
TotalScore = 1707827,
|
||||
//Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 6169483,
|
||||
Username = @"-Hebel-",
|
||||
@ -369,7 +370,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
TotalScore = 1707827,
|
||||
//Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 6702666,
|
||||
Username = @"prhtnsm",
|
||||
|
@ -9,6 +9,7 @@ using osu.Framework.Testing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Catch;
|
||||
using osu.Game.Rulesets.Mania;
|
||||
@ -40,9 +41,9 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
|
||||
base.SetUpSteps();
|
||||
|
||||
User getUser(int? rulesetID)
|
||||
APIUser getUser(int? rulesetID)
|
||||
{
|
||||
return new User
|
||||
return new APIUser
|
||||
{
|
||||
Username = @"Dummy",
|
||||
Id = 1001,
|
||||
|
@ -18,6 +18,7 @@ using osu.Framework.Testing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
@ -29,7 +30,6 @@ using osu.Game.Screens.Play;
|
||||
using osu.Game.Screens.Select;
|
||||
using osu.Game.Screens.Select.Carousel;
|
||||
using osu.Game.Screens.Select.Filter;
|
||||
using osu.Game.Users;
|
||||
using osuTK.Input;
|
||||
|
||||
namespace osu.Game.Tests.Visual.SongSelect
|
||||
@ -807,7 +807,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
|
||||
songSelect.PresentScore(new ScoreInfo
|
||||
{
|
||||
User = new User { Username = "woo" },
|
||||
User = new APIUser { Username = "woo" },
|
||||
BeatmapInfo = getPresentBeatmap(),
|
||||
Ruleset = getPresentBeatmap().Ruleset
|
||||
});
|
||||
@ -839,7 +839,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
|
||||
songSelect.PresentScore(new ScoreInfo
|
||||
{
|
||||
User = new User { Username = "woo" },
|
||||
User = new APIUser { Username = "woo" },
|
||||
BeatmapInfo = getPresentBeatmap(),
|
||||
Ruleset = getPresentBeatmap().Ruleset
|
||||
});
|
||||
|
@ -5,6 +5,7 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osuTK.Graphics;
|
||||
using osu.Game.Online.Leaderboards;
|
||||
using osu.Game.Overlays;
|
||||
@ -60,7 +61,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
MaxCombo = 244,
|
||||
TotalScore = 1707827,
|
||||
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 6602580,
|
||||
Username = @"waaiiru",
|
||||
@ -78,7 +79,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
Accuracy = 1,
|
||||
MaxCombo = 244,
|
||||
TotalScore = 1707827,
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 4608074,
|
||||
Username = @"Skycries",
|
||||
@ -96,7 +97,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
Accuracy = 1,
|
||||
MaxCombo = 244,
|
||||
TotalScore = 1707827,
|
||||
User = new User
|
||||
User = new APIUser
|
||||
{
|
||||
Id = 1541390,
|
||||
Username = @"Toukai",
|
||||
|
@ -7,11 +7,11 @@ using osu.Game.Overlays.Dashboard.Home;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Users;
|
||||
using System;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using APIUser = osu.Game.Online.API.Requests.Responses.APIUser;
|
||||
|
||||
namespace osu.Game.Tests.Visual.UserInterface
|
||||
{
|
||||
@ -62,7 +62,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
{
|
||||
Title = "Very Long Title (TV size) [TATOE]",
|
||||
Artist = "This artist has a really long name how is this possible",
|
||||
Author = new User
|
||||
Author = new APIUser
|
||||
{
|
||||
Username = "author",
|
||||
Id = 100
|
||||
@ -77,7 +77,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
{
|
||||
Title = "Very Long Title (TV size) [TATOE]",
|
||||
Artist = "This artist has a really long name how is this possible",
|
||||
Author = new User
|
||||
Author = new APIUser
|
||||
{
|
||||
Username = "author",
|
||||
Id = 100
|
||||
@ -96,7 +96,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
{
|
||||
Title = "Very Long Title (TV size) [TATOE]",
|
||||
Artist = "This artist has a really long name how is this possible",
|
||||
Author = new User
|
||||
Author = new APIUser
|
||||
{
|
||||
Username = "author",
|
||||
Id = 100
|
||||
@ -111,7 +111,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
{
|
||||
Title = "Very Long Title (TV size) [TATOE]",
|
||||
Artist = "This artist has a really long name how is this possible",
|
||||
Author = new User
|
||||
Author = new APIUser
|
||||
{
|
||||
Username = "author",
|
||||
Id = 100
|
||||
|
@ -15,13 +15,13 @@ using osu.Game.Beatmaps;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Graphics.Cursor;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Leaderboards;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens.Select.Leaderboards;
|
||||
using osu.Game.Tests.Resources;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
using osuTK.Input;
|
||||
|
||||
@ -64,7 +64,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
ID = 1,
|
||||
Title = "TestSong",
|
||||
Artist = "TestArtist",
|
||||
Author = new User
|
||||
Author = new APIUser
|
||||
{
|
||||
Username = "TestAuthor"
|
||||
},
|
||||
@ -98,7 +98,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
TotalScore = RNG.Next(1, 1000000),
|
||||
MaxCombo = RNG.Next(1, 1000),
|
||||
Rank = ScoreRank.XH,
|
||||
User = new User { Username = "TestUser" },
|
||||
User = new APIUser { Username = "TestUser" },
|
||||
};
|
||||
|
||||
importedScores.Add(scoreManager.Import(score).Result.Value);
|
||||
|
@ -6,9 +6,9 @@ using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Dashboard.Friends;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tests.Visual.UserInterface
|
||||
{
|
||||
@ -29,17 +29,17 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
[Test]
|
||||
public void Populate()
|
||||
{
|
||||
AddStep("Populate", () => control.Populate(new List<User>
|
||||
AddStep("Populate", () => control.Populate(new List<APIUser>
|
||||
{
|
||||
new User
|
||||
new APIUser
|
||||
{
|
||||
IsOnline = true
|
||||
},
|
||||
new User
|
||||
new APIUser
|
||||
{
|
||||
IsOnline = false
|
||||
},
|
||||
new User
|
||||
new APIUser
|
||||
{
|
||||
IsOnline = false
|
||||
}
|
||||
|
@ -3,13 +3,13 @@
|
||||
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Tests.Visual;
|
||||
using osu.Game.Tournament.Components;
|
||||
using osu.Game.Tournament.Models;
|
||||
using osu.Game.Tournament.Screens.Drawings.Components;
|
||||
using osu.Game.Tournament.Screens.Gameplay.Components;
|
||||
using osu.Game.Tournament.Screens.Ladder.Components;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tournament.Tests.Components
|
||||
{
|
||||
@ -24,13 +24,13 @@ namespace osu.Game.Tournament.Tests.Components
|
||||
FullName = { Value = "Australia" },
|
||||
Players =
|
||||
{
|
||||
new User { Username = "ASecretBox" },
|
||||
new User { Username = "Dereban" },
|
||||
new User { Username = "mReKk" },
|
||||
new User { Username = "uyghti" },
|
||||
new User { Username = "Parkes" },
|
||||
new User { Username = "Shiroha" },
|
||||
new User { Username = "Jordan The Bear" },
|
||||
new APIUser { Username = "ASecretBox" },
|
||||
new APIUser { Username = "Dereban" },
|
||||
new APIUser { Username = "mReKk" },
|
||||
new APIUser { Username = "uyghti" },
|
||||
new APIUser { Username = "Parkes" },
|
||||
new APIUser { Username = "Shiroha" },
|
||||
new APIUser { Username = "Jordan The Bear" },
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -4,12 +4,12 @@
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Chat;
|
||||
using osu.Game.Tests.Visual;
|
||||
using osu.Game.Tournament.Components;
|
||||
using osu.Game.Tournament.IPC;
|
||||
using osu.Game.Tournament.Models;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Tournament.Tests.Components
|
||||
{
|
||||
@ -18,20 +18,20 @@ namespace osu.Game.Tournament.Tests.Components
|
||||
private readonly Channel testChannel = new Channel();
|
||||
private readonly Channel testChannel2 = new Channel();
|
||||
|
||||
private readonly User admin = new User
|
||||
private readonly APIUser admin = new APIUser
|
||||
{
|
||||
Username = "HappyStick",
|
||||
Id = 2,
|
||||
Colour = "f2ca34"
|
||||
};
|
||||
|
||||
private readonly User redUser = new User
|
||||
private readonly APIUser redUser = new APIUser
|
||||
{
|
||||
Username = "BanchoBot",
|
||||
Id = 3,
|
||||
};
|
||||
|
||||
private readonly User blueUser = new User
|
||||
private readonly APIUser blueUser = new APIUser
|
||||
{
|
||||
Username = "Zallius",
|
||||
Id = 4,
|
||||
@ -57,11 +57,11 @@ namespace osu.Game.Tournament.Tests.Components
|
||||
{
|
||||
Team1 =
|
||||
{
|
||||
Value = new TournamentTeam { Players = new BindableList<User> { redUser } }
|
||||
Value = new TournamentTeam { Players = new BindableList<APIUser> { redUser } }
|
||||
},
|
||||
Team2 =
|
||||
{
|
||||
Value = new TournamentTeam { Players = new BindableList<User> { blueUser } }
|
||||
Value = new TournamentTeam { Players = new BindableList<APIUser> { blueUser } }
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -14,6 +14,7 @@ using osu.Game.Tournament.IO;
|
||||
using osu.Game.Tournament.IPC;
|
||||
using osu.Game.Tournament.Models;
|
||||
using osu.Game.Users;
|
||||
using APIUser = osu.Game.Online.API.Requests.Responses.APIUser;
|
||||
|
||||
namespace osu.Game.Tournament.Tests
|
||||
{
|
||||
@ -120,11 +121,11 @@ namespace osu.Game.Tournament.Tests
|
||||
},
|
||||
Players =
|
||||
{
|
||||
new User { Username = "Hello", Statistics = new UserStatistics { GlobalRank = 12 } },
|
||||
new User { Username = "Hello", Statistics = new UserStatistics { GlobalRank = 16 } },
|
||||
new User { Username = "Hello", Statistics = new UserStatistics { GlobalRank = 20 } },
|
||||
new User { Username = "Hello", Statistics = new UserStatistics { GlobalRank = 24 } },
|
||||
new User { Username = "Hello", Statistics = new UserStatistics { GlobalRank = 30 } },
|
||||
new APIUser { Username = "Hello", Statistics = new UserStatistics { GlobalRank = 12 } },
|
||||
new APIUser { Username = "Hello", Statistics = new UserStatistics { GlobalRank = 16 } },
|
||||
new APIUser { Username = "Hello", Statistics = new UserStatistics { GlobalRank = 20 } },
|
||||
new APIUser { Username = "Hello", Statistics = new UserStatistics { GlobalRank = 24 } },
|
||||
new APIUser { Username = "Hello", Statistics = new UserStatistics { GlobalRank = 30 } },
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -137,11 +138,11 @@ namespace osu.Game.Tournament.Tests
|
||||
FullName = { Value = "United States" },
|
||||
Players =
|
||||
{
|
||||
new User { Username = "Hello" },
|
||||
new User { Username = "Hello" },
|
||||
new User { Username = "Hello" },
|
||||
new User { Username = "Hello" },
|
||||
new User { Username = "Hello" },
|
||||
new APIUser { Username = "Hello" },
|
||||
new APIUser { Username = "Hello" },
|
||||
new APIUser { Username = "Hello" },
|
||||
new APIUser { Username = "Hello" },
|
||||
new APIUser { Username = "Hello" },
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -5,8 +5,8 @@ using System.Linq;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Tournament.Models;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
@ -54,7 +54,7 @@ namespace osu.Game.Tournament.Components
|
||||
},
|
||||
};
|
||||
|
||||
TournamentSpriteText createPlayerText(User p) =>
|
||||
TournamentSpriteText createPlayerText(APIUser p) =>
|
||||
new TournamentSpriteText
|
||||
{
|
||||
Text = p.Username,
|
||||
|
@ -5,7 +5,7 @@ using System;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Users;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Tournament.Models
|
||||
{
|
||||
@ -57,7 +57,7 @@ namespace osu.Game.Tournament.Models
|
||||
};
|
||||
|
||||
[JsonProperty]
|
||||
public BindableList<User> Players { get; set; } = new BindableList<User>();
|
||||
public BindableList<APIUser> Players { get; set; } = new BindableList<APIUser>();
|
||||
|
||||
public TournamentTeam()
|
||||
{
|
||||
|
@ -13,6 +13,7 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays.Settings;
|
||||
using osu.Game.Tournament.Components;
|
||||
using osu.Game.Tournament.Models;
|
||||
@ -199,14 +200,14 @@ namespace osu.Game.Tournament.Screens.Editors
|
||||
|
||||
public void CreateNew()
|
||||
{
|
||||
var user = new User();
|
||||
var user = new APIUser();
|
||||
team.Players.Add(user);
|
||||
flow.Add(new PlayerRow(team, user));
|
||||
}
|
||||
|
||||
public class PlayerRow : CompositeDrawable
|
||||
{
|
||||
private readonly User user;
|
||||
private readonly APIUser user;
|
||||
|
||||
[Resolved]
|
||||
protected IAPIProvider API { get; private set; }
|
||||
@ -218,7 +219,7 @@ namespace osu.Game.Tournament.Screens.Editors
|
||||
|
||||
private readonly Container drawableContainer;
|
||||
|
||||
public PlayerRow(TournamentTeam team, User user)
|
||||
public PlayerRow(TournamentTeam team, APIUser user)
|
||||
{
|
||||
this.user = user;
|
||||
|
||||
|
@ -18,8 +18,8 @@ using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Tournament.IO;
|
||||
using osu.Game.Tournament.IPC;
|
||||
using osu.Game.Tournament.Models;
|
||||
using osu.Game.Users;
|
||||
using osuTK.Input;
|
||||
using APIUser = osu.Game.Online.API.Requests.Responses.APIUser;
|
||||
|
||||
namespace osu.Game.Tournament
|
||||
{
|
||||
@ -241,7 +241,7 @@ namespace osu.Game.Tournament
|
||||
|
||||
private void updateLoadProgressMessage(string s) => Schedule(() => initialisationText.Text = s);
|
||||
|
||||
public void PopulateUser(User user, Action success = null, Action failure = null, bool immediate = false)
|
||||
public void PopulateUser(APIUser user, Action success = null, Action failure = null, bool immediate = false)
|
||||
{
|
||||
var req = new GetUserRequest(user.Id, Ruleset.Value);
|
||||
|
||||
|
@ -18,10 +18,10 @@ using osu.Game.Database;
|
||||
using osu.Game.IO;
|
||||
using osu.Game.IO.Archives;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays.Notifications;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Skinning;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Beatmaps
|
||||
{
|
||||
@ -68,7 +68,7 @@ namespace osu.Game.Beatmaps
|
||||
/// <summary>
|
||||
/// Create a new <see cref="WorkingBeatmap"/>.
|
||||
/// </summary>
|
||||
public WorkingBeatmap CreateNew(RulesetInfo ruleset, User user)
|
||||
public WorkingBeatmap CreateNew(RulesetInfo ruleset, APIUser user)
|
||||
{
|
||||
var metadata = new BeatmapMetadata
|
||||
{
|
||||
@ -262,7 +262,7 @@ namespace osu.Game.Beatmaps
|
||||
Artist = model.Metadata?.Artist ?? string.Empty,
|
||||
TitleUnicode = model.Metadata?.TitleUnicode ?? string.Empty,
|
||||
ArtistUnicode = model.Metadata?.ArtistUnicode ?? string.Empty,
|
||||
Author = new User { Username = model.Metadata?.Author },
|
||||
Author = new APIUser { Username = model.Metadata?.Author },
|
||||
}
|
||||
}, minimiseDownloadSize);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Users;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
#nullable enable
|
||||
|
||||
@ -36,7 +36,7 @@ namespace osu.Game.Beatmaps
|
||||
public List<BeatmapSetInfo> BeatmapSets { get; set; } = new List<BeatmapSetInfo>();
|
||||
|
||||
/// <summary>
|
||||
/// Helper property to deserialize a username to <see cref="User"/>.
|
||||
/// Helper property to deserialize a username to <see cref="APIUser"/>.
|
||||
/// </summary>
|
||||
[JsonProperty(@"user_id")]
|
||||
[Column("AuthorID")]
|
||||
@ -45,13 +45,13 @@ namespace osu.Game.Beatmaps
|
||||
get => Author?.Id ?? 1;
|
||||
set
|
||||
{
|
||||
Author ??= new User();
|
||||
Author ??= new APIUser();
|
||||
Author.Id = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper property to deserialize a username to <see cref="User"/>.
|
||||
/// Helper property to deserialize a username to <see cref="APIUser"/>.
|
||||
/// </summary>
|
||||
[JsonProperty(@"creator")]
|
||||
[Column("Author")]
|
||||
@ -60,7 +60,7 @@ namespace osu.Game.Beatmaps
|
||||
get => Author?.Username ?? string.Empty;
|
||||
set
|
||||
{
|
||||
Author ??= new User();
|
||||
Author ??= new APIUser();
|
||||
Author.Username = value;
|
||||
}
|
||||
}
|
||||
@ -69,7 +69,7 @@ namespace osu.Game.Beatmaps
|
||||
/// The author of the beatmaps in this set.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public User? Author;
|
||||
public APIUser? Author;
|
||||
|
||||
public string Source { get; set; } = string.Empty;
|
||||
|
||||
|
@ -9,33 +9,33 @@ using JetBrains.Annotations;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Users;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Database
|
||||
{
|
||||
public class UserLookupCache : MemoryCachingComponent<int, User>
|
||||
public class UserLookupCache : MemoryCachingComponent<int, APIUser>
|
||||
{
|
||||
[Resolved]
|
||||
private IAPIProvider api { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Perform an API lookup on the specified user, populating a <see cref="User"/> model.
|
||||
/// Perform an API lookup on the specified user, populating a <see cref="APIUser"/> model.
|
||||
/// </summary>
|
||||
/// <param name="userId">The user to lookup.</param>
|
||||
/// <param name="token">An optional cancellation token.</param>
|
||||
/// <returns>The populated user, or null if the user does not exist or the request could not be satisfied.</returns>
|
||||
[ItemCanBeNull]
|
||||
public Task<User> GetUserAsync(int userId, CancellationToken token = default) => GetAsync(userId, token);
|
||||
public Task<APIUser> GetUserAsync(int userId, CancellationToken token = default) => GetAsync(userId, token);
|
||||
|
||||
/// <summary>
|
||||
/// Perform an API lookup on the specified users, populating a <see cref="User"/> model.
|
||||
/// Perform an API lookup on the specified users, populating a <see cref="APIUser"/> model.
|
||||
/// </summary>
|
||||
/// <param name="userIds">The users to lookup.</param>
|
||||
/// <param name="token">An optional cancellation token.</param>
|
||||
/// <returns>The populated users. May include null results for failed retrievals.</returns>
|
||||
public Task<User[]> GetUsersAsync(int[] userIds, CancellationToken token = default)
|
||||
public Task<APIUser[]> GetUsersAsync(int[] userIds, CancellationToken token = default)
|
||||
{
|
||||
var userLookupTasks = new List<Task<User>>();
|
||||
var userLookupTasks = new List<Task<APIUser>>();
|
||||
|
||||
foreach (int u in userIds)
|
||||
{
|
||||
@ -51,18 +51,18 @@ namespace osu.Game.Database
|
||||
return Task.WhenAll(userLookupTasks);
|
||||
}
|
||||
|
||||
protected override async Task<User> ComputeValueAsync(int lookup, CancellationToken token = default)
|
||||
protected override async Task<APIUser> ComputeValueAsync(int lookup, CancellationToken token = default)
|
||||
=> await queryUser(lookup).ConfigureAwait(false);
|
||||
|
||||
private readonly Queue<(int id, TaskCompletionSource<User>)> pendingUserTasks = new Queue<(int, TaskCompletionSource<User>)>();
|
||||
private readonly Queue<(int id, TaskCompletionSource<APIUser>)> pendingUserTasks = new Queue<(int, TaskCompletionSource<APIUser>)>();
|
||||
private Task pendingRequestTask;
|
||||
private readonly object taskAssignmentLock = new object();
|
||||
|
||||
private Task<User> queryUser(int userId)
|
||||
private Task<APIUser> queryUser(int userId)
|
||||
{
|
||||
lock (taskAssignmentLock)
|
||||
{
|
||||
var tcs = new TaskCompletionSource<User>();
|
||||
var tcs = new TaskCompletionSource<APIUser>();
|
||||
|
||||
// Add to the queue.
|
||||
pendingUserTasks.Enqueue((userId, tcs));
|
||||
@ -78,14 +78,14 @@ namespace osu.Game.Database
|
||||
private void performLookup()
|
||||
{
|
||||
// contains at most 50 unique user IDs from userTasks, which is used to perform the lookup.
|
||||
var userTasks = new Dictionary<int, List<TaskCompletionSource<User>>>();
|
||||
var userTasks = new Dictionary<int, List<TaskCompletionSource<APIUser>>>();
|
||||
|
||||
// Grab at most 50 unique user IDs from the queue.
|
||||
lock (taskAssignmentLock)
|
||||
{
|
||||
while (pendingUserTasks.Count > 0 && userTasks.Count < 50)
|
||||
{
|
||||
(int id, TaskCompletionSource<User> task) next = pendingUserTasks.Dequeue();
|
||||
(int id, TaskCompletionSource<APIUser> task) next = pendingUserTasks.Dequeue();
|
||||
|
||||
// Perform a secondary check for existence, in case the user was queried in a previous batch.
|
||||
if (CheckExists(next.id, out var existing))
|
||||
@ -95,7 +95,7 @@ namespace osu.Game.Database
|
||||
if (userTasks.TryGetValue(next.id, out var tasks))
|
||||
tasks.Add(next.task);
|
||||
else
|
||||
userTasks[next.id] = new List<TaskCompletionSource<User>> { next.task };
|
||||
userTasks[next.id] = new List<TaskCompletionSource<APIUser>> { next.task };
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -115,7 +115,7 @@ namespace osu.Game.Database
|
||||
createNewTask();
|
||||
}
|
||||
|
||||
List<User> foundUsers = request.Response?.Users;
|
||||
List<APIUser> foundUsers = request.Response?.Users;
|
||||
|
||||
if (foundUsers != null)
|
||||
{
|
||||
|
@ -11,7 +11,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.Users;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Graphics.Containers
|
||||
{
|
||||
@ -70,7 +70,7 @@ namespace osu.Game.Graphics.Containers
|
||||
createLink(new TextPartManual(text), new LinkDetails(action, linkArgument), tooltipText);
|
||||
}
|
||||
|
||||
public void AddUserLink(User user, Action<SpriteText> creationParameters = null)
|
||||
public void AddUserLink(APIUser user, Action<SpriteText> creationParameters = null)
|
||||
=> createLink(CreateChunkFor(user.Username, true, CreateSpriteText, creationParameters), new LinkDetails(LinkAction.OpenUserProfile, user.Id.ToString()), "view profile");
|
||||
|
||||
private void createLink(ITextPart textPart, LinkDetails link, LocalisableString tooltipText, Action action = null)
|
||||
|
@ -17,6 +17,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Online.API
|
||||
@ -41,13 +42,13 @@ namespace osu.Game.Online.API
|
||||
|
||||
private string password;
|
||||
|
||||
public IBindable<User> LocalUser => localUser;
|
||||
public IBindableList<User> Friends => friends;
|
||||
public IBindable<APIUser> LocalUser => localUser;
|
||||
public IBindableList<APIUser> Friends => friends;
|
||||
public IBindable<UserActivity> Activity => activity;
|
||||
|
||||
private Bindable<User> localUser { get; } = new Bindable<User>(createGuestUser());
|
||||
private Bindable<APIUser> localUser { get; } = new Bindable<APIUser>(createGuestUser());
|
||||
|
||||
private BindableList<User> friends { get; } = new BindableList<User>();
|
||||
private BindableList<APIUser> friends { get; } = new BindableList<APIUser>();
|
||||
|
||||
private Bindable<UserActivity> activity { get; } = new Bindable<UserActivity>();
|
||||
|
||||
@ -436,7 +437,7 @@ namespace osu.Game.Online.API
|
||||
flushQueue();
|
||||
}
|
||||
|
||||
private static User createGuestUser() => new GuestUser();
|
||||
private static APIUser createGuestUser() => new GuestUser();
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
@ -447,7 +448,7 @@ namespace osu.Game.Online.API
|
||||
}
|
||||
}
|
||||
|
||||
internal class GuestUser : User
|
||||
internal class GuestUser : APIUser
|
||||
{
|
||||
public GuestUser()
|
||||
{
|
||||
|
@ -6,7 +6,7 @@ using JetBrains.Annotations;
|
||||
using Newtonsoft.Json;
|
||||
using osu.Framework.IO.Network;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Game.Users;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Online.API
|
||||
{
|
||||
@ -69,7 +69,7 @@ namespace osu.Game.Online.API
|
||||
/// <summary>
|
||||
/// The currently logged in user. Note that this will only be populated during <see cref="Perform"/>.
|
||||
/// </summary>
|
||||
protected User User { get; private set; }
|
||||
protected APIUser User { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Invoked on successful completion of an API request.
|
||||
|
@ -6,19 +6,20 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Online.API
|
||||
{
|
||||
public class DummyAPIAccess : Component, IAPIProvider
|
||||
{
|
||||
public Bindable<User> LocalUser { get; } = new Bindable<User>(new User
|
||||
public Bindable<APIUser> LocalUser { get; } = new Bindable<APIUser>(new APIUser
|
||||
{
|
||||
Username = @"Dummy",
|
||||
Id = 1001,
|
||||
});
|
||||
|
||||
public BindableList<User> Friends { get; } = new BindableList<User>();
|
||||
public BindableList<APIUser> Friends { get; } = new BindableList<APIUser>();
|
||||
|
||||
public Bindable<UserActivity> Activity { get; } = new Bindable<UserActivity>();
|
||||
|
||||
@ -90,7 +91,7 @@ namespace osu.Game.Online.API
|
||||
}
|
||||
|
||||
LastLoginError = null;
|
||||
LocalUser.Value = new User
|
||||
LocalUser.Value = new APIUser
|
||||
{
|
||||
Username = username,
|
||||
Id = 1001,
|
||||
@ -115,8 +116,8 @@ namespace osu.Game.Online.API
|
||||
|
||||
public void SetState(APIState newState) => state.Value = newState;
|
||||
|
||||
IBindable<User> IAPIProvider.LocalUser => LocalUser;
|
||||
IBindableList<User> IAPIProvider.Friends => Friends;
|
||||
IBindable<APIUser> IAPIProvider.LocalUser => LocalUser;
|
||||
IBindableList<APIUser> IAPIProvider.Friends => Friends;
|
||||
IBindable<UserActivity> IAPIProvider.Activity => Activity;
|
||||
|
||||
public void FailNextLogin() => shouldFailNextLogin = true;
|
||||
|
@ -6,6 +6,7 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Online.API
|
||||
@ -16,13 +17,13 @@ namespace osu.Game.Online.API
|
||||
/// The local user.
|
||||
/// This is not thread-safe and should be scheduled locally if consumed from a drawable component.
|
||||
/// </summary>
|
||||
IBindable<User> LocalUser { get; }
|
||||
IBindable<APIUser> LocalUser { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The user's friends.
|
||||
/// This is not thread-safe and should be scheduled locally if consumed from a drawable component.
|
||||
/// </summary>
|
||||
IBindableList<User> Friends { get; }
|
||||
IBindableList<APIUser> Friends { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The current user's activity.
|
||||
|
@ -3,17 +3,17 @@
|
||||
|
||||
using System.Net.Http;
|
||||
using osu.Framework.IO.Network;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Chat;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
public class CreateNewPrivateMessageRequest : APIRequest<CreateNewPrivateMessageResponse>
|
||||
{
|
||||
private readonly User user;
|
||||
private readonly APIUser user;
|
||||
private readonly Message message;
|
||||
|
||||
public CreateNewPrivateMessageRequest(User user, Message message)
|
||||
public CreateNewPrivateMessageRequest(APIUser user, Message message)
|
||||
{
|
||||
this.user = user;
|
||||
this.message = message;
|
||||
|
@ -2,11 +2,11 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Users;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
public class GetFriendsRequest : APIRequest<List<User>>
|
||||
public class GetFriendsRequest : APIRequest<List<APIUser>>
|
||||
{
|
||||
protected override string Target => @"friends";
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Game.Users;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets;
|
||||
|
||||
namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
public class GetUserRequest : APIRequest<User>
|
||||
public class GetUserRequest : APIRequest<APIUser>
|
||||
{
|
||||
public readonly string Lookup;
|
||||
public readonly RulesetInfo Ruleset;
|
||||
|
@ -3,13 +3,13 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using osu.Game.Users;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
public class GetUsersResponse : ResponseWithCursor
|
||||
{
|
||||
[JsonProperty("users")]
|
||||
public List<User> Users;
|
||||
public List<APIUser> Users;
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Users;
|
||||
|
||||
#nullable enable
|
||||
|
||||
@ -72,10 +71,10 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
[JsonProperty("artist_unicode")]
|
||||
public string ArtistUnicode { get; set; } = string.Empty;
|
||||
|
||||
public User? Author = new User();
|
||||
public APIUser? Author = new APIUser();
|
||||
|
||||
/// <summary>
|
||||
/// Helper property to deserialize a username to <see cref="User"/>.
|
||||
/// Helper property to deserialize a username to <see cref="APIUser"/>.
|
||||
/// </summary>
|
||||
[JsonProperty(@"user_id")]
|
||||
public int AuthorID
|
||||
@ -83,13 +82,13 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
get => Author?.Id ?? 1;
|
||||
set
|
||||
{
|
||||
Author ??= new User();
|
||||
Author ??= new APIUser();
|
||||
Author.Id = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper property to deserialize a username to <see cref="User"/>.
|
||||
/// Helper property to deserialize a username to <see cref="APIUser"/>.
|
||||
/// </summary>
|
||||
[JsonProperty(@"creator")]
|
||||
public string AuthorString
|
||||
@ -97,7 +96,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
get => Author?.Username ?? string.Empty;
|
||||
set
|
||||
{
|
||||
Author ??= new User();
|
||||
Author ??= new APIUser();
|
||||
Author.Username = value;
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user