예제 #1
0
        protected void WriteBases(List <Base> items)
        {
            DynaBuffer.WriteInt32(items.Count);

            foreach (var o in items)
            {
                DynaBuffer.WriteUInt16((UInt16)o.TeamColor);
                DynaBuffer.WriteVector3F(o.Position);
                DynaBuffer.WriteFloat(o.Rotation);
                DynaBuffer.WriteVector3F(o.Size);

                byte state = 0;

                if (o.DriveThrough)
                {
                    state |= Constants.DRIVE_THRU;
                }
                if (o.ShootThrough)
                {
                    state |= Constants.SHOOT_THRU;
                }
                if (o.Ricochet)
                {
                    state |= Constants.RICOCHET;
                }
                DynaBuffer.WriteByte(state);
            }
        }
예제 #2
0
        public override byte[] Pack()
        {
            DynamicOutputBuffer buffer = DynamicOutputBuffer.Get(Code);

            buffer.WriteByte(VictimID);
            buffer.WriteByte(KillerID);

            int r = (int)Reason;

            if (Reason == BlowedUpReasons.DeathTouch)
            {
                r = Constants.PhysicsDriverDeath;
            }
            buffer.WriteInt16(r);

            buffer.WriteInt16(ShotID);
            buffer.WriteFixedSizeString(FlagAbreviation, 2);

            if (Reason == BlowedUpReasons.DeathTouch)
            {
                buffer.WriteInt32(PhysicsDriverID);
            }

            return(buffer.GetMessageBuffer());
        }
예제 #3
0
        protected void PackHeader(DynamicOutputBuffer buffer)
        {
            buffer.WriteFloat(TimeStamp);
            buffer.WriteByte((byte)PlayerID);

            buffer.WriteInt32(Order);
            buffer.WriteInt16((Int16)Status);
        }
예제 #4
0
        public override byte[] Pack()
        {
            DynamicOutputBuffer buffer = DynamicOutputBuffer.Get(Code);

            buffer.WriteInt32(TimeLeft);

            return(buffer.GetMessageBuffer());
        }
예제 #5
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
            }
        }