[Release] Close batches without rollback
Hey guys, I made a shutdown hook to save all your accounts before shutdown:
NO MORE !shutdown!!
Code:
public class MapleShutdownHook extends Thread {
public void run() {
for (ChannelServer cs : ChannelServer.allInstances()) {
for (MapleCharacter chr : cs.getPlayerStorage().getAllCharacters()) {
chr.saveToDB(true);
}
}
}
If you can't use it, then tough luck :sneaky2:
All credits go to me ;)
Re: [Release] Close bats without rollback
Re: [Release] Close batches without rollback
fyi
Runtime.getRuntime().addShutdownHook(new MapleShutdownHook());
Re: [Release] Close batches without rollback
Re: [Release] Close batches without rollback
Quote:
Originally Posted by
Traitor
fyi
Runtime.getRuntime().addShutdownHook(new MapleShutdownHook(););
Wrong syntax. =P
Re: [Release] Close batches without rollback
Quote:
Originally Posted by
PurpleMadness
Wrong syntax. =P
oh whoops, went right past me that time.
Re: [Release] Close batches without rollback
Like 0,5% of RZ knows what to do with this now.
Re: [Release] Close batches without rollback
What? You put an extra ';' in your code :P
Re: [Release] Close batches without rollback
Quote:
Originally Posted by
Jvlaple
What? You put an extra ';' in your code :P
I noticed that when purplemadness pointed it out.
Re: [Release] Close batches without rollback
Re: [Release] Close batches without rollback
Thanks for the hook ^^. Now I can finally stop worrying about this -.-.
Re: [Release] Close batches without rollback
Re: [Release] Close batches without rollback
Quote:
Originally Posted by
PurpleMadness
Like 0,5% of RZ knows what to do with this now.
LOL, why don't you help the leechers?
Re: [Release] Close batches without rollback
Re: [Release] Close batches without rollback
this is awsome
i hate having to !shutdown