mirror of
https://github.com/ppy/osu.git
synced 2025-02-10 11:42:54 +08:00
Add begin/end session logic
This commit is contained in:
parent
4788b4a643
commit
96049c39c9
@ -5,10 +5,12 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Online.Spectator;
|
using osu.Game.Online.Spectator;
|
||||||
using osu.Game.Replays;
|
using osu.Game.Replays;
|
||||||
using osu.Game.Rulesets.Replays;
|
using osu.Game.Rulesets.Replays;
|
||||||
@ -27,6 +29,12 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
public int RecordFrameRate = 60;
|
public int RecordFrameRate = 60;
|
||||||
|
|
||||||
|
[Resolved(canBeNull: true)]
|
||||||
|
private SpectatorStreamingClient spectatorStreaming { get; set; }
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private IBindable<WorkingBeatmap> beatmap { get; set; }
|
||||||
|
|
||||||
protected ReplayRecorder(Replay target)
|
protected ReplayRecorder(Replay target)
|
||||||
{
|
{
|
||||||
this.target = target;
|
this.target = target;
|
||||||
@ -41,6 +49,14 @@ namespace osu.Game.Rulesets.UI
|
|||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
inputManager = GetContainingInputManager();
|
inputManager = GetContainingInputManager();
|
||||||
|
|
||||||
|
spectatorStreaming?.BeginPlaying(beatmap.Value.BeatmapInfo.ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool isDisposing)
|
||||||
|
{
|
||||||
|
base.Dispose(isDisposing);
|
||||||
|
spectatorStreaming?.EndPlaying(beatmap.Value.BeatmapInfo.ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnMouseMove(MouseMoveEvent e)
|
protected override bool OnMouseMove(MouseMoveEvent e)
|
||||||
@ -62,9 +78,6 @@ namespace osu.Game.Rulesets.UI
|
|||||||
recordFrame(true);
|
recordFrame(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Resolved(canBeNull: true)]
|
|
||||||
private SpectatorStreamingClient spectatorStreaming { get; set; }
|
|
||||||
|
|
||||||
private void recordFrame(bool important)
|
private void recordFrame(bool important)
|
||||||
{
|
{
|
||||||
var last = target.Frames.LastOrDefault();
|
var last = target.Frames.LastOrDefault();
|
||||||
|
Loading…
Reference in New Issue
Block a user