Beispiel #1
0
        void WriteNetVector2(FieldInfo FI)
        {
            NetVector2 nv2 = (NetVector2)FI.GetValue(this);

            _bw.Write(nv2.Data[0]);
            _bw.Write(nv2.Data[1]);
            _SendPacket.Counter += 8;
        }
Beispiel #2
0
        void ReadNetVector2A(FieldInfo field)
        {
            int c = _DecodeMSReader.ReadInt32();

            if (c * 8 > (_ReadSize - _ReadCounter) || _ReadSize > MaximumPacketSize)
            {
                throw new Exception("Array is beond the packetlimits! Hacking attempt?");
            }
            _ReadCounter += c * 8;
            NetVector2[] b = new NetVector2[c];
            for (int x = 0; x < b.Length; x++)
            {
                b[x] = new NetVector2(_DecodeMSReader.ReadSingle(), _DecodeMSReader.ReadSingle());
            }
            field.SetValue(this, b);
        }