question

JJNCreator avatar image
JJNCreator asked

PlayStream and updating internal user data

I'm working on a anti-duplicate login system. The basic flow is:

1. Player attempts to log in

2. Calls a CloudScript function that checks if the user is already logged in

3. If the value returns true, the player can't log in

4. If it returns false, the player proceeds to the Main Menu

The value is stored in the player's internal data. I also made a PlayStream segment that when the player hasn't logged in for more than x minutes (I have x set to 6 right now), it deletes the internal data key, allowing the player to log in. However, I haven't been able to get the segment working. The player enters the segment, but it doesn't call the CloudScript function for deleting the internal data key.

Any help would be much appreciated.

Thank you.

Player DataCloudScriptPlayStream
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

We do plan to add a "log out" function later on, as part of a revamp to our session system we'll be making. For now, it is possible to do something like this, but one immediate problem is that you'd be timing this off the log in operation, meaning that you would delete the data set to indicate logged in X amount of time after the player logs in - even if he's still playing. Also, it's worth noting that our Session Tickets are currently good for 24 hours, so there's nothing stopping a hacked client from keeping the ticket for that period and sending calls, even if you have a system like this in place.

To make this work, what you would need to do is set a value indicating that the player is active, once every few minutes. The timestamp on that data value will then tell you the last time the player updated it. When the player signs in again, if that value is recent (within the period of the write - so, a few minutes), don't allow the player to sign in. Please note though, that attempting to write to this value frequently would be a bad idea, as that could exceed the per-player rate limit, causing the player to be throttled.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.