I'm trying to implement a reconnect function and GetMutiplayerServerDetails looks just what I needed to get started, but I can't call it on the client. Is there any way I could call the function on the client side?
I'm trying to implement a reconnect function and GetMutiplayerServerDetails looks just what I needed to get started, but I can't call it on the client. Is there any way I could call the function on the client side?
If you have got the session Id and the build region of an active server session, you can retrieve the sever details of it via calling the entity API RequestMultiplayerServer on the client. This API RequestMultiplayerServer can be accessed by title_player_account entity token by default.
For clarification, if you pass a new session Id to the API RequestMultiplayerServer, it will try to allocate a server from the standby server pool. And If you pass a existed session Id to it, it will return the server data, including the IPV4Address and Ports to you.
But using RequestMultiplayerServer will always return the server state as active, even if the original session is already terminated. I wanted to check if the original session is terminated/finished, the player can't reconnect (because the game is already finished) and have to find a new match to play.
Thanks for your clarification. As you said, if the original server has been terminated, the API RequestMultiplayerServer will allocate a new standby server to active state.
If your target is to retrieve the state of a server instance and return the result to players. You can consider calling the entity API GetMultiplayerServerDetails on the CloudScript using Azure Functions, and let clients call the API ExecuteFunction to execute a function and obtain the result the function returned. Please check the documentation – PlayFab CloudScript using Azure Functions Quickstart Guide - PlayFab | Microsoft Docs for more information about how to use the CloudScript using Azure Functions.
Guess you can't do it on the client after all. Thanks
8 People are following this question.