void RecieveMessage(object sender, RtmpSharp.Messaging.MessageReceivedEventArgs e) { if (MessageRecieved != null) { MessageRecieved(this, e); } }
void RiotConnection_MessageReceived(object sender, RtmpSharp.Messaging.MessageReceivedEventArgs e) { if (e.Body is SimpleDialogMessage) { var item = e.Body as SimpleDialogMessage; if (item.Type == "championMastery") { var mastery = JsonConvert.DeserializeObject <ChampionMastery>(item.Params.ToString()); GotChampionMasteryPoints(mastery); } } }
private async void RiotConnection_MessageReceived(object sender, RtmpSharp.Messaging.MessageReceivedEventArgs e) { if (e.Body is LcdsServiceProxyResponse proxy) { if (proxy.MessageId == null && proxy.MethodName == "tbdGameDtoV1" && proxy.ServiceName == "teambuilder-draft") { var messageData = JsonConvert.DeserializeObject <PartyPhaseMessage>( Encoding.UTF8.GetString(Gzip.Decompress(Convert.FromBase64String(proxy.Payload)))); if (messageData.PhaseName == "CHAMPION_SELECT") { await Dispatcher.BeginInvoke(DispatcherPriority.Render, (Action)(() => { UpdateChampSelect(messageData); })); } } } }