From 1968bf50f19ca2bad56fda278d08426a9f538675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 4 Jan 2021 16:58:29 -0500 Subject: [PATCH] fix: #9163, fix total connection count on ACP sockets.sockets is a JS map in 3.x --- src/socket.io/admin/rooms.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/socket.io/admin/rooms.js b/src/socket.io/admin/rooms.js index 1dc58f1c13..705d3d9e9d 100644 --- a/src/socket.io/admin/rooms.js +++ b/src/socket.io/admin/rooms.js @@ -131,10 +131,10 @@ SocketRooms.getLocalStats = function () { topics: {}, }; - if (io) { + if (io && io.sockets) { socketData.onlineGuestCount = Sockets.getCountInRoom('online_guests'); socketData.onlineRegisteredCount = SocketRooms.getOnlineUserCount(io); - socketData.socketCount = Object.keys(io.sockets.sockets).length; + socketData.socketCount = io.sockets.sockets.size; socketData.users.categories = Sockets.getCountInRoom('categories'); socketData.users.recent = Sockets.getCountInRoom('recent_topics'); socketData.users.unread = Sockets.getCountInRoom('unread_topics');