QwertygiyJoin Date: 2009-08-09 Post Count: 89 |
With the addition of name changing and data stores allowing leaderboards, one big problem has risen: If you store data via username and a player changes their name, they lose all their data. If you store data via userid, you get a list of boring numbers on leaderboards and people have to do some tedious searching to get the names of the people they're trying to beat. The only logical current work around is to have dual datastores for both userId and name, and save the data of the userid table to the name table. But this only works for leaderboards, and there are other reasons someone might want to turn names into ids or vice versa.
I propose the following methods, of the Players service would be most logical.
GetUsernameFromId(int id): Returns the current username of the player with the userId "id".
GetUserIdFromName(string name): Returns the ID of the player who at any point used the username "name".
GetAllNamesOfId(int id): Returns a table of all the usernames that the player with the userId "id" has ever had. |
|
DespairusJoin Date: 2008-09-03 Post Count: 5407 |
yes...Yes!! Brilliant idea!!! Support! Can never go wrong with adding more pre-made functions ;D |
|
Manwich1Join Date: 2010-06-23 Post Count: 1735 |
Support |
|
XenonLiJoin Date: 2009-08-19 Post Count: 5013 |
the "at any point" made me angry
can't previous names be used again?
if not, support |
|
ZhouJiangJoin Date: 2012-01-01 Post Count: 1265 |
Support.
"A man chooses, a slave obeys." - Andrew Ryan |
|
QwertygiyJoin Date: 2009-08-09 Post Count: 89 |
"The at any point part"
A username can't be taken by another user if the original user changed away from it. It's reserved for that user.
If "Bob123" changes his name to "Bob12345", only he can change his name back to "Bob123". Nobody else can register a new account under it, and nobody else can change their name to it. |
|
QwertygiyJoin Date: 2009-08-09 Post Count: 89 |
Bump.
The way I am currently getting around this in my game is by using Data Stores. When a player enters the game, it saves their username to a DataStore with the userId as the key, and also saves their userId to a different DataStore with the username as the key.
Then, on the leaderboard which stores the data per userId, there is a button they can click beside each userId to get the username. It's clunky and is only effective on one-person servers, plus it isn't retroactive -- the username cannot be retrieved for players who haven't played since I added that script. |
|
|
QwertygiyJoin Date: 2009-08-09 Post Count: 89 |
Rebump. |
|
QwertygiyJoin Date: 2009-08-09 Post Count: 89 |
Meowbump. |
|
QwertygiyJoin Date: 2009-08-09 Post Count: 89 |
Kreebump. This shouldn't be a hard function to add at all. |
|
DataStoreJoin Date: 2012-02-07 Post Count: 8540 |
You can already get a person's username, from their ID, in at least two different ways:
1) You can use HttpService, and an API someone has created.
2) You can get a player's username through using the GetUserSets method, and then the creator name of their My Model set.
I'd also like to point out that a 'GetUserIdFromName' method would be incredibly pointless, in my personal opinion. If you're going to use your DataStore example, then the place creator can simply check the userId property of the player in their game. No need for an additional method.
Again, I disagree with your suggestion of 'GetAllNamesOfId'. Since the addition of HttpService you can already do this, and there are multiple sites out there offering ROBLOX APIs for getting this kind of information. Completely unneeded.
|
|
duck14Join Date: 2009-09-20 Post Count: 20912 |
Support. |
|
trogyssyJoin Date: 2010-10-29 Post Count: 2322 |
DataStore has a point.
===A message to all you price floor haters, courtesy of the ROBLOX mods: youtu.be/NPlXc7h5z4M=== |
|
QwertygiyJoin Date: 2009-08-09 Post Count: 89 |
DataStore also has a limit. You can only use it 60 + 10 * player times a minute. If you have 25 names on a scoreboard, you can't even scroll three times before you've used up the base limit and the player's limit, as well as sucked up other players'. |
|
QwertygiyJoin Date: 2009-08-09 Post Count: 89 |
HTTPService has a similar limit, with similar problems. |
|
InteWvJoin Date: 2014-04-04 Post Count: 316 |
No support. |
|
DataStoreJoin Date: 2012-02-07 Post Count: 8540 |
@Qwert,
The issue with DataStores can be gotten around. You do not need to access the SAME bits of data over, and over, again within a small period of time. You point out a flaw with DataStores, yet people are using them for the exact purpose, of leaderboards, without any issues at all.
HttpService has a limit per server not per place, of which you wouldn't exceed easily, so long as you don't keep requesting the same data over and over again - wasting your limit.
|
|
QwertygiyJoin Date: 2009-08-09 Post Count: 89 |
I will take my example.
Saved leaderboard:
1: UserID 3251851
2: UserID 43256262
3: UserID 4759254
4: UserID 9540263
5: UserID 20591433
To get the Username via DataStore, that's one usage for each page of 15 to get the data, and then that's one usage of GetAsync("usernames", userID) for each position.
To get it via HTTPService, same thing, one usage per UserID. |
|
NetprobeJoin Date: 2011-08-04 Post Count: 7212 |
Full support. |
|