Playtime Tracking#23
Conversation
Tracks playtime.
lukechatton
left a comment
There was a problem hiding this comment.
What happens when the server crashes/restarts and players get kicked out without calling the endpoint?
Logging in multiple times in a row wouldn't affect the API (apart from not saving playtime of the last session), as the join timestamps are managed on TGM. I don't see a better way of implementing playtime tracking... |
This would add the total time between Date1 and Date2 to the user's play time (a full week). What about having the server send the api a list of online players every minute or so? Then every time you just add 1 minute to all of the batched players. |
It wouldn't add the total time between Date1 and Date2. It would however ignore the playtime between Date1 and the server crash. Join timestamps are managed by TGM, and whenever a user logs out properly (disconnect or timeout), a request is sent with the join timestamp and the API will add this playtime to the profile. If the API never gets the logout request, the player simply would lose some playtime, but it wouldn't add playtime which never was there when the player joins back.
I don't think this solution is much better than mine. All playtimes would be cut off by full minutes, and after some months this could add up to several hours in inaccuracy. If we would add both solutions though it might work. |
Tracks playtime.