PDA

View Full Version : RollsManager Registering Roll Handlers



UrsaTeddy
July 17th, 2021, 02:35
Hi,

are registered roll handlers "global" - as in if the Host registers or unregisters the handlers, is that set for all of the connected Users? Or can each individual User have them on/off as they desire?

In addition, if I register a SubHandler for "all rolls":


RollsManager.registerTraitResolutionSubHandlerForG roup(nil, showFunnyFaces)

can it be unregistered using:


RollsManager.unregisterTraitResolutionSubHandler(n il, true, showFunnyFaces)

or is it not unregistered-able due to the "nil" parameter.

chillhelm
July 17th, 2021, 12:37
RollsManager and all the other *Managers are local to the clients. Something registered on one client, is not registered on the others.

Can't answer your 2nd question, without trying it, but that would be my suggesion. Just try it out.

UrsaTeddy
July 17th, 2021, 13:44
That is the problem ... I have the code doing the unregister when an option is set to False (standard cycler in the Options screen).

It does not seem to be unregistering.

chillhelm
July 17th, 2021, 17:25
Are you calling the unregister function again after the option is changed? (E.g. using the OptionsManager.registerCallback("YourOptionName",fUnregisterMyTraitRollResolutionSubhandler))

Right now thats the only thing I can think of, with just the code of RollsManager to look at.
If you want to, you can send me your code and I'll have a look there to find out what the problem is.

UrsaTeddy
July 17th, 2021, 17:55
That is correct ... when the option is clicked to change On to Off and vice versa, I have a callback. In that callback I check the status of the option using OptionsManager.isOption and execute either a Register or an Unregister based on that result.

However it feels as if the Client and Host are sharing the value because it either triggers or it does not irrespective of local settings.

Actually where would I see a per-client/per-host setting list? In CampaignRegistry.lua it seems that there is only one entry for the Option. Since the Host holds the campaign files and the Client retrieves a file list, where are the Client's files stored?

Trenloe
July 17th, 2021, 18:09
Actually where would I see a per-client/per-host setting list? In CampaignRegistry.lua it seems that there is only one entry for the Option. Since the Host holds the campaign files and the Client retrieves a file list, where are the Client's files stored?
For the player it's embedded in the encrypted campaign.dat file in the cache\<campaign name> directory.

UrsaTeddy
July 18th, 2021, 02:21
That's what I suspected after search around ... which means that I cannot 100% check the settings that a player may have set.

I understand the security needs for the campaign data so that a non-licensee does not get free material ... and possibly how the options could affect that.

Well I will plod along and quadruple check everything and work out what is going on ...

Trenloe
July 18th, 2021, 07:01
I'm not sure exactly what you're trying to do, and if the issue is on the GM side or the player side. But maybe you can approach it from a different perspective - have the showFunnyFaces handler registered permanently, but have code in the handler that checks the option and exits if the option isn't set?

UrsaTeddy
July 18th, 2021, 07:42
I may have to go this route ... I do not like things hanging around in memory - hard habit to break from development career - however it may just have to be the "solution" in my case.

Ikael
July 18th, 2021, 08:59
I may have to go this route ... I do not like things hanging around in memory - hard habit to break from development career - however it may just have to be the "solution" in my case.

That's the right route to take. These things would anyway be "hanging" in memory because you introduce the function. Register/unregister just includes it into roll handling mechanism.