Додана сторінка "Стенд"
Додане повідомлення про оновлення застосунку Оновлен Service Worker Перероблен WebSocket APІ
This commit is contained in:
@@ -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}` }));
|
||||
|
||||
Reference in New Issue
Block a user