Bonus code removed and replaced with a db call actually used.
This commit is contained in:
@@ -183,82 +183,6 @@ public class EffectsBase {
|
||||
// getFailConditions();
|
||||
}
|
||||
|
||||
public static ArrayList<EffectsBase> getAllEffectsBase() {
|
||||
PreparedStatementShared ps = null;
|
||||
ArrayList<EffectsBase> out = new ArrayList<>();
|
||||
try {
|
||||
ps = new PreparedStatementShared("SELECT * FROM static_power_effectbase ORDER BY `IDString` DESC");
|
||||
ResultSet rs = ps.executeQuery();
|
||||
while (rs.next()) {
|
||||
EffectsBase toAdd = new EffectsBase(rs);
|
||||
out.add(toAdd);
|
||||
}
|
||||
rs.close();
|
||||
} catch (Exception e) {
|
||||
Logger.error(e);
|
||||
} finally {
|
||||
ps.release();
|
||||
}
|
||||
//testHash(out);
|
||||
return out;
|
||||
}
|
||||
|
||||
public static ArrayList<EffectsBase> getAllLiveEffectsBase() {
|
||||
PreparedStatementShared ps = null;
|
||||
ArrayList<EffectsBase> out = new ArrayList<>();
|
||||
try {
|
||||
ps = new PreparedStatementShared("SELECT * FROM static_power_effectbase_24 ORDER BY `IDString` DESC");
|
||||
ResultSet rs = ps.executeQuery();
|
||||
while (rs.next()) {
|
||||
EffectsBase toAdd = new EffectsBase(rs);
|
||||
out.add(toAdd);
|
||||
}
|
||||
rs.close();
|
||||
} catch (Exception e) {
|
||||
Logger.error(e);
|
||||
} finally {
|
||||
ps.release();
|
||||
}
|
||||
//testHash(out);
|
||||
return out;
|
||||
}
|
||||
|
||||
//private static void testHash(ArrayList<EffectsBase> effs) {
|
||||
// int valid = 0, invalid = 0;
|
||||
// for (EffectsBase eff : effs) {
|
||||
// String ids = eff.getIDString();
|
||||
// int tok = eff.getToken();
|
||||
// if (ids.length() != 8 || ids.startsWith("PRE-") || ids.startsWith("SUF-") || ids.endsWith("X") || !ids.substring(3,4).equals("-"))
|
||||
// continue;
|
||||
//
|
||||
//// if ((tok > 1 || tok < 0) && ids.length() == 8) {
|
||||
// int out = Hash(ids);
|
||||
// if (out != tok) {
|
||||
// System.out.println(ids + ": " + Integer.toHexString(out) + "(" + out + ")");
|
||||
// invalid++;
|
||||
// } else
|
||||
// valid++;
|
||||
//// }
|
||||
// }
|
||||
// System.out.println("valid: " + valid + ", invalid: " + invalid);
|
||||
//}
|
||||
|
||||
//private static int Hash(String IDString) {
|
||||
// char[] val = IDString.toCharArray();
|
||||
// int out = 360;
|
||||
// out ^= val[0];
|
||||
// out ^= (val[1] << 5);
|
||||
// out ^= (val[2] << 10);
|
||||
// out ^= (val[4] << 23);
|
||||
// out ^= (val[5] << 19);
|
||||
// out ^= (val[6] << 15);
|
||||
// out ^= (val[7] << 26);
|
||||
// out ^= (val[7] >> 6);
|
||||
// out ^= 17;
|
||||
// return out;
|
||||
//}
|
||||
|
||||
|
||||
public static void getFailConditions(HashMap<String, EffectsBase> effects) {
|
||||
PreparedStatementShared ps = null;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user