Closed Jaxkr closed 2 years ago
Another option is to have the server send heartbeats to the client as well. This would allow the client to detect when the server has died and send another handshake. This would require less re-engineering and be more elegant.
Heartbeats are already echoed back as-is to the server that sent them, should be pretty trivial to keep a track of missed heartbeats and reconnect.
Heartbeats are already echoed back as-is to the server that sent them, should be pretty trivial to keep a track of missed heartbeats and reconnect.
Oh sweet. I'll add a timer to the Mammoth plugin that sends another handshake if too much time has passed.
Right now the handshake process seems to be very error prone and can cause servers to disconnect. Additionally, if the WorldQL server is restarted the clients have no way to reconnect (without restarting themselves).
Replacing the handshake message with a combined handshake/heartbeat would solve this. This heartbeat packet would function as an idempotent handshake in which the client says "hey, I'm still here and btw my port and host are x in case you've never seen me before".