public override byte[] Pack() { DynamicOutputBuffer buffer = DynamicOutputBuffer.Get(Code); PackHeader(buffer); buffer.WriteSmallVector3F(Position); buffer.WriteSmallVelVector3F(Velocity); buffer.WriteSmallAngle(Azimuth); buffer.WriteSmallAngVel(AngularVelocity); PackFooter(buffer); return(buffer.GetMessageBuffer()); }
protected void PackFooter(DynamicOutputBuffer buffer) { if (Status == PlayerStatuses.JumpJets) { buffer.WriteSmallScale(JumpSquish); //2 } if (Status == PlayerStatuses.OnDriver) { buffer.WriteInt32(OnDriver); //4 } if (Status == PlayerStatuses.UserInputs) { buffer.WriteSmallVel(UserSpeed); //6 buffer.WriteSmallAngVel(UserAngVel); //8 } if (Status == PlayerStatuses.PlaySound) { buffer.WriteByte((byte)Sounds); //9 } }