- Joined
- Jul 8, 2008
- Messages
- 164
- Reaction score
- 0
I made a shutdown hook for logging all accounts out. Takes away having to edit your database if you forced your batches shut.
Code:
public class MapleLogoutHook extends java.lang.Thread {
public void run() {
try {
Connection con = DatabaseConnection.getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE accounts SET loggedin = 0");
ps.executeUpdate();
ps.close();
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}