When two servers start, the registration of servers is too slow. It could be up to 30 seconds before both servers acknowledge the presence of the other. This creates the risk of a disregarded handshake, i.e.:
Player1 is on Server1, neither server has the other registered
Player2 tries to swap to Server2 -> Server2 checks the validity of the NetworkProfile lastSeen (Server1) and disregards the handshake since it thinks its an invalid server
Handshake does not occur -> data loss!
Solution (2 Steps):
When a server comes online, we send out a pulse on the group, asking other servers to identify themselves. We deny joins until ~2 seconds after the pulse, to ensure we receive most responses.
We maintain a 5 second keep-alive task that publishes alive status to other servers.
TODO
[x] Figure out why network statuses aren't being sent or received (/sync servers <db> lists nothing)
[x] Ensure join statuses are sent
[x] Ensure pings are sent periodically
[x] Ensure when we see a server join, we send a ping
When two servers start, the registration of servers is too slow. It could be up to 30 seconds before both servers acknowledge the presence of the other. This creates the risk of a disregarded handshake, i.e.:
Solution (2 Steps):
TODO
/sync servers <db>
lists nothing)