question

amazdeh avatar image
amazdeh asked

How can i remove a server from match making

We have a metagame server which hosts our metagame parts and not match sessions and as a result it remains up for a long time and as a result of that its log files will become huge and we can not download them because your systems don't store them if they become big.

How can we implement a system so say after 3 hours a metagame server stops participating in match making process and a new metagame server for new players is created so we can quit the current one after all of its current players went to matches/exited the game?

For Metagame we are using your default match maker, does it work if we call DeregisterServer from the MetaGameServer ? , We don't want to quit it immediately because all of its current players would disconnect and this is not going to make for a pleasant experience. I would like to create a flow like this.

1- A Metagame server starts and participates in match making and accepts players up to 1000 CCU (works now)
2- After X seconds it tells the match maker to forget about it and does not accept new players
3- MM starts a new MetaGameServer instance for new players

Thanks for the help in advance

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

Specifically, the issue is that once the log file gets into the GB range, the server won't remain active long enough for us to copy the file off, once the executable has been shut down. More simply put, we do not currently support log files that are 100MB or larger.

DeregisterServer is specifically for externally-hosted servers (https://api.playfab.com/docs/tutorials/external-game-servers).

The way to do what you're aiming for is like so:

When the server has reached the time limit you want it to run (which is a good idea not just due to log file sizes, but to prevent issues due to any memory leaks or other bugs that might be in the custom game server logic), set its instance state to Closed (https://api.playfab.com/documentation/server/method/SetGameServerInstanceState). That blocks it from matchmaking. A new matchmaking call at that point would result in the player going to a new instance.

Important note: There needs to be an instance ready to start when you do this. So your MinFreeGameSlots needs to be set high enough that there is a waiting slot ready.

At some point after closing the server to new players, you'll also want to start "kicking" players - telling those clients to do a new matchmaking call to get to the new server. It's a good idea to not do this to all players at once, so that your new instance isn't trying to handle 1,000 players all trying to join it at the same time.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

amazdeh avatar image amazdeh commented ·

Thanks for the response. It is a good idea to kick players but the thing is our metagame sessions are very short in almost all cases, Players upgrade cards, change decks if needed and go to the next match. the average metagame session time is less than a minute and max is less than 5 minutes 99% of the time so no need for kicking.

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.