mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-20 13:30:27 -07:00
Another batch of preemptive bugfixing
This commit is contained in:
parent
62ab9e80a9
commit
13dce7226e
19 changed files with 84 additions and 84 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue