示例#1
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);
        }
示例#2
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;
        }
示例#3
0
        public void SendLogonHallData()
        {
            if (false)
            {
                /* NetCmdLogonHall ncl = new NetCmdLogonHall();
                 * ncl.SetCmdType(NetCmdType.CMD_LOGON_HALL);
                 * ncl.CRC1 = GlobalLogon.Instance.AccountData.AccountInfo.CRC1;
                 * ncl.CRC2 = GlobalLogon.Instance.AccountData.AccountInfo.CRC2;
                 * ncl.CRC3 = GlobalLogon.Instance.AccountData.AccountInfo.CRC3;
                 * ncl.UID = GlobalLogon.Instance.AccountData.AccountInfo.UID;
                 * NetServices.Instance.Send<NetCmdLogonHall>(ncl);*/
            }
            else
            {
                CL_Cmd_AccountOnlyID msgHall = new CL_Cmd_AccountOnlyID();
                msgHall.SetCmdType(NetCmdType.CMD_CL_AccountOnlyID);
                msgHall.dwOnlyID   = _mOnlyId;
                msgHall.dwUserID   = _mUserId;
                msgHall.MacAddress = UIDevice.GetMacAddress();
                //携带数据
                msgHall.PlateFormID = (Byte)UIDevice.GetPlatformString();
                int Witdh = GF.Resolution.GetScreenWidth();
                msgHall.ScreenPoint = Convert.ToUInt32((Witdh << 16) + GF.Resolution.GetScreenHeight());

                NetManager.Instance.Send <CL_Cmd_AccountOnlyID>(msgHall);
            }
            SetState(LogonState.LOGON_WAIT_HALL_RESULT);
        }