Solved Simulating a Server Crash

Discussion in 'Plugin Development' started by amhokies, Dec 22, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    amhokies

    This may seem like a bit of a weird question, but I'd figure I would ask here to see if anyone has had to do this before...

    I'm making a minigame plugin that will allow players to break and place blocks, then when the game is over, the blocks are regenned. The problem is that when the server crashes, this doesn't happen. So, what I'm planning to do is storing each block as it's broken in a database and in the case of a server crash, the blocks will be loaded from the database and restored when the server starts back up.

    In order to test if this works or not, I need to find a way of simulating a server crash to see if the blocks will be restored when the server starts back up again. Anyone know of a way of doing this?
     
  2. Offline

    Tirelessly

    amhokies You could try making an infinite loop
     
  3. Offline

    hellboyPS

    What about System.exit()?
    Or just kill the process?
     
  4. Offline

    amhokies

    I've tried just exiting out of the console window and that seems to do the trick.
     
  5. Offline

    TheLexoPlexx

    Kick Everbody with the reason: "End of Stream" :p

    #EDIT: Maybe set the motd for a short time (Scheduler) to: "Communication Error" :D
     
    werter318 and jusjus112 like this.
  6. Offline

    Bart

    The following won't answer your question at all but it is a tip from my past experiences:

    If you are always needing to restore a world, just copy the world with no changes on it to a different directory. Then, you can load that world and use that rather than the initial backup. When you want to restore it, you can just copy it back from your clean copy and you completely avoid having to rollback changes :)
     
Thread Status:
Not open for further replies.

Share This Page