mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 13:22:55 +08:00
More correctly handle rulesets which don't support replay recording
This commit is contained in:
parent
2feb66d423
commit
a7bfaad60f
@ -650,24 +650,28 @@ namespace osu.Game.Screens.Play
|
|||||||
this.Push(CreateResults(DrawableRuleset.ReplayScore.ScoreInfo));
|
this.Push(CreateResults(DrawableRuleset.ReplayScore.ScoreInfo));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var score = new Score
|
var score = new Score { ScoreInfo = CreateScore() };
|
||||||
{
|
|
||||||
ScoreInfo = CreateScore(),
|
|
||||||
Replay = recordingReplay
|
|
||||||
};
|
|
||||||
|
|
||||||
using (var stream = new MemoryStream())
|
LegacyByteArrayReader replayReader = null;
|
||||||
{
|
|
||||||
new LegacyScoreEncoder(score, gameplayBeatmap).Encode(stream);
|
|
||||||
|
|
||||||
scoreManager.Import(score.ScoreInfo, new LegacyByteArrayReader(stream.ToArray(), "replay.osr"))
|
if (recordingReplay?.Frames.Count > 0)
|
||||||
.ContinueWith(imported => Schedule(() =>
|
{
|
||||||
{
|
score.Replay = recordingReplay;
|
||||||
// screen may be in the exiting transition phase.
|
|
||||||
if (this.IsCurrentScreen())
|
using (var stream = new MemoryStream())
|
||||||
this.Push(CreateResults(imported.Result));
|
{
|
||||||
}));
|
new LegacyScoreEncoder(score, gameplayBeatmap).Encode(stream);
|
||||||
|
replayReader = new LegacyByteArrayReader(stream.ToArray(), "replay.osr");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scoreManager.Import(score.ScoreInfo, replayReader)
|
||||||
|
.ContinueWith(imported => Schedule(() =>
|
||||||
|
{
|
||||||
|
// screen may be in the exiting transition phase.
|
||||||
|
if (this.IsCurrentScreen())
|
||||||
|
this.Push(CreateResults(imported.Result));
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user