Ejemplo n.º 1
0
    private void OnAccountLogOnResponse(byte[] buffer)
    {
        AccountLogOnResponseProto proto = AccountLogOnResponseProto.GetProto(buffer);

        if (!proto.IsSuccess)
        {
            TipsUtil.ShowTextTips(1000111);
        }
        else
        {
            //登录成功
            //TipsUtil.ShowTextTips("用户编号 = " + proto.UserId);
            if (m_LogOnWindow != null)
            {
                Stat.LogOn(proto.UserId, m_LogOnWindow.IFAccount.text);
                PlayerPrefsUtil.SetAccountID(proto.UserId);
                PlayerPrefsUtil.SetAccountUserName(m_LogOnWindow.IFAccount.text);
                PlayerPrefsUtil.SetAccountPwd(m_LogOnWindow.IFPwd.text);
                m_LogOnWindow.CloseAndOpenNext(Window.GameServerEnter);
            }
            else
            {
                Stat.Register(proto.UserId, PlayerPrefsUtil.GetAccountUserName());
                WindowManager.Instance.OpenWindow(Window.GameServerEnter);
            }
            GlobalInit.Instance.AccountId       = proto.UserId;
            GlobalInit.Instance.AccountUserName = PlayerPrefsUtil.GetAccountUserName();
        }
    }
Ejemplo n.º 2
0
 /// <summary> 快速登录 </summary>
 public void QuickLogOn()
 {
     //PlayerPrefs.DeleteAll();
     //1.首先判断本地账号
     //2.如果本地没有账号,则进入注册界面
     //3.如果本地有账号,则自动登录,登录成功后 进入游戏界面(选区)
     if (!PlayerPrefs.HasKey(ConstDefine.LogOn_AccountID))
     {
         OpenRegisterWindow();
     }
     else
     {
         LogOn(PlayerPrefsUtil.GetAccountUserName(), PlayerPrefsUtil.GetAccountPwd());
     }
 }