public int size(Kaminari.IMarshal marshal) { int size = 0; size += marshal.size <byte>() + this.name.Length; size += marshal.size <ushort>(); return(size); }
public int size(Kaminari.IMarshal marshal) { int size = 0; size += marshal.size <char>(); size += marshal.size <char>(); size += marshal.size <byte>(); return(size); }
public int size(Kaminari.IMarshal marshal) { int size = 0; size += marshal.size <ulong>(); size += marshal.size <float>(); size += marshal.size <float>(); return(size); }
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); }
public int size(Kaminari.IMarshal marshal) { int size = 0; size += marshal.size <byte>() + this.username.Length; size += marshal.size <ulong>(); size += marshal.size <ulong>(); size += marshal.size <ulong>(); size += marshal.size <ulong>(); return(size); }
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); }
public int size(Kaminari.IMarshal marshal) { int size = 0; size += marshal.size <bool>(); return(size); }
public int size(Kaminari.IMarshal marshal) { int size = 0; size += sizeof(byte) + this.data.Count * marshal.size <EntityUpdate>(); return(size); }
public int size(Kaminari.IMarshal marshal) { int size = 0; size += sizeof(byte); if (this.x.hasValue()) { size += marshal.size <uint>(); } size += sizeof(byte) + this.y.Count * marshal.size <SpawnData>(); size += marshal.size <int>(); size += sizeof(byte); if (this.w.hasValue()) { size += sizeof(byte) + this.w.getValue().Count *marshal.size <bool>(); } return(size); }