Додана сторінка "Стенд"

Додане повідомлення про оновлення застосунку
Оновлен Service Worker
Перероблен WebSocket APІ
This commit is contained in:
2025-10-19 00:55:30 +03:00
parent 6ec6523d71
commit 3f08f3f6c9
46 changed files with 2651 additions and 2691 deletions

View File

@@ -1,6 +1,6 @@
const { updateApartment } = require("../services/apartments.service");
const { updateBuilding } = require("../services/buildings.service");
const { updateStand } = require("../services/stand.service");
const { lockingStand, unlockingStand, updateStand } = require("../services/stand.service");
const { broadcast } = require("../utils/broadcaster");
module.exports = async (wss, ws, message) => {
@@ -12,8 +12,17 @@ module.exports = async (wss, ws, message) => {
case "building":
await updateBuilding(ws.user, message.data);
break;
case "stand":
case "stand_locking":
await lockingStand(ws.user, message.data);
if(!message.data.sheep_name) message.data.sheep_name = ws.user.name;
break;
case "stand_unlocking":
await unlockingStand(ws.user, message.data);
if(!message.data.sheep_name) message.data.sheep_name = ws.user.name;
break;
case "stand_update":
await updateStand(ws.user, message.data);
if(!message.data.sheep_name) message.data.sheep_name = ws.user.name;
break;
default:
return ws.send(JSON.stringify({ error: `Unknown message type: ${message.type}` }));