"online": true-->does it actually indicate current status?
a
ahsan muzaheed
started a topic
over 3 years ago
i am ruinning this code:
var players = Spark.systemCollection("player");
var playesOnline = players.find({"online" : true}, {_id : 1, displayName:1,location:1,userName:1,online:1}); // requires an 'email' value to be set on each player via setScriptData, and an index to exist on scriptData.email
Spark.setScriptData("playesOnline", playesOnline);
but it is returinnning me list which contains players that are not actually online. so the big question is what actually represents by "online" : true
Best Answer
C
Customer Support
said
over 3 years ago
Hi Ashan,
GS.Disconnect() should be what you are looking for. This will disconnect the player and immediately set their status as offline. This can bee seen in the Test Harness if you Authenticate a player, click on disconnect at the top of the harness and check their "isOnline" status inside their entry in the System.Player Collection.
EndSession is for Analytics purposes and determining session length on the platform.
Would these players have logged in within the last half hour or so of running that script? Can I confirm that you are ending the players session with EndSessionRequest (https://docs.gamesparks.com/api-documentation/request-api/analytics/endsessionrequest.html) what might be the case here is, if this request isn't sent it can take a bit of time for the session to timeout and update the player online status. This will also help in accurately determining the players session length. I hope this helps answer your question.
Kind regards,
- Steve
a
ahsan muzaheed
said
over 3 years ago
hi. I am back again to this issue. it is still unsolved. i am just calling disConnect() to end the game.
should i call LogOut() or EndSessionRequest() ??
which one would be better during logout and shutdown also?
Customer Support
said
over 3 years ago
Answer
Hi Ashan,
GS.Disconnect() should be what you are looking for. This will disconnect the player and immediately set their status as offline. This can bee seen in the Test Harness if you Authenticate a player, click on disconnect at the top of the harness and check their "isOnline" status inside their entry in the System.Player Collection.
EndSession is for Analytics purposes and determining session length on the platform.
ahsan muzaheed
i am ruinning this code:
but it is returinnning me list which contains players that are not actually online.
so the big question is what actually represents by "online" : true
Hi Ashan,
GS.Disconnect() should be what you are looking for. This will disconnect the player and immediately set their status as offline. This can bee seen in the Test Harness if you Authenticate a player, click on disconnect at the top of the harness and check their "isOnline" status inside their entry in the System.Player Collection.
EndSession is for Analytics purposes and determining session length on the platform.
Happy to help - Patrick.
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Hi Ahsan,
Would these players have logged in within the last half hour or so of running that script? Can I confirm that you are ending the players session with EndSessionRequest (https://docs.gamesparks.com/api-documentation/request-api/analytics/endsessionrequest.html) what might be the case here is, if this request isn't sent it can take a bit of time for the session to timeout and update the player online status. This will also help in accurately determining the players session length. I hope this helps answer your question.
Kind regards,
- Steve
ahsan muzaheed
hi. I am back again to this issue. it is still unsolved.
i am just calling disConnect() to end the game.
should i call LogOut() or EndSessionRequest() ??
which one would be better during logout and shutdown also?
Customer Support
Hi Ashan,
GS.Disconnect() should be what you are looking for. This will disconnect the player and immediately set their status as offline. This can bee seen in the Test Harness if you Authenticate a player, click on disconnect at the top of the harness and check their "isOnline" status inside their entry in the System.Player Collection.
EndSession is for Analytics purposes and determining session length on the platform.
Happy to help - Patrick.
-
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 2485 topics