forked from ppfun/pixelplanet
improve ws user lookup
This commit is contained in:
parent
87a73cb5c9
commit
4109ebe142
|
@ -259,6 +259,7 @@ class SocketServer {
|
|||
while (!client.done) {
|
||||
const ws = client.value;
|
||||
if (ws.readyState === WebSocket.OPEN
|
||||
&& ws.user
|
||||
&& ws.user.id === userId
|
||||
) {
|
||||
return ws;
|
||||
|
@ -275,6 +276,7 @@ class SocketServer {
|
|||
while (!client.done) {
|
||||
const ws = client.value;
|
||||
if (ws.readyState === WebSocket.OPEN
|
||||
&& ws.user
|
||||
&& ws.user.id === userId
|
||||
) {
|
||||
clients.push(ws);
|
||||
|
|
Loading…
Reference in New Issue
Block a user