I need to display the nickname of the player above their heads once they walk within AOI, and this nickname is different from the username. The nickname is persistent in the database and it is unique, the nickname will be fetched from DB and pass over to clients.
However, I dont know how to get this piece of info once a remote player is within AOI.
Do I keep a local dict of all "met" userId with their nickname? and if the remote player that is within AOI is not in the list, i send a request to the server and fetch the player info and then add it to the dict of known userid/nickname?
Or is there a way to set this nickname variable ONCE from the server and be available to clients forever for the duration of the session?
How to transmit nickname data
Re: How to transmit nickname data
Hello,
You could store the nickname as UserVariable in each User object.
When a player logs in the system you can read the nickname from the database and set the UserVariable for the new User.
This way any player appearing in the user's AOI will also carry the nickname and you can display it on screen.
Makes sense?
However, I dont know how to get this piece of info once a remote player is within AOI.
You could store the nickname as UserVariable in each User object.
When a player logs in the system you can read the nickname from the database and set the UserVariable for the new User.
This way any player appearing in the user's AOI will also carry the nickname and you can display it on screen.
Makes sense?
Re: How to transmit nickname data
Thanks!
I overlooked the code, I was focused on "changedVar" and assumed only changedVars can be looked at and didnt noticed that the user objects contains all set variables!
got it working!
I overlooked the code, I was focused on "changedVar" and assumed only changedVars can be looked at and didnt noticed that the user objects contains all set variables!
got it working!
Who is online
Users browsing this forum: No registered users and 47 guests