Package utility

Examples of utility.GamePacket.addString()


                    }
                    if (preyList.endsWith(", ")) {
                        preyList = preyList.substring(0, preyList.lastIndexOf(","));
                    }

                    packet.addString(predatorList);
                    packet.addString(preyList);

                    packet.addShort16((short) animal.getAvgBiomass());
                    packet.addShort16((short) animal.getMass());
                    packet.addShort16((short) animal.getMovtForce());
View Full Code Here


                    if (preyList.endsWith(", ")) {
                        preyList = preyList.substring(0, preyList.lastIndexOf(","));
                    }

                    packet.addString(predatorList);
                    packet.addString(preyList);

                    packet.addShort16((short) animal.getAvgBiomass());
                    packet.addShort16((short) animal.getMass());
                    packet.addShort16((short) animal.getMovtForce());
                    packet.addShort16((short) animal.getMaxForce());
View Full Code Here

                    packet.addShort16((short) animal.getAvgBiomass());
                    packet.addShort16((short) animal.getMass());
                    packet.addShort16((short) animal.getMovtForce());
                    packet.addShort16((short) animal.getMaxForce());
                    packet.addInt32(animal.getModelID());
                    packet.addString(animal.getAnimalCategory());
                }
            }
        }

        return packet.getBytes();
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());
        packet.addShort16((short) plant.getBiomass());
View Full Code Here

        }

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

        if (status == 0) {
            packet.addInt32(world.getID());
            //world name
            packet.addString(world.getGameName());
            //ecosystem
            packet.addString(world.getEnvType());
            //max player number
            packet.addShort16((short) world.getMaxPlayers());

            //Character name
            packet.addString(charName);
View Full Code Here

            packet.addString(world.getEnvType());
            //max player number
            packet.addShort16((short) world.getMaxPlayers());

            //Character name
            packet.addString(charName);
            packet.addFloat(world.getTimeRate());
        }

        return packet.getBytes();
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());
        packet.addShort16((short) animal.getBiomass());
View Full Code Here

    @Override
    public byte[] constructResponseInBytes() {
        GamePacket packet = new GamePacket(responseCode);
        packet.addShort16(type);
        packet.addString(csv);

        return packet.getBytes();
    }

    public void setCSV(String csv) {
View Full Code Here

        if (allPlantType != null) {
            packet.addShort16((short) allPlantType.size());

            for (PlantType pt : allPlantType) {
                packet.addShort16((short) pt.getID());
                packet.addString(pt.getSpeciesName());
                packet.addString(pt.getDescription());
                packet.addString(pt.getCategory());
                packet.addShort16((short) pt.getCost());

                String predatorList = "";
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.