Radicade Public Code

This commit is contained in:
JogmansonReal
2026-10-16 23:33:13 -07:00
commit 55175acdf6
832 changed files with 363261 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
using RadicadeServer.API.Notifications;
using RadicadeServer.RecNet.Enums.Messages;
using RadicadeServer.RecNet.Notifications;
namespace RadicadeServer.RecNet.Board
{
public static class CommunityBoardBroadcast
{
public const string UpdateNotificationId = "CommunityBoardUpdate";
public static IReadOnlyList<Notification> BuildFrames(CommunityBoard? board)
{
if (board == null)
return Array.Empty<Notification>();
return new List<Notification>
{
new Notification
{
Id = UpdateNotificationId,
Msg = board
},
new Notification
{
Id = NotificationType.CommunityBoardAnnouncementUpdate,
Msg = board.CurrentAnnouncement ?? new BoardAnnouncement
{
Message = string.Empty,
MoreInfoUrl = string.Empty
}
}
};
}
public static async Task PushAsync(CommunityBoard? board)
{
foreach (var frame in BuildFrames(board))
await Notify.SendGlobalNotify(frame);
}
}
}