Closed NenoxAG closed 4 years ago
Hey @NenoxAG, thanks for your report!
both LavalinkNode and LavalinkCluster implement the IAudioService interface:
All Wikis for the LavalinkNode apply for the LavalinkCluster.
Are you using the latest version of Lavalink4NET and Lavalink?
In your Lavalink log it seems like the Lavalink4NET client is closing the connection due to a protocol error (1007 [WebSocketCloseStatus.InvalidPayloadData
]):
Can you provide the log of your Lavalink client? You can turn on logging with passing an ILogger implementation to your Cluster constructor:
For dummy logging you can use a simple inline logger:
var myLogger = new EventLogger();
myLogger.LogMessage += (sender, args) =>
{
Console.WriteLine(args.Message);
if (args.Exception != null)
{
Console.Out.WriteLine(args.Exception);
}
};
new LavalinkCluster([...], [...], myLogger);
Thanks in advance!
Hello,
yes i'm using the latest version of Lavalink4NET (1.4.12) and Lavalink (3.3.1).
Here is the Lavalink4NET log:
Connected to Lavalink Node!
Received payload: `{"playingPlayers":0,"op":"stats","memory":{"reservable":8436842496,"used":170429056,"free":362247552,"allocated":532676608},"players":0,"cpu":{"cores":10,"systemLoad":0.07212137099416738,"lavalinkLoad":0.10774647887323943},"uptime":251315}` from: ws://127.0.0.1:3330/.
Connected to Lavalink Node!
Received payload: `{"playingPlayers":0,"op":"stats","memory":{"reservable":8436842496,"used":154565184,"free":378111424,"allocated":532676608},"players":0,"cpu":{"cores":10,"systemLoad":0.03724814311436318,"lavalinkLoad":0.10739299610894941},"uptime":251623}` from: ws://127.0.0.1:3331/.
Loading track 'https://www.youtube.com/watch?v=A6Ple4aJRyA'...
Sent payload `{"op":"voiceUpdate","guildId":"xxx","sessionId":"xxx","event":{"token":"xxx","guild_id":xxx,"endpoint":"eu-central514.discord.media:80"}}` to ws://127.0.0.1:3330/.
Got response for track load: `https://www.youtube.com/watch?v=A6Ple4aJRyA`: {"playlistInfo":{},"loadType":"TRACK_LOADED","tracks":[{"track":"QAAAlQIAM1VubGlrZSBQbHV0byAtIEV2ZXJ5dGhpbmcgQmxhY2sgKGZlYXQuIE1pa2UgVGF5bG9yKQAIQ2xvdWRLaWQAAAAAAAN+iAALQTZQbGU0YUpSeUEAAQAraHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1BNlBsZTRhSlJ5QQAHeW91dHViZQAAAAAAAAAA","info":{"identifier":"A6Ple4aJRyA","isSeekable":true,"author":"CloudKid","length":229000,"isStream":false,"position":0,"title":"Unlike Pluto - Everything Black (feat. Mike Taylor)","uri":"https://www.youtube.com/watch?v=A6Ple4aJRyA"}}]}.
Sent payload `{"op":"play","guildId":"xxx","track":"QAAAlQIAM1VubGlrZSBQbHV0byAtIEV2ZXJ5dGhpbmcgQmxhY2sgKGZlYXQuIE1pa2UgVGF5bG9yKQAIQ2xvdWRLaWQAAAAAAAN+iAALQTZQbGU0YUpSeUEAAQAraHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1BNlBsZTRhSlJ5QQAHeW91dHViZQAAAAAAAAAA","startTime":0,"noReplace":false}` to ws://127.0.0.1:3330/.
Received payload: `{"op":"event","type":"TrackStartEvent","track":"QAAAlQIAM1VubGlrZSBQbHV0byAtIEV2ZXJ5dGhpbmcgQmxhY2sgKGZlYXQuIE1pa2UgVGF5bG9yKQAIQ2xvdWRLaWQAAAAAAAN+iAALQTZQbGU0YUpSeUEAAQAraHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1BNlBsZTRhSlJ5QQAHeW91dHViZQAAAAAAAAAA","guildId":"xxx"}` from: ws://127.0.0.1:3330/.
Received bad payload: {"op":"event","type":"TrackStartEvent","track":"QAAAlQIAM1VubGlrZSBQbHV0byAtIEV2ZXJ5dGhpbmcgQmxhY2sgKGZlYXQuIE1pa2UgVGF5bG9yKQAIQ2xvdWRLaWQAAAAAAAN+iAALQTZQbGU0YUpSeUEAAQAraHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1BNlBsZTRhSlJ5QQAHeW91dHViZQAAAAAAAAAA","guildId":"xxx"}.
System.ArgumentException: Could not convert 'TrackStartEvent' to EventType.
---> Newtonsoft.Json.JsonSerializationException: Error converting value "TrackStartEvent" to type 'Lavalink4NET.Payloads.EventType'. Path 'type'.
---> System.ArgumentException: Requested value 'TrackStartEvent' was not found.
at Newtonsoft.Json.Utilities.EnumUtils.ParseEnum(Type enumType, NamingStrategy namingStrategy, String value, Boolean disallowNumber)
at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
--- End of inner exception stack trace ---
at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType)
--- End of inner exception stack trace ---
at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType)
at Newtonsoft.Json.Linq.JToken.ToObject[T]()
at Lavalink4NET.Payloads.PayloadConverter.ReadPayload(String json)
at Lavalink4NET.LavalinkSocket.ProcessNextPayload()
Reconnected to Lavalink Node!
Received payload: `{"playingPlayers":0,"op":"stats","memory":{"reservable":8436842496,"used":256414336,"free":276262272,"allocated":532676608},"players":0,"cpu":{"cores":10,"systemLoad":0.10149283638913936,"lavalinkLoad":0.10718185636287274},"uptime":271467}` from: ws://127.0.0.1:3330/
Thanks in advance!
I identified the problem and I'm currently working on a fix and the implementation of the TrackStart event. Thanks for your report!
I implemented the TrackStart
event in the following commit: c3ecd31.
I will publish the release (1.4.13) on NuGet and GitHub Tags.
You can try out the built artifacts (https://ci.appveyor.com/project/angelobreuer/lavalink4net/builds/32098918/artifacts) from the CI server.
Is your feature request related to a problem? Please describe. I won't be able to get my bot to run with a cluster of Lavalink Nodes. There always is an error in the Lavalink console. With a single Lavalink node everything works as expected.
Describe the solution you'd like A better wiki entry that deals more with the cluster, how to use a cluster and how to start players from a cluser, ...
Additional context Log of Lavalink: