yojimbo icon indicating copy to clipboard operation
yojimbo copied to clipboard

Sending a message from server to disconnected client using unreliable channel.

Open awgil opened this issue 5 years ago • 1 comments

Currently if you try to send a message from server to disconnected client using unreliable channel, this message will be received by the next client that connects into same "slot".

The problem is that Server::SendMessage() simply calls UnreliableUnorderedChannel::SendMessage(), which adds message to the send queue, and this message stays there - Server::SendPackets() will skip disconnected clients. Next client that gets assigned to the same client index will then receive this message instead.

While it's easy to fix on the user side (skip code that sends messages to particular client if this client has disconnected), I think library should handle this better (either assert or ignore SendMessage, not sure which is better).

awgil avatar Dec 26 '19 14:12 awgil

Seeing as it is an unreliable channel, the message should just be silently dropped. Can you make a PR that does this?

gafferongames avatar Dec 27 '19 00:12 gafferongames

This should be fixed in head

gafferongames avatar Dec 26 '23 03:12 gafferongames