예제 #1
0
        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());
        }
예제 #2
0
        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
            }
        }