Wrong section.. And you probably need to make the command save the accounts before restarting
|
Hello.
Every time I do update to my server and close the run cmd all who logged in get reset, what I can do ??!?!??!
Wrong section.. And you probably need to make the command save the accounts before restarting
Thats From my Cpanel..
if (cmd.equalsIgnoreCase("Save all")) {
for (int i = 0; i < Config.MAX_PLAYERS; i++) {
if (validClient(i)) {
Client c = getClient(i);
try {
c.SaveGame();
c.sendMessage("<col=1532693>Your Account Is Saved</col>");
p.displayMessage("You successfully saved all players!", cmd, 1);
} catch (Exception e) {
p.displayMessage("There was an error parsing the ID.", "Error", 0);
}
}
}
Thats From my Cpanel..
if (cmd.equalsIgnoreCase("Save all")) {
for (int i = 0; i < Config.MAX_PLAYERS; i++) {
if (validClient(i)) {
Client c = getClient(i);
try {
c.SaveGame();
c.sendMessage("<col=1532693>Your Account Is Saved</col>");
p.displayMessage("You successfully saved all players!", cmd, 1);
} catch (Exception e) {
p.displayMessage("There was an error parsing the ID.", "Error", 0);
}
}
}
Commands.java
Code:if (playerCommand.equalsIgnoreCase("saveall")) { for (final Player p : PlayerHandler.players) { if (p == null) { continue; } PlayerSave.saveGame((Client) p); } System.out.println("Saved game for all players."); c.sendMessage("Saved game for all players."); }
This really isn't what he want's. I know what you do wrong. Telling you this now it's not a "reset" It's a rollback. Clearly it doesn't save the files when you shut the server off. You should loop it so it saves every 600ms. As well instead of shutting it down and turning it back on try using the ::update command
How he sounded is that he just wanted a simple way to make sure the character files are saved. I did provide a solution to that problem. Just a very simple one.Code:if (playerCommand.startsWith("update")) { String[] args = playerCommand.split(" "); int a = Integer.parseInt(args[1]); PlayerHandler.updateSeconds = a; PlayerHandler.updateAnnounced = false; PlayerHandler.updateRunning = true; PlayerHandler.updateStartTime = System.currentTimeMillis(); }
Yeah I understand that. Just wanted to clarify more. As well if you want to further your experience stop using all the save files command and make a button in your quest tab so they can click to save their progress more advanced then calling the command everytime you need to save files as soon as they see the update they usually rush to the tab to save their char
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |