Package utility

Examples of utility.GamePacket.addString()


        GamePacket packet = new GamePacket(responseCode);
        packet.addShort16(status);
        packet.addShort16(type);

        if (type == 0) {
            packet.addString(name);
            packet.addString(message);
        } else {
            packet.addString(message);
        }
        return packet.getBytes();
View Full Code Here


        packet.addShort16(status);
        packet.addShort16(type);

        if (type == 0) {
            packet.addString(name);
            packet.addString(message);
        } else {
            packet.addString(message);
        }
        return packet.getBytes();
    }
View Full Code Here

        if (type == 0) {
            packet.addString(name);
            packet.addString(message);
        } else {
            packet.addString(message);
        }
        return packet.getBytes();
    }

    public void setStatus(short status) {
View Full Code Here

        GamePacket packet = new GamePacket(responseCode);
        packet.addShort16(type);
        packet.addShort16((short) scoreList.size());

        for (String[] score : scoreList) {
            packet.addString(score[0]);
            packet.addInt32(Integer.parseInt(score[1]));
        }

        packet.addShort16((short) totalScoreList.size());
View Full Code Here

        }

        packet.addShort16((short) totalScoreList.size());

        for (String[] score : totalScoreList) {
            packet.addString(score[0]);
            packet.addInt32(Integer.parseInt(score[1]));
        }

        packet.addShort16((short) currentScoreList.size());
View Full Code Here

        }

        packet.addShort16((short) currentScoreList.size());

        for (String[] score : currentScoreList) {
            packet.addString(score[0]);
            packet.addInt32(Integer.parseInt(score[1]));
        }

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

        GamePacket packet = new GamePacket(responseCode);
        packet.addShort16((short) onlinePlayers.size());

        for (Player player : onlinePlayers) {
            packet.addInt32(player.getID());
            packet.addString(player.getUsername());
        }

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

        for (World world : pvpWorlds) {
            packet.addString(world.getGameName());
            packet.addShort16((short) world.getEnvironments().size());
            packet.addShort16((short) world.getMaxPlayers());
            packet.addString(world.getEnvType());
        }

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

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

            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 = "";
View Full Code Here

            packet.addShort16((short) allAnimalType.size());

            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)) {
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.