Example #1
0
 private void securityModule_CommandMessageReceived(object sender, CommandMessageReceivedEventArgs e)
 {
     if (_verbose)
     {
         WriteLine("Command message: " + e.Message);
     }  // if(_verbose)
 }
        public void CommandMessageReceivedEventArgsConstructorTest()
        {
            CommandMessage message = new CommandMessage();
            CommandMessageReceivedEventArgs target = new CommandMessageReceivedEventArgs(message);

            Assert.AreSame(message, target.Message);
        }
Example #3
0
        static void ClientCommandReceieved(object sender, CommandMessageReceivedEventArgs e)
        {
            RtmpClient client = sender as RtmpClient;

            if (e.Message.Operation == CommandOperation.Login)
            {
                ClientDynamicConfigurationNotification clientConfig = new ClientDynamicConfigurationNotification
                {
                    Delta  = false,
                    Config = new Dictionary <string, object>()
                    {
                        {
                            "Chroma",
                            new Dictionary <string, object>()
                            {
                                {
                                    "IsEnabled",
                                    true
                                }
                            }
                        },
                        {
                            "LootConfig",
                            new Dictionary <string, object>()
                            {
                                {
                                    "NewPlayerChestEnabled",
                                    true
                                },
                                {
                                    "Enabled",
                                    true
                                },
                                {
                                    "PurchaseChestsEnabled",
                                    true
                                },
                                {
                                    "MinSummonerLevel",
                                    1
                                },
                                {
                                    "Visible",
                                    true
                                },
                                {
                                    "NoRefundConfirmationEnabled",
                                    false
                                },
                                {
                                    "EventChestsEnabled",
                                    true
                                },
                            }
                        }
                    }
                };
                client.InvokeDestReceive("cn-200006292", "cn-200006292", "messagingDestination", clientConfig);
            }
        }
Example #4
0
        public async Task <object> HandleCommand(object sender, CommandMessageReceivedEventArgs e)
        {
            if (_client == null)
            {
                throw new NotConnectedException();
            }

            return(await _client.ForwardCommand(sender, e));
        }
Example #5
0
        void ServerCommandReceived(object sender, CommandMessageReceivedEventArgs e)
        {
            RtmpClient client = (RtmpClient)sender;

            switch (e.Message.Operation)
            {
            case CommandOperation.Login:
                AcknowledgeMessageExt login = new AcknowledgeMessageExt
                {
                    Body          = "success",
                    CorrelationId = e.Message.MessageId,
                    MessageId     = Uuid.NewUuid(),
                    ClientId      = Uuid.NewUuid(),
                    Headers       = new AsObject
                    {
                        { "DSMessagingVersion", 1.0 },
                        { FlexMessageHeaders.FlexClientId, e.DSId }
                    }
                };

                client.InvokeResult(e.InvokeId, login);
                break;

            case CommandOperation.Subscribe:
                AcknowledgeMessageExt subscribe = new AcknowledgeMessageExt
                {
                    Body          = null,
                    CorrelationId = e.Message.MessageId,
                    MessageId     = Uuid.NewUuid(),
                    ClientId      = e.Message.ClientId
                };

                client.InvokeResult(e.InvokeId, subscribe);
                break;

            case CommandOperation.Unsubscribe:
                break;

            case CommandOperation.ClientPing:
                break;

            case CommandOperation.Logout:
                break;

            default:
                throw new NotSupportedException();
            }

            if (ClientCommandReceieved != null)
            {
                ClientCommandReceieved(sender, e);
            }
        }
Example #6
0
        public async Task <object> ForwardCommand(object sender, CommandMessageReceivedEventArgs e)
        {
            object s = await _client.InvokeAsync <string>(null, e.Message);

            if (s != null && s.GetType() == typeof(string))
            {
                return((string)s == "success");
            }
            else
            {
                return(s);
            }
        }
