///<summary>序列化,写入数据</summary> public override int Write(byte[] _buffer_, int _offset_) { _offset_ = base.Write(_buffer_, _offset_); //先写入当前对象长度占位符 int _startOffset_ = _offset_; XBuffer.WriteInt(0, _buffer_, ref _offset_); //写入字段数量,最多支持255个 XBuffer.WriteByte(9, _buffer_, ref _offset_); //写入数据 XBuffer.WriteLong(id_f, _buffer_, ref _offset_); XBuffer.WriteString(s1, _buffer_, ref _offset_); XBuffer.WriteInt(i1, _buffer_, ref _offset_); XBuffer.WriteBool(b1, _buffer_, ref _offset_); XBuffer.WriteFloat(f1, _buffer_, ref _offset_); XBuffer.WriteShort(s2, _buffer_, ref _offset_); XBuffer.WriteDouble(d1, _buffer_, ref _offset_); XBuffer.WriteBytes(b2, _buffer_, ref _offset_); XBuffer.WriteString(o1, _buffer_, ref _offset_); //覆盖当前对象长度 XBuffer.WriteInt(_offset_ - _startOffset_, _buffer_, ref _startOffset_); return(_offset_); }
///<summary>序列化,写入数据</summary> public override int Write(byte[] _buffer_, int _offset_) { _offset_ = base.Write(_buffer_, _offset_); //先写入当前对象长度占位符 int _startOffset_ = _offset_; XBuffer.WriteInt(0, _buffer_, ref _offset_); //写入字段数量,最多支持255个 XBuffer.WriteByte(12, _buffer_, ref _offset_); //写入数据 XBuffer.WriteLong(roleId, _buffer_, ref _offset_); XBuffer.WriteString(roleName, _buffer_, ref _offset_); XBuffer.WriteInt(level, _buffer_, ref _offset_); XBuffer.WriteInt(vipLevel, _buffer_, ref _offset_); XBuffer.WriteLong(fightPower, _buffer_, ref _offset_); XBuffer.WriteLong(guildId, _buffer_, ref _offset_); XBuffer.WriteString(guildName, _buffer_, ref _offset_); XBuffer.WriteInt(openServerDays, _buffer_, ref _offset_); XBuffer.WriteInt(serverLevel, _buffer_, ref _offset_); XBuffer.WriteLong(loginTick, _buffer_, ref _offset_); XBuffer.WriteLong(createTick, _buffer_, ref _offset_); XBuffer.WriteBool(isGMRole, _buffer_, ref _offset_); //覆盖当前对象长度 XBuffer.WriteInt(_offset_ - _startOffset_, _buffer_, ref _startOffset_); return(_offset_); }
///<summary>序列化,写入数据</summary> public override int Write(byte[] _buffer_, int _offset_) { _offset_ = base.Write(_buffer_, _offset_); //写入字段数量,最多支持255个 XBuffer.WriteByte(1, _buffer_, ref _offset_); //写入数据 XBuffer.WriteBool(success, _buffer_, ref _offset_); return(_offset_); }
///<summary>序列化,写入数据</summary> public override int Write(byte[] _buffer_, int _offset_) { _offset_ = base.Write(_buffer_, _offset_); //写入字段数量,最多支持255个 XBuffer.WriteByte(5, _buffer_, ref _offset_); //写入数据 XBuffer.WriteInt(result, _buffer_, ref _offset_); XBuffer.WriteInt(reason, _buffer_, ref _offset_); XBuffer.WriteBool(hasRole, _buffer_, ref _offset_); if (hasRole) { XBuffer.WriteByte(role._msgIdx_, _buffer_, ref _offset_); _offset_ = role.Write(_buffer_, _offset_); } XBuffer.WriteString(userName, _buffer_, ref _offset_); XBuffer.WriteBool(isNewCreate, _buffer_, ref _offset_); return(_offset_); }
///<summary>序列化,写入数据</summary> public override int Write(byte[] _buffer_, int _offset_) { _offset_ = base.Write(_buffer_, _offset_); //写入字段数量,最多支持255个 XBuffer.WriteByte(12, _buffer_, ref _offset_); //写入数据 XBuffer.WriteString(userName, _buffer_, ref _offset_); XBuffer.WriteInt(serverId, _buffer_, ref _offset_); XBuffer.WriteString(sdkToken, _buffer_, ref _offset_); XBuffer.WriteInt(sdkType, _buffer_, ref _offset_); XBuffer.WriteString(channelId, _buffer_, ref _offset_); XBuffer.WriteBool(isRelogin, _buffer_, ref _offset_); XBuffer.WriteLong(handToken, _buffer_, ref _offset_); XBuffer.WriteInt(deviceType, _buffer_, ref _offset_); XBuffer.WriteString(deviceOS, _buffer_, ref _offset_); XBuffer.WriteString(deviceModel, _buffer_, ref _offset_); XBuffer.WriteString(deviceName, _buffer_, ref _offset_); XBuffer.WriteString(deviceId, _buffer_, ref _offset_); return(_offset_); }