detect disconnect
This commit is contained in:
parent
fcfacb1e96
commit
4f9a8c6413
1 changed files with 4 additions and 1 deletions
5
index.js
5
index.js
|
@ -70,6 +70,10 @@ lanyard.addEventListener("message", async (res) => {
|
|||
}
|
||||
})
|
||||
|
||||
lanyard.on('disconnect', () => {
|
||||
console.log("Disconnected")
|
||||
})
|
||||
|
||||
// wsServer = new WebSocket.WebSocketServer({ port: 8090 })
|
||||
wsServer = WebSocket.Server;
|
||||
let server = require('http').createServer()
|
||||
|
@ -82,7 +86,6 @@ server.on('request', app)
|
|||
wsServer.on("connection", function connection(socket) {
|
||||
socket.on('message', function message(data) {
|
||||
data = JSON.parse(data)
|
||||
console.log(data)
|
||||
if (data.op == 3) {
|
||||
for (let index = 0; index < sockets.length; index++) {
|
||||
const socketData = sockets[index];
|
||||
|
|
Loading…
Reference in a new issue