Пример #1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            RequestServer newreq = new RequestServer();
            ParserJSON parser = new ParserJSON();

            try
            {
                var addr = new System.Net.Mail.MailAddress(txtUsername.Text);
                s.tokenConnection = parser.ServerConnect(newreq.ServerConnect("", txtPassword.Text, txtUsername.Text));
            }
            catch
            {
                s.tokenConnection = parser.ServerConnect(newreq.ServerConnect(txtUsername.Text, txtPassword.Text, ""));
            }

            if (s.tokenConnection.connectionAccepted == true)
            {
                s.tokenConnection.Nickname = txtUsername.Text;
                s.AffProfil();
            }
            else
            {
                MessageBox.Show("Informations de connection incorrectes.");
            }
        }
Пример #2
0
 private void btnDeleteDeck_Click(object sender, EventArgs e)
 {
     ParserJSON    parser = new ParserJSON();
     RequestServer newreq = new RequestServer();
     String        rsp    = newreq.DeleteDeck(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok, currentDeck.deck_id.ToString());
     //  decksList = parser.DeckAll(newreq.DeckAll(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok));
 }
Пример #3
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            RequestServer newreq = new RequestServer();
            ParserJSON    parser = new ParserJSON();

            try
            {
                var addr = new System.Net.Mail.MailAddress(txtUsername.Text);
                s.tokenConnection = parser.ServerConnect(newreq.ServerConnect("", txtPassword.Text, txtUsername.Text));
            }
            catch
            {
                s.tokenConnection = parser.ServerConnect(newreq.ServerConnect(txtUsername.Text, txtPassword.Text, ""));
            }

            if (s.tokenConnection.connectionAccepted == true)
            {
                s.tokenConnection.Nickname = txtUsername.Text;
                s.AffProfil();
            }
            else
            {
                MessageBox.Show("Informations de connection incorrectes.");
            }
        }
Пример #4
0
 private void btnDeleteDeck_Click(object sender, EventArgs e)
 {
     ParserJSON parser = new ParserJSON();
     RequestServer newreq = new RequestServer();
     String rsp = newreq.DeleteDeck(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok, currentDeck.deck_id.ToString());
       //  decksList = parser.DeckAll(newreq.DeckAll(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok));
 }
Пример #5
0
        private void    InitializeClientInfos()
        {
            ParserJSON    parser = new ParserJSON();
            RequestServer newreq = new RequestServer();

            s.client = parser.InfosPlayer(newreq.InfosPlayer(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok));
        }
Пример #6
0
        private void btnCreateDeck_Click(object sender, EventArgs e)
        {
            ParserJSON parser = new ParserJSON();
            RequestServer newreq = new RequestServer();
            String rsp = newreq.CreateDeck(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok, currentDeck.deck_name, "");
            MessageBox.Show("CREATE DECK ? : " + rsp);

            //decksList = parser.DeckAll(newreq.DeckAll(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok));
        }
Пример #7
0
        private void btnCreateDeck_Click(object sender, EventArgs e)
        {
            ParserJSON    parser = new ParserJSON();
            RequestServer newreq = new RequestServer();
            String        rsp    = newreq.CreateDeck(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok, currentDeck.deck_name, "");

            MessageBox.Show("CREATE DECK ? : " + rsp);

            //decksList = parser.DeckAll(newreq.DeckAll(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok));
        }
Пример #8
0
        private void    FirstConnection()
        {
            //MessageBox.Show("Premiere co");
            ParserJSON    parser = new ParserJSON();
            RequestServer newreq = new RequestServer();

            s.client = parser.InfosPlayer(newreq.ProfilCreation(s.tokenConnection.Nickname, s.tokenConnection.Tok));
            //MessageBox.Show(tmp.nickname);
            //pnlChooseClass.Show();
        }
        private void setRankingLocalProfilsInfos()
        {
            tabPageLocal.Controls.Clear();
            ParserJSON parser = new ParserJSON();
            RequestServer newreq = new RequestServer();

            String rsp = newreq.RankOverall(p.s.client.profile_id, "nat", p.s.tokenConnection.Tok);
            ClientInfos_List tmp = parser.RankOverall(rsp);
            YPanelLocation = 1;
            for (int i = 0; i < tmp.data.Count(); i++)
            {
                tabPageFriends.Controls.Add(getRankingProfilInfos(tmp.data[i]));
            }
        }
