Enable/Disable Status Not Saving On Server Restart
cjayride opened this issue ยท 11 comments
Every time the server is restarted, any Precious Stone blocks that were previously toggled to "Disabled" are automatically reverted back to "Enabled" when the server starts back up.
To no success, I did do the "SQLite outdated database schema fix" as suggested by Phaed420.
http://dev.bukkit.org/server-mods/preciousstones/pages/sqlite-outdated-database-schema-fix/
This did not fix it.
I have tried a fresh install of Precious Stones, all new files.
The version: 8.2.1
Crafbukkitversion: 1846
Latest recommended build: 1846
Once this is sorted out I would gladly like to donate money for the great development of this mod, it's great!
Use something like SQLiteManager and check the database if the disabled flag is being set to true. Its in the flags column. Let me know, would help to narrow down where the problem is.
I just used SQLiteManager and here is what I can tell is happening.
If an object is NOT a cuboid, the flag column for that object is always this: {}
If an object IS a cuboid and I set a custom field in drawing mode, the flags field will looks something like this: {"disabled":true}
If an object IS a cuboid but I do NOT set a custom field in drawing mode, the flags field is always this: {}
Interesting Observation:
A cuboid object with custom field from drawing mode that is set to "Disabled" will become "Enabled" after a server restart.
A cuboid object with custom field from drawing mode that is set to "Enabled" will become "Disabled" after a server restart.
Any object (cuboid or not) with no custom field from drawing mode, has no flags saved and always starts "Enabled" after a server restart.
You are very generous by helping me, thank you.
Here is my \PreciousStones\config.yml if it helps: http://pastebin.com/kLXwq86Z
Try this version, let me know if it fixed it:
http://dev.bukkit.org/media/files/574/443/PreciousStones.jar
The server said tables were being edited to some extent when I replaced the .jar file. I reloaded the server as it instructed afterwards.
Here are my results using 3 different objects:
+175, -149, 68
Cuboid: false
Trial 1:
Set to [Enabled].
__Shutdown server.
SQLite Flag: {}
__Start server.
Object is Enabled.
Trial 2:
Set to [Disabled].
__Shutdown server.
SQLite Flag: {}
__Start server.
Object is Enabled.
+174, -149, 68
Cuboid: true
Custom-Field-Drawn-By-Me: true
Trial 1:
Set to [Enabled].
__Shutdown server.
SQLite Flag: {"disabledFlags":["welcome-message","farewell-message"]}
__Start server.
Object is Enabled.
Trial 2:
Set to [Disabled].
__Shutdown server.
SQLite Flag: {"disabledFlags":["welcome-message","farewell-message"]}
__Start server.
Object is Enabled.
+173, -149, 68
Cuboid: true
Custom-Field-Drawn-By-Me: false
Trial 1:
Set to [Enabled].
__Shutdown server.
SQLite Flag: {}
__Start server.
Object is Enabled.
Trial 2:
Set to [Disabled].
__Shutdown server.
SQLite Flag: {}
__Start server.
Object is Enabled.
Ok, so from your description the disabled flag is never making it to the database to begin with. Are you shutting down the server cleanly with the stop command?
I use Pail Server Manager, so to shutdown I've been going to "Server" -> Stop.
I just tried shutting down the server by typing "stop" in server console, but there is no change to the database table then by using the Pail Server menu.
The database is now different than a couple hours ago when I last checked.
pstone_cuboids
object1: field drawn - flags: {"disabledFlags":["welcome-message","farewell-message"],"disabled":true}
object2: no field drawn - flags: {"disabledFlags":["welcome-message","farewell-message"]}
pstone_fields
object3: flags: {}
This is how databases entries look while the server is running (before restart) and after a server is restarted.
The entries are the same no matter if the block tells me if it is toggled to Enabled or Disabled
The only difference now is that [disabled":true}] is being added to cuboids of player drawn custom fields.
The flag, however, is the same in the databases no matter if the game tells me the object is enabled or disabled.
Again, thank you for taking the time to read this and the great support.
- Chris
PS saves to the database every x seconds. Configurable from the config file (saving.frequency-seconds), could be that you're checking the database before things got a chance to save.
Dunno what else this could be. I have tried this on my machine and everything works as its supposed to. I do /ps disable while pointing at a cuboid and then check the database once stuff has had time to save, and i see a {disabled: true}. I restart the server and its still there and it loads up the cuboid disabled. I do /ps enable and wait, and sure enough the database no longer shows the disabled flag.
Try to run PS using the default config and a new database (remove the PreciousStones.db file) and try the steps above. Lets see if you can get it working as it should with everything clean.
You were right about me not waiting for the database to save, I changed it to 1 second for testing and now both cuboid fields are showing the same flags.
Even better, I found out what's not working thanks to your clues!
/ps enable and /ps disable are saving to the database correctly with the correct flags.
I was using shift + right click to enable and disable using this field flag: enable-on-src: true
This means that the enable-on-src code is not writing correctly to the database.
I was trying to not have to type commands to make it easier for the newbies to remember.
I'm assuming this has something to do with the code, and not something I can fix, but either way I'll be donating some money through Dev Bukkit's link tonight, thanks.
"Version 8.2.3
Fixed: Disabled fields acting enabled after restart (not tested)"
Unfortunately, not fixed. [enable-on-src] is still not saving disabled fields.
/ps enable and /ps disable are still working though.