예제 #1
0
파일: Session.cs 프로젝트: GooogleTHT/LGcl2
        private async void RtmpConn_Disconnected(object sender, EventArgs e)
        {
            Connected = false;
            await RtmpConn.RecreateConnection(ReconnectToken);

            var bc    = $"bc-{Account.AccountID}";
            var gn    = $"gn-{Account.AccountID}";
            var cn    = $"cn-{Account.AccountID}";
            var tasks = new[] {
                RtmpConn.SubscribeAsync("my-rtmps", "messagingDestination", "bc", bc),
                RtmpConn.SubscribeAsync("my-rtmps", "messagingDestination", gn, gn),
                RtmpConn.SubscribeAsync("my-rtmps", "messagingDestination", cn, cn),
            };
            await Task.WhenAll(tasks);

            Connected = true;
        }
예제 #2
0
파일: Session.cs 프로젝트: GooogleTHT/LGcl2
 public void Logout()
 {
     if (Connected)
     {
         try {
             SaveSettings(Settings.Username, Settings);
             RtmpConn.MessageReceived -= RtmpConn_MessageReceived;
             HeartbeatTimer.Dispose();
             new Thread(async() => {
                 Connected = false;
                 CurrentQueue?.Cancel();
                 CurrentLobby?.Dispose();
                 await RiotServices.LoginService.Logout();
                 await RtmpConn.LogoutAsync();
                 RtmpConn.Close();
             }).Start();
         } catch { }
     }
     ChatManager?.Dispose();
 }