question

ignat-nee-1 avatar image
ignat-nee-1 asked

GetCurrentGameRequest with heartbeat

Greetings.
I'm want to create matchmaking system, where players get list of suitable servers and join them. But some server can be "dead" for some reasons.
Each "alife" matchmaking server send heartbeat state every 10 seconds by RefreshServerInstanceHeartbeat method. If i'm got it correctly from related topics, when i'm send GetCurrentGameRequest method, i'm get list of active games with some heartbeat delay (about 2 minutes). But when i'm called it, i'm recieve all my game servers, even dead.
My game's title id is 59DD.

Matchmaking
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

It sounds like you're saying that you have a set of externally hosted servers which may or may not be allowing players to join, and you're using https://api.playfab.com/documentation/client/method/GetCurrentGames to get the list of all available servers, for purposes of matchmaking.

What RefreshServerInstanceHeartbeat does is to let our matchmaker know that your server is still active, and so available for matchmaking (it is initially added to the list the matchmaker maintains when you call https://api.playfab.com/documentation/server/method/RegisterGame.

If you want the games to not be returned in the list of session the matchmaker is tracking, the simplest thing to do would be to use https://api.playfab.com/documentation/server/method/DeregisterGame to remove it from the list.

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

ignat-nee-1 avatar image ignat-nee-1 commented ·

Thanks for advice, but "Deregister game" method is not for my case.
There is possibility than my server can crash,or can be closed by system, and "Deregister Game" just can't execute, but server can still be returned in servers list. I wan't to prevent this issue.
So, as i get it correctly, i can't exclude "dead" servers with "heartbeat" option?

0 Likes 0 ·
brendan avatar image brendan ignat-nee-1 commented ·

We maintain a list of active servers in the matchmaker. When you register a server, and when it calls the heartbeat API, that tells us to make sure to keep the server in that list. It's not an active socket connection. So when your server goes "dead", if there's no way for it to notify us via the deregister API call, it will be removed from the list when it misses the time limit for the heartbeat call, which is two minutes.

0 Likes 0 ·
ignat-nee-1 avatar image ignat-nee-1 brendan commented ·

Seems pretty logical, but my instances then i'm launch yesterday still returns in via GetCurrentGames method. Is there any mistmatch than i'm didn't noticed?
Otherwise, is there any opportunity to reduce 2 minutes timeout?

0 Likes 0 ·
Show more comments

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.