Esempio n. 1
0
        public static Entity ReadEntity(this BasePacket packet)
        {
            if (packet.ReadBool())
            {
                return(Core.FindEntity(packet.ReadNetworkId()));
            }

            return(null);
        }
Esempio n. 2
0
        public static bool ReadStopMarker(this BasePacket stream)
        {
            if (stream.CanRead())
            {
                return(stream.ReadBool());
            }

            return(false);
        }
Esempio n. 3
0
        public static byte[] ReadByteArraySimple(this BasePacket stream)
        {
            if (stream.ReadBool())
            {
                int    length = stream.ReadUShort();
                byte[] data   = new byte[length];

                stream.ReadByteArray(data, 0, data.Length);

                return(data);
            }
            else
            {
                return(null);
            }
        }