|
|
|
@ -35,15 +35,16 @@ var io = require('socket.io')(server);
|
|
|
|
|
|
|
|
|
|
socket.on("blink", () => {
|
|
|
|
|
console.log("Blink event received!");
|
|
|
|
|
io.emit("blink");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
socket.on("message", (message) => {
|
|
|
|
|
console.log("Received message:", message);
|
|
|
|
|
if (message === "blink") {
|
|
|
|
|
console.log("Blink event received!");
|
|
|
|
|
io.emit("blink"); // Trigger the blink event to all connected clients
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// socket.on("message", (message) => {
|
|
|
|
|
// console.log("Received message:", message);
|
|
|
|
|
// if (message === "blink") {
|
|
|
|
|
// console.log("Blink event received!");
|
|
|
|
|
// io.emit("blink"); // Trigger the blink event to all connected clients
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
socket.on('chat message', (msg) => {
|
|
|
|
|
console.log('[user]['+ socket.id + '][' + msg + ']');
|
|
|
|
|