Example #7
0
        void ClientCommandReceieved(object sender, CommandMessageReceivedEventArgs e)
        {
            RtmpClient client = sender as RtmpClient;

            if (e.Message.Operation == CommandOperation.Login)
            {
                ClientDynamicConfigurationNotification clientConfig = new ClientDynamicConfigurationNotification
                {
                    Delta = false,
                    //TODO: not have this data stored in code
                    Config = "{\"PlatformShutdown\":{\"Enabled\":false},\"BotConfigurations\":{\"IntermediateInCustoms\":true},\"ShareMatchHistory\":{\"MatchHistoryUrlTemplate\":\"http://matchhistory.oce.leagueoflegends.com/{2}/#login?redirect=%23player-search%2FcurrentAccount%2FOC1%2F{0}\",\"AdvancedGameDetailsUrlTemplate\":\"http://matchhistory.oce.leagueoflegends.com/{2}/#match-details/OC1/{0}/{1}/eog\",\"AdvancedGameDetailsEnabled\":true,\"MatchDetailsUrlTemplate\":\"http://matchhistory.oce.leagueoflegends.com/{2}/#match-details/OC1/{0}/{1}\",\"ShareEndOfGameEnabled\":true,\"ShareGameUrlTemplate\":\"http://matchhistory.oce.leagueoflegends.com/{2}/#match-details/OC1/{0}/{1}/eog\",\"MatchHistoryEnabled\":true},\"GuestSlots\":{\"Enabled\":null},\"ServiceStatusAPI\":{\"Enabled\":true},\"GameTimerSync\":{\"Enabled\":false,\"PercentOfTotalTimerToSyncAt\":0.8},\"QueueRestriction\":{\"ServiceEnabled\":true,\"RankedDuoQueueRestrictionMode\":\"TIER\",\"KarmaEnabled\":false,\"RankedDuoQueueRestrictionMaxDelta\":1,\"RankedDuoQueueDefaultUnseededTier\":\"SILVER\"},\"DockedPrompt\":{\"EnabledNewDockedPromptRenderer\":true},\"QueueImages\":{\"OverrideQueueImage\":true},\"SuggestedPlayers\":{\"HonoredPlayersLimit\":4,\"FriendsOfFriendsLimit\":22,\"Enabled\":true,\"OnlineFriendsLimit\":4,\"PreviousPremadesLimit\":4,\"MaxNumSuggestedPlayers\":8,\"VictoriousComradesLimit\":4,\"FriendsOfFriendsEnabled\":true,\"MaxNumReplacements\":22},\"DisabledChampions\":{\"FIRSTBLOOD\":\"[]\",\"KINGPORO\":\"[161]\",\"ARAM_UNRANKED_5x5\":\"[]\",\"ONEFORALL_5x5\":\" []\",\"ASCENSION\":\"[83]\",\"SR_6x6\":\"[]\",\"URF\":\"[120,16,76,12,10,72,13,38,37]\",\"KING_PORO\":\"[161]\",\"ODIN_UNRANKED\":\"[]\",\"NIGHTMARE_BOT\":\"[]\",\"RANKED_SOLO_5x5\":\"[]\",\"TUTORIAL\":\"[]\",\"URF_BOT\":\"[]\",\"FIRSTBLOOD_2x2\":\"[]\",\"FIRSTBLOOD_1x1\":\"[]\",\"CLASSIC\":\"[]\",\"RANKED_TEAM_5x5\":\"[]\",\"RANKED_TEAM_3x3\":\"[]\",\"HEXAKILL\":\"[]\",\"BOT\":\"[]\",\"ODIN\":\"[]\",\"ONEFORALL\":\"[]\",\"NORMAL\":\"[]\",\"NORMAL_3x3\":\"[]\",\"BOT_3x3\":\"[]\",\"ARAM\":\"[]\"},\"Mutators\":{\"EnabledMutators\":\"[]\",\"EnabledModes\":\"[\\\"CLASSIC\\\",\\\"TUTORIAL\\\",\\\"ODIN\\\",\\\"ARAM\\\"]\"},\"EndOfGameGifting\":{\"Enabled\":true},\"SkinRentals\":{\"Enabled\":\"PROCESSONLY\"},\"ContextualEducation\":{\"TargetMinionsPerWave\":0.4,\"Enabled\":false,\"MaxTargetSummonerLevel\":10.0},\"DisabledChampionSkins\":{\"DisabledChampionSkins\":\"[]\"},\"EndOfGameGiftSettings\":{\"SenderGiftDailyMax\":5,\"GiftRecipientLevelMin\":5,\"GiftSenderRPMax\":50000,\"RecipientGiftDailyMax\":5,\"GiftSenderLevelMin\":15},\"Chat\":{\"Rename_general_group_throttle\":1.0,\"Default_public_chat_rooms\":\"\"},\"GameInvites\":{\"ServiceEnabled\":true,\"InviteBulkMaxSize\":200,\"LobbyCreationEnabled\":true},\"ContextualEducationURLs\":{\"LAST_HIT\":\"null\"},\"NewPlayerRouter\":{\"QueueID\":\"31\",\"ABDisablingOfTutorial\":true},\"SeasonReward\":{\"Maximum_team_reward_level\":3,\"Enabled\":true,\"ServiceCallEnabled\":true,\"QualificationWarningEnabled\":false,\"Minimum_points_per_reward_level\":\"20,45,75\",\"Minimum_win_team_reward_level_2\":35,\"Minimum_win_team_reward_level_1\":10,\"Minimum_win_team_reward_level_3\":75},\"String\":{\"String\":null},\"LeagueConfig\":{\"IsPreseason\":true,\"MasterTierEnabled\":true,\"PreseasonName\":\"2015\",\"SeasonName\":\"2014\"},\"ChampionTradeService\":{\"Enabled\":true},\"ChampionSelect\":{\"UseOptimizedChampSelectProcessor\":false,\"UseOptimizedSpellSelectProcessor\":false,\"AllChampsAvailableInAram\":false,\"UseOptimizedBotChampionSelectProcessor\":false,\"AutoReconnectEnabled\":false,\"CollatorChampionFilterEnabled\":false},\"FeaturedGame\":{\"MetadataEnabled\":\"OFF\"}}"
                };

                client.InvokeDestReceive("cn-1", "cn-1", "messagingDestination", clientConfig);
            }
        }
