public void Serialize(int networkId, ref GhostSnapshotData baseline, DataStreamWriter writer, NetworkCompressionModel compressionModel)
 {
     #region __GHOST_CALCULATE_CHANGE_MASK_ZERO__
     changeMask__GHOST_MASK_BATCH__ = __GHOST_FIELD_NAME__.Equals(baseline.__GHOST_FIELD_NAME__) ? 0 : 1u;
     #endregion
     #region __GHOST_CALCULATE_CHANGE_MASK__
     changeMask__GHOST_MASK_BATCH__ |= __GHOST_FIELD_NAME__.Equals(baseline.__GHOST_FIELD_NAME__) ? 0 : (1u << __GHOST_MASK_INDEX__);
     #endregion
     #region __GHOST_WRITE__
     if ((changeMask__GHOST_MASK_BATCH__ & (1 << __GHOST_MASK_INDEX__)) != 0)
     {
         writer.WritePackedStringDelta(__GHOST_FIELD_NAME__, baseline.__GHOST_FIELD_NAME__, compressionModel);
     }
     #endregion
 }
Ejemplo n.º 2
0
        public void NativeString64EqualsWorks(String a, String b)
        {
            NativeString64 aa = new NativeString64(a);
            NativeString64 bb = new NativeString64(b);

            Assert.AreEqual(aa.Equals(bb), a.Equals(b));
        }
Ejemplo n.º 3
0
 public void Serialize(int networkId, ref GameModeSnapshotData baseline, ref DataStreamWriter writer, NetworkCompressionModel compressionModel)
 {
     changeMask0  = (GameModeDatagameTimerSeconds != baseline.GameModeDatagameTimerSeconds) ? 1u : 0;
     changeMask0 |= GameModeDatagameTimerMessage.Equals(baseline.GameModeDatagameTimerMessage) ? 0 : (1u << 1);
     changeMask0 |= GameModeDatateamName0.Equals(baseline.GameModeDatateamName0) ? 0 : (1u << 2);
     changeMask0 |= GameModeDatateamName1.Equals(baseline.GameModeDatateamName1) ? 0 : (1u << 3);
     changeMask0 |= (GameModeDatateamScore0 != baseline.GameModeDatateamScore0) ? (1u << 4) : 0;
     changeMask0 |= (GameModeDatateamScore1 != baseline.GameModeDatateamScore1) ? (1u << 5) : 0;
     writer.WritePackedUIntDelta(changeMask0, baseline.changeMask0, compressionModel);
     if ((changeMask0 & (1 << 0)) != 0)
     {
         writer.WritePackedIntDelta(GameModeDatagameTimerSeconds, baseline.GameModeDatagameTimerSeconds, compressionModel);
     }
     if ((changeMask0 & (1 << 1)) != 0)
     {
         writer.WritePackedStringDelta(GameModeDatagameTimerMessage, baseline.GameModeDatagameTimerMessage, compressionModel);
     }
     if ((changeMask0 & (1 << 2)) != 0)
     {
         writer.WritePackedStringDelta(GameModeDatateamName0, baseline.GameModeDatateamName0, compressionModel);
     }
     if ((changeMask0 & (1 << 3)) != 0)
     {
         writer.WritePackedStringDelta(GameModeDatateamName1, baseline.GameModeDatateamName1, compressionModel);
     }
     if ((changeMask0 & (1 << 4)) != 0)
     {
         writer.WritePackedIntDelta(GameModeDatateamScore0, baseline.GameModeDatateamScore0, compressionModel);
     }
     if ((changeMask0 & (1 << 5)) != 0)
     {
         writer.WritePackedIntDelta(GameModeDatateamScore1, baseline.GameModeDatateamScore1, compressionModel);
     }
 }
