Exemple #1
0
 public void Merge(EntityUpdate playerEntityData)
 {
     if (position != null)
     {
         playerEntityData.position = position;
     }
     if (rotation != null)
     {
         playerEntityData.rotation = rotation;
     }
     if (velocity != null)
     {
         playerEntityData.velocity = velocity;
     }
     if (acceleration != null)
     {
         playerEntityData.acceleration = acceleration;
     }
     if (extraVel != null)
     {
         playerEntityData.extraVel = extraVel;
     }
     if (viewportPitch != null)
     {
         playerEntityData.viewportPitch = viewportPitch;
     }
     if (physicsFlags != null)
     {
         playerEntityData.physicsFlags = physicsFlags;
     }
     if (hostility != null)
     {
         playerEntityData.hostility = hostility;
     }
     if (entityType != null)
     {
         playerEntityData.entityType = entityType;
     }
     if (mode != null)
     {
         playerEntityData.mode = mode;
     }
     if (modeTimer != null)
     {
         playerEntityData.modeTimer = modeTimer;
     }
     if (combo != null)
     {
         playerEntityData.combo = combo;
     }
     if (lastHitTime != null)
     {
         playerEntityData.lastHitTime = lastHitTime;
     }
     if (appearance != null)
     {
         playerEntityData.appearance = appearance;
     }
     if (entityFlags != null)
     {
         playerEntityData.entityFlags = entityFlags;
     }
     if (roll != null)
     {
         playerEntityData.roll = roll;
     }
     if (stun != null)
     {
         playerEntityData.stun = stun;
     }
     if (slow != null)
     {
         playerEntityData.slow = slow;
     }
     if (ice != null)
     {
         playerEntityData.ice = ice;
     }
     if (wind != null)
     {
         playerEntityData.wind = wind;
     }
     if (showPatchTime != null)
     {
         playerEntityData.showPatchTime = showPatchTime;
     }
     if (entityClass != null)
     {
         playerEntityData.entityClass = entityClass;
     }
     if (specialization != null)
     {
         playerEntityData.specialization = specialization;
     }
     if (charge != null)
     {
         playerEntityData.charge = charge;
     }
     if (unused24 != null)
     {
         playerEntityData.unused24 = unused24;
     }
     if (unused25 != null)
     {
         playerEntityData.unused25 = unused25;
     }
     if (rayHit != null)
     {
         playerEntityData.rayHit = rayHit;
     }
     if (HP != null)
     {
         playerEntityData.HP = HP;
     }
     if (MP != null)
     {
         playerEntityData.MP = MP;
     }
     if (block != null)
     {
         playerEntityData.block = block;
     }
     if (multipliers != null)
     {
         playerEntityData.multipliers = multipliers;
     }
     if (unused31 != null)
     {
         playerEntityData.unused31 = unused31;
     }
     if (unused32 != null)
     {
         playerEntityData.unused32 = unused32;
     }
     if (level != null)
     {
         playerEntityData.level = level;
     }
     if (XP != null)
     {
         playerEntityData.XP = XP;
     }
     if (parentOwner != null)
     {
         playerEntityData.parentOwner = parentOwner;
     }
     if (unused36 != null)
     {
         playerEntityData.unused36 = unused36;
     }
     if (powerBase != null)
     {
         playerEntityData.powerBase = powerBase;
     }
     if (unused38 != null)
     {
         playerEntityData.unused38 = unused38;
     }
     if (unused39 != null)
     {
         playerEntityData.unused39 = unused39;
     }
     if (spawnPos != null)
     {
         playerEntityData.spawnPos = spawnPos;
     }
     if (unused41 != null)
     {
         playerEntityData.unused41 = unused41;
     }
     if (unused42 != null)
     {
         playerEntityData.unused42 = unused42;
     }
     if (consumable != null)
     {
         playerEntityData.consumable = consumable;
     }
     if (equipment != null)
     {
         playerEntityData.equipment = equipment;
     }
     if (name != null)
     {
         playerEntityData.name = name;
     }
     if (skillDistribution != null)
     {
         playerEntityData.skillDistribution = skillDistribution;
     }
     if (manaCubes != null)
     {
         playerEntityData.manaCubes = manaCubes;
     }
 }
Exemple #2
0
 public void Filter(EntityUpdate previous)
 {
     if (position != null)
     {
         if (Math.Abs(position.x - previous.position.x) < 100000 &&
             Math.Abs(position.y - previous.position.y) < 100000 &&
             Math.Abs(position.z - previous.position.z) < 100000)
         {
             position = null;
         }
     }
     rotation = null;
     if (velocity != null)
     {
         if (Math.Abs(velocity.z - previous.velocity.z) < 2)
         {
             velocity = null;
         }
     }
     if (acceleration != null)
     {
         if (Math.Abs(acceleration.x - previous.acceleration.x) < 10 &&
             Math.Abs(acceleration.y - previous.acceleration.y) < 10 &&
             Math.Abs(acceleration.z - previous.acceleration.z) < 10)
         {
             acceleration = null;
         }
     }
     if (extraVel != null)
     {
         if (Math.Abs(extraVel.x) < 1 &&
             Math.Abs(extraVel.y) < 1 &&
             Math.Abs(extraVel.z) < 1)
         {
             extraVel = null;
         }
     }
     viewportPitch = null;
     physicsFlags  = null;
     if (modeTimer != null && modeTimer > 100)
     {
         previous.modeTimer = modeTimer;//necessary for rayhit filtering
         modeTimer          = null;
     }
     lastHitTime = null;
     if (roll != null && !(roll > 500))
     {
         roll = null;
     }
     if (stun != null && stun < previous.stun)
     {
         stun = null;
     }
     if (slow != null && slow < previous.slow)
     {
         slow = null;
     }
     if (ice != null && ice < previous.ice)
     {
         ice = null;
     }
     if (wind != null && wind < previous.wind)
     {
         wind = null;
     }
     showPatchTime = null;
     if (charge != null)
     {
         if (Math.Abs((float)(charge - previous.charge)) < 0.1f)
         {
             charge = null;
         }
     }
     unused24 = null;
     unused25 = null;
     if (rayHit != null)
     {
         if (previous.mode == 0 || previous.modeTimer > 1500 || //current could be null
             (Math.Abs(rayHit.x - previous.rayHit.x) < 1.5f &&
              Math.Abs(rayHit.y - previous.rayHit.y) < 1.5f &&
              Math.Abs(rayHit.z - previous.rayHit.z) < 1.5f))
         {
             rayHit = null;
         }
     }
     MP                = null;
     multipliers       = null;
     unused31          = null;
     unused32          = null;
     XP                = null;
     unused36          = null;
     powerBase         = null;
     unused38          = null;
     unused39          = null;
     spawnPos          = null;
     unused41          = null;
     unused42          = null;
     skillDistribution = null;
     manaCubes         = null;
 }