Example #8
0
        void ClientCommandReceieved(object sender, CommandMessageReceivedEventArgs e)
        {
            RtmpClient client = sender as RtmpClient;

            if (e.Message.Operation == CommandOperation.Login)
            {
                ClientDynamicConfigurationNotification clientConfig = new ClientDynamicConfigurationNotification
                {
                    Delta = false,
                    //TODO: not have this data stored in code
                    Config = "{\"Chroma\":{\"IsEnabled\":true},\"PlatformShutdown\":{\"Enabled\":false},\"BotConfigurations\":{\"IntermediateInCustoms\":true},\"ShareMatchHistory\":{\"MatchHistoryUrlTemplate\":\"http://matchhistory.oce.leagueoflegends.com/{2}/#login?redirect=%23player-search%2FcurrentAccount%2FOC1%2F{0}\",\"AdvancedGameDetailsUrlTemplate\":\"http://matchhistory.oce.leagueoflegends.com/{2}/#match-details/OC1/{0}/{1}/eog\",\"AdvancedGameDetailsEnabled\":true,\"MatchDetailsUrlTemplate\":\"http://matchhistory.oce.leagueoflegends.com/{2}/#match-details/OC1/{0}/{1}\",\"ShareEndOfGameEnabled\":true,\"ShareGameUrlTemplate\":\"http://matchhistory.oce.leagueoflegends.com/{2}/#match-details/OC1/{0}/{1}/eog\",\"MatchHistoryEnabled\":true},\"GuestSlots\":{\"Enabled\":null},\"ServiceStatusAPI\":{\"Enabled\":true},\"FriendRecommendations\":{\"FaqLink\":\"http://oce.leagueoflegends.com/en/page/faq-add-friends\",\"StatusExpiryMillis\":300000,\"EnableAddFriendButton\":true,\"EnabledPercent\":100,\"ShowToolTip\":true,\"RegistrationPollRateMillis\":5000,\"HideFriends\":false,\"PlayerLevelForNewNotification\":0,\"RegistrationPollDurationMillis\":300000,\"ContactsUrlTemplate\":\"https://recofriender.leagueoflegends.com/v1/contacts/{0}/{1}\",\"ContactDetailsUrlTemplate\":\"https://recofriender.leagueoflegends.com/v1/contactdetails/{0}/{1}/{2}/\",\"AssociationUrlTemplate\":\"https://recofriender.leagueoflegends.com/v1/facebook-oauth?locale={0}\",\"EnableViewAllPanel\":true,\"UnlinkUrlTemplate\":\"https://recofriender.leagueoflegends.com/v1/facebook-oauth/unlink/{0}/{1}\",\"UseNativeFacebookPop\":false},\"GameTimerSync\":{\"Enabled\":false,\"PercentOfTotalTimerToSyncAt\":0.8},\"DockedPrompt\":{\"EnabledNewDockedPromptRenderer\":true},\"QueueRestriction\":{\"ServiceEnabled\":true,\"RankedDuoQueueRestrictionMode\":\"TIER\",\"KarmaEnabled\":false,\"RankedDuoQueueRestrictionMaxDelta\":1,\"RankedDuoQueueDefaultUnseededTier\":\"SILVER\"},\"PartyRewards\":{\"Enabled\":false,\"GameFlowVisualUpdate\":false},\"QueueImages\":{\"OverrideQueueImage\":true},\"SuggestedPlayers\":{\"HonoredPlayersLimit\":4,\"FriendsOfFriendsLimit\":22,\"Enabled\":true,\"OnlineFriendsLimit\":4,\"PreviousPremadesLimit\":4,\"MaxNumSuggestedPlayers\":8,\"VictoriousComradesLimit\":4,\"FriendsOfFriendsEnabled\":true,\"MaxNumReplacements\":22},\"DisabledChampions\":{\"FIRSTBLOOD\":\"[]\",\"KINGPORO\":\"[161]\",\"ARAM_UNRANKED_5x5\":\"[]\",\"ONEFORALL_5x5\":\" []\",\"ASCENSION\":\"[83]\",\"SR_6x6\":\"[]\",\"BILGEWATER\":\"[]\",\"URF\":\"[]\",\"KING_PORO\":\"[161]\",\"ODIN_UNRANKED\":\"[]\",\"NIGHTMARE_BOT\":\"[]\",\"RANKED_SOLO_5x5\":\"[]\",\"TUTORIAL\":\"[]\",\"URF_BOT\":\"[]\",\"FIRSTBLOOD_2x2\":\"[]\",\"FIRSTBLOOD_1x1\":\"[]\",\"CLASSIC\":\"[]\",\"RANKED_TEAM_5x5\":\"[]\",\"COUNTER_PICK\":\"[]\",\"RANKED_TEAM_3x3\":\"[]\",\"HEXAKILL\":\"[]\",\"BOT\":\"[]\",\"ODIN\":\"[]\",\"ONEFORALL\":\"[]\",\"NORMAL\":\"[]\",\"NORMAL_3x3\":\"[]\",\"BOT_3x3\":\"[]\",\"ARAM\":\"[]\"},\"Mutators\":{\"CustomGameMutators\":\"[]\",\"BattleTrainingMutators\":\"[]\",\"EnabledMutators\":\"[\\\"Bilgewater\\\"]\",\"BasicTutorialMutators\":\"[\\\"BasicTutorial\\\"]\",\"EnabledModes\":\"[\\\"CLASSIC\\\",\\\"TUTORIAL\\\",\\\"ODIN\\\",\\\"ARAM\\\"]\"},\"EndOfGameGifting\":{\"Enabled\":true},\"ProfileHoverCard\":{\"IsEnabledForBuddyPanelView\":\"true\",\"ACSLookup\":\"true\",\"IsEnabledForSummonerQuickView\":\"true\",\"IsEnabledForGameLobbySuggestedPlayers\":\"true\",\"IsEnabledForGroupFinderCapViewSuggestedPlayers\":null,\"IsEnabledForChatFriendsList\":\"true\",\"IsEnabledForChatGroupChatParticipants\":\"true\",\"IsEnabledForCustomGameLobby\":\"true\",\"IsEnabled\":\"true\",\"ChampionMasteryLookup\":\"true\",\"IsEnabledForTeamBuilderSuggestedPlayers\":\"true\",\"LeagueLookup\":\"true\"},\"SkinRentals\":{\"Enabled\":\"ON\"},\"ContextualEducation\":{\"TargetMinionsPerWave\":0.4,\"Enabled\":false,\"MaxTargetSummonerLevel\":10.0},\"DisabledChampionSkins\":{\"DisabledChampionSkins\":\"[]\"},\"ChampionMasteryConfig\":{\"Enabled\":true,\"MinSummonerLevel\":5,\"EndOfGameEnabled\":true,\"SupportedQueueTypes\":\"RANKED_SOLO_5x5,RANKED_TEAM_5x5,CAP_5x5,NORMAL,BILGEWATER-5x5\",\"MaxChampionLevel\":5,\"ShowGradeAvailablePopup\":true,\"CapUnlockChampionLevel\":4,\"GradeEnabled\":true},\"EndOfGameGiftSettings\":{\"SenderGiftDailyMax\":5,\"GiftRecipientLevelMin\":5,\"GiftSenderRPMax\":50000,\"RecipientGiftDailyMax\":5,\"GiftSenderLevelMin\":15},\"GameInvites\":{\"ServiceEnabled\":true,\"InviteBulkMaxSize\":200,\"LobbyCreationEnabled\":true},\"Chat\":{\"Rename_general_group_throttle\":1.0,\"Default_public_chat_rooms\":\"\",\"MaximumRosterSize\":325},\"ContextualEducationURLs\":{\"LAST_HIT\":\"null\"},\"NewMatchHistory\":{\"Enabled\":true,\"PostIPXPToLegSEnabled\":true,\"SharingEnabled\":true},\"NewPlayerRouter\":{\"QueueID\":\"31\",\"ABDisablingOfTutorial\":true},\"SeasonReward\":{\"Maximum_team_reward_level\":3,\"Enabled\":true,\"ServiceCallEnabled\":true,\"QualificationWarningEnabled\":true,\"Minimum_points_per_reward_level\":\"20,45,75\",\"Minimum_win_team_reward_level_2\":35,\"Minimum_win_team_reward_level_1\":10,\"Minimum_win_team_reward_level_3\":75},\"String\":{\"String\":null},\"LeagueConfig\":{\"IsPreseason\":false,\"MasterTierEnabled\":true,\"PreseasonName\":\"2015\",\"SeasonName\":\"2015\"},\"ChampionTradeService\":{\"Enabled\":true},\"ChampionSelect\":{\"UseOptimizedChampSelectProcessor\":false,\"UseOptimizedSpellSelectProcessor\":false,\"AllChampsAvailableInAram\":false,\"UseOptimizedBotChampionSelectProcessor\":false,\"AutoReconnectEnabled\":true,\"CollatorChampionFilterEnabled\":false,\"AlwaysShowRewardIcon\":false},\"FeaturedGame\":{\"MetadataEnabled\":\"OFF\"},\"PlatfromShutdown\":{\"Enabled\":false}}"
                };

                client.InvokeDestReceive("cn-200006292", "cn-200006292", "messagingDestination", clientConfig);
            }
        }
