STAR TREK 2d20
  1. #1

    Join Date
    Mar 2020
    Location
    Sydney, Australia
    Posts
    247

    RollsManager Registering Roll Handlers

    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":

    Code:
    RollsManager.registerTraitResolutionSubHandlerForGroup(nil, showFunnyFaces)
    can it be unregistered using:

    Code:
    RollsManager.unregisterTraitResolutionSubHandler(nil, true, showFunnyFaces)
    or is it not unregistered-able due to the "nil" parameter.
    Thanks In Advance,
    D

  2. #2
    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.
    Check out my Extensions for Savage Worlds:
    Arcane Devices:Forge and github
    Mass Battles: Forge and github
    Fast Tests: Forge and github
    Reload Consumption: Forge
    Chase&Combat Compilation: Forge

  3. #3

    Join Date
    Mar 2020
    Location
    Sydney, Australia
    Posts
    247
    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.
    Thanks In Advance,
    D

  4. #4
    Are you calling the unregister function again after the option is changed? (E.g. using the OptionsManager.registerCallback("YourOptionName",f UnregisterMyTraitRollResolutionSubhandler))

    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.
    Check out my Extensions for Savage Worlds:
    Arcane Devices:Forge and github
    Mass Battles: Forge and github
    Fast Tests: Forge and github
    Reload Consumption: Forge
    Chase&Combat Compilation: Forge

  5. #5

    Join Date
    Mar 2020
    Location
    Sydney, Australia
    Posts
    247
    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?
    Thanks In Advance,
    D

  6. #6
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,361
    Quote Originally Posted by UrsaTeddy View Post
    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.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  7. #7

    Join Date
    Mar 2020
    Location
    Sydney, Australia
    Posts
    247
    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 ...
    Thanks In Advance,
    D

  8. #8
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,361
    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?
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  9. #9

    Join Date
    Mar 2020
    Location
    Sydney, Australia
    Posts
    247
    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.
    Thanks In Advance,
    D

  10. #10
    Ikael's Avatar
    Join Date
    Jan 2008
    Location
    Finland/Joensuu
    Posts
    2,383
    Quote Originally Posted by UrsaTeddy View Post
    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.
    "Alright, you primitive screwheads, listen up: THIS... is my BOOMSTICK!" -- Ash Williams, Army of Darkness

    Post your SavageWorlds ruleset feature requests and issue reports here!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
FG Spreadshirt Swag

Log in

Log in