Exemple #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);
        }