Skip to content
This repository has been archived by the owner on May 8, 2021. It is now read-only.

Wrong size header in vision packets #12

Open
danil179 opened this issue Oct 15, 2019 · 0 comments
Open

Wrong size header in vision packets #12

danil179 opened this issue Oct 15, 2019 · 0 comments

Comments

@danil179
Copy link

danil179 commented Oct 15, 2019

var buffer = writer2.GetBytes();

Should change to:

using (var writer2 = new ByteWriter())
            {
                foreach (var packet in Packets)
                {
                    var data = packet.GetBytes();
                    if (data.Length > 0x1FFF)
                    {
                        throw new IOException("Packet too big!");
                    }
                    writer2.WriteUInt16((ushort)data.Length);
                    writer2.WriteBytes(data);
                }
                var buffer = writer2.GetBytes();
                if (buffer.Length > 0x1FFF)
                {
                    throw new IOException("Packet data too big!");
                }
                writer.WriteUInt16((ushort)(buffer.Length & 0x1FFF));
                writer.WriteBytes(buffer);
            }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant