PDA

View Full Version : Is the DB the only place to store shared variables?



Debinani
September 23rd, 2009, 20:23
Might sound like a silly question - but what I'm trying to do is implement a language system, where at the beginning of the session I register whish users know which languages, and then garble the text for people who don't know said language (still deciding if I'll hijack moods or write a whole new slash command).

My initial idea was to have a class-level variable in chatmanager and some new slash commands to register - but it just occured to me that if I set the variable on the host, it wont be set on the clients - I assume I'm correct in this assumption?

Is the only good way to have this data shared to make a DB entry for it?

Casimir
September 23rd, 2009, 20:52
Now that is a really cool idea. I'd be very interested in the development of this idea - could you perhaps share how it was done, or perhaps create a module for it or some such when it's complete?

Debinani
September 23rd, 2009, 21:32
Now that is a really cool idea. I'd be very interested in the development of this idea - could you perhaps share how it was done, or perhaps create a module for it or some such when it's complete?

I may do it eventually - I'm probably going to break down and just use some IRC rooms for languages for the time-being. The right way to do it would be to have a language section in the charcater sheet and interogate that, but that's way more than I want to get into with this older WHFRP ruleset - and it's a HUGE PITA to test.

Moon Wizard
September 23rd, 2009, 21:40
When I first started working with FG, the only persistent variables I found were stored in the CampaignRegistry variable, which saves to a local file that is only affects the local instance of FG.

When I added options to my rulesets, the only way I found to have variables which are shared to all users is to create them in the database. If you go that route, you have to make sure that the database node holding the options is shared to all users, so that they can read the data.

Right now, my rulesets store user options locally in the CampaignRegistry, and campaign options globally in the database.

Cheers,
JPG