Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDN audio streaming through HTTP #5550

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Robust.Client/ClientIoC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Robust.Client.GameStates;
using Robust.Client.Graphics;
using Robust.Client.Graphics.Clyde;
using Robust.Client.HTTPClient;
using Robust.Client.HWId;
using Robust.Client.Input;
using Robust.Client.Map;
Expand Down Expand Up @@ -102,6 +103,8 @@ public static void RegisterIoC(GameController.DisplayMode mode, IDependencyColle
deps.Register<ProfViewManager>();
deps.Register<IGamePrototypeLoadManager, GamePrototypeLoadManager>();
deps.Register<NetworkResourceManager>();
deps.Register<ICDNConsumer, CDNConsumer>();
deps.Register<IJSON, JSON>();

switch (mode)
{
Expand Down
4 changes: 4 additions & 0 deletions Robust.Client/GameController/GameController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Robust.Client.GameObjects;
using Robust.Client.GameStates;
using Robust.Client.Graphics;
using Robust.Client.HTTPClient;
using Robust.Client.Input;
using Robust.Client.Placement;
using Robust.Client.Replays.Loading;
Expand Down Expand Up @@ -94,6 +95,8 @@ internal sealed partial class GameController : IGameControllerInternal
[Dependency] private readonly IReplayRecordingManagerInternal _replayRecording = default!;
[Dependency] private readonly IReflectionManager _reflectionManager = default!;

[Dependency] private readonly ICDNConsumer _cdnConsumer = default!;

private IWebViewManagerHook? _webViewHook;

private CommandLineArgs? _commandLineArgs;
Expand Down Expand Up @@ -206,6 +209,7 @@ internal bool StartupContinue(DisplayMode displayMode)
_replayLoader.Initialize();
_replayPlayback.Initialize();
_replayRecording.Initialize();
_cdnConsumer.Initialize();
_userInterfaceManager.PostInitialize();
_modLoader.BroadcastRunLevel(ModRunLevel.PostInit);

Expand Down
24 changes: 24 additions & 0 deletions Robust.Client/HTTPClient/Commands/HTTPPlayAudioFromCDN.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Robust.Shared.Console;
using Robust.Shared.IoC;

namespace Robust.Client.HTTPClient.Commands
{
public sealed class HTTPPlayAudioFromCDN : LocalizedCommands
{
[Dependency] private readonly ICDNConsumer _consumer = default!;

public override string Command => "playaudiocdn";

public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (args.Length < 1)
{
shell.WriteLine("Usage: playaudiocdn <url>");
return;
}

var url = args[0];
_consumer.PlayAudioFromCDN(url);
}
}
}
Loading
Loading