Game Connection Handler
A handler interface for any game logins and reconnections.
Parameters
the receiver of the incoming game packets, typically a Player class.
Functions
The onLogin function is triggered whenever a login request is received by the library, and it passes all the initial validation necessary. The server is responsible for doing most of the validation here, but preliminary things like max number of connections and session ids will have been pre-checked by us.
The onReconnect function is triggered whenever a reconnect request is received by the library. It is worth noting that Proof of Work will not be involved if this is the case, assuming it is enabled in the first place. Instead of transmitting the password, the client will transmit the seed used by the previous login connection. If the seed does not match with what the server knows, the request should be rejected. If the reconnect is successful, the server should replace the Session object in that player with the one provided by the response handler. The old session will close or time out shortly afterwards, if it already hasn't.