Esempio n. 1
0
 @Override
 public void deserialize(Buffer buf) {
   name = buf.readString();
   worldX = buf.readShort();
   if (worldX < -255 || worldX > 255)
     throw new RuntimeException(
         "Forbidden value on worldX = "
             + worldX
             + ", it doesn't respect the following condition : worldX < -255 || worldX > 255");
   worldY = buf.readShort();
   if (worldY < -255 || worldY > 255)
     throw new RuntimeException(
         "Forbidden value on worldY = "
             + worldY
             + ", it doesn't respect the following condition : worldY < -255 || worldY > 255");
   ownername = buf.readString();
 }
Esempio n. 2
0
 @Override
 public void deserialize(Buffer buf) {
   short flag1 = buf.readUByte();
   isOnSale = BooleanByteWrapper.getFlag(flag1, 0);
   isSaleLocked = BooleanByteWrapper.getFlag(flag1, 1);
   houseId = buf.readInt();
   if (houseId < 0)
     throw new RuntimeException(
         "Forbidden value on houseId = "
             + houseId
             + ", it doesn't respect the following condition : houseId < 0");
   int limit = buf.readUShort();
   doorsOnMap = new int[limit];
   for (int i = 0; i < limit; i++) {
     doorsOnMap[i] = buf.readInt();
   }
   ownerName = buf.readString();
   modelId = buf.readShort();
   if (modelId < 0)
     throw new RuntimeException(
         "Forbidden value on modelId = "
             + modelId
             + ", it doesn't respect the following condition : modelId < 0");
 }