question

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

Close custom game server after specified amount of time?

Currently, I have my custom game server coded so that an instance exits when a match ends (victory/defeat) or all players leave the game or 60 minutes have elapsed (games should only take about 40 minutes max, so 60 is a safe upper bound).

However, in certain circumstances (such as server dropping someone's connection or erroring, I think), the server doesn't exit. I know this because I've observed some servers that have been running for 6+ hours.

Is it possible to configure the Game Wrangler or pass in some kind of command line argument that ensures that the server instance shuts down after, say, 1 hour after it is started?

Custom Game Serversgame manager
10 |1200

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

brendan avatar image
brendan answered

Not currently - the way the system works for custom game servers is that instances only terminate if the executable exits or you use the terminate option in the Game Manager.

3 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.

Chad Franklin avatar image Chad Franklin commented ·

Hello @Brendan, I have the same concern, and is this still the case? No way to ensure the container is closed after a period of time?

0 Likes 0 ·
brendan avatar image brendan Chad Franklin commented ·

We do not forcibly shut down your executable currently. The hosted servers will continue to be available until the game server code exits (whether a normal exit or a crash), at which point they are reclaimed. For others, there's a Feature Request on this topic here if you want to up-vote (Like) it: https://community.playfab.com/idea/21647/automatically-shutdown-a-server-after-x-amount-of.html

0 Likes 0 ·
Chad Franklin avatar image Chad Franklin brendan commented ·

Alright, thanks for the update :)

0 Likes 0 ·
Montana Tuska avatar image
Montana Tuska answered

Why not just add in your own timer to kill the server after an hour?

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.