If a player changes its name, is it updated in-game, too, or would they have to rejoin?

Hello!

I can’t find anything about this, so i’m confused as to what to do now. It occurred to me that if it’s updated right away, the way my project currently works, might cause data leaks, because when player joins, he’s added to contestants table, but if he changed his name in the middle of the game, i wouldn’t know what to remove from that table when he leaves.

Better safe than sorry, so i rather ask…

I suppose i should clear the contestants table once in a while to be on the safe side?

The changes are not applied in-game. I asked this myself with a user that has more experience than me. He said no. Plus what are the chances that a user will change their name in-game?

1 Like

Yeah that’s kind of why you’re supposed to work with UserIds and the player instances rather than usernames, though no a username change does not apply to games until a new session starts.

6 Likes

The username updates after the player rejoins, you should use UserId as they never change.

1 Like

I am using player instances for the most part yeah. Other than appearance and data saving, i see no reason to use UserId. Is there?
At least the biggest cocnern is clear now, so that`s good…

1 Like

Appearance-wise (e.g., showing their username on a leaderboard), should be fine.

For data saving. NEVER use their name. Ever. Only use their UserId. If a player changes their name, you would be creating a new key with new data so the only way they can get their old data back is by reverting their name. That’s no fun.