question

vastchen avatar image
vastchen asked

Help me GetCurrentGames

I need a list of game servers, I want it to return the lobby server and the game server but if I call GetCurrentGames it doesn't work and it always returns {"GameCount":0,"Games":[],"PlayerCount":0}


title id: AB621

Start command:C:\Assets\DarkRift.Server.Console.exe -game_build_version="1.0" -game_mode="test"

client used:


8sdxy.png (17.9 KiB)
1cybu.png (34.5 KiB)
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

·
Sarah Zhang avatar image
Sarah Zhang answered

For clarification, the API GetCurrentGames is designed for the Legacy Custom Server that is no longer available for users who haven’t has a legacy server build. In other words, this feature – Legacy Custom Server and the corresponding document Custom Game Servers are not applicable to your title now. What now you are using is the new multiplayer feature -- PlayFab Multiplayer Servers (MPS). Please note that the PlayFab Multiplayer Servers are different from the Legacy Custom Servers, it doesn’t provide the feature lobby server. Please check the documentations under the [Multiplayer]->[Server] branch, such as Using PlayFab Multiplayer Servers to host multiplayer games, for more information about MPS.

Now, to request a server instance from one server build on the client, you can call the Multiplayer API ListBuildSummariesV2 to obtain the build Ids, then call the API RequestMultiplayerServer to request a server session. If you want to get the list of the existed available server instances for one server build, you can call the Multiplayer API ListMultiplayerServers. This API can list all server sessions for a build according to the build Id you provide, and this API can be only accessed by the title entity. It means you can only call this API on the server-side logic or the administrative tool. If you don’t have a custom external server, you can call this API ListMultiplayerServers on the CloudScript using this method.

multiplayer. ListMultiplayerServers(request);
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.

vastchen avatar image vastchen commented ·

thank

you,I think this information should be in the documentation, to avoid other novice misunderstandings

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang vastchen commented ·

Thanks for the suggestions.

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.