[Release] No more MySQL editing for login
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);
}
}
Re: [Release] No more MySQL editing for login
lol might aswell shove it inside the shutdown hook
Re: [Release] No more MySQL editing for login
Re: [Release] No more MySQL editing for login
I was going to make something similar to this a long time ago, but never got around to it.
Re: [Release] No more MySQL editing for login
lol traitor your so damn lazy xD
but this is awsome
its so anoying to have to reset evreyone to 0
Re: [Release] No more MySQL editing for login
Re: [Release] No more MySQL editing for login
Very nice, saves the trouble to go MySQL
Re: [Release] No more MySQL editing for login
you're on fire man ;D
thanks :D
Re: [Release] No more MySQL editing for login
Simple and easy. you can just run the query anyway <_<.
Re: [Release] No more MySQL editing for login
sinems has it so everytime you open your server, it does that.
Re: [Release] No more MySQL editing for login
thanks for the replies ;)
Re: [Release] No more MySQL editing for login
Quote:
Originally Posted by
josho192837
Jvlaple, you'll have to give some info for these guys. They're not smart enough to actually add stuff, hence all the repacks -_-
Ummm Leech Protection FTW?
Anyways Nice release, I think I had tried to do this, back when I didn't know SQL and I failed, anyways Nice Release Again.
Code:
catch (Exception ex) {
throw new RuntimeException(ex);
}
Forgive me if I'm mistaken but shouldn't it be throw then catch?
By the way, you're missing a closing brace at the end.
Re: [Release] No more MySQL editing for login
wait, where do i put this stuff,
sorry idk :P:
Re: [Release] No more MySQL editing for login
You don't need to do this. You can update it inside ChannelServer.java inside the run() function.
Re: [Release] No more MySQL editing for login
You could just remove the entire loggedin thing and get on with it..