Originally Posted by
EmulousGuru
Okay, your ShutDownHook is perfect, just make sure you have:
Code:
ShutDownHook shutdownhook = new ShutDownHook();
Runtime.getRuntime().addShutdownHook(shutdownhook);
In your Server class.
If you do, and it's still rolling back, it's your saveGame boolean.
Well, I just replaced my shutdownhook with yours. Now I need to add these 2:
Code:
ShutDownHook shutdownhook = new ShutDownHook();
Runtime.getRuntime().addShutdownHook(shutdownhook);
On top of my server class they are all put like this though;
Code:
public static CastleWars castleWars = new CastleWars();
public static PestControl pestControl = new PestControl();
public static NPCDrops npcDrops = new NPCDrops();
public static ClanChatHandler clanChat = new ClanChatHandler();
public static FightCaves fightCaves = new FightCaves();
So dont i need to put like public static orso, in front of it?
because;
Code:
src\server\Server.java:71: <identifier> expected
Runtime.getRuntime().addShutdownHook(shutdownhook);
^
src\server\Server.java:71: ';' expected
Runtime.getRuntime().addShutdownHook(shutdownhook);
^
2 errors