Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: transfer players to new nodes #85

Merged
merged 1 commit into from
Jun 1, 2023
Merged

Conversation

ooliver1
Copy link
Owner

@ooliver1 ooliver1 commented Jun 1, 2023

Summary

This is impressive that it even works.

NodePool.remove_node has been added, which has a transfer_players keyword argument, which:

  • False: destroys all players
  • True: Player.transfer_to with the best node per player

Player.transfer_to tries its best to:

  • Fetch existing player state from old node
  • Remove player from internal old node state
  • Add player to internal new node state
  • Tell the new node about our voice config (endpoint, session id, token)
  • Update the new player with track, position, volume, pause, filter

Node.close was also added to disconnect and cleanup an old node, called in NodePool.remove_node

Checklist

  • If code changes were made then they have been tested.
  • I have run task lint to format code and my changes.
  • I have run task pyright and fixed the relevant issues.

@ooliver1 ooliver1 added t: enhancement Type: enhancement - new feature or request p: low Priority: low - not important to be worked on labels Jun 1, 2023
@ooliver1 ooliver1 enabled auto-merge (squash) June 1, 2023 20:22
@ooliver1 ooliver1 merged commit bd833ee into master Jun 1, 2023
8 checks passed
@ooliver1 ooliver1 deleted the feat/transfer-players branch June 1, 2023 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p: low Priority: low - not important to be worked on t: enhancement Type: enhancement - new feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant