mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 15:44:04 +09:00
Merge branch 'master' into i-ruleset-store
This commit is contained in:
@ -65,9 +65,6 @@ namespace osu.Game.Online.Leaderboards
|
||||
[Resolved(CanBeNull = true)]
|
||||
private SongSelect songSelect { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private ScoreManager scoreManager { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private Storage storage { get; set; }
|
||||
|
||||
|
@ -32,12 +32,36 @@ namespace osu.Game.Online.Multiplayer
|
||||
/// </summary>
|
||||
public event Action? RoomUpdated;
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when a new user joins the room.
|
||||
/// </summary>
|
||||
public event Action<MultiplayerRoomUser>? UserJoined;
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when a user leaves the room of their own accord.
|
||||
/// </summary>
|
||||
public event Action<MultiplayerRoomUser>? UserLeft;
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when a user was kicked from the room forcefully.
|
||||
/// </summary>
|
||||
public event Action<MultiplayerRoomUser>? UserKicked;
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when a new item is added to the playlist.
|
||||
/// </summary>
|
||||
public event Action<MultiplayerPlaylistItem>? ItemAdded;
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when a playlist item is removed from the playlist. The provided <c>long</c> is the playlist's item ID.
|
||||
/// </summary>
|
||||
public event Action<long>? ItemRemoved;
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when a playlist item's details change.
|
||||
/// </summary>
|
||||
public event Action<MultiplayerPlaylistItem>? ItemChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when the multiplayer server requests the current beatmap to be loaded into play.
|
||||
/// </summary>
|
||||
@ -617,6 +641,7 @@ namespace osu.Game.Online.Multiplayer
|
||||
Room.Playlist.Add(item);
|
||||
APIRoom.Playlist.Add(playlistItem);
|
||||
|
||||
ItemAdded?.Invoke(item);
|
||||
RoomUpdated?.Invoke();
|
||||
});
|
||||
}
|
||||
@ -636,6 +661,7 @@ namespace osu.Game.Online.Multiplayer
|
||||
Room.Playlist.Remove(Room.Playlist.Single(existing => existing.ID == playlistItemId));
|
||||
APIRoom.Playlist.RemoveAll(existing => existing.ID == playlistItemId);
|
||||
|
||||
ItemRemoved?.Invoke(playlistItemId);
|
||||
RoomUpdated?.Invoke();
|
||||
});
|
||||
|
||||
@ -666,6 +692,7 @@ namespace osu.Game.Online.Multiplayer
|
||||
if (CurrentMatchPlayingItem.Value?.ID == playlistItem.ID)
|
||||
CurrentMatchPlayingItem.Value = playlistItem;
|
||||
|
||||
ItemChanged?.Invoke(item);
|
||||
RoomUpdated?.Invoke();
|
||||
});
|
||||
}
|
||||
@ -717,7 +744,9 @@ namespace osu.Game.Online.Multiplayer
|
||||
OwnerID = item.OwnerID,
|
||||
Beatmap = { Value = apiBeatmap },
|
||||
Ruleset = { Value = ruleset },
|
||||
Expired = item.Expired
|
||||
Expired = item.Expired,
|
||||
PlaylistOrder = item.PlaylistOrder,
|
||||
PlayedAt = item.PlayedAt
|
||||
};
|
||||
|
||||
playlistItem.RequiredMods.AddRange(item.RequiredMods.Select(m => m.ToMod(rulesetInstance)));
|
||||
|
@ -39,6 +39,18 @@ namespace osu.Game.Online.Rooms
|
||||
[Key(7)]
|
||||
public bool Expired { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The order in which this <see cref="MultiplayerPlaylistItem"/> will be played, starting from 0 and increasing for items which will be played later.
|
||||
/// </summary>
|
||||
[Key(8)]
|
||||
public ushort PlaylistOrder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The date when this <see cref="MultiplayerPlaylistItem"/> was played.
|
||||
/// </summary>
|
||||
[Key(9)]
|
||||
public DateTimeOffset? PlayedAt { get; set; }
|
||||
|
||||
public MultiplayerPlaylistItem()
|
||||
{
|
||||
}
|
||||
@ -52,6 +64,8 @@ namespace osu.Game.Online.Rooms
|
||||
RequiredMods = item.RequiredMods.Select(m => new APIMod(m)).ToArray();
|
||||
AllowedMods = item.AllowedMods.Select(m => new APIMod(m)).ToArray();
|
||||
Expired = item.Expired;
|
||||
PlaylistOrder = item.PlaylistOrder ?? 0;
|
||||
PlayedAt = item.PlayedAt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,12 @@ namespace osu.Game.Online.Rooms
|
||||
[JsonProperty("expired")]
|
||||
public bool Expired { get; set; }
|
||||
|
||||
[JsonProperty("playlist_order")]
|
||||
public ushort? PlaylistOrder { get; set; }
|
||||
|
||||
[JsonProperty("played_at")]
|
||||
public DateTimeOffset? PlayedAt { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public IBindable<bool> Valid => valid;
|
||||
|
||||
|
Reference in New Issue
Block a user