gikopoi2 icon indicating copy to clipboard operation
gikopoi2 copied to clipboard

if isGhost == true, write messages to a buffer

Open iccanobif opened this issue 2 years ago • 0 comments

When user A sends a message and user B is temporarily disconnected (so B.isGhost == true), B will not receive that message. A possible solution would be to keep a buffer with a list of missed messages for each user (simply a list in the Player object), and when A sends a message, for every B that's currently isGhost but in the same room, the message is written in the buffer instead of being sent to the socket. When B reconnects, the server will send him all the messages in the buffer. Would have to keep a size limit for the buffer (only the last 20 messages, for example?) to prevent spammers from filling the node.js server's RAM.

iccanobif avatar Jul 17 '22 09:07 iccanobif