-
[Release] AutoSave function
PHP Code:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package net.sf.odinms.server;
import net.sf.odinms.client.MapleCharacter;
import net.sf.odinms.net.channel.ChannelServer;
/**
*
* @author <deleted>
*/
public class AutoSave {
private static AutoSave instance;
public AutoSave() {
super();
}
public static void main(String[] args) {
if (instance == null) return;
instance.run();
}
public static void run() {
for (int i = 0; i < ChannelServer.getAllInstances().size(); i++) {
for (MapleCharacter character : ChannelServer.getInstance(i).getPlayerStorage().getAllCharacters()) {
if (character == null) continue;
try {
character.saveToDB(true);
character.dropMessage("You have been auto-saved");
} catch (Exception e) {
character.dropMessage("You haven't been auto-saved because of an error");
}
}
}
}
public static void createInstance(AutoSave inst) {
instance = inst;
}
public static AutoSave getInstance() {
return instance;
}
}
put this in the run() of channelserver
AutoSave.createInstance(new AutoSave());
To run from a bat file use
Code:
@echo off
color 4b
set CLASSPATH=.;dist\odinms.jar
java net.sf.odinms.server.AutoSave
pause
after you saved all of your characters without being online, you can restart your server without rollback
Enjoy (This is my first release D: so no flames)
This is untested, but should work
PS:
you can put this in your autorestarter, so it saves right before it shuts down
-
Re: [Release] AutoSave function
-
Re: [Release] AutoSave function
-
Re: [Release] AutoSave function
well this isn't autosave, just saving all characters w.e being online.
-
Re: [Release] AutoSave function
lol i know
nice try
i remember when titanms was alive
the PRO's had the auto save function
lol so all the other servers rolled back =/
-
Re: [Release] AutoSave function
Can you set auto save time?
-
Re: [Release] AutoSave function
Nice Release. - But in Valhalla, it saves to the database every time a person levels up.
-
Re: [Release] AutoSave function
nice release..i think this means that..if you dun wan to go into game and ask ppl to type @save or you type !saveall..you can just run that bat..and just close those world, login and channel without any rollbacks for players..
-
Re: [Release] AutoSave function
Not hard.
Why are you in these forums?
-
Re: [Release] AutoSave function
!shutdown will do, why made another shyt?
-
Re: [Release] AutoSave function
i remember a fag add the saveToDB at levelUp function, his name start with m something..
btw, with this release, we can run the bat before restarting the server without save all database in game.
-
Re: [Release] AutoSave function
-
Re: [Release] AutoSave function
Yea. Nice release. Finally something usefull.
@MSDartz Fuck off
-
Re: [Release] AutoSave function
Not useful. Most sources have an autosave at a certain point.
-
Re: [Release] AutoSave function
So? Doesent matter. At least hes contributing.
-
Re: [Release] AutoSave function
-
Re: [Release] AutoSave function
GREAT!
With this release and with this:
http://forum.ragezone.com/f427/auto-restarter-561123/
You have a 100% working auto restarter that auto saves before shutting down.
Good job :)
-
Re: [Release] AutoSave function
Quote:
Originally Posted by
Morhsn
Wow. Did you really just try to get your thread bumped?
-
Re: [Release] AutoSave function
Quote:
Originally Posted by
EspadaFung
i remember a fag add the saveToDB at levelUp function, his name start with m something..
btw, with this release, we can run the bat before restarting the server without save all database in game.
Rofl, was the fags name '0wnage'?
-
Re: [Release] AutoSave function
Quote:
Originally Posted by
Acrylic
Rofl, was the fags name '0wnage'?
i don't think so, i remember someone's name start with "M" in svn, i got an infraction in valhalla for calling him a fag in the svn update thread, :)
-
Re: [Release] AutoSave function
Quote:
Originally Posted by
EspadaFung
i don't think so, i remember someone's name start with "M" in svn, i got an infraction in valhalla for calling him a fag in the svn update thread, :)
Sounds like the thing 0wnage would do, infact 0wnage fucked up Meso Explosion, stole stuff from LaiLai's fork (w/o credits), and is a retard. Meso Explosion was later fixed by airflow0 in like rev 174.
-
Re: [Release] AutoSave function
Sometimes, Sparks never think twice before recruiting, which is sad.
-
Re: [Release] AutoSave function
-
Re: [Release] AutoSave function
-
Re: [Release] AutoSave function
Totally, useless. But nice try.