General cleanup

This commit is contained in:
smoogipoo
2021-02-01 18:50:32 +09:00
parent 3a906a89fc
commit 89a42d60fb
16 changed files with 71 additions and 72 deletions

View File

@ -57,6 +57,11 @@ namespace osu.Game.Online.Multiplayer
/// <param name="beatmapAvailability">The new beatmap availability state of the user.</param>
Task UserBeatmapAvailabilityChanged(int userId, BeatmapAvailability beatmapAvailability);
/// <summary>
/// Signals that a user in this room changed their local mods.
/// </summary>
/// <param name="userId">The ID of the user whose mods have changed.</param>
/// <param name="mods">The user's new local mods.</param>
Task UserModsChanged(int userId, IEnumerable<APIMod> mods);
/// <summary>

View File

@ -49,6 +49,10 @@ namespace osu.Game.Online.Multiplayer
/// <param name="newBeatmapAvailability">The proposed new beatmap availability state.</param>
Task ChangeBeatmapAvailability(BeatmapAvailability newBeatmapAvailability);
/// <summary>
/// Change the local user's mods in the currently joined room.
/// </summary>
/// <param name="newMods">The proposed new mods, excluding any required by the room itself.</param>
Task ChangeUserMods(IEnumerable<APIMod> newMods);
/// <summary>

View File

@ -26,6 +26,9 @@ namespace osu.Game.Online.Multiplayer
/// </summary>
public BeatmapAvailability BeatmapAvailability { get; set; } = BeatmapAvailability.LocallyAvailable();
/// <summary>
/// Any mods applicable only to the local user.
/// </summary>
[NotNull]
public IEnumerable<APIMod> UserMods { get; set; } = Enumerable.Empty<APIMod>();

View File

@ -232,6 +232,10 @@ namespace osu.Game.Online.Multiplayer
public abstract Task ChangeBeatmapAvailability(BeatmapAvailability newBeatmapAvailability);
/// <summary>
/// Change the local user's mods in the currently joined room.
/// </summary>
/// <param name="newMods">The proposed new mods, excluding any required by the room itself.</param>
public Task ChangeUserMods(IEnumerable<Mod> newMods) => ChangeUserMods(newMods.Select(m => new APIMod(m)).ToList());
public abstract Task ChangeUserMods(IEnumerable<APIMod> newMods);
@ -393,7 +397,7 @@ namespace osu.Game.Online.Multiplayer
{
var user = Room?.Users.SingleOrDefault(u => u.UserID == userId);
// errors here are not critical - user mods is mostly for display.
// errors here are not critical - user mods are mostly for display.
if (user == null)
return;