void LateUpdate()
    {
        //change login status
        LOGIN_STEP step = LOGIN_STEP.LOGIN_FAILED;

        switch (step)
        {
        case LOGIN_STEP.NOT_START:
            _loginStatus.text = "login not start";
            break;

        case LOGIN_STEP.LOGINING:
            _loginStatus.text = "begin login ...";
            break;

        case LOGIN_STEP.LOGIN_RECONNECTING:
            _loginStatus.text = "Login failed, reconnect ...";
            break;

        case LOGIN_STEP.LOGIN_OK:
            _loginStatus.text   = "login success!";
            _continueLabel.text = "online play";
            NGUITools.SetActive(_continueButton, true);
            //OnClickOK(); //auto-enter game
            break;

        case LOGIN_STEP.LOGIN_FAILED:
            _loginStatus.text   = "login failed!";
            _continueLabel.text = "offline debug";
            NGUITools.SetActive(_continueButton, true);
            break;
        }
    }
Esempio n. 2
0
    private void OnServiceFail(int reason)
    {
        loginStep = LOGIN_STEP.NONE;
        switch (reason)
        {
        case 0:
            MessageBoxMgr.Instance.AddMessage(StringMgr.Instance.Get("NETWORK_FAIL"));
            break;

        case 1:
            MessageBoxMgr.Instance.AddMessage(StringMgr.Instance.Get("SERVICE_CROWDED"));
            break;
        }
    }
Esempio n. 3
0
 private void OnRoundRobin()
 {
     DialogManager.Instance.CloseAll();
     CSNetManager.Instance.SwitchAfter = new SockTcp();
     if (CSNetManager.Instance.SwitchAfter.Open(CSNetManager.Instance.BfServer, CSNetManager.Instance.BfPort))
     {
         if (CSNetManager.Instance.Sock != null)
         {
             CSNetManager.Instance.Sock.Close();
         }
         loginStep = LOGIN_STEP.WAITING_SEED;
     }
     else
     {
         loginStep = LOGIN_STEP.NONE;
         MessageBoxMgr.Instance.AddMessage(StringMgr.Instance.Get("NETWORK_FAIL"));
     }
 }
Esempio n. 4
0
 private void OnSeed()
 {
     if (GlobalVars.Instance.bRemember)
     {
         GlobalVars.Instance.strMyID = id;
     }
     loginStep = LOGIN_STEP.WAITING_LOGIN;
     if (BuildOption.Instance.IsAxeso5)
     {
         using (MD5 md5Hash = MD5.Create())
         {
             string md5Hash2 = GetMd5Hash(md5Hash, pswd);
             CSNetManager.Instance.Sock.SendCS_LOGIN_TO_AXESO5_REQ(id, md5Hash2, BuildOption.Instance.Major, BuildOption.Instance.Minor);
         }
     }
     else
     {
         CSNetManager.Instance.Sock.SendCS_LOGIN_REQ(id, pswd, BuildOption.Instance.Major, BuildOption.Instance.Minor);
     }
 }
Esempio n. 5
0
    private void Reset()
    {
        loginStep      = LOGIN_STEP.NONE;
        welcomeMessage = StringMgr.Instance.Get(WelcomeMessages[Random.Range(0, WelcomeMessages.Length)]);
        BuildOption.Instance.ResetSingletons();
        guiOnce       = false;
        returnPressed = false;
        dtFocus       = 0f;
        pswd          = string.Empty;
        hostedServer  = false;
        string @string = PlayerPrefs.GetString("myID", string.Empty);

        if (@string.Length <= 0)
        {
            GlobalVars.Instance.bRemember = false;
        }
        else
        {
            id = @string;
            GlobalVars.Instance.bRemember = true;
            bFocusPswd = true;
        }
    }
Esempio n. 6
0
 private void OnLoginFailMessage(string message)
 {
     MessageBoxMgr.Instance.AddMessage(message);
     loginStep = LOGIN_STEP.NONE;
 }
Esempio n. 7
0
 private void OnLoginFail()
 {
     loginStep = LOGIN_STEP.NONE;
 }