Package utility

Examples of utility.GamePacket.addInt32()


            packet.addBoolean(waterSource != null);

            if (waterSource != null) {
                packet.addInt32(waterSource.getID());
                packet.addInt32(waterSource.getMaxWater());
                packet.addInt32(waterSource.getWater());
            }
        }

        return packet.getBytes();
    }
View Full Code Here


    }

    @Override
    public byte[] constructResponseInBytes() {
        GamePacket packet = new GamePacket(responseCode);
        packet.addInt32(species.getID());

        return packet.getBytes();
    }

    public void setSpecies(Organism species) {
View Full Code Here

    @Override
    public byte[] constructResponseInBytes() {
        GamePacket packet = new GamePacket(responseCode);
        packet.addShort16(status);
        packet.addInt32(plant.getID());
        packet.addString(plant.getSpeciesType().getSpeciesName());
        packet.addShort16((short) plant.getSpeciesType().getModelID());
        packet.addShort16((short) plant.getSpeciesTypeID());
        packet.addInt32(plant.getPlayerID());
        packet.addInt32(plant.getZoneID());
View Full Code Here

        packet.addShort16(status);
        packet.addInt32(plant.getID());
        packet.addString(plant.getSpeciesType().getSpeciesName());
        packet.addShort16((short) plant.getSpeciesType().getModelID());
        packet.addShort16((short) plant.getSpeciesTypeID());
        packet.addInt32(plant.getPlayerID());
        packet.addInt32(plant.getZoneID());
        packet.addShort16((short) plant.getBiomass());
        packet.addFloat(plant.getX());
        packet.addFloat(plant.getY());
        packet.addFloat(plant.getZ());
View Full Code Here

        packet.addInt32(plant.getID());
        packet.addString(plant.getSpeciesType().getSpeciesName());
        packet.addShort16((short) plant.getSpeciesType().getModelID());
        packet.addShort16((short) plant.getSpeciesTypeID());
        packet.addInt32(plant.getPlayerID());
        packet.addInt32(plant.getZoneID());
        packet.addShort16((short) plant.getBiomass());
        packet.addFloat(plant.getX());
        packet.addFloat(plant.getY());
        packet.addFloat(plant.getZ());
        packet.addShort16((short) plant.getGroupSize());
View Full Code Here

        } else if (world.getGameMode() == Constants.GAME_TYPE_PVP) {
            packet.addShort16((short) 2);
        }

        if (status == 0) {
            packet.addInt32(world.getID());
            //world name
            packet.addString(world.getGameName());
            //ecosystem
            packet.addString(world.getEnvType());
            //max player number
View Full Code Here

    @Override
    public byte[] constructResponseInBytes() {
        GamePacket packet = new GamePacket(responseCode);
        packet.addShort16(status);
        packet.addInt32(animal.getID());
        packet.addString(animal.getSpeciesType().getSpeciesName());
        packet.addShort16((short) animal.getSpeciesType().getModelID());
        packet.addShort16((short) animal.getSpeciesTypeID());
        packet.addInt32(animal.getPlayerID());
        packet.addInt32(animal.getZoneID());
View Full Code Here

        packet.addShort16(status);
        packet.addInt32(animal.getID());
        packet.addString(animal.getSpeciesType().getSpeciesName());
        packet.addShort16((short) animal.getSpeciesType().getModelID());
        packet.addShort16((short) animal.getSpeciesTypeID());
        packet.addInt32(animal.getPlayerID());
        packet.addInt32(animal.getZoneID());
        packet.addShort16((short) animal.getBiomass());
        packet.addFloat(animal.getX());
        packet.addFloat(animal.getY());
        packet.addFloat(animal.getZ());
View Full Code Here

        packet.addInt32(animal.getID());
        packet.addString(animal.getSpeciesType().getSpeciesName());
        packet.addShort16((short) animal.getSpeciesType().getModelID());
        packet.addShort16((short) animal.getSpeciesTypeID());
        packet.addInt32(animal.getPlayerID());
        packet.addInt32(animal.getZoneID());
        packet.addShort16((short) animal.getBiomass());
        packet.addFloat(animal.getX());
        packet.addFloat(animal.getY());
        packet.addFloat(animal.getZ());
        packet.addShort16((short) animal.getGroupSize());
View Full Code Here

    }

    @Override
    public byte[] constructResponseInBytes() {
        GamePacket packet = new GamePacket(responseCode);
        packet.addInt32(animal_id);
        packet.addInt32(predator_id);
        packet.addShort16(count);
        return packet.getBytes();
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.