colores asignados al azar y simulador de jugadores en el dashboard
This commit is contained in:
@@ -2,6 +2,7 @@ import { Request, Response, Router } from "express";
|
||||
import { matchMaker } from "colyseus";
|
||||
import { GameRoom } from "./rooms/GameRoom";
|
||||
import { NameManager } from "./utils/nameManager";
|
||||
import { getAllowedUuidCount, listAllowedUuids } from "./utils/uuidRegistry";
|
||||
|
||||
// SSE connections storage
|
||||
const sseClients = new Set<Response>();
|
||||
@@ -432,6 +433,17 @@ adminRouter.post("/admin/shuffle-players", async (req: Request, res: Response) =
|
||||
}
|
||||
});
|
||||
|
||||
// UUID allowlist endpoint
|
||||
adminRouter.get("/admin/uuids", async (req: Request, res: Response) => {
|
||||
try {
|
||||
const uuids = listAllowedUuids();
|
||||
res.json({ count: getAllowedUuidCount(), uuids });
|
||||
} catch (error) {
|
||||
console.error("[AdminAPI] Error fetching UUIDs:", error);
|
||||
res.status(500).json({ error: "Failed to fetch UUIDs" });
|
||||
}
|
||||
});
|
||||
|
||||
// SSE endpoint for real-time dashboard updates
|
||||
adminRouter.get("/dashboard-stream", (req: Request, res: Response) => {
|
||||
// Set SSE headers
|
||||
@@ -558,4 +570,4 @@ function broadcastDashboardUpdate() {
|
||||
sendDashboardUpdate();
|
||||
}
|
||||
|
||||
export { adminRouter, broadcastDashboardUpdate };
|
||||
export { adminRouter, broadcastDashboardUpdate };
|
||||
|
||||
Reference in New Issue
Block a user