A few questions about users

0 votes

Hello 42-ers smiley

I have a few questions about users in the App42 Cloud API:

- is there a way to get the user id of a user? (not the username, but a sequential id or a guid or something that uniquely identifies the user in the system, other than through a readable username)

- if there is no internal user id, are there plans of including it?

- must the username be unique?

- if the username is unique, are there plans to implement a way to either duplicate usernames (for example by adding a user id as asked above)?

- is there a way to use a display name? so my account name is "superplayer", but I want my in-game name to be "Rockstar01". I will login with username "superplayer" and password "super" but everyone sees me as "Rockstar01" and next week I can change to "Rockstar02". Is there such a system in place? If not, are there plans for it?

- is there a way to add custom fields/metadata for users? For example adding a nickname, age (yes I know you can calculate it from a DOB, but it is an example), favorite color and some other social trivia stuff? if not, are there plans for it? (maybe like a hashmap/list of strings and such)

- is there support for teams/clans? And if not are there plans for a team management service? i.e. Rockstar01 is a member of team SuperTeam1337. SuperTeam1337 has 3 memebers. SuperTeam1337 has some info/bio for visitors or an avatar/icon etc.

- is there support for cdkeys or something similar? Like uniquely authenticating an application (maybe, for example, replacing the api private key with a cd key hash/checksum that is unique for each user) per user/device

- how can I add penalties for a player? Rockstart01 harassed somebody. he/she deserves a 6 month ban or something like that (but automatic). Or Rockstar01 can now only play game type X instead of all of them. Is there such a system in place? If not, are there plans for it?

 

Thanks yes

Best regards!

asked Jul 6, 2018 in Unity by xian_ef (35 points)
retagged Jul 23, 2018 by xian_ef

1 Answer

0 votes
 
Best answer

Hi Xian,

Please find the answers inline:

- is there a way to get the user id of a user? (not the username, but a sequential id or a guid or something that uniquely identifies the user in the system, other than through a readable username)

Answer: For us user name is the unique identifier, so you can consider this as user ID.

- if there is no internal user id, are there plans of including it?

Answer: The User Management Module is built considering the user name as a unique identifier and hence it is always advisable to pass some unique id while calling createUser API. We are not assigning any random key to any particular user as his user id considering the fact that it may be hard to remember while login again. If he can create the unique user name by his/her own then it will be easier to remember.

- must the username be unique?

Answer: Yes

- if the username is unique, are there plans to implement a way to either duplicate usernames (for example by adding a user id as asked above)?

Answer: As our Authenticate API uses userName and Password to uniquely identified the user while authenticating the new session to the user, hence two users can not be allowed to have same user name

- is there a way to use a display name? so my account name is "superplayer", but I want my in-game name to be "Rockstar01". I will login with username "superplayer" and password "super" but everyone sees me as "Rockstar01" and next week I can change to "Rockstar02". Is there such a system in place? If not, are there plans for it?

Answer: Yes, you can add metaInfo to the user in a JSON doc which can contain display name. This doc can be modified whenever required and can be fetched along with the user details.

- is there a way to add custom fields/metadata for users? For example adding a nickname, age (yes I know you can calculate it from a DOB, but it is an example), favorite color and some other social trivia stuff? if not, are there plans for it? (maybe like a hashmap/list of strings and such)

Answer: Yes, you can add as explained in above answer

- is there support for teams/clans? And if not are there plans for a team management service? i.e. Rockstar01 is a member of team SuperTeam1337. SuperTeam1337 has 3 memebers. SuperTeam1337 has some info/bio for visitors or an avatar/icon etc.

Answer: As of now, there is no direct API available for team or clans management. However, you can use our Stoage module where you can store the team info in a JSON doc. You can also use our Buddy Services to form a group which you can call it as team. 

- is there support for cdkeys or something similar? Like uniquely authenticating an application (maybe, for example, replacing the api private key with a cd key hash/checksum that is unique for each user) per user/device

Answer: As of now, there is no support for cdkeys available. May be if you could provide some more information on the user case of it then I may be able to suggest some alternatives

- how can I add penalties for a player? Rockstart01 harassed somebody. he/she deserves a 6 month ban or something like that (but automatic). Or Rockstar01 can now only play game type X instead of all of them. Is there such a system in place? If not, are there plans for it?

Answer: You can user lockUser / unlockUser APIs of User Management module to lock or unlock the user account but it can not be done automatically. The APIs need to be called whenever these actions are required. To automate, you can use these APIs in combination with Custom Code APIs.

Let me know if you have any further query, I will be happy to help.
 
Thanks.
answered Jul 9, 2018 by rajeev.etc (1,660 points)
selected Jul 9, 2018 by xian_ef
Hmm... I didn't see the metainfo chapter before. Thanks for that, it seems perfect!
Thank you for your other explanations as well.


