This commit is contained in:
skidfire
2026-09-06 19:59:27 -04:00
parent 55d8e11a5d
commit fe3468c65d
247 changed files with 338183 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
using Vanadium.Classes.WebSocket;
using Newtonsoft.Json;
using Vanadium.Controllers;
namespace Vanadium.Hubs
{
public static class NotificationHub
{
public static async Task SubscribeToPlayers()
{
await Task.CompletedTask;
}
public static async Task SubscribeToRooms()
{
await Task.CompletedTask;
}
public static async Task SubscribeToEvents()
{
await Task.CompletedTask;
}
public static async Task SendNotificationToPlayer(long playerId, object notification)
{
try
{
var message = JsonConvert.SerializeObject(notification);
await NotificationsController.SendToPlayer(playerId, message);
}
catch (Exception ex)
{
Console.WriteLine($"[NotificationHub] Error sending notification: {ex.Message}");
}
}
public static async Task SendNotificationToAll(object notification)
{
try
{
var message = JsonConvert.SerializeObject(notification);
await NotificationsController.SendToAll(message);
}
catch (Exception ex)
{
Console.WriteLine($"[NotificationHub] Error broadcasting notification: {ex.Message}");
}
}
}
}