question

Jason Woodall avatar image
Jason Woodall asked

How do I start a game server in a specific GameMode?

I am trying to set up a game server, so I can access Admin API calls in my game.

I followed all the directions in https://api.playfab.com/docs/tutorials/landing-tournaments/custom-game-servers.


Except the "ModifyMatchmakerGameModes" call. I can't figure out where I am supposed to make this call from, as it is an Admin API call.

When I run my client everything works except I get an error on Matchmake: "Game mode not found: Basic"
I have a game mode set up call "Basic", and even tried to force the server to run in Basic mode by setting the command line option in the Command line options:
Command-line arguments

-game_id=<game_id> -game_build_version=<game_build_version> -game_mode=Basic

Thoughts?
apisCustom Game Serversgame manager
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.

Jason Woodall avatar image Jason Woodall commented ·

I also get the same Game mode not found: Basic when trying to call PlayFabClientAPI.StartGame

0 Likes 0 ·
Jason Woodall avatar image Jason Woodall commented ·

I was able to get it to work by manually calling:
'List<GameModeInfo> modes = new List<GameModeInfo>() { new GameModeInfo { Gamemode = "Basic", MaxPlayerCount=10, MinPlayerCount=1, StartOpen=true} }; PlayFabAdminAPI.ModifyMatchmakerGameModes(new ModifyMatchmakerGameModesRequest() { BuildVersion = "0.2", GameModes = modes }, HandleModifyMatchmakerGameModes, HandlePlayFabError); '

in the game server itself, but this seems wrong.

This also replaced all the entries I made in the Dashboard.

0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

The ModifyMatchmakerGameModes is specifically for setting up the definition of your game builds in the service. When starting a game server instance, you'll either be calling Matchmake or StartGame - both of which have a GameMode parameter. The GameMode you specify in those calls is what will be used for the server instance.

If you're seeing "Game mode not found", please check that you have the Game Mode in question set up for the specific Build ID you're trying to start.

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.