Closed MichalPetryka closed 3 years ago
I need this in uMMORPG as well. right now I have a workaround where I send an error message without disconnecting, and the client disconnects itself.
I could be wrong, but I think not all transports will deliver the last message properly if we call disconnect immediately after calling send.
closing this for now, unless anyone has an idea how to do send(DisconnectMessage); close(); in TCP with the disconnect message actually being sent.
Send a message with this, and make the client respond with disconnect? @vis2k
could you do something on the server where after the msg to disconnect is sent you give them until the normal timeout period then drop the connection anyway?
reopening: according to c6 it might work with LingerState
In websockets you also send a close message with a reason.
Okay, so: 2 transports support disconnect reasons (WebSockets and LiteNetLib) 1 transport has DisconnectLater (Ignorance)
TargetRpc ahead of the server's call to Disconnect (perhaps with a 1 frame delay) is the only way to sanely do this, since we can't be assured of what various transports might support in terms of a d/c reason. Closing.
Is your feature request related to a problem? Please describe. Having possibility to send some text on disconnect would be useful for things like "You have been banned".
Describe the solution you'd like Optional string parameter in Disconnect method.
Describe alternatives you've considered Sending message manually with TargetRPCs before disconnect.
Additional context Some transports might have possibility to send the reason in disconnect packet, utilizing that would be useful.