Ejemplo n.º 1
0
        public bool unpack(Kaminari.IMarshal marshal, Kaminari.PacketReader packet)
        {
            if (packet.bytesRead() + sizeof(byte) > packet.bufferSize())
            {
                return(false);
            }
            this.x = new Kaminari.Optional <uint>();
            if (packet.getData().readByte() == 1)
            {
                if (packet.bytesRead() + marshal.size <uint>() > packet.bufferSize())
                {
                    return(false);
                }
                this.x.setValue(packet.getData().readUint());
            }
            int size_y = packet.getData().readByte();

            this.y = new List <SpawnData>();
            for (int i = 0; i < size_y; ++i)
            {
                SpawnData data = new SpawnData();
                if (data.unpack(marshal, packet))
                {
                    this.y.Add(data);
                }
                else
                {
                    return(false);
                }
            }
            if (packet.bytesRead() + marshal.size <int>() > packet.bufferSize())
            {
                return(false);
            }
            this.z = packet.getData().readInt();
            if (packet.bytesRead() + sizeof(byte) > packet.bufferSize())
            {
                return(false);
            }
            this.w = new Kaminari.Optional <List <bool> >();
            if (packet.getData().readByte() == 1)
            {
                int size_w = packet.getData().readByte();
                if (packet.bytesRead() + size_w * marshal.size <bool>() > packet.bufferSize())
                {
                    return(false);
                }
                this.w.setValue(new List <bool>());
                for (int i = 0; i < size_w; ++i)
                {
                    this.w.getValue().Add(packet.getData().readBool());
                }
            }
            return(true);
        }
Ejemplo n.º 2
0
 public bool unpack(Kaminari.IMarshal marshal, Kaminari.PacketReader packet)
 {
     if (packet.bytesRead() + marshal.size <byte>() > packet.bufferSize())
     {
         return(false);
     }
     if (packet.bytesRead() + marshal.size <byte>() + packet.getData().peekByte() > packet.bufferSize())
     {
         return(false);
     }
     this.name = packet.getData().readString();
     return(true);
 }
Ejemplo n.º 3
0
 public bool unpack(Kaminari.IMarshal marshal, Kaminari.PacketReader packet)
 {
     if (packet.bytesRead() + this.size(marshal) > packet.bufferSize())
     {
         return(false);
     }
     return(true);
 }
Ejemplo n.º 4
0
 public bool unpack(Kaminari.IMarshal marshal, Kaminari.PacketReader packet)
 {
     if (packet.bytesRead() + this.size(marshal) > packet.bufferSize())
     {
         return(false);
     }
     this.success = packet.getData().readBool();
     return(true);
 }
Ejemplo n.º 5
0
 public bool unpack(Kaminari.IMarshal marshal, Kaminari.PacketReader packet)
 {
     if (packet.bytesRead() + this.size(marshal) > packet.bufferSize())
     {
         return(false);
     }
     this.id = packet.getData().readUlong();
     this.x  = packet.getData().readFloat();
     this.z  = packet.getData().readFloat();
     return(true);
 }
Ejemplo n.º 6
0
 public bool unpack(Kaminari.IMarshal marshal, Kaminari.PacketReader packet)
 {
     if (packet.bytesRead() + this.size(marshal) > packet.bufferSize())
     {
         return(false);
     }
     this.x     = packet.getData().readFloat();
     this.z     = packet.getData().readFloat();
     this.speed = packet.getData().readFloat();
     this.vx    = packet.getData().readFloat();
     this.vz    = packet.getData().readFloat();
     this.seq   = packet.getData().readByte();
     this.frame = packet.getData().readUshort();
     return(true);
 }