Example #1
0
 public bool unpack(Kaminari.IMarshal marshal, Kaminari.PacketReader packet)
 {
     if (packet.bytesRead() + this.size(marshal) > packet.bufferSize())
     {
         return(false);
     }
     this.x   = packet.getData().readChar();
     this.y   = packet.getData().readChar();
     this.seq = packet.getData().readByte();
     return(true);
 }
Example #2
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);
 }
Example #3
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);
 }
Example #4
0
 public bool unpack(Kaminari.IMarshal marshal, Kaminari.PacketReader packet)
 {
     if (packet.bytesRead() + this.size(marshal) > packet.bufferSize())
     {
         return(false);
     }
     this.version = packet.getData().readUint();
     return(true);
 }
Example #5
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);
        }
Example #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);
 }
Example #7
0
        public bool unpack(Kaminari.IMarshal marshal, Kaminari.PacketReader packet)
        {
            int size_data = packet.getData().readByte();

            this.data = new List <EntityUpdate>();
            for (int i = 0; i < size_data; ++i)
            {
                EntityUpdate data = new EntityUpdate();
                if (data.unpack(marshal, packet))
                {
                    this.data.Add(data);
                }
                else
                {
                    return(false);
                }
            }
            return(true);
        }