Easier way would be to do the updates, compile, run the server source, and close the original one.
To save all, just add a player save function in the shutdown hook of your server.
|
|
Well, i would like to know if there was an easier way to update my server without actually shutting down the files and everything temporarily. While i code.
So what im asking is if i could code and update the server without shutting down my server while i code.
And i would like to know if there's the command for me to save everyone's character file at once. Such as :aveall
Easier way would be to do the updates, compile, run the server source, and close the original one.
To save all, just add a player save function in the shutdown hook of your server.
For the shutdown hook saving, add this to your PlayerHandler.java:
The character files wont be affected.Code:public static PlayerSave save; static { Runtime.getRuntime().addShutdownHook(new Thread(){ public void run() { System.out.println("Saving players..."); synchronized(this) { for(int i = 0; i < Config.MAX_PLAYERS; i++) if(players[i] != null) save.saveGame((Client)players[i]); } } }); }
Thank you.
Your welcome![]()
Also, my server doesnt add a "puremaster" to my char files when created, i tried to add one to playersave, but nothing happened. Could you help me?
you can use JRebel, it's a program that updates the server without restarting it.
My player.java haspublic int
safeTimer = 0,
KC,
DC,
recoil = 0,
ag1,
puremaster,
| « Need a cheap and good vps hosting | [PI]Changing walking and walking anims for npcs[PI] » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |