Properly output how many cells were loaded, hopefully this has something
to do with #26 displaying incorrect information.
This commit is contained in:
		@@ -378,7 +378,6 @@ public class JailIO {
 | 
			
		||||
				//that doesn't exist anymore
 | 
			
		||||
				List<Integer> cellsToRemove = new LinkedList<Integer>();
 | 
			
		||||
				
 | 
			
		||||
				int cs = 0;
 | 
			
		||||
				try {
 | 
			
		||||
					if(con == null) this.prepareStorage(false);
 | 
			
		||||
					PreparedStatement ps = con.prepareStatement("SELECT * FROM " + prefix + "cells");
 | 
			
		||||
@@ -405,7 +404,6 @@ public class JailIO {
 | 
			
		||||
							
 | 
			
		||||
							
 | 
			
		||||
							j.addCell(c, false);
 | 
			
		||||
							cs++;
 | 
			
		||||
						}else {
 | 
			
		||||
							cellsToRemove.add(set.getInt("cellid"));
 | 
			
		||||
						}
 | 
			
		||||
@@ -444,8 +442,6 @@ public class JailIO {
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
				
 | 
			
		||||
				pl.getLogger().info("Loaded " + cs + (cs == 1 ? " cell." : " cells."));
 | 
			
		||||
				
 | 
			
		||||
				//This list contains a string which refers to the name of the prisoner in sql
 | 
			
		||||
				//this list only gets populated if there are prisoners which reference a jail
 | 
			
		||||
				//that doesn't exist anymore
 | 
			
		||||
@@ -538,6 +534,9 @@ public class JailIO {
 | 
			
		||||
		int js = pl.getJailManager().getJails().size();
 | 
			
		||||
		pl.getLogger().info("Loaded " + js + (js == 1 ? " jail." : " jails."));
 | 
			
		||||
		
 | 
			
		||||
		int cs = pl.getJailManager().getAllCells().size();
 | 
			
		||||
		pl.getLogger().info("Loaded " + cs + (cs == 1 ? " cell." : " cells."));
 | 
			
		||||
		
 | 
			
		||||
		int ps = pl.getJailManager().getAllPrisoners().size();
 | 
			
		||||
		pl.getLogger().info("Loaded " + ps + (ps == 1 ? " prisoner." : " prisoners."));
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -155,6 +155,20 @@ public class JailManager {
 | 
			
		||||
		return this.jails.get(name) != null;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets all the {@link Cell cells} in the jail system, best for system wide count of the cells or touching each cell.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @return HashSet of all the Cells.
 | 
			
		||||
	 */
 | 
			
		||||
	public HashSet<Cell> getAllCells() {
 | 
			
		||||
		HashSet<Cell> cells = new HashSet<Cell>();
 | 
			
		||||
		
 | 
			
		||||
		for(Jail j : jails.values())
 | 
			
		||||
			cells.addAll(j.getCells());
 | 
			
		||||
		
 | 
			
		||||
		return cells;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets all the prisoners in the system, best for a system wide count of the prisoners or accessing all the prisoners at once.
 | 
			
		||||
	 * 
 | 
			
		||||
@@ -163,9 +177,8 @@ public class JailManager {
 | 
			
		||||
	public HashSet<Prisoner> getAllPrisoners() {
 | 
			
		||||
		HashSet<Prisoner> prisoners = new HashSet<Prisoner>();
 | 
			
		||||
		
 | 
			
		||||
		for(Jail j : jails.values()) {
 | 
			
		||||
		for(Jail j : jails.values())
 | 
			
		||||
			prisoners.addAll(j.getAllPrisoners());
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		return prisoners;
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user