Ejemplo n.º 4
0
 public void Serialize(int networkId, ref GameInfoSnapshotData baseline, ref DataStreamWriter writer, NetworkCompressionModel compressionModel)
 {
     changeMask0  = GameInfoComponentName.Equals(baseline.GameInfoComponentName) ? 0 : 1u;
     changeMask0 |= (GameInfoComponentSizeX != baseline.GameInfoComponentSizeX) ? (1u << 1) : 0;
     changeMask0 |= (GameInfoComponentSizeY != baseline.GameInfoComponentSizeY) ? (1u << 2) : 0;
     changeMask0 |= (GameInfoComponentId != baseline.GameInfoComponentId) ? (1u << 3) : 0;
     writer.WritePackedUIntDelta(changeMask0, baseline.changeMask0, compressionModel);
     if ((changeMask0 & (1 << 0)) != 0)
     {
         writer.WritePackedStringDelta(GameInfoComponentName, baseline.GameInfoComponentName, compressionModel);
     }
     if ((changeMask0 & (1 << 1)) != 0)
     {
         writer.WritePackedIntDelta(GameInfoComponentSizeX, baseline.GameInfoComponentSizeX, compressionModel);
     }
     if ((changeMask0 & (1 << 2)) != 0)
     {
         writer.WritePackedIntDelta(GameInfoComponentSizeY, baseline.GameInfoComponentSizeY, compressionModel);
     }
     if ((changeMask0 & (1 << 3)) != 0)
     {
         writer.WritePackedIntDelta(GameInfoComponentId, baseline.GameInfoComponentId, compressionModel);
     }
 }
Ejemplo n.º 5
0
 public bool Equals(State other)
 {
     return(Trait.Equals(other.Trait) &&
            ValueString.Equals(other.ValueString) && IsNegative.Equals(other.IsNegative) &&
            Target.Equals(other.Target));
 }
