Losing my mind over here
This commit is contained in:
parent
32c6532a4f
commit
de69048ebe
2 changed files with 3 additions and 58 deletions
21
index.js
21
index.js
|
@ -56,28 +56,9 @@ server.on('request', app)
|
|||
|
||||
wsServer.on("connection", function connection(socket) {
|
||||
console.log("BALLS")
|
||||
socket.on('message', function message(data) {
|
||||
data = JSON.parse(data)
|
||||
if (data.op == 3) {
|
||||
for (let index = 0; index < sockets.length; index++) {
|
||||
const socketData = sockets[index];
|
||||
if (socketData.socket == socket) {
|
||||
sockets[index].lastPing = Date.now()
|
||||
}
|
||||
}
|
||||
|
||||
socket.send(`{"op": 3}`)
|
||||
}
|
||||
})
|
||||
|
||||
socket.send(JSON.stringify(lanyardData))
|
||||
socket.send(`{ "op": 1 }`)
|
||||
|
||||
sockets.push({ socket, lastPing: Date.now() })
|
||||
socket.send("FUCK")
|
||||
})
|
||||
|
||||
|
||||
|
||||
process.on('uncaughtException', (err, origin) => {
|
||||
fs.writeSync(
|
||||
process.stderr.fd,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue