private async Task LoginRTMP(ProgressDialogController controller, HTTPLoginResult res) { controller.SetMessage("Contacting RTMP Server"); Supporting.LRtmp rtmpClient = new Supporting.LRtmp(); await rtmpClient.ConnectAsync(); com.riotgames.platform.login.AuthenticationCredentials rtmpInfo = new com.riotgames.platform.login.AuthenticationCredentials() { operatingSystem = "Windows 8", username = txtUser.Text, domain = "lolclient.lol.riotgames.com", clientVersion = "4.17.14_09_22_18_55", //todo: don't hardcode this locale = "en_US", password = txtPass.Password, macAddress = "" }; rtmpInfo.authToken = await Task.Factory.StartNew(() => Newtonsoft.Json.JsonConvert.SerializeObject(new com.riotgames.platform.login.AuthToken { account_id = res.lqt.account_id, account_name = res.lqt.account_name, fingerprint = res.lqt.fingerprint, other = res.lqt.other, resources = res.lqt.resources, signature = res.lqt.signature, timestamp = res.lqt.timestamp, uuid = res.lqt.uuid })); if (await rtmpClient.LoginAsync(rtmpInfo)) { com.riotgames.platform.clientfacade.domain.LoginDataPacket data = await rtmpClient.GetLoginDataPacketAsync(); MainWindow mainWindow = new MainWindow(data, rtmpClient); mainWindow.Show(); rtmpClient.PerformHeartBeatLoop(); this.Close(); return; } else { await ProgressFailed(controller, "Rejected from RTMPS side(?)"); } }
public async Task <bool> LoginAsync(com.riotgames.platform.login.AuthenticationCredentials cred) { try { com.riotgames.platform.login.Session session = await mainClient.InvokeAsync <com.riotgames.platform.login.Session>("my-rtmps", "loginService", "login", cred); CurrentSession = session; await mainClient.SubscribeAsync("my-rtmps", "messagingDestination", "bc", "bc-" + session.accountSummary.accountId); await mainClient.SubscribeAsync("my-rtmps", "messagingDestination", "gn-" + session.accountSummary.accountId, "gn-" + session.accountSummary.accountId); await mainClient.SubscribeAsync("my-rtmps", "messagingDestination", "cn-" + session.accountSummary.accountId, "cn-" + session.accountSummary.accountId); return(await mainClient.LoginAsync(session.accountSummary.username, session.token)); } catch (Exception e) { //TODO: handle exceptions properly System.Windows.MessageBox.Show("login:" + e.ToString()); } return(false); }