Example #9
0
        void LolProxy_ClientCommandReceived(object sender, CommandMessageReceivedEventArgs e)
        {
            if (e.Message.Operation == CommandOperation.Subscribe)
            {
                switch (e.Message.ClientId.Substring(0, 2))
                {
                case "cn":
                    CnChannelId = e.Message.ClientId;
                    break;

                case "gn":
                    GnChannelId = e.Message.ClientId;
                    break;

                case "bc":
                    BcChannelId = e.Message.ClientId;
                    break;
                }
            }
        }
        public void CommandMessageReceivedEventArgsConstructorNullTest()
        {
            CommandMessageReceivedEventArgs target = new CommandMessageReceivedEventArgs(null);

            Assert.Fail("No exception raised.");
        }
Example #11
0
 private void OnCommandMessageReceived(object sender, CommandMessageReceivedEventArgs e)
 {
     e.Result = _remote.InvokeAckAsync(e.InvokeId, null, e.Message).Result;
 }
Example #12
0
        private async void EventReceivedCallback(object sender, EventReceivedEventArgs e)
        {
            try
            {
                Command command;
                object  param;
                switch (e.Event.MessageType)
                {
                case MessageType.UserControlMessage:
                    UserControlMessage userControlMessage = (UserControlMessage)e.Event;
                    if (userControlMessage.EventType == UserControlMessageType.PingRequest)
                    {
                        this.WriteProtocolControlMessage((RtmpEvent) new UserControlMessage(UserControlMessageType.PingResponse, userControlMessage.Values));
                        break;
                    }
                    break;

                case MessageType.CommandAmf3:
                case MessageType.DataAmf0:
                case MessageType.CommandAmf0:
                    command = (Command)e.Event;
                    Method methodCall = command.MethodCall;
                    param = methodCall.Parameters.Length == 1 ? methodCall.Parameters[0] : (object)methodCall.Parameters;
                    if (methodCall.Name == "_result" || methodCall.Name == "_error" || methodCall.Name == "receive")
                    {
                        throw new InvalidDataException();
                    }
                    if (!(methodCall.Name == "onstatus"))
                    {
                        if (methodCall.Name == "connect")
                        {
                            CommandMessage parameter = (CommandMessage)methodCall.Parameters[3];
                            object         obj1;
                            parameter.Headers.TryGetValue("DSEndpoint", out obj1);
                            object obj2;
                            parameter.Headers.TryGetValue("DSId", out obj2);
                            ConnectMessageEventArgs args = new ConnectMessageEventArgs((string)methodCall.Parameters[1], (string)methodCall.Parameters[2], parameter, (string)obj1, (string)obj2, command.InvokeId, (AsObject)command.ConnectionParameters);
                            // ISSUE: reference to a compiler-generated field
                            EventHandler <ConnectMessageEventArgs> connectMessageReceived = this.ConnectMessageReceived;
                            if (connectMessageReceived != null)
                            {
                                ConnectMessageEventArgs e1 = args;
                                connectMessageReceived((object)this, e1);
                            }
                            if (parameter.Operation == CommandOperation.ClientPing)
                            {
                                AsObject asObject1 = await this.InvokeConnectResultAsync(command.InvokeId, (AsObject)args.Result.Body);
                            }
                            else
                            {
                                AsObject asObject2 = await this.InvokeReconnectResultInvokeAsync(command.InvokeId, (AsObject)args.Result.Body);
                            }
                            args = (ConnectMessageEventArgs)null;
                            break;
                        }
                        if (param is RemotingMessage)
                        {
                            RemotingMessage message = param as RemotingMessage;
                            object          obj1;
                            message.Headers.TryGetValue("DSEndpoint", out obj1);
                            object obj2;
                            message.Headers.TryGetValue("DSId", out obj2);
                            string endpoint = (string)obj1;
                            string clientId = (string)obj2;
                            int    invokeId = command.InvokeId;
                            RemotingMessageReceivedEventArgs receivedEventArgs = new RemotingMessageReceivedEventArgs(message, endpoint, clientId, invokeId);
                            // ISSUE: reference to a compiler-generated field
                            EventHandler <RemotingMessageReceivedEventArgs> remotingMessageReceived = this.RemotingMessageReceived;
                            if (remotingMessageReceived != null)
                            {
                                RemotingMessageReceivedEventArgs e1 = receivedEventArgs;
                                remotingMessageReceived((object)this, e1);
                            }
                            if (receivedEventArgs.Error == null)
                            {
                                this.InvokeResult(command.InvokeId, receivedEventArgs.Result);
                                break;
                            }
                            this.InvokeError(command.InvokeId, receivedEventArgs.Error);
                            break;
                        }
                        if (param is CommandMessage)
                        {
                            CommandMessage message = param as CommandMessage;
                            object         obj1;
                            message.Headers.TryGetValue("DSEndpoint", out obj1);
                            object obj2;
                            message.Headers.TryGetValue("DSId", out obj2);
                            string endpoint = obj1 as string;
                            string dsId     = obj2 as string;
                            int    invokeId = command.InvokeId;
                            CommandMessageReceivedEventArgs receivedEventArgs = new CommandMessageReceivedEventArgs(message, endpoint, dsId, invokeId);
                            // ISSUE: reference to a compiler-generated field
                            EventHandler <CommandMessageReceivedEventArgs> commandMessageReceived = this.CommandMessageReceived;
                            if (commandMessageReceived != null)
                            {
                                CommandMessageReceivedEventArgs e1 = receivedEventArgs;
                                commandMessageReceived((object)this, e1);
                            }
                            this.InvokeResult(command.InvokeId, receivedEventArgs.Result);
                            break;
                        }
                        break;
                    }
                    break;
                }
                command = (Command)null;
                param   = (object)null;
            }
            catch (ClientDisconnectedException ex)
            {
            }
        }
Example #13
0
        static void ClientCommandReceieved(object sender, CommandMessageReceivedEventArgs e)
        {
            RtmpClient     client         = sender as RtmpClient;
            SummonerClient targetSummoner = _connectedClients.FirstOrDefault <SummonerClient>(tSum => client.ClientId == tSum._rtmpClient.ClientId);

            if (e.Message.Operation == CommandOperation.Login)
            {
                var configData = new Dictionary <string, dynamic>
                {
                    {
                        "LootConfig",
                        new Dictionary <string, dynamic>
                        {
                            {
                                "NewPlayerChestEnabled",
                                true
                            },
                            {
                                "Enabled",
                                true
                            },
                            {
                                "PurchaseChestsEnabled",
                                true
                            },
                            {
                                "MinSummonerLevel",
                                5
                            },
                            {
                                "Visible",
                                true
                            },
                            {
                                "NoRefundConfirmationEnabled",
                                true
                            },
                            {
                                "EventChestsEnabled",
                                true
                            },
                        }
                    },
                    {
                        "ChampionMasteryConfig",
                        new Dictionary <string, dynamic>
                        {
                            {
                                "Enabled",
                                true
                            },
                            {
                                "MinSummonerLevel",
                                1
                            },
                            {
                                "EndOfGameEnabled",
                                false
                            },
                            {
                                "SupportedQueueTypes",
                                "RANKED_SOLO_5x5,"
                            },
                            {
                                "MaxChampionLevel",
                                5
                            },
                            {
                                "LootChestsEnabled",
                                true
                            },
                            {
                                "ShowGradeAvailablePopup",
                                true
                            },
                            {
                                "ChampionPointQueueTypes",
                                "RANKED_SOLO_5x5,"
                            },
                            {
                                "GradeEnabled",
                                true
                            },
                            {
                                "CapUnlockChampionLevel",
                                5
                            }
                        }
                    }
                };

                ClientDynamicConfigurationNotification clientConfig = new ClientDynamicConfigurationNotification
                {
                    Delta = false,
                    //Config = JsonConvert.SerializeObject(configData)
                    //TODO: not have this data stored in code
                    Config = "{\"Chroma\":{\"IsEnabled\":true},\"LcuAlphaShutdown\":{\"Countdown\":15,\"Enabled\":true},\"Masteries\":{\"ShowPointsResetMessage\":false},\"DisabledChampion\":{\"ODINBOT-5x5\":null},\"PlatformShutdown\":{\"Enabled\":false},\"BotConfigurations\":{\"IntermediateInCustoms\":true},\"ShareMatchHistory\":{\"MatchHistoryUrlTemplate\":\"http://matchhistory.euw.leagueoflegends.com/{2}/#login?redirect=%23player-search%2FcurrentAccount%2FEUW1%2F{0}\",\"AdvancedGameDetailsUrlTemplate\":\"http://matchhistory.euw.leagueoflegends.com/{2}/#match-details/EUW1/{0}/{1}/eog\",\"AdvancedGameDetailsEnabled\":false,\"MatchDetailsUrlTemplate\":\"http://matchhistory.euw.leagueoflegends.com/{2}/#match-details/EUW1/{0}/{1}\",\"ShareEndOfGameEnabled\":true,\"ShareGameUrlTemplate\":\"http://matchhistory.euw.leagueoflegends.com/{2}/#match-details/EUW1/{0}/{1}/eog\",\"MatchHistoryEnabled\":true},\"CustomGame\":{\"BotsAvailableInAram\":false},\"GuestSlots\":{\"Enabled\":null},\"ServiceStatusAPI\":{\"Enabled\":true},\"FriendRecommendations\":{\"FaqLink\":\"http://euw.leagueoflegends.com/{0}/page/features/faq-add-friends\",\"StatusExpiryMillis\":300000,\"EnableAddFriendButton\":true,\"EnabledPercent\":100,\"ShowToolTip\":true,\"RegistrationPollRateMillis\":5000,\"HideFriends\":false,\"PlayerLevelForNewNotification\":5,\"RegistrationPollDurationMillis\":300000,\"ContactsUrlTemplate\":\"https://recofriender.leagueoflegends.com/v1/contacts/{0}/{1}\",\"ContactDetailsUrlTemplate\":\"https://recofriender.leagueoflegends.com/v1/contactdetails/{0}/{1}/{2}/\",\"AssociationUrlTemplate\":\"https://recofriender.leagueoflegends.com/v1/facebook-oauth?locale={0}\",\"EnableViewAllPanel\":true,\"UnlinkUrlTemplate\":\"https://recofriender.leagueoflegends.com/v1/facebook-oauth/unlink/{0}/{1}\",\"UseNativeFacebookPop\":false},\"GameTimerSync\":{\"Enabled\":false,\"PercentOfTotalTimerToSyncAt\":0.8},\"DockedPrompt\":{\"EnabledNewDockedPromptRenderer\":true},\"QueueRestriction\":{\"ServiceEnabled\":true,\"RankedDuoQueueRestrictionMode\":\"TIER\",\"RankedLowSkillRestrictionMaxDelta\":1,\"KarmaEnabled\":true,\"RankedDuoQueueRestrictionMaxDelta\":1,\"RankedHighSkillLowestTier\":\"DIAMOND\",\"RankedLowSkillRestrictionMode\":\"TIER\",\"RankedHighSkillRestrictionMaxDelta\":2,\"RankedHighSkillRestrictionMode\":\"RANK\",\"RankedDuoQueueDefaultUnseededTier\":\"SILVER\"},\"PartyRewards\":{\"Enabled\":false,\"GameFlowVisualUpdate\":false},\"QueueImages\":{\"OverrideQueueImage\":true},\"PlayerFeedbackTool\":{\"BackendUrl\":\"\"},\"TeamBoost\":{\"RandomSkinEnabled\":\"ON\",\"AllSkinEnabled\":\"OFF\"},\"SuggestedPlayers\":{\"HonoredPlayersLimit\":4,\"FriendsOfFriendsLimit\":22,\"Enabled\":true,\"OnlineFriendsLimit\":4,\"PreviousPremadesLimit\":4,\"MaxNumSuggestedPlayers\":8,\"VictoriousComradesLimit\":4,\"FriendsOfFriendsEnabled\":true,\"MaxNumReplacements\":22},\"PersonalizedOffers\":{\"BaseServiceURL\":\"po-service.euw1.leagueoflegends.com\",\"Port\":443,\"ServiceConfig\":\"[{\\\"endpoint\\\":\\\"/player/offers\\\",\\\"version\\\":1,\\\"operation\\\":\\\"GET\\\"},{\\\"endpoint\\\":\\\"/player/offers/accept\\\",\\\"version\\\":1,\\\"operation\\\":\\\"POST\\\"},{\\\"endpoint\\\":\\\"/player/offers/deny\\\",\\\"version\\\":1,\\\"operation\\\":\\\"POST\\\"},{\\\"endpoint\\\":\\\"/player/offers/view\\\",\\\"version\\\":1,\\\"operation\\\":\\\"POST\\\"},{\\\"endpoint\\\":\\\"/player/wallet\\\",\\\"version\\\":1,\\\"operation\\\":\\\"GET\\\"},{\\\"endpoint\\\":\\\"/player/authenticate\\\",\\\"version\\\":1,\\\"operation\\\":\\\"POST\\\"},{\\\"endpoint\\\":\\\"/player/payletter\\\",\\\"version\\\":1,\\\"operation\\\":\\\"GET\\\"}]\",\"ServicePath\":\"personalized-offers/\",\"HubEnabled\":false,\"Protocol\":\"https://\"},\"DisabledChampions\":{\"ARAM_BOT\":\"[]\",\"KINGPORO\":\"[]\",\"FIRSTBLOOD\":\"[]\",\"ARAM_UNRANKED_5x5\":\"[]\",\"ONEFORALL_5x5\":\"[17,30]\",\"ODINBOT-5x5\":\"[14]\",\"ASCENSION\":\"[]\",\"SR_6x6\":\"[]\",\"BILGEWATER\":\"[]\",\"KING_PORO\":\"[]\",\"ODIN_UNRANKED\":\"[]\",\"URF\":\"[]\",\"ODINBOT\":\"[14]\",\"NIGHTMARE_BOT\":\"[]\",\"ODINBOT_5x5\":\"[14]\",\"RANKED_SOLO_5x5\":\"[]\",\"TUTORIAL\":\"[]\",\"URF_BOT\":\"[]\",\"KINGPORO-5X5\":\"[161]\",\"FIRSTBLOOD_1x1\":\"[]\",\"FIRSTBLOOD_2x2\":\"[]\",\"CLASSIC\":\"[]\",\"RANKED_TEAM_5x5\":\"[]\",\"COUNTER_PICK\":\"[]\",\"RANKED_TEAM_3x3\":\"[]\",\"HEXAKILL\":\"[]\",\"BOT\":\"[]\",\"ODIN\":\"[]\",\"RANKED_PREMADE_3x3\":\"[]\",\"ONEFORALL\":\"[17,30]\",\"NORMAL\":\"[]\",\"BOT_3x3\":\"[]\",\"NORMAL_3x3\":\"[]\",\"ARAM\":\"[]\",\"RANKED_PREMADE_5x5\":\"[]\"},\"PersonlizedOffers\":{\"Port\":443,\"BaseServiceURL\":\"po-service.usw2.leagueoflegends.com\",\"ServiceConfig\":\"[{\\\"endpoint\\\":\\\"/player/offers\\\",\\\"version\\\":1,\\\"operation\\\":\\\"GET\\\"},{\\\"endpoint\\\":\\\"/player/offers/accept\\\",\\\"version\\\":1,\\\"operation\\\":\\\"POST\\\"},{\\\"endpoint\\\":\\\"/player/offers/deny\\\",\\\"version\\\":1,\\\"operation\\\":\\\"POST\\\"},{\\\"endpoint\\\":\\\"/player/offers/view\\\",\\\"version\\\":1,\\\"operation\\\":\\\"POST\\\"},{\\\"endpoint\\\":\\\"/player/wallet\\\",\\\"version\\\":1,\\\"operation\\\":\\\"GET\\\"},{\\\"endpoint\\\":\\\"/player/authenticate\\\",\\\"version\\\":1,\\\"operation\\\":\\\"POST\\\"},{\\\"endpoint\\\":\\\"/player/payletter\\\",\\\"version\\\":1,\\\"operation\\\":\\\"GET\\\"}]\",\"HubEnabled\":true,\"ServicePath\":\"personalized-offers/\",\"Protocol\":\"https://\"},\"Mutators\":{\"CustomGameMutators\":\"[]\",\"BattleTrainingMutators\":\"[]\",\"EnabledMutators\":\"[]\",\"BasicTutorialMutators\":\"[\\\"BasicTutorial\\\"]\",\"EnabledModes\":\"[\\\"CLASSIC\\\",\\\"TUTORIAL\\\",\\\"ARAM\\\"]\"},\"EndOfGameGifting\":{\"Enabled\":true},\"ProfileHoverCard\":{\"ACSLookup\":\"true\",\"IsEnabledForBuddyPanelView\":\"true\",\"CreateStringConfiguration\":null,\"IsEnabledForSummonerQuickView\":\"true\",\"IsEnabledForClubChatParticipants\":\"false\",\"IsEnabledForGameLobbySuggestedPlayers\":\"true\",\"IsEnabledForGroupFinderCapViewSuggestedPlayers\":null,\"IsEnabledForChatFriendsList\":\"true\",\"IsEnabledForChatGroupChatParticipants\":\"true\",\"IsEnabledForCustomGameLobby\":\"true\",\"IsEnabled\":\"true\",\"ChampionMasteryLookup\":\"true\",\"LeagueLookup\":\"true\",\"IsEnabledForTeamBuilderSuggestedPlayers\":\"true\"},\"SkinRentals\":{\"Enabled\":\"ON\"},\"ContextualEducation\":{\"TargetMinionsPerWave\":0.4,\"Enabled\":false,\"MaxTargetSummonerLevel\":10.0},\"DisabledChampionSkins\":{\"DisabledChampionSkins\":\"[]\"},\"ChampionMasteryConfig\":{\"Enabled\":true,\"MinSummonerLevel\":5,\"EndOfGameEnabled\":true,\"SupportedQueueTypes\":\"RANKED_SOLO_5x5,RANKED_TEAM_5x5,CAP_5x5,NORMAL,RANKED_PREMADE_3x3,RANKED_PREMADE_5x5,RANKED_TEAM_3x3,NORMAL_3x3,ARAM_UNRANKED_5x5,ASCENSION,KING_PORO\",\"MaxChampionLevel\":5,\"LootChestsEnabled\":true,\"ShowGradeAvailablePopup\":true,\"ChampionPointQueueTypes\":\"RANKED_SOLO_5x5,RANKED_TEAM_5x5,CAP_5x5,NORMAL,KING_PORO,ASCENSION\",\"GradeEnabled\":true,\"CapUnlockChampionLevel\":4},\"WardSkinConfig\":{\"WardSkinSelection\":true},\"EndOfGameGiftSettings\":{\"SenderGiftDailyMax\":5,\"GiftRecipientLevelMin\":5,\"GiftSenderRPMax\":50000,\"RecipientGiftDailyMax\":5,\"GiftSenderLevelMin\":15},\"Esports\":{\"NotificationsAssetMagickURL\":\"http://am-a.akamaihd.net/image/?f=\",\"NotificationsStreamGroupSlug\":\"eu-lcs,na-lcs\",\"NotificationsServiceEndpoint\":\"http://api.lolesports.com/api/v2/streamgroups\",\"NotificationsEnabled\":true,\"NotificationsStreamURL\":\"http://watch.lolesports.com?utm_source=euw_pvp_client\\u0026utm_medium=referral\\u0026utm_campaign=match_notifications\"},\"PlayerPreferences\":{\"Enabled\":true,\"ServiceEndpoint\":\"https://playerpreferences.riotgames.com:443\"},\"GameInvites\":{\"ServiceEnabled\":true,\"GameInviteServiceEnabled\":false,\"InviteBulkMaxSize\":200,\"LobbyCreationEnabled\":true},\"Chat\":{\"Rename_general_group_throttle\":1.0,\"Default_public_chat_rooms\":\"\",\"MaximumRosterSize\":325,\"ChatHistoryEnabled\":true,\"ChatHistoryThreshold\":1.0,\"MobileEnabled\":true},\"NewMatchHistory\":{\"Enabled\":true,\"PostIPXPToLegSEnabled\":true,\"SharingEnabled\":true},\"ContextualEducationURLs\":{\"LAST_HIT\":\"null\"},\"NewPlayerRouter\":{\"QueueID\":\"31\",\"ABDisablingOfTutorial\":true},\"TeamBuilderDraft\":{\"TakeoverEnabled\":true,\"SkinPurchaseEnabled\":false},\"Clubs\":{\"ClubsEnabled\":false,\"InviteToClubLobbyEnabled\":true,\"ClubServiceUrl\":\"https://clubs.leagueoflegends.com/\",\"ClubPresenceDecryptionKey\":\"-----BEGIN RSA PRIVATE KEY-----|MIICXAIBAAKBgQCIPHDgCEhsrODynDW4ecpo5JnQi31Iow9oq4x1pQvtMVynAtrq|zUj9eowbfi2dpcr8+fnpmJIs5+Q8LCT5KC2DmXVdzeDXR1VFh85GL7gSW81QWr0R|y1i/pLI5TIC+x1wx2zu74TmLm2rXCGnPmpYDWiLIg6AaKkgUKPaJe4i3DwIDAQAB|AoGAP1rELxsK+ybmMUy9mr1giKkOcrH7oCTcTJPCbQ9E3Zgf+zbTsW+n6uDrePmT|owVvwXdKZfxitelc9TKeOxQZHbN6ySjYmPWYRpzRzTK028TCxSoFA4Gbw7Y5pvCF|w6efflWMZFcbCY5pIhSRtl++hSk/xVTemXalEvnbIqMeZaECQQDXAAaurwa8D+6J|zcoZg1vBlQMOlxWEcZ8DBRXnC4K12EY2CXVCMHecCo3xPEw3zGi5bo9Hs9eff1j7|6E4AeZT/AkEAojdHA6DpZbjNKNIKzZbgo1q3aeHRHRpwYzRBdSjcxQrhS+JE2D5A|ZSAOg1OfnRuph+iOxaNHparSntAWLv2N8QJAYnyTkw+AMUPHDH8lVfyTWqDs7pEM|/UejBJoex2DBdpVkzDoW6cQT9nnrPZdWfrT3QAJCRiE+48RNOc/Xc2Y+dwJAHQvW|3HB4um0v10pdAtksWjPJOd1ki1iLnUfjHK53cZT0KJlYiHwFHdZyotNbdk9YuOxM|fFkzYBfJZQSPpFRkkQJBALAlNqBc4VPBKiwgBN9sHexfgCsVEnedrXsTsWXj1tCY|nK4RQUMFTs3uDucwju0fgLeef25CSdxxKBi2j1QhlzI=|-----END RSA PRIVATE KEY-----\"},\"SeasonReward\":{\"Maximum_team_reward_level\":3,\"Enabled\":false,\"ServiceCallEnabled\":true,\"QualificationWarningEnabled\":true,\"Minimum_points_per_reward_level\":\"20,45,75\",\"Minimum_win_team_reward_level_2\":35,\"Minimum_win_team_reward_level_1\":10,\"Minimum_win_team_reward_level_3\":75},\"LootConfig\":{\"NewPlayerChestEnabled\":true,\"Enabled\":true,\"PurchaseChestsEnabled\":true,\"MinSummonerLevel\":5,\"Visible\":true,\"NoRefundConfirmationEnabled\":false,\"EventChestsEnabled\":false},\"LeagueConfig\":{\"PromoHelperEnabled\":true,\"IsPreseason\":false,\"MasterTierEnabled\":true,\"PreseasonName\":\"2016\",\"SeasonName\":\"2016\"},\"ChampionTradeService\":{\"Enabled\":true},\"ChampionSelect\":{\"UseOptimizedChampSelectProcessor\":false,\"UseOptimizedSpellSelectProcessor\":false,\"AllChampsAvailableInAram\":false,\"UseOptimizedBotChampionSelectProcessor\":false,\"AutoReconnectEnabled\":true,\"CollatorChampionFilterEnabled\":false,\"AlwaysShowRewardIcon\":false},\"FeaturedGame\":{\"MetadataEnabled\":\"OFF\"}}"
                };

                client.InvokeDestReceive("cn-" + targetSummoner._accId, "cn-" + targetSummoner._accId, "messagingDestination", clientConfig);
            }
        }
