diff --git a/ProjectLighthouse/Pages/Debug/RoomVisualizerPage.cshtml b/ProjectLighthouse/Pages/Debug/RoomVisualizerPage.cshtml new file mode 100644 index 00000000..919417da --- /dev/null +++ b/ProjectLighthouse/Pages/Debug/RoomVisualizerPage.cshtml @@ -0,0 +1,28 @@ +@page "/debug/roomVisualizer" +@using LBPUnion.ProjectLighthouse.Helpers +@using LBPUnion.ProjectLighthouse.Types +@using LBPUnion.ProjectLighthouse.Types.Match +@model LBPUnion.ProjectLighthouse.Pages.Debug.RoomVisualizerPage + +@{ + Layout = "Layouts/BaseLayout"; + Model.Title = "Debug - Room Visualizer"; +} + + @* Refresh page every second *@ + +

The page will automatically refresh once a second.

+

@RoomHelper.Rooms.Count rooms

+ +@foreach (Room room in RoomHelper.Rooms) +{ +
+

Room @room.RoomId

+

@room.Players.Count players, State is @room.State

+

Slot type: @room.Slot.SlotType, slot id: @room.Slot.SlotId

+ @foreach (User player in room.Players) + { +
@player.Username
+ } +
+} \ No newline at end of file diff --git a/ProjectLighthouse/Pages/Debug/RoomVisualizerPage.cshtml.cs b/ProjectLighthouse/Pages/Debug/RoomVisualizerPage.cshtml.cs new file mode 100644 index 00000000..3966e460 --- /dev/null +++ b/ProjectLighthouse/Pages/Debug/RoomVisualizerPage.cshtml.cs @@ -0,0 +1,21 @@ +using System.Threading.Tasks; +using JetBrains.Annotations; +using LBPUnion.ProjectLighthouse.Pages.Layouts; +using Microsoft.AspNetCore.Mvc; + +namespace LBPUnion.ProjectLighthouse.Pages.Debug; + +public class RoomVisualizerPage : BaseLayout +{ + public RoomVisualizerPage([NotNull] Database database) : base(database) + {} + + public async Task OnGet() + { + #if !DEBUG + return this.NotFound(); + #else + return this.Page(); + #endif + } +} \ No newline at end of file