Regarding cdkeys, I have a(n untested) theory. Looking at the dashboard I can theorize I can generate some random server keys for function calls. And I can assign them to user login calls. I could maybe convert the random key to a "readable" GUID-structure or some simpler hash and distribute them as cdkeys.

Then have a UI in the game where it's filled in and saved locally (or in the windows registry), then do a test login with it. Disabling a key in the Dashboard would work well to deny access to that particular installation.

I don't have an actual unit-test for it, but I am keeping it in mind in case I'll need it, but I think this might work. What do you think?
The custom key generation in dashboard is tied with API calls not with user. Keys generated in the dashboard can be tied with APIs such as Authenticate API but not with every user. If you disable it from dashboard then Authentication will fail for all user for just for a single user.

In this case, what you can do is, generate a random key per user(You may use custom code for this) and save in our Storage Module in a JSON doc. For example, the JSON doc can have {"GUID":"Randomly generated unique number","isEnabled":"true"}. For every login request, you can call a custom code which can validate the request by accessing these JSON docs. Once validated then you can process the login request.

I hope this will help.
Hello,

Regarding saving additional info:
- how do I manage a database? (create/delete) i found a button to create a DB in the Storage menu from the Dashboard. Is this the one to be used by users as well?
- how many databases can I have? just the one from storage in the dashboard?
- if I specify the collection must it be built in advance from the dashboard or can it be created on the first json "upload" from the C# API?


Thanks!
I also have a suggestion for the user dashboard: please add a status column. It can show the status of a user such as: active (meaning unlocked and valid), locked or deleted (for soft deleted, since perm-del erases everything). I just tried experimenting with a soft delete and if I wouldn't have done it myself, I couldn't even tell it was deleted... I am sure everyone would benefit from this :)

And yes I know you can open the details and see that it's soft deleted or locked but when you have a lot of users, that might not help. Even with the xls report. A clear column for managing users would improve the user experience :)

Not a priority, but I think you should keep it in a TODO list somewhere :)
DB is the ultimate container of the data under Storage module. Only one DB can be created per app and it can be created only by Admin from AppHQ Dashboard(From the location you have mentioned in your question).

To save a JSON doc, you will need a DB and a Collection. One App can have one DB, one DB can have multiple Collections and one Collection can have multiple JSON Docs.

The additional meta data for users are stored in Storage module internally and hence you need to provide DB Name and Collection name. You can create both from the dashboard and use it in your code.
I hope it will help.
Regarding User Status column, I will raise a request to add it in our release pipeline. I will update you if the production team accepts the request.
Thanks for both points. So I need to create the Collection before using it on clients. That's fine, it gives even more control this way.

As for the column, thank you, as I said, it is low prio, so if they think it's a "maybe" they can postpone it until they have more time or whatnot :) It's jsut something for user management. Alternatively, ask them if instead of the column  they might want to add filters (similar to Role filters) for the status as active/locked/deleted users instead. Either one works :)

Thank you!
Another question, related to users but using buddy services. I haven't tried it yet, but I am working on it :)
My question is, if PlayerA sends a request to PlayerB, does the server automatically route the request to B or must B fetch it?
If B must fetch it, how do I know the moment when to fetch? If it is routed automatically, then does this "consume" an API call?
If B accepts A's request, is an automatic response sent to A notifying them that B accepted th friend request? If yes, does it "consume" API calls? If not, how do I detect it? If not, how do I know when to check for acceptance? Periodic fetches?

Regarding Buddy groups, are people already added to it after an API call? Or is it invitation-based where they can reject being added? Meaning A adds B to group G, can B reject the invitation or is B automatically a member of G?

Also, is there a Group management service? I see group creation and adding friends to it, but how do I delete a group or remove players from a group? If I am in a group, how do I leave it?
As we are not establishing any persistent connectivity between server and the client, server can not notify the client regarding a friend request or regarding request acceptance. We have to check it periodically.

Once a user adds a friend to a group, the friend will be added to the group. There are no permission required from the user who is being added to the group.

Regarding removing a group or leaving a group, let me check this with team on adding new API to enhance this feature.
Thank you very much. I think this is needed as it seems weird that someone I added as friend can "move" me around groups randomly and I have no opt-out alternative. If requests cannot be implemented, at least the option to leave a group.
Alternatively I can think of adding someone to a group and they become disruptive and harass members, so they ask me to remove him (but if we are real life friends I won't delete them from my list even if they are an asshole :) ).  So removal is needed too I think.

These are my use-cases. Thank you :)
I noticed the examples had a call for metadata: SetOtherMetaHeaders().
The options I see used are:
- customName (this is unclear to me... is this the name that appears as a "Dear X"? I haven't set-up a mail provider so I can't test)
- emailVerification
- emailAuth
- userProfile
- deletePermanent
- SQL "like" operator

Is there some documentation on this? What other properties do I have besides those?

Also, how can "like" be used? The only examples are some contextual queries of what I input vs what it can find. Are there other operators? "not like" for example? "greater than"? Or only "like"?
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...