GameServer.getInstance().updateCash(player, 0);
Zone zone = zones.get(zone_id);
if (zone != null) {
Organism organism = createOrganism(species_id, amount);
for (int node_id : organism.getSpeciesType().getNodeList()) {
zone.addNewNode(node_id, amount * organism.getSpeciesType().getNodeAmount(node_id));
}
createOrganismByResponse(organism, organism.getGroupSize(), zone_id, Constants.CREATE_STATUS_PURCHASE, xCoor, yCoor, Constants.CREATE_USER);
try {
if (organism_type == Constants.ORGANISM_TYPE_PLANT) {
PlantStatDAO.insertPlantStat(organism.getID(), species_id, currentMonth, "Purchase", world.getEnvByUserID(player_id).getEnvironmentScore(), null, player_id, zone_id);
} else if (organism_type == Constants.ORGANISM_TYPE_ANIMAL) {
AnimalStatDAO.insertAnimalStat(organism.getID(), species_id, currentMonth, "Purchase", world.getEnvByUserID(player_id).getEnvironmentScore(), null, player_id, zone_id);
}
for (int node_id : species.getNodeList()) {
UserActionsDAO.createAction(zone.getManipulationID(), zone.getCurrentTimeStep(), 0, node_id, GameServer.getInstance().getSpeciesTypeByNodeID(node_id).getAvgBiomass() * organism.getGroupSize());
}
} catch (SQLException ex) {
System.err.println(ex.getMessage());
}