remove the PlayerSaving.saveAllPlayers();
you dont have the variable.
|
Heres my command
And when I compile I get an error that it can't find the variable PlayerSaving which is a class that is in the correct place. Am I coding it wrong? I want it to save all t eh characters as the ::update command is called apon.Code:if (playerCommand.startsWith("update")) { PlayerSaving.saveAllPlayers(); String[] args = playerCommand.split(" "); int a = Integer.parseInt(args[1]); PlayerHandler.updateSeconds = a; PlayerHandler.updateAnnounced = false; PlayerHandler.updateRunning = true; PlayerHandler.updateStartTime = System.currentTimeMillis(); }
remove the PlayerSaving.saveAllPlayers();
you dont have the variable.
Pi already comes with an ::update command? And it saves players I believe
Mine was removed. So even when I delete it, it will still save the players correct?
if (playerCommand.startsWith("update") && c.playerName.equalsIgnoreCase("patrick")) {
String[] args = playerCommand.split(" ");
int a = Integer.parseInt(args[1]);
PlayerHandler.updateSeconds = a;
PlayerHandler.updateAnnounced = false;
PlayerHandler.updateRunning = true;
PlayerHandler.updateStartTime = System.currentTimeMillis();
}
You've got to add the variable in playersave to get it working just use this atm your players will have to relog for there accounts to be saved.
How would I go about adding a variable here is the save all void
& what do you mean by re log in?Code:public void saveAllPlayers() { lastGroupSave = System.currentTimeMillis(); //requests.clear(); long start = lastGroupSave; for (Player p : PlayerHandler.players) { if (p != null) PlayerSave.saveGame((Client)p); if (System.currentTimeMillis() - start >= (Server.getSleepTimer() - 5)) { System.out.println("Aborted all saving to prevent lag."); return; } } System.out.println("Saved all games."); }
What I don't want happening is players getting rolled back when I close the console.
declare it in player.java then
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |