Пример #1
0
        internal TrackEndedEventArgs(LavaPlayer player, TrackEndEvent endEvent)
        {
            Player = player;
            Track  = TrackDecoder.Decode(endEvent.Hash);
            Reason = endEvent.Reason;

            if (endEvent.Reason == TrackEndReason.Replaced)
            {
                return;
            }

            player.UpdatePlayer(x =>
            {
                x.PlayerState = PlayerState.Stopped;
                x.Track       = default;
            });
        }
Пример #2
0
 internal TrackStuckEventArgs(LavaPlayer player, TrackStuckEvent stuckEvent)
 {
     Player    = player;
     Track     = TrackDecoder.Decode(stuckEvent.Hash);
     Threshold = new TimeSpan(stuckEvent.ThresholdMs);
 }
Пример #3
0
 internal TrackStartEventArgs(LavaPlayer player, TrackStartEvent trackStartEvent)
 {
     Player = player;
     Track  = TrackDecoder.Decode(trackStartEvent.Hash);
 }
Пример #4
0
 internal TrackEndedEventArgs(LavaPlayer player, TrackEndEvent endEvent)
 {
     Player = player;
     Track  = TrackDecoder.Decode(endEvent.Hash);
     Reason = endEvent.Reason;
 }
Пример #5
0
 internal TrackExceptionEventArgs(LavaPlayer player, TrackExceptionEvent exceptionEvent)
 {
     Player       = player;
     Track        = TrackDecoder.Decode(exceptionEvent.Hash);
     ErrorMessage = exceptionEvent.Error;
 }