Esempio n. 1
0
        private void inviteSummonerBtn_Click(object sender, EventArgs e)
        {
            Lobby lobby = null;

            try
            {
                lobby = QsoApi.GetMyLobby();
            }
            catch (QsoEndpointException) { }

            Summoner sum = null;

            try
            {
                var found = QsoApi.GetSummonerByName(inviteSummonerTextbox.Text);
                if (found.Length <= 0)
                {
                    MessageBox.Show("Unable to find summoner", "Missing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                sum = found[0];
            }
            catch (QsoEndpointException ex)
            {
                MessageBox.Show($"Error trying to find summoner:\n{ex.ErrorResponse.Message}", "Endpoint Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            lobby.Invite(sum.ID);
        }
Esempio n. 2
0
        private void addBotBtn_Click(object sender, EventArgs e)
        {
            if (botChampionCombo.SelectedItem == null || botTeamCombo.SelectedItem == null || botDifficultyCombo.SelectedItem == null)
            {
                return;
            }
            Lobby lobby = null;

            try
            {
                lobby = QsoApi.GetMyLobby();
            }
            catch (QsoEndpointException)
            {
                return; // lobby doesn't exist, no need for user response.
            }

            try
            {
                lobby.AddBot((ChampionID)Enum.Parse(typeof(ChampionID), (string)botChampionCombo.SelectedItem), (TeamID)Enum.Parse(typeof(TeamID), (string)botTeamCombo.SelectedItem), (string)botDifficultyCombo.SelectedItem);
            }
            catch (QsoEndpointException ex)
            {
                MessageBox.Show($"Unable to add bot to lobby with such configuration:\n{ex.ErrorResponse.Message}", "Endpoint Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 3
0
 private void forceStartLobbyBtn_Click(object sender, EventArgs e)
 {
     try
     {
         QsoApi.GetMyLobby().StartChampSelect();
     }
     catch (QsoEndpointException) { }
 }