Package utility

Examples of utility.GamePacket


        responseCode = Constants.SMSG_RESTART;
    }

    @Override
    public byte[] constructResponseInBytes() {
        GamePacket packet = new GamePacket(responseCode);
        packet.addBoolean(status);

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


        responseCode = Constants.SMSG_UPDATE_ANIMAL_NO_WATER_COUNT;
    }

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

        responseCode = Constants.SMSG_GET_FUNCTIONAL_PARAMETERS;
    }

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

        if (status == 0) {
          packet.addShort16((short) this.parameterType);
            packet.addShort16((short) preyList.size());

            for (String parameter : preyList.keySet()) {
                packet.addString(parameter);
                packet.addFloat(preyList.get(parameter));
            }
        }

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

        responseCode = Constants.SMSG_GIVE_SPECIES;
    }

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

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

        responseCode = Constants.SMSG_UPDATE_TIME;
    }

    @Override
    public byte[] constructResponseInBytes() {
        GamePacket packet = new GamePacket(responseCode);
        packet.addShort16((short) month);
        packet.addShort16((short) year);
        packet.addInt32(duration);
        packet.addInt32(current);
        packet.addFloat(rate);
        return packet.getBytes();
    }
View Full Code Here

        responseCode = Constants.SMSG_UPDATE_ANIMAL_ZONE;
    }

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

        responseCode = Constants.SMSG_UPDATE_WATER_SOURCE;
    }

    @Override
    public byte[] constructResponseInBytes() {
        GamePacket packet = new GamePacket(responseCode);
        packet.addShort16(waterSourceID);
        packet.addShort16(zoneID);
        packet.addShort16(waterAmount);
        packet.addShort16(targetWaterAmount);
        packet.addShort16(targetTime);
        return packet.getBytes();
    }
View Full Code Here

        responseCode = Constants.SMSG_UPDATE_PLANT_NO_WATER_COUNT;
    }

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

        responseCode = Constants.SMSG_UPDATE_XP;
    }

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

        responseCode = Constants.SMSG_REQUESTWATERSOURCES;
    }

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

        if (status == 0) {
            if (world != null) {
                packet.addShort16((short) world.getEnvironments().size());
                for (Environment env : world.getEnvironments()) {
                    for (Zone zone : env.getZones()) {
//                        if (zone.getWaters().size() > 0) {
//                            packet.addShort16((short) zone.getID());
//                            packet.addInt32(zone.getWaters().get(0).getLocationX());
//                            packet.addInt32(zone.getWaters().get(0).getLocationY());
//                            packet.addInt32(zone.getWaters().get(0).getLocationZ());
//                        }
                    }
                }
            }
        }

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

TOP

Related Classes of utility.GamePacket

Copyright © 2018 www.massapicom. 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.