-
January 20th, 2022, 00:58 #1
- Join Date
- Jan 2020
- Posts
- 280
DB.isOwner returning false unexpectedly
I have a client connected with two characters in their possession and added to the CT (added after the client took ownership). I am trying to use DB.isOwner to determine if the OOB recipient is the owner of the active CT token:
Code:function toggleSelectedToken(bSelect) local nodeActive = CombatManager.getActiveCT(); Debug.chat('rcv token select', bSelect, nodeActive, DB.isOwner(nodeActive)); if not DB.isOwner(nodeActive) then return; end -- etc.
owner1.jpg
And from the host view, you can see "anathemort" is the owner of both characters.
owner2.jpg
Did I get something wrong here? Thanks!
-
January 20th, 2022, 01:20 #2
Only the GM owns database nodes in the combat tracker. Check the database node your code is looking at in db.xml - you'll see there's no <holder> tag, which will indicate who is the owner (assuming the owner="true" property is used as part of the <owner> tag), as only the GM owns the data in the database.
If you want to see who owns the character, you'll need to look at the <charsheet> entry for the PC, not the combat tracker entry.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!
-
January 20th, 2022, 03:36 #3
- Join Date
- Jan 2020
- Posts
- 280
Thanks very much Trenloe, that is clarifying
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks