Add some debugging code.

This commit is contained in:
graywolf336 2014-07-14 21:38:15 -05:00
parent 27b557991e
commit ce1231da39
2 changed files with 7 additions and 5 deletions

View File

@ -2,7 +2,6 @@ package com.graywolf336.jail;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader;
import java.sql.Blob; import java.sql.Blob;
import java.sql.Connection; import java.sql.Connection;
import java.sql.DriverManager; import java.sql.DriverManager;
@ -519,7 +518,7 @@ public class JailIO {
} }
} }
pl.debug("Took " + (System.currentTimeMillis() - st) + " millis."); pl.debug("Took " + (System.currentTimeMillis() - st) + " millis to load the jails and all the data.");
break; break;
default: default:
//load the jails from flatfile //load the jails from flatfile
@ -779,7 +778,7 @@ public class JailIO {
pl.getLogger().severe("Error while saving the prisoners of the Jail '" + j.getName() + "', please check the error and fix what is wrong."); pl.getLogger().severe("Error while saving the prisoners of the Jail '" + j.getName() + "', please check the error and fix what is wrong.");
} }
pl.debug("Took " + (System.currentTimeMillis() - st) + " millis."); pl.debug("Took " + (System.currentTimeMillis() - st) + " millis to save the jail " + j.getName() + ".");
break; break;
default: default:
if(flat != null) { if(flat != null) {
@ -987,7 +986,7 @@ public class JailIO {
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
pl.getLogger().severe("---------- Jail Error!!! ----------"); pl.getLogger().severe("---------- Jail Error!!! ----------");
pl.getLogger().severe("Error while removing the prisoner '" + p.getLastKnownName() + "' from the database, please check the error and fix what is wrong."); pl.getLogger().severe("Error while removing the prisoner '" + p.getLastKnownName() + "' (" + p.getUUID().toString() + ") from the database, please check the error and fix what is wrong.");
} }
break; break;
default: default:

View File

@ -248,7 +248,10 @@ public class JailManager {
* @return The jail the player is in, <strong>CAN BE NULL</strong>. * @return The jail the player is in, <strong>CAN BE NULL</strong>.
*/ */
public Jail getJailPlayerIsIn(UUID uuid) { public Jail getJailPlayerIsIn(UUID uuid) {
if(this.cache.containsKey(uuid)) return this.cache.get(uuid).getJail(); if(this.cache.containsKey(uuid)) {
plugin.debug(uuid.toString() + " is in the cache (getJailPlayerIsIn).");
return this.cache.get(uuid).getJail();
}
for(Jail j : jails.values()) for(Jail j : jails.values())
if(j.isPlayerJailed(uuid)) if(j.isPlayerJailed(uuid))