Exemplo n.º 1
0
        protected override void Main_Loop()
        {
            Init();

            string login    = UserInput(TEXT_SET_LOGIN);
            string password = UserInput(TEXT_SET_PASSWORD);

            NotyficationFree(TEXT_IN_PROGRESS);

            SerwerClient client   = new SerwerClient();
            Request      request  = Request.Create.Auth.Login(login, password);
            Response     response = client.SendRequest(request);

            if (response.JsonCode == "OK")
            {
                Notyfication(TEXT_LOGIN_OK);
                new SelectCharacter().Run();
            }
            else
            {
                Notyfication(TEXT_LOGIN_BAD);
            }

            base.Main_Loop();
        }
Exemplo n.º 2
0
        protected override void Main_Loop()
        {
            Init();

            string login    = UserInput(TEXT_SET_LOGIN);
            string password = UserInput(TEXT_SET_PASSWORD);
            string email    = UserInput(TEXT_SET_EMAIL);

            if (CheckPassword(password) && CheckLogin(login))
            {
                NotyficationFree(TEXT_CREATING_ACC);
                SerwerClient client   = new SerwerClient();
                Request      req      = Request.Create.Auth.Register(login, password, email);
                Response     response = client.SendRequest(req);

                if (response.JsonCode == "LOGIN_ERROR")
                {
                    Notyfication(TEXT_LOGIN_ERROR);
                }
                if (response.JsonCode == "OK")
                {
                    Notyfication(TEXT_ACC_WAS_CREATED); new MainMenu().Run();
                }
            }
            base.Main_Loop();
        }