mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 01:21:20 -04:00
gruh
This commit is contained in:
@@ -171,6 +171,15 @@ function getSocketByRequesterKey(requesterKey) {
|
||||
const socketId = requesterKey.slice('socket:'.length);
|
||||
return io.sockets.sockets.get(socketId) || null;
|
||||
}
|
||||
if (requesterKey.startsWith('cookie:')) {
|
||||
const cookieUserId = requesterKey.slice('cookie:'.length);
|
||||
for (const socket of io.sockets.sockets.values()) {
|
||||
const key = String(socket?.data?.cookieUserId || '').trim().toLowerCase();
|
||||
if (key && key === cookieUserId) {
|
||||
return socket;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user