Plugin State directory

Posted by WillFa on Mon 19 Jul 2010 01:17 AM — 10 posts, 35,896 views.

USA #0
Nick,

Would it be possible to add an AlphaOption for the state directory instead of just tacking it on to the plugins dir?

I use Live Mesh to sync some plugins I write with my clan, and I'd like to default to this synced dir for plugins, but don't really need to sync my state to them.

Thanks
Australia Forum Administrator #1
Do you want to set it or test it?
USA #2
Set please (and test while you're at it)

I pretty much want to move it from under the plugins directory so it's not synced.
Australia Forum Administrator #3
There is no provision for changing global options (other than doing it yourself with the SQLite interface).

However I have moved the hard-coded plugins/state directory into a global option, which you can test with GetGlobalOption, and change yourself if you fiddle with the database.
USA #4
that's cool. I have no problem fiddling with databases. :) Thanks Nick.
USA #5
I wanted to add a couple of small things.

The default of "./worlds/plugins/state" is based off the current directory, which can change in the shortcut. It may be a more reliable solution to base the default off the user's Plugin Directory (GetInfo(60)) instead of the MC install dir.

It should be noted in the documentation that this string expects the trailing backslash on the path. i.e. "C:\Users\Foo\Documents\PluginStates\"


Thanks again!
Australia Forum Administrator #6
The default in a new execution is:


{ GLB_ALPHA_OPT (m_strPluginsDirectory         ), "PluginsDirectory", ".\\worlds\\plugins\\" },
{ GLB_ALPHA_OPT (m_strDefaultStateFilesDirectory), "StateFilesDirectory", ".\\worlds\\plugins\\state\\" },


So really, the state directory should be the same as before (since it was previously the plugins directory with state\ appended to it).

Australia Forum Administrator #7
WillFa said:

It should be noted in the documentation that this string expects the trailing backslash on the path. i.e. "C:\Users\Foo\Documents\PluginStates\"



Where in the documentation? It isn't easily changed anyway.
USA #8
Nick Gammon said:

The default in a new execution is:


{ GLB_ALPHA_OPT (m_strPluginsDirectory         ), "PluginsDirectory", ".\\worlds\\plugins\\" },
{ GLB_ALPHA_OPT (m_strDefaultStateFilesDirectory), "StateFilesDirectory", ".\\worlds\\plugins\\state\\" },


So really, the state directory should be the same as before (since it was previously the plugins directory with state\ appended to it).




But you're going to have a lot of upgrading users that may have changed their plugin directory. "StateFilesDirectory" is new, but "PluginsDirectory" is an existing (possibly changed) value.

And, if they're like me, the Plugins folder may have just been moved out of C:\Program...\worlds, which is going to cause a lot of errors for them as the directory structure doesn't exist.
Amended on Tue 20 Jul 2010 02:21 AM by WillFa
Australia Forum Administrator #9
OK, well hopefully 4.55 will do that for you.