mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Begin shaping the spectator streaming component
This commit is contained in:
@ -3,8 +3,6 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.SignalR.Client;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
@ -264,25 +262,13 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
|
||||
internal class TestReplayRecorder : ReplayRecorder<TestAction>
|
||||
{
|
||||
private readonly SpectatorClient client;
|
||||
|
||||
public TestReplayRecorder(Replay target)
|
||||
: base(target)
|
||||
{
|
||||
var connection = new HubConnectionBuilder()
|
||||
.WithUrl("http://localhost:5009/spectator")
|
||||
.AddMessagePackProtocol()
|
||||
// .ConfigureLogging(logging => { logging.AddConsole(); })
|
||||
.Build();
|
||||
|
||||
connection.StartAsync().Wait();
|
||||
|
||||
client = new SpectatorClient(connection);
|
||||
}
|
||||
|
||||
protected override ReplayFrame HandleFrame(Vector2 mousePosition, List<TestAction> actions, ReplayFrame previousFrame)
|
||||
{
|
||||
client.SendFrames(new FrameDataBundle(new[] { new LegacyReplayFrame(Time.Current, mousePosition.X, mousePosition.Y, ReplayButtonState.None) }));
|
||||
return new TestReplayFrame(Time.Current, mousePosition, actions.ToArray());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user