///<summary>反序列化,读取数据</summary> public override int Read(byte[] _buffer_, int _offset_) { _offset_ = base.Read(_buffer_, _offset_); //字段个数,最多支持255个 var _fieldNum_ = XBuffer.ReadByte(_buffer_, ref _offset_); do { if (_fieldNum_ > 0) { result = XBuffer.ReadInt(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 1) { reason = XBuffer.ReadInt(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 2) { hasRole = XBuffer.ReadBool(_buffer_, ref _offset_); if (hasRole) { var _idx_ = XBuffer.ReadByte(_buffer_, ref _offset_); role = new RoleInfo(); _offset_ = role.Read(_buffer_, _offset_); } } else { break; } if (_fieldNum_ > 3) { userName = XBuffer.ReadString(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 4) { isNewCreate = XBuffer.ReadBool(_buffer_, ref _offset_); } else { break; } }while(false); return(_offset_); }
///<summary>反序列化,读取数据</summary> public override int Read(byte[] _buffer_, int _offset_) { _offset_ = base.Read(_buffer_, _offset_); //字段个数,最多支持255个 var _fieldNum_ = XBuffer.ReadByte(_buffer_, ref _offset_); do { if (_fieldNum_ > 0) { success = XBuffer.ReadBool(_buffer_, ref _offset_); } else { break; } }while(false); return(_offset_); }
///<summary>反序列化,读取数据</summary> public override int Read(byte[] _buffer_, int _offset_) { _offset_ = base.Read(_buffer_, _offset_); int _startOffset_ = _offset_; int _toReadLength_ = XBuffer.ReadInt(_buffer_, ref _offset_); //字段个数,最多支持255个 var _fieldNum_ = XBuffer.ReadByte(_buffer_, ref _offset_); do { if (_fieldNum_ > 0) { id_f = XBuffer.ReadLong(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 1) { s1 = XBuffer.ReadString(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 2) { i1 = XBuffer.ReadInt(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 3) { b1 = XBuffer.ReadBool(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 4) { f1 = XBuffer.ReadFloat(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 5) { s2 = XBuffer.ReadShort(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 6) { d1 = XBuffer.ReadDouble(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 7) { b2 = XBuffer.ReadBytes(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 8) { o1 = XBuffer.ReadString(_buffer_, ref _offset_); } else { break; } }while(false); //剔除多余数据 if (_offset_ < _toReadLength_ - _startOffset_) { _offset_ += _toReadLength_ - _startOffset_; } return(_offset_); }
///<summary>反序列化,读取数据</summary> public override int Read(byte[] _buffer_, int _offset_) { _offset_ = base.Read(_buffer_, _offset_); //字段个数,最多支持255个 var _fieldNum_ = XBuffer.ReadByte(_buffer_, ref _offset_); do { if (_fieldNum_ > 0) { userName = XBuffer.ReadString(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 1) { serverId = XBuffer.ReadInt(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 2) { sdkToken = XBuffer.ReadString(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 3) { sdkType = XBuffer.ReadInt(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 4) { channelId = XBuffer.ReadString(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 5) { isRelogin = XBuffer.ReadBool(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 6) { handToken = XBuffer.ReadLong(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 7) { deviceType = XBuffer.ReadInt(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 8) { deviceOS = XBuffer.ReadString(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 9) { deviceModel = XBuffer.ReadString(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 10) { deviceName = XBuffer.ReadString(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 11) { deviceId = XBuffer.ReadString(_buffer_, ref _offset_); } else { break; } }while(false); return(_offset_); }
///<summary>反序列化,读取数据</summary> public override int Read(byte[] _buffer_, int _offset_) { _offset_ = base.Read(_buffer_, _offset_); int _startOffset_ = _offset_; int _toReadLength_ = XBuffer.ReadInt(_buffer_, ref _offset_); //字段个数,最多支持255个 var _fieldNum_ = XBuffer.ReadByte(_buffer_, ref _offset_); do { if (_fieldNum_ > 0) { roleId = XBuffer.ReadLong(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 1) { roleName = XBuffer.ReadString(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 2) { level = XBuffer.ReadInt(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 3) { vipLevel = XBuffer.ReadInt(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 4) { fightPower = XBuffer.ReadLong(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 5) { guildId = XBuffer.ReadLong(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 6) { guildName = XBuffer.ReadString(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 7) { openServerDays = XBuffer.ReadInt(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 8) { serverLevel = XBuffer.ReadInt(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 9) { loginTick = XBuffer.ReadLong(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 10) { createTick = XBuffer.ReadLong(_buffer_, ref _offset_); } else { break; } if (_fieldNum_ > 11) { isGMRole = XBuffer.ReadBool(_buffer_, ref _offset_); } else { break; } }while(false); //剔除多余数据 if (_offset_ < _toReadLength_ - _startOffset_) { _offset_ += _toReadLength_ - _startOffset_; } return(_offset_); }