question

Brent Batas (Lisk) avatar image
Brent Batas (Lisk) asked

How to remove game mode via Admin API?

I'd like to remove all game modes via the Admin API.

The only relevant operation I see is ModifyMatchmakerGameModes but I don't see how to use this to explicitly remove game modes. It only seems to overwrite them.

Usage/problem context:

My build script uploads a new server build, then adds the server build, then modifies the matchmaker game mode to point to the new build.

I want it to look something like...

  • lobby - aelobby0.1
  • classic - aeserver0.20
  • tutorial - aeserver0.20

But it ends up looking like...

  • classic - aelobby0.1
  • tutorial - aelobby0.1
  • lobby - aelobby0.1
  • classic - aeserver0.20
  • tutorial - aeserver0.20

Somewhere during the build process, I think when the script removes the old server build, the server game modes try to fall back to the only remaining build (which is the lobby).

Custom Game Servers
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

When you call ModifyMatchmakerGameModes, it's an overwrite - you're specifying the complete set of Game Modes available for the build. Just leave out any you no longer want, and they'll be removed.

But two points on that:

1. When you call ModifyMatchmakerGameModes, you're setting the Game Modes for a specific Build ID. No Game Modes for any other Build ID are changed.

2. When you remove a build, you should also remove the relevant Game Modes for that Build ID. They are not automatically updated to a different game build.

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.

Brent Batas (Lisk) avatar image Brent Batas (Lisk) commented ·

As always, thanks for the answer!

Regarding 2, how do I do that "remove" you described? Is doing it through the Game Manager the only way?

0 Likes 0 ·
brendan avatar image brendan Brent Batas (Lisk) commented ·

If you leave the GameModes array empty, that'll remove all Game Modes for the Build ID.

1 Like 1 ·

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.