public override void AppendToPacket(ByteBuffer data) { data.WriteUInt16(DynamicFieldChangeType); if (DynamicFieldChangeType.HasAnyFlag((uint)Entities.DynamicFieldChangeType.ValueAndSizeChanged) && _updateType == UpdateType.Values) { data.WriteUInt32(_fieldCount); } var maskArray = new byte[_blockCount << 2]; _mask.CopyTo(maskArray, 0); data.WriteBytes(maskArray); }
public void EncodeDynamicFieldChangeType(DynamicFieldChangeType changeType, UpdateType updateType) { _updateType = updateType; DynamicFieldChangeType = (uint)(_blockCount | ((uint)(changeType & Entities.DynamicFieldChangeType.ValueAndSizeChanged) * ((3 - (int)updateType /*this part evaluates to 0 if update type is not VALUES*/) / 3))); }