STAR TREK 2d20
  1. #1

    How do I use User.isOwnedIdentity to determine if a charsheet is owned by user

    I'm trying to figure out how to determine if a callback function from a DB.handler is returning something owned by the player.

    I thought User.isOwnedIdentity was the way to go. But I can't figure out what to pass it for the sIdentity.

    I've tried the charsheet.id-00002 and even gotten the combat tracker character name and passed that in. Starting with a character sheet node - how do I figure out if it's owned by the player running the code currently?

    I'm hoping the answer is not get the user identity - read the DB for the owner someplace. I'm hoping there is easy magic I'm just unaware of.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  2. #2
    On the player side, User.isOwnedIdentity only takes the short name of the PC database node (i.e. id-00002), and returns whether the current player owns the PC.
    On the GM side, User.isOwnedIdentity takes 2 parameters, the short ID name and the user name, and returns whether that user owns that PC.

    Regards,
    JPG

  3. #3
    Quote Originally Posted by Moon Wizard View Post
    On the player side, User.isOwnedIdentity only takes the short name of the PC database node (i.e. id-00002), and returns whether the current player owns the PC.
    On the GM side, User.isOwnedIdentity takes 2 parameters, the short ID name and the user name, and returns whether that user owns that PC.

    Regards,
    JPG
    Hmm.. Guess I'll go the long way that can be run the same in both places. Thanks .

    Code:
    		local sOwner = DB.getOwner(nodeChar);
    		local sUser = User.getUsername();
    		if not User.isHost() and sUser ~= sOwner then
    ... stuff...
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

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
  •  
DICE PACKS BUNDLE

Log in

Log in