diff options
| author | Adam Soltys <[email protected]> | 2020-07-30 19:45:04 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-07-30 19:45:04 -0700 |
| commit | 51405858756e107304a908898d2ac6ea5a43f121 (patch) | |
| tree | b27c601e9dc2fc8b5c0c08122c6f0b0504a9a693 /lib | |
| parent | 68556f9272a66c0cf4d9deacc340e59da045fdd1 (diff) | |
| download | coinos-server-51405858756e107304a908898d2ac6ea5a43f121.tar.gz coinos-server-51405858756e107304a908898d2ac6ea5a43f121.zip | |
logout the earliest socket not the latest
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sockets.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sockets.js b/lib/sockets.js index 87317a16..514d701a 100644 --- a/lib/sockets.js +++ b/lib/sockets.js @@ -56,8 +56,8 @@ wss.on("connection", function (ws, req) { if (!sockets[username]) sockets[username] = {}; const existing = Object.keys(sockets[username]); if (existing.length > 5) { - l.warn("too many sockets, logging out", existing[0]); - sockets[username][existing[0]].send( + l.warn("too many sockets, logging out", existing[5]); + sockets[username][existing[5]].send( JSON.stringify({ type: "login", data: false }) ); } |
