question

b avatar image
b asked

Unity - Do I need to implement the HealthCallback?

When I use LocalMultiplayerAgent.exe to test my server locally the output shows:

state: PlayFab.MultiplayerAgent.Model.HeartbeatRequest, 

payload: {

"CurrentGameState":"Active",

"CurrentGameHealth":null,

"CurrentPlayers":[{"playerId":"a0f0ebee-b3d1-4a2b-bab0-bca06caed24c"}]}


Do I need to implement a callback to set the GameHealth?
If so how do I do that in unity?

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

·
Seth Du avatar image
Seth Du answered

No, you don’t have to implement the codes to set healthy because the state is determined by GSDK. Moreover, the health state is monitored via heartbeat sent by GSDK. If you look in to the source code of GSDK, the heartbeat is sent to PlayFab via HTTP. As long as the server build can communicate with PlayFab, the state will be healthy. For the game server logic, you may simply get the state.

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.