question

Muhammad Roshaan Tariq avatar image
Muhammad Roshaan Tariq asked

Redundant DateTime Value

Hi, I'm using this Client GetTime function to get server time for preventing players to cheat by changing DateTime of device. But the issue I'm facing at random is that it returns the garbage value or redundant value.

Below is the JSON of my player data in which I have stored the server time I got from server

json.png

What could be the problem here?

apissdks
json.png (28.0 KiB)
1 comment
10 |1200

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

Muhammad Roshaan Tariq avatar image Muhammad Roshaan Tariq commented ·

Check "deployedTime" in the picture I have attached of my JSON

0 Likes 0 ·

1 Answer

Seth Du avatar image
Seth Du answered

What SDK you are using?

The type of Time in the callback response is DateTime. If you are using a strong typed language, you need to convert it before use.

ps. If you are referring this doc:https://docs.microsoft.com/en-us/rest/api/playfab/client/title-wide-data-management/gettime?view=playfab-rest#gettimeresult, we have noticed that the this API documentation is incorrect and will file a doc change request shortly.

11 comments
10 |1200

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

Muhammad Roshaan Tariq avatar image Muhammad Roshaan Tariq commented ·

Hey @SethDu, I'm using this function of Client SDK

and I know it's DateTime and I'm recieving it in a DateTime object but it sometimes give me the response as shown in the image I have attached. Please check "deployedTime"

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Muhammad Roshaan Tariq commented ·

Player Data can only store string. I have tested GetTime API, and the result is fine. The thing you need to do seems to convert the DateTime to String.

0 Likes 0 ·
Muhammad Roshaan Tariq avatar image Muhammad Roshaan Tariq Seth Du ♦ commented ·

I am storing the DateTime in string format using the System.Convert class in C#
What I'm stating here as a problem is that it sometimes gives the value as shown in the image which an incorrect timestamp. Could please look into it?

0 Likes 0 ·
Show more comments
Muhammad Roshaan Tariq avatar image Muhammad Roshaan Tariq Muhammad Roshaan Tariq commented ·

Can you link me to the documentation where it shows how to write custom Playstream events?

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Muhammad Roshaan Tariq commented ·
0 Likes 0 ·
Show more comments