Package utility

Examples of utility.GamePacket.addString()


            for (AnimalType at : allAnimalType) {
                packet.addShort16((short) at.getID());
                packet.addString(at.getSpeciesName());
                packet.addString(at.getDescription());
                packet.addString(at.getCategory());
                packet.addShort16((short) at.getCost());

                String predatorList = "";
                for (SpeciesType predator : at.getPredatorList(Constants.ORGANISM_TYPE_ANIMAL)) {
                    predatorList += predator.getSpeciesName() + ", ";
View Full Code Here


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

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

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

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

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

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

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

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

            int size = animalStatList.size() + plantStatList.size();
            packet.addShort16((short)size );

            for (Stat st : animalStatList) {
                packet.addShort16((short) st.getActivityDay());
                packet.addString(st.getAnimalName());
                packet.addString(st.getActivityType());
                packet.addShort16((short) st.getCount());
                //packet.addInt32( st.getEnvironmentScore());
                //packet.addString(st.getActivityMessage());
            }
View Full Code Here

            packet.addShort16((short)size );

            for (Stat st : animalStatList) {
                packet.addShort16((short) st.getActivityDay());
                packet.addString(st.getAnimalName());
                packet.addString(st.getActivityType());
                packet.addShort16((short) st.getCount());
                //packet.addInt32( st.getEnvironmentScore());
                //packet.addString(st.getActivityMessage());
            }
           
View Full Code Here

                //packet.addString(st.getActivityMessage());
            }
           
            for (Stat st : plantStatList) {
                packet.addShort16((short) st.getActivityDay());
                packet.addString(st.getPlantName());
                packet.addString(st.getActivityType());
                packet.addShort16((short) st.getCount());
                //packet.addInt32( st.getEnvironmentScore());
                //packet.addString(st.getActivityMessage());
            }
View Full Code Here

            }
           
            for (Stat st : plantStatList) {
                packet.addShort16((short) st.getActivityDay());
                packet.addString(st.getPlantName());
                packet.addString(st.getActivityType());
                packet.addShort16((short) st.getCount());
                //packet.addInt32( st.getEnvironmentScore());
                //packet.addString(st.getActivityMessage());
            }
        }else{
View Full Code Here

    @Override
    public byte[] constructResponseInBytes() {
        GamePacket packet = new GamePacket(responseCode);
        packet.addShort16((short) amount);
        packet.addShort16((short) level);
        packet.addString(range);
        return packet.getBytes();
    }

    public void setAmount(int amount) {
        this.amount = amount;
View Full Code Here

        if (worldList != null) {
            for (World w : worldList) {
                packet.addShort16(w.getAccessType());
                packet.addShort16((short) 1);
                packet.addString(w.getGameName());
                packet.addShort16((short) w.getEnvironments().size());
                packet.addShort16((short) w.getMaxPlayers());
                packet.addString(w.getEnvType());
            }
        }
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.