Ejemplo n.º 6
0
 public void Serialize(int networkId, ref CharacterSnapshotData baseline, ref DataStreamWriter writer, NetworkCompressionModel compressionModel)
 {
     changeMask0  = (AttackAttackType != baseline.AttackAttackType) ? 1u : 0;
     changeMask0 |= (AttackSeed != baseline.AttackSeed) ? (1u << 1) : 0;
     changeMask0 |= (AttackAttackDirectionX != baseline.AttackAttackDirectionX ||
                     AttackAttackDirectionY != baseline.AttackAttackDirectionY) ? (1u << 2) : 0;
     changeMask0 |= (AttackTarget != baseline.AttackTarget) ? (1u << 3) : 0;
     changeMask0 |= (AttackNeedApplyDamage != baseline.AttackNeedApplyDamage) ? (1u << 4) : 0;
     changeMask0 |= (DamageDamageType != baseline.DamageDamageType) ? (1u << 5) : 0;
     changeMask0 |= (MovableCharacterComponentPlayerId != baseline.MovableCharacterComponentPlayerId) ? (1u << 6) : 0;
     changeMask0 |= (PlayerDatahealth != baseline.PlayerDatahealth) ? (1u << 7) : 0;
     changeMask0 |= (PlayerDataprimarySkillId != baseline.PlayerDataprimarySkillId) ? (1u << 8) : 0;
     changeMask0 |= (PlayerDatamaxHealth != baseline.PlayerDatamaxHealth) ? (1u << 9) : 0;
     changeMask0 |= (PlayerDatapower != baseline.PlayerDatapower) ? (1u << 10) : 0;
     changeMask0 |= (PlayerDatamagic != baseline.PlayerDatamagic) ? (1u << 11) : 0;
     changeMask0 |= (PlayerDatadamageRadius != baseline.PlayerDatadamageRadius) ? (1u << 12) : 0;
     changeMask0 |= (PlayerDatainventory != baseline.PlayerDatainventory) ? (1u << 13) : 0;
     changeMask0 |= (PlayerDataattackSkillId != baseline.PlayerDataattackSkillId) ? (1u << 14) : 0;
     changeMask0 |= (PlayerDatadefenceSkillId != baseline.PlayerDatadefenceSkillId) ? (1u << 15) : 0;
     changeMask0 |= (PlayerDatautilsSkillId != baseline.PlayerDatautilsSkillId) ? (1u << 16) : 0;
     changeMask0 |= (PlayerDataspeedMod != baseline.PlayerDataspeedMod) ? (1u << 17) : 0;
     changeMask0 |= (PlayerDatastun != baseline.PlayerDatastun) ? (1u << 18) : 0;
     changeMask0 |= (PrefabCreatorNameId != baseline.PrefabCreatorNameId) ? (1u << 19) : 0;
     changeMask0 |= (PrefabCreatorSkinId != baseline.PrefabCreatorSkinId) ? (1u << 20) : 0;
     changeMask0 |= PrefabCreatorSkinSetting.Equals(baseline.PrefabCreatorSkinSetting) ? 0 : (1u << 21);
     changeMask0 |= (RotationValueX != baseline.RotationValueX ||
                     RotationValueY != baseline.RotationValueY ||
                     RotationValueZ != baseline.RotationValueZ ||
                     RotationValueW != baseline.RotationValueW) ? (1u << 22) : 0;
     changeMask0 |= (TranslationValueX != baseline.TranslationValueX ||
                     TranslationValueY != baseline.TranslationValueY ||
                     TranslationValueZ != baseline.TranslationValueZ) ? (1u << 23) : 0;
     writer.WritePackedUIntDelta(changeMask0, baseline.changeMask0, compressionModel);
     if ((changeMask0 & (1 << 0)) != 0)
     {
         writer.WritePackedIntDelta(AttackAttackType, baseline.AttackAttackType, compressionModel);
     }
     if ((changeMask0 & (1 << 1)) != 0)
     {
         writer.WritePackedIntDelta(AttackSeed, baseline.AttackSeed, compressionModel);
     }
     if ((changeMask0 & (1 << 2)) != 0)
     {
         writer.WritePackedIntDelta(AttackAttackDirectionX, baseline.AttackAttackDirectionX, compressionModel);
         writer.WritePackedIntDelta(AttackAttackDirectionY, baseline.AttackAttackDirectionY, compressionModel);
     }
     if ((changeMask0 & (1 << 3)) != 0)
     {
         writer.WritePackedIntDelta(AttackTarget, baseline.AttackTarget, compressionModel);
     }
     if ((changeMask0 & (1 << 4)) != 0)
     {
         writer.WritePackedUIntDelta(AttackNeedApplyDamage, baseline.AttackNeedApplyDamage, compressionModel);
     }
     if ((changeMask0 & (1 << 5)) != 0)
     {
         writer.WritePackedIntDelta(DamageDamageType, baseline.DamageDamageType, compressionModel);
     }
     if ((changeMask0 & (1 << 6)) != 0)
     {
         writer.WritePackedIntDelta(MovableCharacterComponentPlayerId, baseline.MovableCharacterComponentPlayerId, compressionModel);
     }
     if ((changeMask0 & (1 << 7)) != 0)
     {
         writer.WritePackedIntDelta(PlayerDatahealth, baseline.PlayerDatahealth, compressionModel);
     }
     if ((changeMask0 & (1 << 8)) != 0)
     {
         writer.WritePackedIntDelta(PlayerDataprimarySkillId, baseline.PlayerDataprimarySkillId, compressionModel);
     }
     if ((changeMask0 & (1 << 9)) != 0)
     {
         writer.WritePackedIntDelta(PlayerDatamaxHealth, baseline.PlayerDatamaxHealth, compressionModel);
     }
     if ((changeMask0 & (1 << 10)) != 0)
     {
         writer.WritePackedIntDelta(PlayerDatapower, baseline.PlayerDatapower, compressionModel);
     }
     if ((changeMask0 & (1 << 11)) != 0)
     {
         writer.WritePackedIntDelta(PlayerDatamagic, baseline.PlayerDatamagic, compressionModel);
     }
     if ((changeMask0 & (1 << 12)) != 0)
     {
         writer.WritePackedIntDelta(PlayerDatadamageRadius, baseline.PlayerDatadamageRadius, compressionModel);
     }
     if ((changeMask0 & (1 << 13)) != 0)
     {
         writer.WritePackedUIntDelta(PlayerDatainventory, baseline.PlayerDatainventory, compressionModel);
     }
     if ((changeMask0 & (1 << 14)) != 0)
     {
         writer.WritePackedIntDelta(PlayerDataattackSkillId, baseline.PlayerDataattackSkillId, compressionModel);
     }
     if ((changeMask0 & (1 << 15)) != 0)
     {
         writer.WritePackedIntDelta(PlayerDatadefenceSkillId, baseline.PlayerDatadefenceSkillId, compressionModel);
     }
     if ((changeMask0 & (1 << 16)) != 0)
     {
         writer.WritePackedIntDelta(PlayerDatautilsSkillId, baseline.PlayerDatautilsSkillId, compressionModel);
     }
     if ((changeMask0 & (1 << 17)) != 0)
     {
         writer.WritePackedFloatDelta(PlayerDataspeedMod, baseline.PlayerDataspeedMod, compressionModel);
     }
     if ((changeMask0 & (1 << 18)) != 0)
     {
         writer.WritePackedUIntDelta(PlayerDatastun, baseline.PlayerDatastun, compressionModel);
     }
     if ((changeMask0 & (1 << 19)) != 0)
     {
         writer.WritePackedUIntDelta(PrefabCreatorNameId, baseline.PrefabCreatorNameId, compressionModel);
     }
     if ((changeMask0 & (1 << 20)) != 0)
     {
         writer.WritePackedUIntDelta(PrefabCreatorSkinId, baseline.PrefabCreatorSkinId, compressionModel);
     }
     if ((changeMask0 & (1 << 21)) != 0)
     {
         writer.WritePackedStringDelta(PrefabCreatorSkinSetting, baseline.PrefabCreatorSkinSetting, compressionModel);
     }
     if ((changeMask0 & (1 << 22)) != 0)
     {
         writer.WritePackedIntDelta(RotationValueX, baseline.RotationValueX, compressionModel);
         writer.WritePackedIntDelta(RotationValueY, baseline.RotationValueY, compressionModel);
         writer.WritePackedIntDelta(RotationValueZ, baseline.RotationValueZ, compressionModel);
         writer.WritePackedIntDelta(RotationValueW, baseline.RotationValueW, compressionModel);
     }
     if ((changeMask0 & (1 << 23)) != 0)
     {
         writer.WritePackedIntDelta(TranslationValueX, baseline.TranslationValueX, compressionModel);
         writer.WritePackedIntDelta(TranslationValueY, baseline.TranslationValueY, compressionModel);
         writer.WritePackedIntDelta(TranslationValueZ, baseline.TranslationValueZ, compressionModel);
     }
 }
