2026-05-15 11:08:23 +02:00
|
|
|
// FIXME: This file should handle the rooms API
|
|
|
|
|
// Functions may include:
|
|
|
|
|
// - fetchRoomConfig (get the configuration of a room)
|
|
|
|
|
// - setCurrentRoomConfig (set the current room configuration and update the DOM accordingly)
|
|
|
|
|
// - getCurrentRoomConfig (get the current room configuration)
|
|
|
|
|
// - joinRoom (join a room by its slug)
|
|
|
|
|
// - listRooms (list all the rooms available)
|
|
|
|
|
// - createRoom (create a room)
|
|
|
|
|
// - updateRoom (update a room's configuration)
|
|
|
|
|
// - deleteRoom (delete a room)
|
2026-05-15 22:59:15 +02:00
|
|
|
//
|
|
|
|
|
|
|
|
|
|
// joinRoom notes
|
|
|
|
|
// io.on('connection', (socket) => {
|
|
|
|
|
// // join the room named 'some room'
|
|
|
|
|
// socket.join('some room');
|
|
|
|
|
|
|
|
|
|
// // broadcast to all connected clients in the room
|
|
|
|
|
// io.to('some room').emit('hello', 'world');
|
|
|
|
|
|
|
|
|
|
// // broadcast to all connected clients except those in the room
|
|
|
|
|
// io.except('some room').emit('hello', 'world');
|
|
|
|
|
|
|
|
|
|
// // leave the room
|
|
|
|
|
// socket.leave('some room');
|
|
|
|
|
// });
|