Jerenaux / phaserquest

Reproduction of Mozilla's BrowserQuest using Phaser, socket.io and Node.js
http://www.dynetisgames.com/2017/03/18/phaser-quest/
MIT License
371 stars 127 forks source link

Chat system not working #5

Closed marius-m2 closed 7 years ago

marius-m2 commented 7 years ago

Hey,

Been having some issues with chat messages not being sent through by the server. So this bit rooms.forEach(function(room){ socket.broadcast.to(room).emit('chat', {id:playerID,txt:txt}); }); doesn't seem to work for me.

Any ideas?

marius-m2 commented 7 years ago

It works fine by replacing the rooms logic with io.emit, but I'm wondering what's running on your example page then, if the source doesn't allow chatting at this moment.

Jerenaux commented 7 years ago

I just pushed a commit to fix it. Several commits ago, I had deleted some code, thinking it wasn't used anymore, but it was actually the code used to manage rooms, which the chat uses. I had forgotten about this and didn't take time to check. Now it should be fixed, it works on my side, if you can confirm to me it works for you I'll close the issue. Thanks for notifying me!

marius-m2 commented 7 years ago

Works great :) many thanks