Fixed up the log messages.

This commit is contained in:
gmcferrin 2013-01-10 21:54:32 -05:00
parent d25a314d3a
commit e20098d462

View File

@ -37,14 +37,13 @@ public class UserPurgeTask implements Runnable {
} }
private void purgePowerlessSQL() { private void purgePowerlessSQL() {
System.out.println("Purging powerless users..."); plugin.getLogger().info("Purging powerless users...");
String query = "taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing"; String query = "taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing";
HashMap<Integer, ArrayList<String>> userslist = database.read("SELECT " + query + ", user_id FROM " + tablePrefix + "skills WHERE " + query + " = 0 ORDER BY " + query + " DESC "); HashMap<Integer, ArrayList<String>> userslist = database.read("SELECT " + query + ", user_id FROM " + tablePrefix + "skills WHERE " + query + " = 0 ORDER BY " + query + " DESC ");
int purgedUsers = 0; int purgedUsers = 0;
for (int i = 1; i <= userslist.size(); i++) { for (int i = 1; i <= userslist.size(); i++) {
System.out.println("Checking user " + i + "/" + userslist.size());
int userId = Integer.valueOf(userslist.get(i).get(1)); int userId = Integer.valueOf(userslist.get(i).get(1));
HashMap<Integer, ArrayList<String>> username = database.read("SELECT user FROM " + tablePrefix + "users WHERE id = '" + userId + "'"); HashMap<Integer, ArrayList<String>> username = database.read("SELECT user FROM " + tablePrefix + "users WHERE id = '" + userId + "'");
String playerName = username.get(1).get(0); String playerName = username.get(1).get(0);
@ -61,7 +60,7 @@ public class UserPurgeTask implements Runnable {
} }
private void purgeOldSQL() { private void purgeOldSQL() {
System.out.println("Purging old users..."); plugin.getLogger().info("Purging old users...");
long currentTime = System.currentTimeMillis(); long currentTime = System.currentTimeMillis();
String query = "taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing"; String query = "taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing";
HashMap<Integer, ArrayList<String>> userslist = database.read("SELECT " + query + ", user_id FROM " + tablePrefix + "skills WHERE " + query + " > 0 ORDER BY " + query + " DESC "); HashMap<Integer, ArrayList<String>> userslist = database.read("SELECT " + query + ", user_id FROM " + tablePrefix + "skills WHERE " + query + " > 0 ORDER BY " + query + " DESC ");
@ -69,7 +68,6 @@ public class UserPurgeTask implements Runnable {
int purgedUsers = 0; int purgedUsers = 0;
for (int i = 1; i <= userslist.size(); i++) { for (int i = 1; i <= userslist.size(); i++) {
System.out.println("Checking user " + i + "/" + userslist.size());
int userId = Integer.valueOf(userslist.get(i).get(1)); int userId = Integer.valueOf(userslist.get(i).get(1));
HashMap<Integer, ArrayList<String>> username = database.read("SELECT user FROM " + tablePrefix + "users WHERE id = '" + userId + "'"); HashMap<Integer, ArrayList<String>> username = database.read("SELECT user FROM " + tablePrefix + "users WHERE id = '" + userId + "'");
String playerName = username.get(1).get(0); String playerName = username.get(1).get(0);
@ -87,7 +85,6 @@ public class UserPurgeTask implements Runnable {
} }
private void deleteFromSQL(int userId, String playerName) { private void deleteFromSQL(int userId, String playerName) {
System.out.println("Deleting user " + userId);
database.write("DELETE FROM " database.write("DELETE FROM "
+ databaseName + "." + databaseName + "."
+ tablePrefix + "users WHERE " + tablePrefix + "users WHERE "
@ -114,8 +111,6 @@ public class UserPurgeTask implements Runnable {
+ tablePrefix + "experience.user_id=" + userId); + tablePrefix + "experience.user_id=" + userId);
profileCleanup(playerName); profileCleanup(playerName);
System.out.println("User " + userId + " was successfully removed!");
} }
private void profileCleanup(String playerName) { private void profileCleanup(String playerName) {