Пример #1
0
        public override byte[] Pack()
        {
            DynamicOutputBuffer buffer = DynamicOutputBuffer.Get(Code);

            buffer.WriteUInt16((UInt16)PlayerType);
            buffer.WriteInt16((Int16)PlayerTeam);

            buffer.WriteFixedSizeString(Callsign, Constants.CallsignLen);
            buffer.WriteFixedSizeString(Motto, Constants.MottoLen);
            buffer.WriteFixedSizeString(Token, Constants.TokenLen);
            buffer.WriteFixedSizeString(Version, Constants.VersionLen);

            return(buffer.GetMessageBuffer());
        }
Пример #2
0
        public override byte[] Pack()
        {
            DynamicOutputBuffer buffer = DynamicOutputBuffer.Get(Code);

            buffer.WriteByte(PlayerID);
            buffer.WriteUInt16((int)PlayerType);
            buffer.WriteUInt16((int)Team);
            buffer.WriteUInt16((int)Wins);
            buffer.WriteUInt16((int)Losses);
            buffer.WriteUInt16((int)TeamKills);
            buffer.WriteFixedSizeString(Callsign, Constants.CallsignLen);
            buffer.WriteFixedSizeString(Motto, Constants.MottoLen);

            return(buffer.GetMessageBuffer());
        }
Пример #3
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());
        }
Пример #4
0
        public override byte[] Pack()
        {
            DynamicOutputBuffer buffer = DynamicOutputBuffer.Get(Code);

            if (!IsServer())
            {
                buffer.WriteByte((byte)To);
                buffer.WriteFixedSizeString(MessageText, BZFlag.Data.Types.Constants.ChatMessageLenght);
            }
            else
            {
                buffer.WriteByte((byte)From);
                buffer.WriteByte((byte)To);
                buffer.WriteByte((byte)MessageType);
            }

            buffer.WriteFixedSizeString(MessageText, BZFlag.Data.Types.Constants.ChatMessageLenght);
            return(buffer.GetMessageBuffer());
        }
Пример #5
0
        public override byte[] Pack()
        {
            DynamicOutputBuffer buffer = DynamicOutputBuffer.Get(Code);

            foreach (var f in FlagAbrevs)
            {
                buffer.WriteFixedSizeString(f, 2);
            }

            return(buffer.GetMessageBuffer());
        }
Пример #6
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());
        }