-
October 19th, 2020, 07:40 #1
- Join Date
- Jan 2020
- Posts
- 222
User.getCurrentyIdentity() and User.getIdentityLabel() not working... sometimes.
In my code, I have:
Code:local sSender; local sSenderID; if User.isHost() then sSenderID = ""; sSender = "GM"; else sSenderID = User.getCurrentIdentity(); Debug.console("Just after getCurrentIdentity: ", sSenderID); sSender = User.getIdentityLabel(); Debug.console("Just after getIdentityLabel: ", sSender); end
When I connect with a localhost copy of the client, sSenderID always ends up being the correct ID for the currently selected character in that copy of the localhost client and sSender ends up as that character's name. Perfect.
However, when a non-host, non-localhost client runs this code, sSenderID=User.getCurrentIdentity(); ends up with sSenderID == nil, and the sSender = User.getIdentityLabel(); line errors out with the error "...getIdentityLabel: Invalid argument".
1. Why is sSenderID = User.getCurrentIdentity(); returning nil when a client runs it?
2. Why is sSender = User.getIdentityLabel(); crapping out when a client runs it? (Yeah, I know, User.getCurrentIdentity() is returning nil so that must be it, but just in case it isn't....)
(btw: I have similar code in another place and it always works: )
Code:local currentID; currentID = User.getCurrentIdentity();
Thanks!Last edited by zuilin; October 19th, 2020 at 07:48. Reason: typo
-
October 19th, 2020, 16:40 #2
- Join Date
- Jan 2020
- Posts
- 222
As of this morning, without any code changes, it works. Literally, no code changes. I just sparked up all three copies, did my exact same test again, and now, no errors.
Go figure.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks