コード例 #1
0
        private async void StartGameButton_Click(object sender, RoutedEventArgs e)
        {
            MatchMakerParams pareams = new MatchMakerParams();
            pareams.InvitationId = 8649134;
            pareams.QueueIds = new int[1] { 2 };
            pareams.Team = new List<int>();
            pareams.Team.Add(222908);
            pareams.Team.Add(499467);
            SearchingForMatchNotification par = await RiotCalls.AttachTeamToQueue(pareams);

            Client.Message("sum222908", "<body><inviteId>8649134</inviteId><userName>Snooowl</userName><profileIconId>576</profileIconId><gameType>NORMAL_GAME</gameType><groupId></groupId><seasonRewards>-1</seasonRewards><mapId>1</mapId><queueId>2</queueId><gameMode>classic_pvp</gameMode><gameDifficulty></gameDifficulty></body>", ChatSubjects.VERIFY_INVITEE);
        }
コード例 #2
0
        private async void QueueButton_Click(object sender, RoutedEventArgs e)
        {
            if (IsInGame())
                return;
            //to queue
            bool Join = InQueue;
            LastSender = (Button)sender;

            if (InQueue == false)
            {
                var settings = (QueueButtonConfig)LastSender.Tag;
                var config = (GameQueueConfig)settings.GameQueueConfig;
                //Make TeamBuilder Work for solo
                if(config.TypeString.Contains("BOT"))
                {
                    if (Queues.Contains(config.Id))
                        return;

                    Queues.Add(config.Id);
                    var parameters = new MatchMakerParams
                    {
                        QueueIds = new[]
                        {
                            Convert.ToInt32(config.Id)
                        },
                        BotDifficulty = settings.BotLevel
                    };
                    Client.QueueId = config.Id;

                    param = parameters;
                    EnteredQueue(await RiotCalls.AttachToQueue(parameters));
                }
                else if (config.Id != 61)
                {
                    if (Queues.Contains(config.Id))
                        return;

                    Queues.Add(config.Id);
                    var parameters = new MatchMakerParams
                    {
                        QueueIds = new[]
                        {
                            Convert.ToInt32(config.Id)
                        }
                    };
                    Client.QueueId = config.Id;
                    param = parameters;
                    EnteredQueue(await RiotCalls.AttachToQueue(parameters));
                }
                else if (config.Id == 61)
                {
                    LobbyStatus lobby = await RiotCalls.CreateArrangedTeamLobby(config.Id);
                    Client.ClearPage(typeof (TeamBuilderPage));
                    Client.SwitchPage(new TeamBuilderPage(false, lobby));
                }
            }
            if (!Join)
                return;

            if (t.Enabled)
            {
                t.Stop();
                t.Close();
            }

            await Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() => LastSender.Content = "Queue (Beta)"));
            InQueue = false;
            Client.GameStatus = "outOfGame";
            Client.SetChatHover();
            await LeaveAllQueues();
        }
コード例 #3
0
#pragma warning disable 4014

        private async void StartGameButton_Click(object sender, RoutedEventArgs e)
        {
            if (!inQueue)
            {
                parameters = new MatchMakerParams();
                parameters.Languages = null;
                QueueIds = new List<int>();
                QueueIds.Add(queueId);
                parameters.QueueIds = (QueueIds.ToArray());
                parameters.InvitationId = CurrentLobby.InvitationID;
                parameters.TeamId = null;
                parameters.LastMaestroMessage = null;
                var InviteList = new List<int>();
                foreach (Member stats in CurrentLobby.Members)
                {
                    int GameInvitePlayerList = Convert.ToInt32(stats.SummonerId);
                    InviteList.Add(GameInvitePlayerList);
                }
                parameters.Team = InviteList;
                parameters.TeamId = selectedTeamId;
                parameters.BotDifficulty = botDifficulty;
                EnteredQueue(await RiotCalls.AttachTeamToQueue(parameters));
            }
            else
            {
                RiotCalls.PurgeFromQueues();
                setStartButtonText("Start Game");
                inQueue = false;
                Client.GameStatus = "outOfGame";
                Client.SetChatHover();
                Dispatcher.Invoke(() =>
                {
                    Client.inQueueTimer.Visibility = Visibility.Hidden;
                    TeamListView.Opacity = 1D;
                });
            }
        }