DICE PACKS BUNDLE
  1. #1

    Join Date
    Mar 2009
    Location
    Lidingö, Sweden, Europe
    Posts
    351

    User.isHost() or Session.IsHost?

    Both User.isHost() and Session.IsHost seems to do the same thing. Is one recommended over the other?

    /Peter

  2. #2

  3. #3

    Join Date
    Mar 2009
    Location
    Lidingö, Sweden, Europe
    Posts
    351
    Quote Originally Posted by damned View Post
    I believe you should generally be using Session.IsHost() now.
    OK thanks.

    Session.isHost is not a function but, I guess, a global variable of sorts and I see both being used in the ruleset I'm using and building an extension for (Basic Roleplaying) so I just wanted to follow a current best practice.

    /Peter

  4. #4
    Session.IsHost is a boolean value in a package of variables. The Session package of variables was specifically created to register common variables requested; so that API functions would not need to be called (which take more overhead) (such as User.isHost())

    Regards,
    JPG

  5. #5
    Varsuuk's Avatar
    Join Date
    Dec 2015
    Location
    New York
    Posts
    2,075
    Both continue to exist from what was mentioned previously - but as Moon mentioned, using Session.IsHost (capital I or get errors like I did once ;P) is the better way to go for performance.

    FYI, Moon Wizard posted this in response to an earlier ask on the subject:
    Quote Originally Posted by Moon Wizard View Post
    Session package variables
    • IsHost [bool]
    • IsLocal [bool]
    • VersionMajor [#][X = client release (X.#.#)]
    • VersionMinor [#][X = client release (#.X.#)]
    • VersionRelease [#][X = client release (#.#.X)]
    • CampaignName [string]
    • RulesetName [string]
    • UserName [string][FG account name]
    Some of these can replace equivalent function calls (perhaps they all do, I haven't used all of the things they replace yet) in other locations like User (sLocal()), etc.

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
  •  
5E Product Walkthrough Playlist

Log in

Log in