Thread: User.getCurrentIdentity()
-
February 24th, 2020, 20:23 #1
User.getCurrentIdentity()
No matter if I'm logged in as a gm or a client, this funtion returns nil.
Is it still a valid function, or am I just being a bit dim?
Cheers, Steve.
-
February 24th, 2020, 20:32 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,539
This will only return a value on the client after the player has activated an identity (i.e. PC).
There are a couple places this is used in the CoreRPG ruleset code.
Regards,
JPG
-
February 24th, 2020, 21:07 #3
Thanks MW.
I must be having a bad night, 'cos even when I log in as a client, select a character, it still seems to return nil.
Think I'll come back to it tomorrow
Cheers, Steve
*edit*
OK, sorted that one after all. Turns out I was being a bit dim. Thanks for the pointer Moon.Last edited by Stv; February 24th, 2020 at 21:32.
-
February 24th, 2020, 21:31 #4
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,539
Just looked at the code to make sure.
If you're calling on GM client, then it requires a parameter with the user name that you are requesting the current identity for. If no parameter is specified, it will return nil. If the user does not have an identity activated, it will return nil.
If you're calling on the player client, then it returns the active identity (if any PC active), otherwise returns nil (if no PCs activated).
Regards,
JPG
-
February 24th, 2020, 22:13 #5
Thanks for taking a deeper look into it
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks