If user isn't in chatroom menu, don't send chatroom events
This commit is contained in:
1 file changed
+16
-8
+16
-8
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user