Beispiel #1
0
 // If u connect to a vc in the same server as ur previous, ur connection won't die
 // It makes no sense to then manually kill it bcuz that's extra time
 // There's a chance that the client will miss events. A low one, but quite possible
 internal DiscordMediaSession(DiscordMediaSession other) : this(other.Client, other.GuildId, other.ChannelId, other.SessionId)
 {
     WebSocket                          = other.WebSocket;
     WebSocket.OnClosed                += OnClosed;
     WebSocket.OnMessageReceived       += OnMessageReceived;
     other.State                        = MediaSessionState.Dead;
     other.OnServerUpdated              = null;
     other.WebSocket.OnMessageReceived -= OnMessageReceived;
     other.WebSocket.OnClosed          -= OnClosed;
     _serverEndpoint                    = other._serverEndpoint;
     _localEndpoint                     = other._localEndpoint;
     UdpClient                          = other.UdpClient;
     SSRC           = other.SSRC;
     SecretKey      = other.SecretKey;
     SessionId      = other.SessionId;
     CurrentServer  = other.CurrentServer;
     ReceivePackets = other.ReceivePackets;
     State          = other.State;
 }
Beispiel #2
0
 public MediaWebSocket(string url, DiscordMediaSession parent) : base(url)
 {
     Id      = _next++;
     _parent = parent;
 }