Skip to content

Commit

Permalink
πŸš‘ subscribing edge case
Browse files Browse the repository at this point in the history
DEV-1188
  • Loading branch information
o4kapuk committed Dec 29, 2023
1 parent 0d6c134 commit cadb3d4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/game/socket/server.js
Expand Up @@ -95,6 +95,9 @@ module.exports = function installSocketServer(server, PROTOCOL) {
conn.on('data', function (message) {

if (m = message.match(/^subscribe (.*)$/)) {
if(user && m[1].startsWith(`user:`) && !m[1].startsWith(`user:${user._id.toString()}`)) {
return;
}
socketModules.forEach(socketMod => {
try {
if (socketMod.onSubscribe(m[1], user, conn)) {
Expand Down

0 comments on commit cadb3d4

Please sign in to comment.