From efb8589a611147ef23119c6b388b5312b5db9834 Mon Sep 17 00:00:00 2001 From: cay Date: Fri, 10 Apr 2026 17:13:23 +0100 Subject: [PATCH] ahaer --- app.js | 22 +++------------------- public/css/hud.css | 10 ++++------ views/launcher.ejs | 9 +++++---- 3 files changed, 12 insertions(+), 29 deletions(-) diff --git a/app.js b/app.js index e854d5a..9427c71 100644 --- a/app.js +++ b/app.js @@ -59,8 +59,8 @@ app.use( defaultSrc: ["'self'"], scriptSrc: ["'self'", "'unsafe-inline'"], scriptSrcAttr: ["'unsafe-inline'"], - styleSrc: ["'self'", "'unsafe-inline'", "https://fonts.googleapis.com"], - fontSrc: ["'self'", "https://fonts.gstatic.com"], + styleSrc: ["'self'", "'unsafe-inline'", "https://fonts.googleapis.com", "https://cdnjs.cloudflare.com"], + fontSrc: ["'self'", "https://fonts.gstatic.com", "https://cdnjs.cloudflare.com"], imgSrc: ["'self'", "data:", "blob:"], connectSrc: ["'self'", "ws:", "wss:"], frameAncestors: ["'self'"], // Erlaubt iframe von eigener Domain @@ -108,25 +108,9 @@ app.use(express.urlencoded({ extended: true })); app.use(express.static(path.join(__dirname, "public"))); /* ======================== - Server Stats (öffentlich – kein Login nötig) - Zählt online Spieler pro Server - via Socket.io Verbindungen + Login Middleware ======================== */ -app.get("/api/server-stats", (req, res) => { - const stats = {}; - - // Alle verbundenen Sockets durchgehen - const sockets = io.sockets.sockets; - sockets.forEach((socket) => { - if (socket.user && socket.serverId) { - stats[socket.serverId] = (stats[socket.serverId] || 0) + 1; - } - }); - - res.json(stats); -}); - function requireLogin(req, res, next) { if (!req.session.user) { return res.status(401).json({ error: "Nicht eingeloggt" }); diff --git a/public/css/hud.css b/public/css/hud.css index 2b4ff49..17102b4 100644 --- a/public/css/hud.css +++ b/public/css/hud.css @@ -206,16 +206,14 @@ } .hud-res-icon { - font-size: 0; /* Emoji unsichtbar */ - color: transparent; - display: inline-block; + display: inline-flex; + align-items: center; + justify-content: center; width: 20px; height: 20px; flex-shrink: 0; - background: url("/images/items/blauer-cristal.png") center / contain - no-repeat; + font-size: 15px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.7)); - vertical-align: middle; } /* Ressource Icons (gem, silver, wood, stone, gold, iron) – einheitliche Größe */ diff --git a/views/launcher.ejs b/views/launcher.ejs index 8f41939..44fb119 100644 --- a/views/launcher.ejs +++ b/views/launcher.ejs @@ -94,6 +94,7 @@ + @@ -654,12 +655,12 @@
- 💠 + 0
- 🪙 + 0
@@ -667,12 +668,12 @@
- 🪵 + 0
- 🪨 + 0