PDA

View Full Version : User.getCurrentIdentity()



Stv
February 24th, 2020, 20:23
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.

Moon Wizard
February 24th, 2020, 20:32
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

Stv
February 24th, 2020, 21:07
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. :)

Moon Wizard
February 24th, 2020, 21:31
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

Stv
February 24th, 2020, 22:13
Thanks for taking a deeper look into it :)