Another batch of preemptive bugfixing

This commit is contained in:
ceikry 2021-07-26 07:33:07 -05:00
parent 62ab9e80a9
commit 13dce7226e
19 changed files with 84 additions and 84 deletions

View file

@ -79,8 +79,9 @@ public final class PunishmentStorage {
e.printStackTrace();
SQLManager.close(connection);
return;
} finally {
SQLManager.close(connection);
}
SQLManager.close(connection);
return;
case 2:
ban(player.getIpAddress(), type);
@ -152,8 +153,9 @@ public final class PunishmentStorage {
e.printStackTrace();
SQLManager.close(connection);
return false;
} finally {
SQLManager.close(connection);
}
SQLManager.close(connection);
return true;
}
@ -175,8 +177,9 @@ public final class PunishmentStorage {
e.printStackTrace();
SQLManager.close(connection);
return false;
} finally {
SQLManager.close(connection);
}
SQLManager.close(connection);
return true;
}
@ -239,8 +242,9 @@ public final class PunishmentStorage {
e.printStackTrace();
SQLManager.close(connection);
return false;
} finally {
SQLManager.close(connection);
}
SQLManager.close(connection);
return true;
}
@ -252,9 +256,9 @@ public final class PunishmentStorage {
private static String getDuration(long end) {
String time = "indefinite time";
if (end != Long.MAX_VALUE) {
int days = (int) ((end -= System.currentTimeMillis()) / (24 * 60 * 60_000));
int hours = (int) ((end -= (days * 24 * 60 * 60_000)) / (60 * 60_000));
int minutes = (int) ((end -= (hours * (60 * 60_000))) / 60_000);
int days = (int) ((System.currentTimeMillis()) / (24 * 60 * 60_000));
int hours = (int) (((24L * days * 60 * 60_000)) / (60 * 60_000));
int minutes = (int) (((hours * (60 * 60_000))) / 60_000);
time = days + "d, " + hours + "h, " + minutes + "m";
}
return time;