PDA

View Full Version : Getting user name



darrenan
January 7th, 2022, 19:10
Do User.getUsername() and Session.UserName return the same information? Should we prefer using one or the other? I don't see Session.UserName being used in CoreRPG at all, so I guess User.getUsername() is preferred?

Trenloe
January 7th, 2022, 19:13
The API reference for both says they return the "local user's network username" - so they should be the same.

The Session package contains variables with the data - it doesn't do a full API call like the User package does. Using Session is more efficient and preferable.

darrenan
January 7th, 2022, 19:34
User.getUsername()=GM Session.UserName=darrenan

They don't return the same data.

Trenloe
January 7th, 2022, 19:36
User.getUsername()=GM Session.UserName=darrenan

They don't return the same data.
So that's either an issue with the code or the API documentation.