예제 #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(PlayerID);
            buffer.WriteUInt16((UInt16)ShotID);
            buffer.WriteVector3F(Position);
            buffer.WriteVector3F(Velocity);
            buffer.WriteFloat(DeltaTime);
            buffer.WriteInt16((Int16)Team);
            buffer.WriteByte(TargetID);

            return(buffer.GetMessageBuffer());
        }
예제 #3
0
        public override byte[] Pack()
        {
            DynamicOutputBuffer buffer = DynamicOutputBuffer.Get(Code);

            PackHeader(buffer);

            buffer.WriteVector3F(Position);
            buffer.WriteVector3F(Velocity);

            buffer.WriteFloat(Azimuth);
            buffer.WriteFloat(AngularVelocity);

            PackFooter(buffer);
            return(buffer.GetMessageBuffer());
        }
예제 #4
0
        public override byte[] Pack()
        {
            DynamicOutputBuffer buffer = DynamicOutputBuffer.Get(Code);

            buffer.WriteFloat(TimeSent);
            buffer.WriteByte(PlayerID);
            buffer.WriteInt16(ShotID);

            buffer.WriteVector3F(Position);
            buffer.WriteVector3F(Velocity);

            buffer.WriteFloat(DeltaTime);

            buffer.WriteInt16((UInt16)Team);

            buffer.WriteFixedSizeString(Flag, 2);
            buffer.WriteFloat(Lifetime);

            return(buffer.GetMessageBuffer());
        }
예제 #5
0
        public override byte[] Pack()
        {
            DynamicOutputBuffer buffer = DynamicOutputBuffer.Get(Code);

            if (!IsSpawn)
            {
                buffer.WriteByte(PlayerID);
                buffer.WriteVector3F(Position);
                buffer.WriteFloat(Azimuth);
            }

            return(buffer.GetMessageBuffer());
        }
예제 #6
0
        public override byte[] Pack()
        {
            DynamicOutputBuffer buffer = DynamicOutputBuffer.Get(Code);

            if (IsServer())
            {
                buffer.WriteByte(PlayerID);
                buffer.WriteFlagUpdateData(Data, true);
            }
            else
            {
                buffer.WriteVector3F(Postion);
            }

            return(buffer.GetMessageBuffer());
        }