falkirks / SimpleWarp

The original warp plugin for PocketMine-MP
MIT License
19 stars 28 forks source link

Warps not saved #23

Closed richardpickett closed 8 years ago

richardpickett commented 8 years ago
[00:27:57] [Server thread/INFO]: Loading SimpleWarp v2.1.1
...
version
[10:49:31] [Server thread/INFO]: This server is running PocketMine-MP 1.6dev 「Unleashed」 implementing API version 2.0.0 for Minecraft: PE v0.15.0.0 alpha (protocol version 81)
addwarp dai1 268 120 72 DiagonAlley
[00:07:31] [Server thread/INFO]: You have created a warp called dai1 (X: 268, Y: 120, Z: 72, LEVEL: DiagonAlley)
listwarps
[00:07:41] [Server thread/INFO]: Warp list:
[00:07:41] [Server thread/INFO]:  * dai1 (X: 268, Y: 120, Z: 72, LEVEL: DiagonAlley)
### Just in case
save-on
[00:08:07] [Server thread/INFO]: [CONSOLE: Turned on world auto-saving]
save-all
[00:08:12] [Server thread/INFO]: [CONSOLE: Saving...]
[00:08:12] [Server thread/INFO]: [CONSOLE: Saved the world]
stop
....
./start.sh
....
listwarps
[00:28:00] [Server thread/INFO]: No warps found.

And the plugins/SimpleWarp/warps.yml is "empty": # cat /home/minecraftpe/plugins/SimpleWarp/warps.yml --- [] ...

richardpickett commented 8 years ago

I figured out a work-around.

In retrospect I'm guessing since I'm running a dev PocketMine it's not cleaning up correctly at the end and doesn't call SimpleWarp to tell it to exit/save cleanly.

I was assuming that when I created a warp it would automatically be written out to the warp.yaml, but when I took a peek at config.yml I found the default storage-mode was set to 0, which means to write them on exit (which wasn't happening correctly).

I changed it to 1, restarted, warps started getting saved.

Recommendation:

Change the default in config.yml to 1. I can't think of any condition where someone would want 0, but I can see why someone would want 1 or 2. While 2 is a "safer" default between the two, I think 1 would be more commonly used.

falkirks commented 8 years ago

Thanks for the documentation of the workaround. It defaults to 0 because that is the least work for the filesystem and for the processor. It is a marginal difference, but they are ordered from fastest to slowest.

richardpickett commented 8 years ago

Maybe instead of hooking server-exit, 0 should hook save-world. Then the overhead is related to saving the world (expected), and the admin can save the warps on-demand instead of having to shut the server down.

falkirks commented 8 years ago

@richardpickett That is a good idea. I will create an issue for that.

falkirks commented 7 years ago

Following up on this, I have done two things

If you want to save warps in mode 0, use the reload command.