public void Deserialize(uint tick, DataStreamReader reader, ref DataStreamReader.Context ctx, UserCommand baseline, NetworkCompressionModel compressionModel) { this.tick = tick; checkTick = reader.ReadPackedIntDelta(ref ctx, baseline.checkTick, compressionModel); renderTick = reader.ReadPackedIntDelta(ref ctx, baseline.renderTick, compressionModel); moveYaw = 0.1f * reader.ReadPackedIntDelta(ref ctx, (int)(baseline.moveYaw * 10), compressionModel); moveMagnitude = 0.01f * reader.ReadPackedIntDelta(ref ctx, (int)(baseline.moveMagnitude * 100), compressionModel); buttons.flags = reader.ReadPackedUIntDelta(ref ctx, baseline.buttons.flags, compressionModel); lookYaw = reader.ReadPackedFloatDelta(ref ctx, baseline.lookYaw, compressionModel); lookPitch = reader.ReadPackedFloatDelta(ref ctx, baseline.lookPitch, compressionModel); }
public void Deserialize(uint tick, ref GhostSnapshotData baseline, ref DataStreamReader reader, NetworkCompressionModel compressionModel) { #region __GHOST_READ__ if ((changeMask__GHOST_MASK_BATCH__ & (1 << __GHOST_MASK_INDEX__)) != 0) { __GHOST_FIELD_NAME__X = reader.ReadPackedFloatDelta(baseline.__GHOST_FIELD_NAME__X, compressionModel); __GHOST_FIELD_NAME__Y = reader.ReadPackedFloatDelta(baseline.__GHOST_FIELD_NAME__Y, compressionModel); } else { __GHOST_FIELD_NAME__X = baseline.__GHOST_FIELD_NAME__X; __GHOST_FIELD_NAME__Y = baseline.__GHOST_FIELD_NAME__Y; } #endregion }
public void Deserialize(uint tick, ref CharacterSnapshotData baseline, ref DataStreamReader reader, NetworkCompressionModel compressionModel) { this.tick = tick; changeMask0 = reader.ReadPackedUIntDelta(baseline.changeMask0, compressionModel); if ((changeMask0 & (1 << 0)) != 0) { AttackAttackType = reader.ReadPackedIntDelta(baseline.AttackAttackType, compressionModel); } else { AttackAttackType = baseline.AttackAttackType; } if ((changeMask0 & (1 << 1)) != 0) { AttackSeed = reader.ReadPackedIntDelta(baseline.AttackSeed, compressionModel); } else { AttackSeed = baseline.AttackSeed; } if ((changeMask0 & (1 << 2)) != 0) { AttackAttackDirectionX = reader.ReadPackedIntDelta(baseline.AttackAttackDirectionX, compressionModel); AttackAttackDirectionY = reader.ReadPackedIntDelta(baseline.AttackAttackDirectionY, compressionModel); } else { AttackAttackDirectionX = baseline.AttackAttackDirectionX; AttackAttackDirectionY = baseline.AttackAttackDirectionY; } if ((changeMask0 & (1 << 3)) != 0) { AttackTarget = reader.ReadPackedIntDelta(baseline.AttackTarget, compressionModel); } else { AttackTarget = baseline.AttackTarget; } if ((changeMask0 & (1 << 4)) != 0) { AttackNeedApplyDamage = reader.ReadPackedUIntDelta(baseline.AttackNeedApplyDamage, compressionModel); } else { AttackNeedApplyDamage = baseline.AttackNeedApplyDamage; } if ((changeMask0 & (1 << 5)) != 0) { DamageDamageType = reader.ReadPackedIntDelta(baseline.DamageDamageType, compressionModel); } else { DamageDamageType = baseline.DamageDamageType; } if ((changeMask0 & (1 << 6)) != 0) { MovableCharacterComponentPlayerId = reader.ReadPackedIntDelta(baseline.MovableCharacterComponentPlayerId, compressionModel); } else { MovableCharacterComponentPlayerId = baseline.MovableCharacterComponentPlayerId; } if ((changeMask0 & (1 << 7)) != 0) { PlayerDatahealth = reader.ReadPackedIntDelta(baseline.PlayerDatahealth, compressionModel); } else { PlayerDatahealth = baseline.PlayerDatahealth; } if ((changeMask0 & (1 << 8)) != 0) { PlayerDataprimarySkillId = reader.ReadPackedIntDelta(baseline.PlayerDataprimarySkillId, compressionModel); } else { PlayerDataprimarySkillId = baseline.PlayerDataprimarySkillId; } if ((changeMask0 & (1 << 9)) != 0) { PlayerDatamaxHealth = reader.ReadPackedIntDelta(baseline.PlayerDatamaxHealth, compressionModel); } else { PlayerDatamaxHealth = baseline.PlayerDatamaxHealth; } if ((changeMask0 & (1 << 10)) != 0) { PlayerDatapower = reader.ReadPackedIntDelta(baseline.PlayerDatapower, compressionModel); } else { PlayerDatapower = baseline.PlayerDatapower; } if ((changeMask0 & (1 << 11)) != 0) { PlayerDatamagic = reader.ReadPackedIntDelta(baseline.PlayerDatamagic, compressionModel); } else { PlayerDatamagic = baseline.PlayerDatamagic; } if ((changeMask0 & (1 << 12)) != 0) { PlayerDatadamageRadius = reader.ReadPackedIntDelta(baseline.PlayerDatadamageRadius, compressionModel); } else { PlayerDatadamageRadius = baseline.PlayerDatadamageRadius; } if ((changeMask0 & (1 << 13)) != 0) { PlayerDatainventory = reader.ReadPackedUIntDelta(baseline.PlayerDatainventory, compressionModel); } else { PlayerDatainventory = baseline.PlayerDatainventory; } if ((changeMask0 & (1 << 14)) != 0) { PlayerDataattackSkillId = reader.ReadPackedIntDelta(baseline.PlayerDataattackSkillId, compressionModel); } else { PlayerDataattackSkillId = baseline.PlayerDataattackSkillId; } if ((changeMask0 & (1 << 15)) != 0) { PlayerDatadefenceSkillId = reader.ReadPackedIntDelta(baseline.PlayerDatadefenceSkillId, compressionModel); } else { PlayerDatadefenceSkillId = baseline.PlayerDatadefenceSkillId; } if ((changeMask0 & (1 << 16)) != 0) { PlayerDatautilsSkillId = reader.ReadPackedIntDelta(baseline.PlayerDatautilsSkillId, compressionModel); } else { PlayerDatautilsSkillId = baseline.PlayerDatautilsSkillId; } if ((changeMask0 & (1 << 17)) != 0) { PlayerDataspeedMod = reader.ReadPackedFloatDelta(baseline.PlayerDataspeedMod, compressionModel); } else { PlayerDataspeedMod = baseline.PlayerDataspeedMod; } if ((changeMask0 & (1 << 18)) != 0) { PlayerDatastun = reader.ReadPackedUIntDelta(baseline.PlayerDatastun, compressionModel); } else { PlayerDatastun = baseline.PlayerDatastun; } if ((changeMask0 & (1 << 19)) != 0) { PrefabCreatorNameId = reader.ReadPackedUIntDelta(baseline.PrefabCreatorNameId, compressionModel); } else { PrefabCreatorNameId = baseline.PrefabCreatorNameId; } if ((changeMask0 & (1 << 20)) != 0) { PrefabCreatorSkinId = reader.ReadPackedUIntDelta(baseline.PrefabCreatorSkinId, compressionModel); } else { PrefabCreatorSkinId = baseline.PrefabCreatorSkinId; } if ((changeMask0 & (1 << 21)) != 0) { PrefabCreatorSkinSetting = reader.ReadPackedStringDelta(baseline.PrefabCreatorSkinSetting, compressionModel); } else { PrefabCreatorSkinSetting = baseline.PrefabCreatorSkinSetting; } if ((changeMask0 & (1 << 22)) != 0) { RotationValueX = reader.ReadPackedIntDelta(baseline.RotationValueX, compressionModel); RotationValueY = reader.ReadPackedIntDelta(baseline.RotationValueY, compressionModel); RotationValueZ = reader.ReadPackedIntDelta(baseline.RotationValueZ, compressionModel); RotationValueW = reader.ReadPackedIntDelta(baseline.RotationValueW, compressionModel); } else { RotationValueX = baseline.RotationValueX; RotationValueY = baseline.RotationValueY; RotationValueZ = baseline.RotationValueZ; RotationValueW = baseline.RotationValueW; } if ((changeMask0 & (1 << 23)) != 0) { TranslationValueX = reader.ReadPackedIntDelta(baseline.TranslationValueX, compressionModel); TranslationValueY = reader.ReadPackedIntDelta(baseline.TranslationValueY, compressionModel); TranslationValueZ = reader.ReadPackedIntDelta(baseline.TranslationValueZ, compressionModel); } else { TranslationValueX = baseline.TranslationValueX; TranslationValueY = baseline.TranslationValueY; TranslationValueZ = baseline.TranslationValueZ; } }