Forum Multiplayer Messages received after a player disconnects, etc?

Discussion and help relating to the PlayerIO Multiplayer API.

Messages received after a player disconnects, etc?

Postby robscherer123 » July 17th, 2017, 5:50 pm

I have a couple questions, that I'm not quite sure of the answers so I thought that I would ask it.

1. Let's say a player sends a message to the server, then disconnects from the server. Lets say the disconnect happens to get received by the server first, THEN the message arrives. Is the message still processed by the server for that player as if the player still existed on the server? I thought this would be false, but from a few bugs that have popped up over the years, it seems like perhaps messages received from a player who has disconnected are still received as normal?

2. Let's say the server sends a message to the player. Then the player disconnects, and rejoins another server room. THEN the message is received (the message from the previous room). By default, does the client still process this message? Again, I always thought it would not be so, but rare bugs popped up that leads me to believe this MIGHT be possible. If that's the case,


Both of the cases I mentioned would be very rare and probably wouldn't occur under normal circumstances. They would probably only ever really occur under HEAVY lag. Just thought I'd see what the answers are for these possible scenarios.
robscherer123
Paid Member
 
Posts: 313
Joined: December 12th, 2012, 8:46 pm

Re: Messages received after a player disconnects, etc?

Postby Henrik » August 12th, 2017, 1:57 am

Yes on both, because the message listeners are still active at that point in both cases.

You might get weird behaviour though, because if a player disconnects on the server, he's removed from the list of players in the room.

In the client example, you would get really weird results if you're re-using a "global" variable for the connection that is now pointing to the connection of the new room, but the message listener for the old room expects to send a message to the old room, but doesn't.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm


Return to Multiplayer



cron