mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 10:42:55 +08:00
Add virtual method to instantiate legacy replays.
This commit is contained in:
parent
b225ae82be
commit
136665e52e
@ -101,7 +101,7 @@ namespace osu.Game.Database
|
|||||||
|
|
||||||
using (var lzma = new LzmaStream(properties, replayInStream, compressedSize, outSize))
|
using (var lzma = new LzmaStream(properties, replayInStream, compressedSize, outSize))
|
||||||
using (var reader = new StreamReader(lzma))
|
using (var reader = new StreamReader(lzma))
|
||||||
score.Replay = new LegacyReplay(reader);
|
score.Replay = score.CreateLegacyReplayFrom(reader);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ using Newtonsoft.Json;
|
|||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
using osu.Game.Modes.Mods;
|
using osu.Game.Modes.Mods;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Scoring
|
namespace osu.Game.Modes.Scoring
|
||||||
{
|
{
|
||||||
@ -43,6 +44,13 @@ namespace osu.Game.Modes.Scoring
|
|||||||
[JsonProperty(@"date")]
|
[JsonProperty(@"date")]
|
||||||
public DateTime Date;
|
public DateTime Date;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a legacy replay which is read from a stream.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="reader">The stream reader.</param>
|
||||||
|
/// <returns>The replay.</returns>
|
||||||
|
public virtual Replay CreateLegacyReplayFrom(StreamReader reader) => new LegacyReplay(reader);
|
||||||
|
|
||||||
// [JsonProperty(@"count50")] 0,
|
// [JsonProperty(@"count50")] 0,
|
||||||
//[JsonProperty(@"count100")] 0,
|
//[JsonProperty(@"count100")] 0,
|
||||||
//[JsonProperty(@"count300")] 100,
|
//[JsonProperty(@"count300")] 100,
|
||||||
|
Loading…
Reference in New Issue
Block a user