I just read Snakes post under the Tech Support thread and it made my eyes go wide
. I wanted to reply there right away to warn him, but it was locked. (It felt like I was jumping and screaming to warn someone that's about to walk in front of a moving bus, but had headphones on. xD)
Removing all instances of Datastore.Save(); may get rid of the problem at the moment with write permissions, but it may be bad in the end.
I had a conversation with Sleepy when he was active on Magma. He mentioned that he doesn't use ANY Datastore.Save(); because it just caused him problems. I saw his logic and agreed that a Datastore.Add(); is already writing data to the file.
Now, I don't know if this is a difference between running a server from a GSP vs private, but for me on a GSP, at least, if I don't perform a Save(); the Datastore.ds file never updates, so I can never back it up. If my server crashes or reboots, all the Datastore info is lost!
I then realized that I had to find a middle ground. Some people were adding DataStore.Save(); just about everytime they were writing to it, which is probably why Sleepy found it to cause problems, too many Save(); bumping into Add(); Remove(); Get(); Flush(); etc, and I still agree with that. IMO--the key is to put them in only for critical stuff that isn't accessed often.
For instance, for me, everytime someone uses a teleport, I update their cooldown timestamp in Datastore. I don't save here because that's completely unnecessary. If it crashes and cooldowns are reset, fuggit!
Where I do save is for thing's that are pretty much static. Like when someone sets their home location. I want that to save as soon as they set it, so it's never lost. (Unless, the server crashes during a write and it corrupts the ds file, and then you're screwed unless you backup religiously.)
Just wanted to share my experience with everyone. I use Datastore for just about everything, because posts on Magma convinced me that it's faster than reading/writing to multiple, separate INIs. And you can easily access the same data set across multiple functions/plugins. That's why it's vital for me to save and backup, and why I wanted to give you guys a heads up if you were unaware.
Cheers!
Removing all instances of Datastore.Save(); may get rid of the problem at the moment with write permissions, but it may be bad in the end.
I had a conversation with Sleepy when he was active on Magma. He mentioned that he doesn't use ANY Datastore.Save(); because it just caused him problems. I saw his logic and agreed that a Datastore.Add(); is already writing data to the file.
Now, I don't know if this is a difference between running a server from a GSP vs private, but for me on a GSP, at least, if I don't perform a Save(); the Datastore.ds file never updates, so I can never back it up. If my server crashes or reboots, all the Datastore info is lost!
I then realized that I had to find a middle ground. Some people were adding DataStore.Save(); just about everytime they were writing to it, which is probably why Sleepy found it to cause problems, too many Save(); bumping into Add(); Remove(); Get(); Flush(); etc, and I still agree with that. IMO--the key is to put them in only for critical stuff that isn't accessed often.
For instance, for me, everytime someone uses a teleport, I update their cooldown timestamp in Datastore. I don't save here because that's completely unnecessary. If it crashes and cooldowns are reset, fuggit!
Where I do save is for thing's that are pretty much static. Like when someone sets their home location. I want that to save as soon as they set it, so it's never lost. (Unless, the server crashes during a write and it corrupts the ds file, and then you're screwed unless you backup religiously.)
Just wanted to share my experience with everyone. I use Datastore for just about everything, because posts on Magma convinced me that it's faster than reading/writing to multiple, separate INIs. And you can easily access the same data set across multiple functions/plugins. That's why it's vital for me to save and backup, and why I wanted to give you guys a heads up if you were unaware.
Cheers!