Ejemplo n.º 7
0
 public void Serialize(int networkId, ref PlayerStateSnapshotData baseline, DataStreamWriter writer, NetworkCompressionModel compressionModel)
 {
     changeMask0  = (PlayerStateplayerId != baseline.PlayerStateplayerId) ? 1u : 0;
     changeMask0 |= PlayerStateplayerName.Equals(baseline.PlayerStateplayerName) ? 0 : (1u << 1);
     changeMask0 |= (PlayerStateteamIndex != baseline.PlayerStateteamIndex) ? (1u << 2) : 0;
     changeMask0 |= (PlayerStatescore != baseline.PlayerStatescore) ? (1u << 3) : 0;
     changeMask0 |= (PlayerStategameModeSystemInitialized != baseline.PlayerStategameModeSystemInitialized) ? (1u << 4) : 0;
     changeMask0 |= (PlayerStatedisplayCountDown != baseline.PlayerStatedisplayCountDown) ? (1u << 5) : 0;
     changeMask0 |= (PlayerStatecountDown != baseline.PlayerStatecountDown) ? (1u << 6) : 0;
     changeMask0 |= (PlayerStatedisplayScoreBoard != baseline.PlayerStatedisplayScoreBoard) ? (1u << 7) : 0;
     changeMask0 |= (PlayerStatedisplayGameScore != baseline.PlayerStatedisplayGameScore) ? (1u << 8) : 0;
     changeMask0 |= (PlayerStatedisplayGameResult != baseline.PlayerStatedisplayGameResult) ? (1u << 9) : 0;
     changeMask0 |= PlayerStategameResult.Equals(baseline.PlayerStategameResult) ? 0 : (1u << 10);
     changeMask0 |= (PlayerStatedisplayGoal != baseline.PlayerStatedisplayGoal) ? (1u << 11) : 0;
     changeMask0 |= (PlayerStategoalPositionX != baseline.PlayerStategoalPositionX ||
                     PlayerStategoalPositionY != baseline.PlayerStategoalPositionY ||
                     PlayerStategoalPositionZ != baseline.PlayerStategoalPositionZ) ? (1u << 12) : 0;
     changeMask0 |= (PlayerStategoalDefendersColor != baseline.PlayerStategoalDefendersColor) ? (1u << 13) : 0;
     changeMask0 |= (PlayerStategoalAttackersColor != baseline.PlayerStategoalAttackersColor) ? (1u << 14) : 0;
     changeMask0 |= (PlayerStategoalAttackers != baseline.PlayerStategoalAttackers) ? (1u << 15) : 0;
     changeMask0 |= (PlayerStategoalDefenders != baseline.PlayerStategoalDefenders) ? (1u << 16) : 0;
     changeMask0 |= PlayerStategoalString.Equals(baseline.PlayerStategoalString) ? 0 : (1u << 17);
     changeMask0 |= PlayerStateactionString.Equals(baseline.PlayerStateactionString) ? 0 : (1u << 18);
     changeMask0 |= (PlayerStategoalCompletion != baseline.PlayerStategoalCompletion) ? (1u << 19) : 0;
     writer.WritePackedUIntDelta(changeMask0, baseline.changeMask0, compressionModel);
     if ((changeMask0 & (1 << 0)) != 0)
     {
         writer.WritePackedIntDelta(PlayerStateplayerId, baseline.PlayerStateplayerId, compressionModel);
     }
     if ((changeMask0 & (1 << 1)) != 0)
     {
         writer.WritePackedUIntDelta(PlayerStateplayerName.LengthInBytes, baseline.PlayerStateplayerName.LengthInBytes, compressionModel);
         var PlayerStateplayerNameBaselineLength = (ushort)math.min((uint)PlayerStateplayerName.LengthInBytes, baseline.PlayerStateplayerName.LengthInBytes);
         for (int sb = 0; sb < PlayerStateplayerNameBaselineLength; ++sb)
         {
             unsafe
             {
                 fixed(byte *b1 = &PlayerStateplayerName.buffer.byte0000)
                 fixed(byte *b2 = &baseline.PlayerStateplayerName.buffer.byte0000)
                 {
                     writer.WritePackedUIntDelta(b1[sb], b2[sb], compressionModel);
                 }
             }
         }
         for (int sb = PlayerStateplayerNameBaselineLength; sb < PlayerStateplayerName.LengthInBytes; ++sb)
         {
             unsafe
             {
                 fixed(byte *b = &PlayerStateplayerName.buffer.byte0000)
                 {
                     writer.WritePackedUIntDelta(b[sb], 0, compressionModel);
                 }
             }
         }
     }
     if ((changeMask0 & (1 << 2)) != 0)
     {
         writer.WritePackedIntDelta(PlayerStateteamIndex, baseline.PlayerStateteamIndex, compressionModel);
     }
     if ((changeMask0 & (1 << 3)) != 0)
     {
         writer.WritePackedIntDelta(PlayerStatescore, baseline.PlayerStatescore, compressionModel);
     }
     if ((changeMask0 & (1 << 4)) != 0)
     {
         writer.WritePackedUIntDelta(PlayerStategameModeSystemInitialized, baseline.PlayerStategameModeSystemInitialized, compressionModel);
     }
     if ((changeMask0 & (1 << 5)) != 0)
     {
         writer.WritePackedUIntDelta(PlayerStatedisplayCountDown, baseline.PlayerStatedisplayCountDown, compressionModel);
     }
     if ((changeMask0 & (1 << 6)) != 0)
     {
         writer.WritePackedIntDelta(PlayerStatecountDown, baseline.PlayerStatecountDown, compressionModel);
     }
     if ((changeMask0 & (1 << 7)) != 0)
     {
         writer.WritePackedUIntDelta(PlayerStatedisplayScoreBoard, baseline.PlayerStatedisplayScoreBoard, compressionModel);
     }
     if ((changeMask0 & (1 << 8)) != 0)
     {
         writer.WritePackedUIntDelta(PlayerStatedisplayGameScore, baseline.PlayerStatedisplayGameScore, compressionModel);
     }
     if ((changeMask0 & (1 << 9)) != 0)
     {
         writer.WritePackedUIntDelta(PlayerStatedisplayGameResult, baseline.PlayerStatedisplayGameResult, compressionModel);
     }
     if ((changeMask0 & (1 << 10)) != 0)
     {
         writer.WritePackedUIntDelta(PlayerStategameResult.LengthInBytes, baseline.PlayerStategameResult.LengthInBytes, compressionModel);
         var PlayerStategameResultBaselineLength = (ushort)math.min((uint)PlayerStategameResult.LengthInBytes, baseline.PlayerStategameResult.LengthInBytes);
         for (int sb = 0; sb < PlayerStategameResultBaselineLength; ++sb)
         {
             unsafe
             {
                 fixed(byte *b1 = &PlayerStategameResult.buffer.byte0000)
                 fixed(byte *b2 = &baseline.PlayerStategameResult.buffer.byte0000)
                 {
                     writer.WritePackedUIntDelta(b1[sb], b2[sb], compressionModel);
                 }
             }
         }
         for (int sb = PlayerStategameResultBaselineLength; sb < PlayerStategameResult.LengthInBytes; ++sb)
         {
             unsafe
             {
                 fixed(byte *b = &PlayerStategameResult.buffer.byte0000)
                 {
                     writer.WritePackedUIntDelta(b[sb], 0, compressionModel);
                 }
             }
         }
     }
     if ((changeMask0 & (1 << 11)) != 0)
     {
         writer.WritePackedUIntDelta(PlayerStatedisplayGoal, baseline.PlayerStatedisplayGoal, compressionModel);
     }
     if ((changeMask0 & (1 << 12)) != 0)
     {
         writer.WritePackedIntDelta(PlayerStategoalPositionX, baseline.PlayerStategoalPositionX, compressionModel);
         writer.WritePackedIntDelta(PlayerStategoalPositionY, baseline.PlayerStategoalPositionY, compressionModel);
         writer.WritePackedIntDelta(PlayerStategoalPositionZ, baseline.PlayerStategoalPositionZ, compressionModel);
     }
     if ((changeMask0 & (1 << 13)) != 0)
     {
         writer.WritePackedUIntDelta(PlayerStategoalDefendersColor, baseline.PlayerStategoalDefendersColor, compressionModel);
     }
     if ((changeMask0 & (1 << 14)) != 0)
     {
         writer.WritePackedUIntDelta(PlayerStategoalAttackersColor, baseline.PlayerStategoalAttackersColor, compressionModel);
     }
     if ((changeMask0 & (1 << 15)) != 0)
     {
         writer.WritePackedUIntDelta(PlayerStategoalAttackers, baseline.PlayerStategoalAttackers, compressionModel);
     }
     if ((changeMask0 & (1 << 16)) != 0)
     {
         writer.WritePackedUIntDelta(PlayerStategoalDefenders, baseline.PlayerStategoalDefenders, compressionModel);
     }
     if ((changeMask0 & (1 << 17)) != 0)
     {
         writer.WritePackedUIntDelta(PlayerStategoalString.LengthInBytes, baseline.PlayerStategoalString.LengthInBytes, compressionModel);
         var PlayerStategoalStringBaselineLength = (ushort)math.min((uint)PlayerStategoalString.LengthInBytes, baseline.PlayerStategoalString.LengthInBytes);
         for (int sb = 0; sb < PlayerStategoalStringBaselineLength; ++sb)
         {
             unsafe
             {
                 fixed(byte *b1 = &PlayerStategoalString.buffer.byte0000)
                 fixed(byte *b2 = &baseline.PlayerStategoalString.buffer.byte0000)
                 {
                     writer.WritePackedUIntDelta(b1[sb], b2[sb], compressionModel);
                 }
             }
         }
         for (int sb = PlayerStategoalStringBaselineLength; sb < PlayerStategoalString.LengthInBytes; ++sb)
         {
             unsafe
             {
                 fixed(byte *b = &PlayerStategoalString.buffer.byte0000)
                 {
                     writer.WritePackedUIntDelta(b[sb], 0, compressionModel);
                 }
             }
         }
     }
     if ((changeMask0 & (1 << 18)) != 0)
     {
         writer.WritePackedUIntDelta(PlayerStateactionString.LengthInBytes, baseline.PlayerStateactionString.LengthInBytes, compressionModel);
         var PlayerStateactionStringBaselineLength = (ushort)math.min((uint)PlayerStateactionString.LengthInBytes, baseline.PlayerStateactionString.LengthInBytes);
         for (int sb = 0; sb < PlayerStateactionStringBaselineLength; ++sb)
         {
             unsafe
             {
                 fixed(byte *b1 = &PlayerStateactionString.buffer.byte0000)
                 fixed(byte *b2 = &baseline.PlayerStateactionString.buffer.byte0000)
                 {
                     writer.WritePackedUIntDelta(b1[sb], b2[sb], compressionModel);
                 }
             }
         }
         for (int sb = PlayerStateactionStringBaselineLength; sb < PlayerStateactionString.LengthInBytes; ++sb)
         {
             unsafe
             {
                 fixed(byte *b = &PlayerStateactionString.buffer.byte0000)
                 {
                     writer.WritePackedUIntDelta(b[sb], 0, compressionModel);
                 }
             }
         }
     }
     if ((changeMask0 & (1 << 19)) != 0)
     {
         writer.WritePackedIntDelta(PlayerStategoalCompletion, baseline.PlayerStategoalCompletion, compressionModel);
     }
 }
Ejemplo n.º 8
0
 public void Serialize(int networkId, ref GameModeSnapshotData baseline, DataStreamWriter writer, NetworkCompressionModel compressionModel)
 {
     changeMask0  = (GameModeDatagameTimerSeconds != baseline.GameModeDatagameTimerSeconds) ? 1u : 0;
     changeMask0 |= GameModeDatagameTimerMessage.Equals(baseline.GameModeDatagameTimerMessage) ? 0 : (1u << 1);
     changeMask0 |= GameModeDatateamName0.Equals(baseline.GameModeDatateamName0) ? 0 : (1u << 2);
     changeMask0 |= GameModeDatateamName1.Equals(baseline.GameModeDatateamName1) ? 0 : (1u << 3);
     changeMask0 |= (GameModeDatateamScore0 != baseline.GameModeDatateamScore0) ? (1u << 4) : 0;
     changeMask0 |= (GameModeDatateamScore1 != baseline.GameModeDatateamScore1) ? (1u << 5) : 0;
     writer.WritePackedUIntDelta(changeMask0, baseline.changeMask0, compressionModel);
     if ((changeMask0 & (1 << 0)) != 0)
     {
         writer.WritePackedIntDelta(GameModeDatagameTimerSeconds, baseline.GameModeDatagameTimerSeconds, compressionModel);
     }
     if ((changeMask0 & (1 << 1)) != 0)
     {
         writer.WritePackedUIntDelta(GameModeDatagameTimerMessage.LengthInBytes, baseline.GameModeDatagameTimerMessage.LengthInBytes, compressionModel);
         var GameModeDatagameTimerMessageBaselineLength = (ushort)math.min((uint)GameModeDatagameTimerMessage.LengthInBytes, baseline.GameModeDatagameTimerMessage.LengthInBytes);
         for (int sb = 0; sb < GameModeDatagameTimerMessageBaselineLength; ++sb)
         {
             unsafe
             {
                 fixed(byte *b1 = &GameModeDatagameTimerMessage.buffer.byte0000)
                 fixed(byte *b2 = &baseline.GameModeDatagameTimerMessage.buffer.byte0000)
                 {
                     writer.WritePackedUIntDelta(b1[sb], b2[sb], compressionModel);
                 }
             }
         }
         for (int sb = GameModeDatagameTimerMessageBaselineLength; sb < GameModeDatagameTimerMessage.LengthInBytes; ++sb)
         {
             unsafe
             {
                 fixed(byte *b = &GameModeDatagameTimerMessage.buffer.byte0000)
                 {
                     writer.WritePackedUIntDelta(b[sb], 0, compressionModel);
                 }
             }
         }
     }
     if ((changeMask0 & (1 << 2)) != 0)
     {
         writer.WritePackedUIntDelta(GameModeDatateamName0.LengthInBytes, baseline.GameModeDatateamName0.LengthInBytes, compressionModel);
         var GameModeDatateamName0BaselineLength = (ushort)math.min((uint)GameModeDatateamName0.LengthInBytes, baseline.GameModeDatateamName0.LengthInBytes);
         for (int sb = 0; sb < GameModeDatateamName0BaselineLength; ++sb)
         {
             unsafe
             {
                 fixed(byte *b1 = &GameModeDatateamName0.buffer.byte0000)
                 fixed(byte *b2 = &baseline.GameModeDatateamName0.buffer.byte0000)
                 {
                     writer.WritePackedUIntDelta(b1[sb], b2[sb], compressionModel);
                 }
             }
         }
         for (int sb = GameModeDatateamName0BaselineLength; sb < GameModeDatateamName0.LengthInBytes; ++sb)
         {
             unsafe
             {
                 fixed(byte *b = &GameModeDatateamName0.buffer.byte0000)
                 {
                     writer.WritePackedUIntDelta(b[sb], 0, compressionModel);
                 }
             }
         }
     }
     if ((changeMask0 & (1 << 3)) != 0)
     {
         writer.WritePackedUIntDelta(GameModeDatateamName1.LengthInBytes, baseline.GameModeDatateamName1.LengthInBytes, compressionModel);
         var GameModeDatateamName1BaselineLength = (ushort)math.min((uint)GameModeDatateamName1.LengthInBytes, baseline.GameModeDatateamName1.LengthInBytes);
         for (int sb = 0; sb < GameModeDatateamName1BaselineLength; ++sb)
         {
             unsafe
             {
                 fixed(byte *b1 = &GameModeDatateamName1.buffer.byte0000)
                 fixed(byte *b2 = &baseline.GameModeDatateamName1.buffer.byte0000)
                 {
                     writer.WritePackedUIntDelta(b1[sb], b2[sb], compressionModel);
                 }
             }
         }
         for (int sb = GameModeDatateamName1BaselineLength; sb < GameModeDatateamName1.LengthInBytes; ++sb)
         {
             unsafe
             {
                 fixed(byte *b = &GameModeDatateamName1.buffer.byte0000)
                 {
                     writer.WritePackedUIntDelta(b[sb], 0, compressionModel);
                 }
             }
         }
     }
     if ((changeMask0 & (1 << 4)) != 0)
     {
         writer.WritePackedIntDelta(GameModeDatateamScore0, baseline.GameModeDatateamScore0, compressionModel);
     }
     if ((changeMask0 & (1 << 5)) != 0)
     {
         writer.WritePackedIntDelta(GameModeDatateamScore1, baseline.GameModeDatateamScore1, compressionModel);
     }
 }