I'm very new to gamesparks and sorry if my question is ridiculous.
In my game I need to know how many players already registered in game, how can I get number of all registered players?
Best Answer
C
Customer Support
said
over 4 years ago
Hi Sina,
To track the count of all registered players you would need to create a custom data type as there is no way to access the player collections via cloud code.
To do this you would create a data type for example called registeredPlayers with an index of registeredCount and each time a new player is registered successfully update the count by one. You will also need to decrease the registeredCount by 1 if a player is deleted. After this you will be able to query Game Data Services and get the value for the registered count and be able to use it for your game. For more information on creating custom data types follow the link here.
I hope this answers your question if you have any more issues please let us know.
Regards,
Garreth.
1 Comment
Customer Support
said
over 4 years ago
Answer
Hi Sina,
To track the count of all registered players you would need to create a custom data type as there is no way to access the player collections via cloud code.
To do this you would create a data type for example called registeredPlayers with an index of registeredCount and each time a new player is registered successfully update the count by one. You will also need to decrease the registeredCount by 1 if a player is deleted. After this you will be able to query Game Data Services and get the value for the registered count and be able to use it for your game. For more information on creating custom data types follow the link here.
I hope this answers your question if you have any more issues please let us know.
Sina Jalali
Hi,
I'm very new to gamesparks and sorry if my question is ridiculous.
In my game I need to know how many players already registered in game, how can I get number of all registered players?
Hi Sina,
To track the count of all registered players you would need to create a custom data type as there is no way to access the player collections via cloud code.
To do this you would create a data type for example called registeredPlayers with an index of registeredCount and each time a new player is registered successfully update the count by one. You will also need to decrease the registeredCount by 1 if a player is deleted. After this you will be able to query Game Data Services and get the value for the registered count and be able to use it for your game. For more information on creating custom data types follow the link here.
I hope this answers your question if you have any more issues please let us know.
Regards,
Garreth.
Customer Support
Hi Sina,
To track the count of all registered players you would need to create a custom data type as there is no way to access the player collections via cloud code.
To do this you would create a data type for example called registeredPlayers with an index of registeredCount and each time a new player is registered successfully update the count by one. You will also need to decrease the registeredCount by 1 if a player is deleted. After this you will be able to query Game Data Services and get the value for the registered count and be able to use it for your game. For more information on creating custom data types follow the link here.
I hope this answers your question if you have any more issues please let us know.
Regards,
Garreth.
1 person likes this
-
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