예제 #1
0
        public void Logon(AccountInfo rd)
        {
            NormalAccountInfo ad = new NormalAccountInfo();

            ad.UID = rd.UID;
            CL_Cmd_AccountLogon ncb = new CL_Cmd_AccountLogon();

            ncb.SetCmdType(NetCmdType.CMD_CL_AccountLogon);
            ncb.AccountName = rd.UID;
            if (NativeInterface.ComputeCrc(ad.UID, rd.PWD, out ad.CRC1, out ad.CRC2, out ad.CRC3))
            {
                ncb.PasswordCrc1 = ad.CRC1;
                ncb.PasswordCrc2 = ad.CRC2;
                ncb.PasswordCrc3 = ad.CRC3;
            }
            accountInfo     = rd;
            ncb.VersionID   = ServerSetting.ClientVer;
            ncb.PlateFormID = (Byte)UIDevice.GetPlatformString();
            ncb.PathCrc     = ServerSetting.RES_VERSION;
            ncb.MacAddress  = UIDevice.GetMacAddress();
            Debug.Log("发送登录......");
            //发送命令
            NetManager.Instance.Send <CL_Cmd_AccountLogon>(ncb);
            return;
        }
예제 #2
0
        public void RegisterLogon(AccountInfo rd)
        {
            if (m_State != LogonState.LOGON_INIT)
            {
                return;
            }
            NormalAccountInfo ad = new NormalAccountInfo();

            ad.UID = rd.UID;
            CL_Cmd_AccountRsg ncb = new CL_Cmd_AccountRsg();

            ncb.SetCmdType(NetCmdType.CMD_CL_AccountRsg);
            ncb.AccountName = rd.UID;
            if (!NativeInterface.ComputeCrc(ad.UID, rd.PWD, out ad.CRC1, out ad.CRC2, out ad.CRC3))
            {
                ncb.PasswordCrc1 = ad.CRC1;
                ncb.PasswordCrc2 = ad.CRC2;
                ncb.PasswordCrc3 = ad.CRC3;
            }
            ncb.MacAddress  = UIDevice.GetMacAddress();
            ncb.VersionID   = ServerSetting.ClientVer;
            ncb.PlateFormID = (Byte)UIDevice.GetPlatformString();
            ncb.PathCrc     = ServerSetting.RES_VERSION;

            //发送命令
            NetManager.Instance.Send <CL_Cmd_AccountRsg>(ncb);
        }
예제 #3
0
 public void LoadTempAccountInfo()
 {
     if (TempAccountInfo.UID != null && TempAccountInfo.UID != "")
     {
         AccountInfo = TempAccountInfo;
         TempAccountInfo.Clear();
     }
 }
예제 #4
0
파일: RoleInfo.cs 프로젝트: Pircs/Fishing-1
    public bool ChangeSecPassword(string OldPassword, string NewPassword)
    {
        //修改二级密码
        CL_Cmd_ChangeSecondPassword ncb = new CL_Cmd_ChangeSecondPassword();

        ncb.SetCmdType(NetCmdType.CMD_CL_ChangeSecondPassword);

        if (!FishConfig.Instance.m_ErrorString.CheckStringIsError(FishDataInfo.PasswordMinLength, FishDataInfo.PasswordLength, OldPassword, StringCheckType.SCT_Password))
        {
            tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_ChangeSecPass_Faile_1);
            MsgEventHandle.HandleMsg(pUOM);
            return(false);
        }
        if (!FishConfig.Instance.m_ErrorString.CheckStringIsError(FishDataInfo.PasswordMinLength, FishDataInfo.PasswordLength, NewPassword, StringCheckType.SCT_Password))
        {
            tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_ChangeSecPass_Faile_2);
            MsgEventHandle.HandleMsg(pUOM);
            return(false);
        }
        if (NewPassword.CompareTo(OldPassword) == 0)
        {
            tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_ChangeSecPass_Faile_3);
            MsgEventHandle.HandleMsg(pUOM);
            return(false);
        }

        NormalAccountInfo ad1 = new NormalAccountInfo();

        if (!NativeInterface.ComputeCrc("", OldPassword, out ad1.CRC1, out ad1.CRC2, out ad1.CRC3))
        {
            tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_ChangeSecPass_Faile_4);
            MsgEventHandle.HandleMsg(pUOM);
            return(false);
        }

        NormalAccountInfo ad2 = new NormalAccountInfo();

        if (!NativeInterface.ComputeCrc("", NewPassword, out ad2.CRC1, out ad2.CRC2, out ad2.CRC3))
        {
            tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_ChangeSecPass_Faile_5);
            MsgEventHandle.HandleMsg(pUOM);
            return(false);
        }

        GlobalLogon.Instance.AccountData.SaveAccountData();

        ncb.dwOldCrc1 = ad1.CRC1;
        ncb.dwOldCrc2 = ad1.CRC2;
        ncb.dwOldCrc3 = ad1.CRC3;

        ncb.dwNewCrc1 = ad2.CRC1;
        ncb.dwNewCrc2 = ad2.CRC2;
        ncb.dwNewCrc3 = ad2.CRC3;

        GlobalLogon.Instance.AccountData.TempPhoneInfo.Clear();
        GlobalLogon.Instance.AccountData.TempAccountInfo.Clear();
        GlobalLogon.Instance.AccountData.TempAccountInfo.UID  = GlobalLogon.Instance.AccountData.AccountInfo.UID;
        GlobalLogon.Instance.AccountData.TempAccountInfo.CRC1 = ad2.CRC1;
        GlobalLogon.Instance.AccountData.TempAccountInfo.CRC2 = ad2.CRC2;
        GlobalLogon.Instance.AccountData.TempAccountInfo.CRC3 = ad2.CRC3;

        NetServices.Instance.Send <CL_Cmd_ChangeSecondPassword>(ncb);

        return(true);
    }