Example #14
0
        private async void EventReceivedCallback(object sender, EventReceivedEventArgs e)
        {
            try
            {
                switch (e.Event.MessageType)
                {
                case MessageType.UserControlMessage:
                    var m = (UserControlMessage)e.Event;
                    if (m.EventType == UserControlMessageType.PingRequest)
                    {
                        WriteProtocolControlMessage(new UserControlMessage(UserControlMessageType.PingResponse,
                                                                           m.Values));
                    }
                    break;

                case MessageType.DataAmf3:
#if DEBUG
                    // Have no idea what the contents of these packets are.
                    // Study these packets if we receive them.
                    Debugger.Break();
#endif
                    break;

                case MessageType.CommandAmf3:
                case MessageType.DataAmf0:
                case MessageType.CommandAmf0:
                    var command = (Command)e.Event;
                    var call    = command.MethodCall;

                    var param = call.Parameters.Length == 1 ? call.Parameters[0] : call.Parameters;
                    if (call.Name == "_result" || call.Name == "_error" || call.Name == "receive")
                    {
                        //should not happen here
                        throw new InvalidDataException();
                    }
                    if (call.Name == "onstatus")
                    {
                        Debug.Print("Received status.");
                    }
                    else if (call.Name == "connect")
                    {
                        var    message = (CommandMessage)call.Parameters[3];
                        object endpoint;
                        message.Headers.TryGetValue(AsyncMessageHeaders.Endpoint, out endpoint);
                        object id;
                        message.Headers.TryGetValue(AsyncMessageHeaders.ID, out id);
                        //ClientId = (string) id;

                        var args = new ConnectMessageEventArgs((string)call.Parameters[1],
                                                               (string)call.Parameters[2], message, (string)endpoint, (string)id, command.InvokeId,
                                                               (AsObject)command.ConnectionParameters);
                        if (ConnectMessageReceived != null)
                        {
                            ConnectMessageReceived(this, args);
                        }
                        if (message.Operation == CommandOperation.ClientPing)
                        {
                            await InvokeConnectResultAsync(command.InvokeId, (AsObject)args.Result.Body);
                        }
                        else
                        {
                            await InvokeReconnectResultInvokeAsync(command.InvokeId, (AsObject)args.Result.Body);
                        }
                    }
                    else if (param is RemotingMessage)
                    {
                        var message = param as RemotingMessage;

                        object endpoint;
                        message.Headers.TryGetValue(AsyncMessageHeaders.Endpoint, out endpoint);
                        object id;
                        message.Headers.TryGetValue(AsyncMessageHeaders.ID, out id);

                        var args = new RemotingMessageReceivedEventArgs(message, (string)endpoint, (string)id,
                                                                        command.InvokeId);
                        if (RemotingMessageReceived != null)
                        {
                            RemotingMessageReceived(this, args);
                        }
                        if (args.Error == null)
                        {
                            InvokeResult(command.InvokeId, args.Result);
                        }
                        else
                        {
                            InvokeError(command.InvokeId, args.Error);
                        }
                    }
                    else if (param is CommandMessage)
                    {
                        var message = param as CommandMessage;

                        object endpoint;
                        message.Headers.TryGetValue(AsyncMessageHeaders.Endpoint, out endpoint);
                        object id;
                        message.Headers.TryGetValue(AsyncMessageHeaders.ID, out id);

                        var args = new CommandMessageReceivedEventArgs(message, endpoint as string, id as string,
                                                                       command.InvokeId);
                        if (CommandMessageReceived != null)
                        {
                            CommandMessageReceived(this, args);
                        }
                        InvokeResult(command.InvokeId, args.Result);
                    }
                    else
                    {
#if DEBUG
                        Debug.Print("Unknown RTMP Command: " + call.Name);
                        Debugger.Break();
#endif
                    }
                    break;
                }
            }
            catch (ClientDisconnectedException)
            {
                //Close();
            }
        }