internal void KillSession(GoLiveDelete goLive) { var key = new StreamKey(goLive.StreamKey); if (OnLeftLivestream != null) { Task.Run(() => OnLeftLivestream.Invoke(this, new LivestreamDisconnectEventArgs(key.UserId, goLive))); } }
internal LivestreamDisconnectEventArgs(ulong streamerId, GoLiveDelete goLive) { StreamerId = streamerId; RawReason = goLive.RawReason; if (Enum.TryParse(RawReason.Replace("_", ""), true, out DiscordLivestreamError err)) { Reason = err; } else { Reason = DiscordLivestreamError.Unknown; } }
internal void Disconnect(GoLiveDelete delete) { base.Disconnect((ushort)UnorthodoxCloseCode.KeepQuiet, "Disconnecting with Go Live error"); OnDisconnected?.Invoke(this, new DiscordGoLiveCloseEventArgs(DiscordMediaCloseCode.Disconnected, "Disconnected from livestream: " + delete.Reason, delete)); }
internal DiscordGoLiveException(GoLiveDelete delete) : base($"Failed to connect to Go Live. Error: {delete.Reason}") { Error = delete.Reason; RawError = delete.RawReason; }