Update: Needs Testing - Not Tested
This commit is contained in:
19
RelayServer/Services/Rtc/RtcNotificationService.cs
Normal file
19
RelayServer/Services/Rtc/RtcNotificationService.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.Text.Json;
|
||||
using RelayServer.Models.Rtc;
|
||||
using WebSocketSharp.Server;
|
||||
|
||||
namespace RelayServer.Services.Rtc;
|
||||
|
||||
public static class RtcNotificationService
|
||||
{
|
||||
public static WebSocketServer? Server { get; set; }
|
||||
|
||||
public static void Broadcast(RtcNotificationMessage message)
|
||||
{
|
||||
if (Server is null)
|
||||
return;
|
||||
|
||||
var json = JsonSerializer.Serialize(message);
|
||||
Server.WebSocketServices["/"]?.Sessions.Broadcast(json);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user