Skip to content

Conversation

@jonathan-ostrander
Copy link

Existing Behavior

When MusicManager connects to a channel, it updates its own map of GuildId to (AudioPlayer, ActorRef[LavaplayerHandler.Command]) with the new guild. When a DisconnectFromChannel command is sent the reference is removed from the players map in all cases (whether or not the player is destroyed) and the actor is left alive. When ConnectToChannel is called for a second time for the same GuildId, there's no reference to the player/actor in the map and it attempts to create a new actor with the same guild id which leads akka to throw an exception for a non-unique name.

New Behavior

On disconnect if destroyPlayer is set to true, the associated actor is also shutdown and the reference in the players map is removed. In all other cases the behavior is kept the same and the LavaplayerHandler actor is left running.

Existing Behavior

When `MusicManager` connects to a channel, it updates its own map of `GuildId` to `(AudioPlayer, ActorRef[LavaplayerHandler.Command])` with the new guild. When a `DisconnectFromChannel` command is sent the reference is removed from the players map in all cases (whether or not the player is destroyed) and the actor is left alive.  When `ConnectToChannel` is called for a second time for the same `GuildId`, there's no reference to the player/actor in the map and it attempts to create a new actor with the same guild id which leads akka to throw an exception for a non-unique name.

New Behavior

On disconnect if `destroyPlayer` is set to `true`, the associated actor is also shutdown and the reference in the players map is removed. In all other cases the behavior is kept the same and the `LavaplayerHandler` actor is left running.
@Katrix Katrix merged commit c09116c into Katrix:master Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants