public override void write(SteamChannel channel)
 {
     base.write(channel);
     channel.write(this.analog);
     channel.write(this.position);
     channel.write(this.yaw);
     channel.write(this.pitch);
 }
Beispiel #2
0
 public override void write(SteamChannel channel)
 {
     base.write(channel);
     channel.write(this.position);
     channel.write(this.angle_x);
     channel.write(this.angle_y);
     channel.write(this.angle_z);
     channel.write(this.speed);
     channel.write(this.physicsSpeed);
     channel.write(this.turn);
 }
Beispiel #3
0
 public virtual void write(SteamChannel channel)
 {
     channel.write(this.sequence);
     channel.write(this.recov);
     channel.write(this.keys);
     if (this.clientsideInputs == null)
     {
         channel.write(0);
     }
     else
     {
         channel.write((byte)this.clientsideInputs.Count);
         foreach (RaycastInfo raycastInfo in this.clientsideInputs)
         {
             if (raycastInfo.player != null)
             {
                 channel.write(3);
                 channel.write(raycastInfo.point);
                 channel.write(raycastInfo.direction);
                 channel.write(raycastInfo.normal);
                 channel.write((byte)raycastInfo.limb);
                 channel.write(raycastInfo.player.channel.owner.playerID.steamID);
             }
             else if (raycastInfo.zombie != null)
             {
                 channel.write(4);
                 channel.write(raycastInfo.point);
                 channel.write(raycastInfo.direction);
                 channel.write(raycastInfo.normal);
                 channel.write((byte)raycastInfo.limb);
                 channel.write(raycastInfo.zombie.id);
             }
             else if (raycastInfo.animal != null)
             {
                 channel.write(5);
                 channel.write(raycastInfo.point);
                 channel.write(raycastInfo.direction);
                 channel.write(raycastInfo.normal);
                 channel.write((byte)raycastInfo.limb);
                 channel.write(raycastInfo.animal.index);
             }
             else if (raycastInfo.vehicle != null)
             {
                 channel.write(6);
                 channel.write(raycastInfo.point);
                 channel.write(raycastInfo.normal);
                 channel.write((byte)raycastInfo.material);
                 channel.write(raycastInfo.vehicle.instanceID);
             }
             else if (raycastInfo.transform != null)
             {
                 if (raycastInfo.transform.CompareTag("Barricade"))
                 {
                     channel.write(7);
                     InteractableDoorHinge component = raycastInfo.transform.GetComponent <InteractableDoorHinge>();
                     if (component != null)
                     {
                         raycastInfo.transform = component.transform.parent.parent;
                     }
                     byte            b;
                     byte            b2;
                     ushort          num;
                     ushort          num2;
                     BarricadeRegion barricadeRegion;
                     if (BarricadeManager.tryGetInfo(raycastInfo.transform, out b, out b2, out num, out num2, out barricadeRegion))
                     {
                         channel.write(raycastInfo.point);
                         channel.write(raycastInfo.normal);
                         channel.write((byte)raycastInfo.material);
                         channel.write(b);
                         channel.write(b2);
                         channel.write(num);
                         channel.write(num2);
                     }
                     else
                     {
                         channel.write(Vector3.zero);
                         channel.write(Vector3.up);
                         channel.write(0);
                         channel.write(0);
                         channel.write(0);
                         channel.write(ushort.MaxValue);
                         channel.write(ushort.MaxValue);
                     }
                 }
                 else if (raycastInfo.transform.CompareTag("Structure"))
                 {
                     channel.write(8);
                     byte            b3;
                     byte            b4;
                     ushort          num3;
                     StructureRegion structureRegion;
                     if (StructureManager.tryGetInfo(raycastInfo.transform, out b3, out b4, out num3, out structureRegion))
                     {
                         channel.write(raycastInfo.point);
                         channel.write(raycastInfo.direction);
                         channel.write(raycastInfo.normal);
                         channel.write((byte)raycastInfo.material);
                         channel.write(b3);
                         channel.write(b4);
                         channel.write(num3);
                     }
                     else
                     {
                         channel.write(Vector3.zero);
                         channel.write(Vector3.up);
                         channel.write(Vector3.up);
                         channel.write(0);
                         channel.write(0);
                         channel.write(0);
                         channel.write(ushort.MaxValue);
                     }
                 }
                 else if (raycastInfo.transform.CompareTag("Resource"))
                 {
                     channel.write(9);
                     byte   b5;
                     byte   b6;
                     ushort num4;
                     if (ResourceManager.tryGetRegion(raycastInfo.transform, out b5, out b6, out num4))
                     {
                         channel.write(raycastInfo.point);
                         channel.write(raycastInfo.direction);
                         channel.write(raycastInfo.normal);
                         channel.write((byte)raycastInfo.material);
                         channel.write(b5);
                         channel.write(b6);
                         channel.write(num4);
                     }
                     else
                     {
                         channel.write(Vector3.zero);
                         channel.write(Vector3.up);
                         channel.write(Vector3.up);
                         channel.write(0);
                         channel.write(0);
                         channel.write(0);
                         channel.write(ushort.MaxValue);
                     }
                 }
                 else if (raycastInfo.transform.CompareTag("Small") || raycastInfo.transform.CompareTag("Medium") || raycastInfo.transform.CompareTag("Large"))
                 {
                     channel.write(2);
                     byte   b7;
                     byte   b8;
                     ushort num5;
                     if (ObjectManager.tryGetRegion(raycastInfo.transform, out b7, out b8, out num5))
                     {
                         channel.write(raycastInfo.point);
                         channel.write(raycastInfo.direction);
                         channel.write(raycastInfo.normal);
                         channel.write((byte)raycastInfo.material);
                         channel.write(raycastInfo.section);
                         channel.write(b7);
                         channel.write(b8);
                         channel.write(num5);
                     }
                     else
                     {
                         channel.write(Vector3.zero);
                         channel.write(Vector3.up);
                         channel.write(Vector3.up);
                         channel.write(0);
                         channel.write(byte.MaxValue);
                         channel.write(0);
                         channel.write(0);
                         channel.write(ushort.MaxValue);
                     }
                 }
                 else if (raycastInfo.transform.CompareTag("Ground") || raycastInfo.transform.CompareTag("Environment"))
                 {
                     channel.write(0);
                     channel.write(raycastInfo.point);
                     channel.write(raycastInfo.normal);
                     channel.write((byte)raycastInfo.material);
                 }
                 else
                 {
                     channel.write(1);
                 }
             }
             else
             {
                 channel.write(1);
             }
         }
     }
 }