Rework for the ws.id

Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
Yonle
2023-10-30 18:15:17 +07:00
parent 71f7cc874c
commit b29049dca2

View File

@@ -14,7 +14,7 @@ sess.exec("CREATE TABLE IF NOT EXISTS events (cID TEXT, subID TEXT, eID TEXT);")
// CL - User socket
module.exports = (ws, req) => {
ws.id = process.pid + "_" + csess.size;
ws.id = process.pid + Math.floor(Math.random() * 1000) + "_" + csess.size;
ws.on("message", data => {
try {
data = JSON.parse(data);