
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
if (time.equals("00:00:00")) {
WordMixUtility.Reset();
PoolConnection pcon = ConnectionPool.getConnection();
PreparedStatement ps = null;
try {
Connection con = pcon.connect();
ps = con.prepareStatement("SELECT `name` FROM `accounts` WHERE `lockType` = 1");
ResultSet rs = ps.executeQuery();
if(!rs.next()) {
System.out.println("Keine nicks zum Entsperren gefunden");
} else {
System.out.println("Gesperrte Nicks vorhanden");
Client target = new Client(null);
target.loadStats(rs.getString("name"));
System.out.println(target.getName());
if (target.getLockDays() < 1) {
target.setUnLock();
target.setComment("Banana", "Automatisch entsperrt.");
System.out.println("Sperrdauer bei " + target.getName() + " verkürzt.");
} else {
target.setLockDays(target.getLockDays() - 1);
System.out.println(target.getName() + " entsperrt");
}
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
if (ps != null) {
try {
ps.close();
} catch (SQLException e) {
}
}
pcon.close();
}
}
try {
Thread.sleep(1000);
} catch (InterruptedException ex) {
}
}
}
});
thread.start();
while (true) {
Socket socket = listener.accept();
new SessionHandler(socket).start();
}
} catch (IOException e) {
e.printStackTrace();
}
}
|