Allow players to search for "Friend Codes" as seen in so many other games?
S
Sean Young
started a topic
over 5 years ago
Hey all!
I just wanted to know what is the best way to go about generating a "Friend Code" for new players, and being able to search for other players by inputting their "Friend Code".
I'm assuming upon device authentication or facebook/google login you just save a random id as a player's friend code but I'm unsure about how to search through a list of OTHER players' friend codes.
Thanks!
-Sean
Best Answer
C
Customer Support
said
over 5 years ago
Hi Sean,
Yes that would be one way of doing it. For searching for other players friends a simple way to achieve this would be to have a Runtime Collection with a document for each player then in that player document an array of each of that players friends (Friend Code) which would need to be updated when a player adds or removes a new friend.
Yes that would be one way of doing it. For searching for other players friends a simple way to achieve this would be to have a Runtime Collection with a document for each player then in that player document an array of each of that players friends (Friend Code) which would need to be updated when a player adds or removes a new friend.
Sean Young
Hey all!
I just wanted to know what is the best way to go about generating a "Friend Code" for new players, and being able to search for other players by inputting their "Friend Code".
I'm assuming upon device authentication or facebook/google login you just save a random id as a player's friend code but I'm unsure about how to search through a list of OTHER players' friend codes.
Thanks!
-Sean
Hi Sean,
Yes that would be one way of doing it. For searching for other players friends a simple way to achieve this would be to have a Runtime Collection with a document for each player then in that player document an array of each of that players friends (Friend Code) which would need to be updated when a player adds or removes a new friend.
If you're planning on social integration there are other ways such as ListGameFriends which is explained here https://docs.gamesparks.com/api-documentation/request-api/player/listgamefriendsrequest.html and of course we have Teams which may suit your needs which is explained here https://docs.gamesparks.com/documentation/configurator/teams.html
Hope this helps,
- Steve
Customer Support
Hi Sean,
Yes that would be one way of doing it. For searching for other players friends a simple way to achieve this would be to have a Runtime Collection with a document for each player then in that player document an array of each of that players friends (Friend Code) which would need to be updated when a player adds or removes a new friend.
If you're planning on social integration there are other ways such as ListGameFriends which is explained here https://docs.gamesparks.com/api-documentation/request-api/player/listgamefriendsrequest.html and of course we have Teams which may suit your needs which is explained here https://docs.gamesparks.com/documentation/configurator/teams.html
Hope this helps,
- Steve
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics