Is it possible to tell how long a user has been registered for?
M
Mike Wuetherick
started a topic
over 7 years ago
I know that the system will tell us if a user has been registered with the system previously or not, but is there any way (from client or server/script code) to tell how long a user's account has been registered?
For our analytics system we want to track how long a user has been active in a game - is this something that is possible to do out of the box?
Thanx in advance,
Mike W
Best Answer
C
Customer Support
said
over 7 years ago
Hey Mike,
I have a solution for you from one of our tech-people.
var createdDate = new Date(parseInt(Spark.getPlayer().getPlayerId().substring(0,8), 16)*1000);
This will get you the creation time as UTC datetime so you may have to parse that back for your own use.
That is currently not available. However, that data is stored in the player collection, so i've submitted a feature request for it to be added to the SparkPlayer object. I'll let you know as soon as its ready.
-Sean
Customer Support
said
over 7 years ago
Answer
Hey Mike,
I have a solution for you from one of our tech-people.
var createdDate = new Date(parseInt(Spark.getPlayer().getPlayerId().substring(0,8), 16)*1000);
This will get you the creation time as UTC datetime so you may have to parse that back for your own use.
-Sean
M
Mike Wuetherick
said
over 7 years ago
Cool thanx. I'll see if I can figure out how to get this working.
Cheers,
Mike W
Customer Support
said
about 7 years ago
Hi Mike,
In our latest release we have added a call that lets you to get the date the player was created.
Mike Wuetherick
I know that the system will tell us if a user has been registered with the system previously or not, but is there any way (from client or server/script code) to tell how long a user's account has been registered?
For our analytics system we want to track how long a user has been active in a game - is this something that is possible to do out of the box?
Thanx in advance,
Mike W
I have a solution for you from one of our tech-people.
var createdDate = new Date(parseInt(Spark.getPlayer().getPlayerId().substring(0,8), 16)*1000);
This will get you the creation time as UTC datetime so you may have to parse that back for your own use.
-Sean
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
That is currently not available. However, that data is stored in the player collection, so i've submitted a feature request for it to be added to the SparkPlayer object. I'll let you know as soon as its ready.
-Sean
Customer Support
I have a solution for you from one of our tech-people.
var createdDate = new Date(parseInt(Spark.getPlayer().getPlayerId().substring(0,8), 16)*1000);
This will get you the creation time as UTC datetime so you may have to parse that back for your own use.
-Sean
Mike Wuetherick
Cool thanx. I'll see if I can figure out how to get this working.
Cheers,
Mike W
Customer Support
Hi Mike,
In our latest release we have added a call that lets you to get the date the player was created.
You can read more about it here. Hope this helps.
Thanks,
Liam
-
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