If user isn't in chatroom menu, don't send chatroom events

This commit is contained in:
Lncvrt committed 2026-03-13 15:47:34 -07:00
1 parent ae40455c5a
commit c65974ff43
1 file changed
+16 -8
+16 -8
View File
@@ -555,8 +555,10 @@ app.ws('/ws', {
if (result[0].affectedRows == 1) {
for (const client of clients) {
if (!clientInfo.some(clientInfo => clientInfo.Id === client.id))
return
const info = clientInfo.find(
clientInfo => clientInfo.Id === client.id
)
if (!info || info.SceneName != 'ChatroomMenu') continue
client.send(
JSON.stringify({
for: message.type + ':' + message.kind,
@@ -632,8 +634,10 @@ app.ws('/ws', {
if (!chatRows.reverse()[0])
for (const client of clients) {
if (!clientInfo.some(clientInfo => clientInfo.Id === client.id))
return
const info = clientInfo.find(
clientInfo => clientInfo.Id === client.id
)
if (!info || info.SceneName != 'ChatroomMenu') continue
client.send(
JSON.stringify({
for: message.type + ':' + message.kind,
@@ -680,8 +684,10 @@ app.ws('/ws', {
let savedata = JSON.parse(userData[0].saveData)
for (const client of clients) {
if (!clientInfo.some(clientInfo => clientInfo.Id === client.id))
return
const info = clientInfo.find(
clientInfo => clientInfo.Id === client.id
)
if (!info || info.SceneName != 'ChatroomMenu') continue
client.send(
JSON.stringify({
for: message.type + ':' + message.kind,
@@ -787,8 +793,10 @@ app.ws('/ws', {
let savedata = JSON.parse(userData[0].saveData)
for (const client of clients) {
if (!clientInfo.some(clientInfo => clientInfo.Id === client.id))
return
const info = clientInfo.find(
clientInfo => clientInfo.Id === client.id
)
if (!info || info.SceneName != 'ChatroomMenu') continue
client.send(
JSON.stringify({
for: message.type + ':' + message.kind,