Add functionality to nodes to transfer all players to other nodes. #35
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was messing around with the new reconnect functionality and was toying with exposing the transferNode function. This allowed for transferring players between nodes. Which can be useful when updating nodes requires a restart of the node. I have a decent sized fleet of nodes and this would be helpful and allow for a much more seamless rollout of updates to my nodes. Allowing users of the client to transfer players away from nodes before rebooting without just killing those players.
One issue I did hit was that the disconnect codes from the node when transferring (and thus disconnecting) would remove the link from cache. We want to preserve that link so I added a state to the node object that prevents the node disconnect codes from removing the transferring links from the cache. This state is removed on a reconnect or manually if desired.
It may make some sense to add some enum states like the links have with CONNECTED/DISCONNECTED, etc to the node. However, that could be also a bit iffy as a node could be transferring and still connected. So for this change I though the scope or broader implications might be better for a follow through.
Changes