responseCode = Constants.SMSG_SEARCH_PRIVATE_WORLD;
}
@Override
public byte[] constructResponseInBytes() {
GamePacket packet = new GamePacket(responseCode);
packet.addShort16(status);
if (status == 0) {
packet.addString(world.getGameName());
packet.addShort16((short) world.getGameMode());
}
// if (status == 0) {
// if (world.getGameMode() == Constants.GAME_TYPE_PVP) {
// packet.addShort16((short) 1);
// } else if (world.getGameMode() == Constants.GAME_TYPE_PVE) {
// packet.addShort16((short) 0);
// }
//
// packet.addString(world.getGameName());
// packet.addString(world.getEnvType());
// packet.addShort16((short) world.getNumEnvironments());
// if (world.getEnvironments() != null) {
// for (Environment env : world.getEnvironments()) {
// packet.addString(env.getAvatar().getPlayer().getUserName());
// if (world.getGameMode() == Constants.GAME_TYPE_PVP) {
// packet.addShort16((short) env.getEnvRow());
// packet.addShort16((short) env.getEnvColumn());
// } else if (world.getGameMode() == Constants.GAME_TYPE_PVE) {
// packet.addShort16((short) 0);
// pveMap = mapDAO.getPvEWorldMap(world.getWorldIdPk());
// packet.addShort16((short) pveMap.getPositionBasingOnRowAndCol(env.getEnvRow(), env.getEnvColumn()));
// }
// packet.addString(env.getAvatar().getAvatarType());
// }
// }
// }
return packet.getBytes();
}