Пример #10
0
        private void setRankingLocalProfilsInfos()
        {
            tabPageLocal.Controls.Clear();
            ParserJSON    parser = new ParserJSON();
            RequestServer newreq = new RequestServer();

            String           rsp = newreq.RankOverall(p.s.client.profile_id, "nat", p.s.tokenConnection.Tok);
            ClientInfos_List tmp = parser.RankOverall(rsp);

            YPanelLocation = 1;
            for (int i = 0; i < tmp.data.Count(); i++)
            {
                tabPageFriends.Controls.Add(getRankingProfilInfos(tmp.data[i]));
            }
        }
Пример #11
0
        private void    InitializeDeckEditor()
        {
            ParserJSON    parser = new ParserJSON();
            RequestServer newreq = new RequestServer();

            String rsp = newreq.DeckAll(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok);

            decksList = parser.DeckAll(rsp);
            if (decksList.data.Count > 0)
            {
                currentDeck = decksList.data[0];
            }
            else
            {
                currentDeck = newDeck;
            }
            UpdateDeckInfos();
        }
Пример #12
0
        private void button1_Click(object sender, EventArgs e)
        {
            ParserJSON    parser = new ParserJSON();
            RequestServer newreq = new RequestServer();

            decksList     = parser.DeckAll(newreq.DeckAll(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok));
            currentDeckIt = 0;
            InitializeNewDeck();
            if (decksList.data.Count() > 0)
            {
                currentDeck = decksList.data[currentDeckIt];
            }
            else
            {
                currentDeck = newDeck;
            }
            UpdateDeckInfos();
        }
Пример #13
0
        private void    InitializeAllCardList()
        {
            ParserJSON parser = new ParserJSON();

            Console.WriteLine("HERE IN INIT CARD LIST");
            // Read the file as one string.
            System.IO.StreamReader myFile = new System.IO.StreamReader("C:\\Users\\PrincessCaroline\\Documents\\GitHub\\EIP-Sowaj-Launcher\\Sowaj\\Sowaj\\cards.json");
            string JsonAllCardList        = myFile.ReadToEnd();

            myFile.Close();

            CardsSingleton allCardsList_Singleton = CardsSingleton.Instance;

            allCardsList_Singleton.AllCardsList = parser.AllCardsList(JsonAllCardList);
            Console.WriteLine("HELOOOO");
            Console.WriteLine("THERE IS : [" + allCardsList_Singleton.AllCardsList.data.Count() + "] CARDS");
            foreach (CardInfos element in allCardsList_Singleton.AllCardsList.data)
            {
                Console.WriteLine("[" + element.className + "] ");
            }
//            Console.WriteLine(JsonAllCardList);
        }
Пример #14
0
        private void btnRenameDeck_Click(object sender, EventArgs e)
        {
            RequestServer newreq = new RequestServer();
            ParserJSON    parser = new ParserJSON();

            if (txtDeckName.Text != "")
            {
/*                if (currentDeck != newDeck)
 *              {
 *                  String rsp = newreq.ModifyDeck(currentDeck.profile_id.ToString(),
 *                                                 s.tokenConnection.Tok,
 *                                                 currentDeck.deck_name,
 *                                                 "",
 *                                                 "action=modify",
 *                                                 currentDeck.deck_id.ToString());
 *                  MessageBox.Show("MODIFY DECK? : " + rsp);
 *                  //decksList = parser.DeckAll(newreq.DeckAll(currentDeck.profile_id.ToString(), s.tokenConnection.Tok));
 *              } */
                currentDeck.deck_name = txtDeckName.Text;
            }
            txtDeckName.Hide();
            btnRenameDeck.Hide();
            UpdateDeckInfos();
        }
Пример #15
0
        private void btnRenameDeck_Click(object sender, EventArgs e)
        {
            RequestServer newreq = new RequestServer();
            ParserJSON parser = new ParserJSON();

            if (txtDeckName.Text != "")
            {
            /*                if (currentDeck != newDeck)
                {
                    String rsp = newreq.ModifyDeck(currentDeck.profile_id.ToString(),
                                                   s.tokenConnection.Tok,
                                                   currentDeck.deck_name,
                                                   "",
                                                   "action=modify",
                                                   currentDeck.deck_id.ToString());
                    MessageBox.Show("MODIFY DECK? : " + rsp);
                    //decksList = parser.DeckAll(newreq.DeckAll(currentDeck.profile_id.ToString(), s.tokenConnection.Tok));
                } */
                currentDeck.deck_name = txtDeckName.Text;
            }
            txtDeckName.Hide();
            btnRenameDeck.Hide();
            UpdateDeckInfos();
        }
Пример #16
0
        private void InitializeAllCardList()
        {
            ParserJSON parser = new ParserJSON();
            Console.WriteLine("HERE IN INIT CARD LIST");
            // Read the file as one string.
            System.IO.StreamReader myFile = new System.IO.StreamReader("C:\\Users\\PrincessCaroline\\Documents\\GitHub\\EIP-Sowaj-Launcher\\Sowaj\\Sowaj\\cards.json");
            string JsonAllCardList = myFile.ReadToEnd();
            myFile.Close();

            CardsSingleton allCardsList_Singleton = CardsSingleton.Instance;
            allCardsList_Singleton.AllCardsList = parser.AllCardsList(JsonAllCardList);
            Console.WriteLine("HELOOOO");
            Console.WriteLine("THERE IS : [" + allCardsList_Singleton.AllCardsList.data.Count() + "] CARDS");
            foreach (CardInfos element in allCardsList_Singleton.AllCardsList.data)
            {
                Console.WriteLine("[" + element.className + "] ");
            }
            //            Console.WriteLine(JsonAllCardList);
        }
Пример #17
0
        private void FirstConnection()
        {
            //MessageBox.Show("Premiere co");
            ParserJSON parser = new ParserJSON();
            RequestServer newreq = new RequestServer();

            s.client = parser.InfosPlayer(newreq.ProfilCreation(s.tokenConnection.Nickname, s.tokenConnection.Tok));
            //MessageBox.Show(tmp.nickname);
            //pnlChooseClass.Show();
        }
Пример #18
0
        private void button1_Click(object sender, EventArgs e)
        {
            ParserJSON parser = new ParserJSON();
            RequestServer newreq = new RequestServer();

            decksList = parser.DeckAll(newreq.DeckAll(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok));
            currentDeckIt = 0;
            InitializeNewDeck();
            if (decksList.data.Count() > 0)
                currentDeck = decksList.data[currentDeckIt];
            else
                currentDeck = newDeck;
            UpdateDeckInfos();
        }
Пример #19
0
        private void InitializeClientInfos()
        {
            ParserJSON parser = new ParserJSON();
            RequestServer newreq = new RequestServer();

            s.client = parser.InfosPlayer(newreq.InfosPlayer(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok));
        }
Пример #20
0
        private void InitializeDeckEditor()
        {
            ParserJSON parser = new ParserJSON();
            RequestServer newreq = new RequestServer();

            String rsp = newreq.DeckAll(s.tokenConnection.Profiles[0].ToString(), s.tokenConnection.Tok);
            decksList = parser.DeckAll(rsp);
            if (decksList.data.Count > 0)
                currentDeck = decksList.data[0];
            else
                currentDeck = newDeck;
            UpdateDeckInfos();
        }