question

Akash avatar image
Akash asked

Which meter does the PlayFabClientAPI.GetTime() method counts under?

My game actually calls for a lot less api calls so checking connection is a challenge for me.

So can someone tell me if this a good idea to check for connection?

And if so which meter does it it fall under?

I am very paranoid about exceeding the metered limit(s).

apislimits
2 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.

Ivan Cai avatar image Ivan Cai ♦ commented ·

What connection do you need to check? If it is a playfab server connection, I think there is no need to check, because we can guarantee the stability and smoothness of the server connection.

1 Like 1 ·
Akash avatar image Akash Ivan Cai ♦ commented ·

No no, i am not doubting playfab but I want to keep in check if the player is connected to playfab, like if he/she has lost connection.

0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

A connection check is pointless, so it's not worth doing. If there's a service interruption or an ISP failure, it could happen at any time, so it could just as easily occur right after your check and before your next API call. When it comes to Web API based services, you should just use the error responses from the API calls you make in the course of normal gameplay. Those will provide the information on your ability to talk to the service.

15 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.

Akash avatar image Akash commented ·

Thank you for the answer and I will keep it in mind.

But then again can I know which meter does the GetTime fall under, I would be using my own ntp script if I end up calling it a lot to save on some api calls.

0 Likes 0 ·
brendan avatar image brendan Akash commented ·

Could you please explain how calling GetTime could "save" on API calls? The only thing that function does is return the time of day. It cannot replace the functionality of any other API call. If you mean you're going to call it to check if the player's device can reach the service, again, that's not something you should be doing.

0 Likes 0 ·
Akash avatar image Akash brendan commented ·

I am sorry for so much confusion, okay let me explain my case, I want to save a lot of player data with date and time, hence I have to call GetTime() so many times. Hence I was wondering if calling it was going to stack up on my api call meter. And checking connection was secondary as it serves that purpose as well.

0 Likes 0 ·
Show more comments
Akash avatar image Akash commented ·

Can I display the time in realtime, like a server time display?

I mean I am trying to avoid local device time.

Will that stack up onto my meter?

0 Likes 0 ·
brendan avatar image brendan Akash commented ·

I'm not sure what behavior you're defining. If your question is "can I call this periodically - say, six times a minute for a player?" That would be fine, and no, it doesn't hit the meters currently. If you're talking about hitting it with high frequency, that would be abusive behavior per our Terms of Service, and we would have to throttle or block your title.

1 Like 1 ·
Akash avatar image Akash brendan commented ·

Okay, yes I wanted to show a server time in realtime. And I have made it fetch only when a scene changes. So will that be a risky move? Like my whole title getting blocked for one player repeatedly loading scenes?

0 Likes 0 ·
Show more comments
Show more comments
Akash avatar image Akash commented ·

There are multiple scenes like store and records that can be spammed in and out by anyone, hence my concern, the game itself does not encourage frequent switching of scenes.

0 Likes 0 ·
brendan avatar image brendan Akash commented ·

Let me rephrase: What is the maximum rate you expect to need to query GetTime on a per player basis?

0 Likes 0 ·
Akash avatar image Akash commented ·

Let me rephrase too : My game contains "buttons" to multiple scenes like "Store", "Records", "About", "Single-player", "Multi-player" and so on, from the "Main Menu".

And, I am fetching with "GetTime()" every time the player enters any of the above-mentioned scenes.

Hence, I don't/won't know how many times a player may "switch scenes"/"load scenes".

Anyone can "spam" switching/loading scenes with the provided buttons.

0 Likes 0 ·
brendan avatar image brendan Akash commented ·

Then you should have rate throttling as part of the logic in your client code. The client should not be making this request more than a few times a minute.

0 Likes 0 ·
Akash avatar image Akash brendan commented ·

Okay, I am doing this then.

0 Likes 0 ·

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.