2021-10-20 20:08:58 +08:00
|
|
|
// 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.
|
|
|
|
|
2021-11-10 17:25:14 +08:00
|
|
|
using System;
|
2021-10-20 20:08:58 +08:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using MessagePack;
|
|
|
|
using osu.Game.Online.API;
|
|
|
|
|
2021-10-22 15:48:28 +08:00
|
|
|
namespace osu.Game.Online.Rooms
|
2021-10-20 20:08:58 +08:00
|
|
|
{
|
2021-11-10 17:25:14 +08:00
|
|
|
[Serializable]
|
|
|
|
[MessagePackObject]
|
2021-11-15 22:14:27 +08:00
|
|
|
public class MultiplayerPlaylistItem
|
2021-10-20 20:08:58 +08:00
|
|
|
{
|
|
|
|
[Key(0)]
|
2021-10-22 15:48:28 +08:00
|
|
|
public long ID { get; set; }
|
2021-10-20 20:08:58 +08:00
|
|
|
|
|
|
|
[Key(1)]
|
2021-11-16 13:37:54 +08:00
|
|
|
public int OwnerID { get; set; }
|
2021-10-20 20:08:58 +08:00
|
|
|
|
|
|
|
[Key(2)]
|
2021-11-12 23:22:48 +08:00
|
|
|
public int BeatmapID { get; set; }
|
2021-10-20 20:08:58 +08:00
|
|
|
|
|
|
|
[Key(3)]
|
2021-11-12 23:22:48 +08:00
|
|
|
public string BeatmapChecksum { get; set; } = string.Empty;
|
2021-10-20 20:08:58 +08:00
|
|
|
|
|
|
|
[Key(4)]
|
2021-11-12 23:22:48 +08:00
|
|
|
public int RulesetID { get; set; }
|
2021-10-22 15:48:28 +08:00
|
|
|
|
|
|
|
[Key(5)]
|
2021-11-12 23:22:48 +08:00
|
|
|
public IEnumerable<APIMod> RequiredMods { get; set; } = Enumerable.Empty<APIMod>();
|
2021-10-22 15:48:28 +08:00
|
|
|
|
2021-10-22 20:25:49 +08:00
|
|
|
[Key(6)]
|
2021-11-12 23:22:48 +08:00
|
|
|
public IEnumerable<APIMod> AllowedMods { get; set; } = Enumerable.Empty<APIMod>();
|
|
|
|
|
|
|
|
[Key(7)]
|
2021-10-22 20:25:49 +08:00
|
|
|
public bool Expired { get; set; }
|
|
|
|
|
2021-12-02 18:15:27 +08:00
|
|
|
/// <summary>
|
2021-12-06 12:03:11 +08:00
|
|
|
/// The order in which this <see cref="MultiplayerPlaylistItem"/> will be played relative to others.
|
|
|
|
/// Playlist items should be played in increasing order (lower values are played first).
|
2021-12-02 18:15:27 +08:00
|
|
|
/// </summary>
|
2021-12-06 12:03:11 +08:00
|
|
|
/// <remarks>
|
|
|
|
/// This is only valid for items which are not <see cref="Expired"/>. The value for expired items is undefined and should not be used.
|
|
|
|
/// </remarks>
|
2021-12-02 18:15:27 +08:00
|
|
|
[Key(8)]
|
2021-12-03 14:45:13 +08:00
|
|
|
public ushort PlaylistOrder { get; set; }
|
2021-12-02 18:15:27 +08:00
|
|
|
|
2021-12-03 13:38:14 +08:00
|
|
|
/// <summary>
|
2021-12-03 19:05:25 +08:00
|
|
|
/// The date when this <see cref="MultiplayerPlaylistItem"/> was played.
|
2021-12-03 13:38:14 +08:00
|
|
|
/// </summary>
|
2021-12-03 19:05:25 +08:00
|
|
|
[Key(9)]
|
|
|
|
public DateTimeOffset? PlayedAt { get; set; }
|
2021-12-03 13:38:14 +08:00
|
|
|
|
2021-11-15 22:14:27 +08:00
|
|
|
public MultiplayerPlaylistItem()
|
2021-10-22 15:48:28 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-11-15 22:14:27 +08:00
|
|
|
public MultiplayerPlaylistItem(PlaylistItem item)
|
2021-10-22 15:48:28 +08:00
|
|
|
{
|
|
|
|
ID = item.ID;
|
2021-12-09 01:01:11 +08:00
|
|
|
OwnerID = item.OwnerID;
|
2022-02-15 22:33:26 +08:00
|
|
|
BeatmapID = item.Beatmap.OnlineID;
|
|
|
|
BeatmapChecksum = item.Beatmap.MD5Hash;
|
2021-10-22 15:48:28 +08:00
|
|
|
RulesetID = item.RulesetID;
|
2022-02-15 15:01:14 +08:00
|
|
|
RequiredMods = item.RequiredMods.ToArray();
|
|
|
|
AllowedMods = item.AllowedMods.ToArray();
|
2021-10-22 20:25:49 +08:00
|
|
|
Expired = item.Expired;
|
2021-12-03 14:45:13 +08:00
|
|
|
PlaylistOrder = item.PlaylistOrder ?? 0;
|
2021-12-03 19:05:25 +08:00
|
|
|
PlayedAt = item.PlayedAt;
|
2021-10-22 15:48:28 +08:00
|
|
|
}
|
2021-10-20 20:08:58 +08:00
|
|
|
}
|
|
|
|
}
|