question

entelicon avatar image
entelicon asked

Running a .bat file

I'm new to batch files, but if I told PlayFab to execute one when a server spins up, would it be able to?

If not, do you recommend any ways about how I can handle this?

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

There is no facility in PlayFab for running a batch file. Depending on what it is you're trying to do, you have a few options:

1. Since you mention "when a server spins up", I'm guessing you mean you'll be running dedicated servers (custom game servers) as part of your game . If so, you would simply use the Server API to make calls from the server to PlayFab, for the info you need.

2. You can run Cloud Script handlers via a Client or Server API call, or trigger them via a Rule in PlayStream, to execute lightweight server-authoritative logic that runs in your title.

3. You could set up Scheduled Task that runs some specific logic (also potentially a Cloud Script) either manually or on a regularly scheduled basis (hourly, daily, etc.).

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.

entelicon avatar image entelicon commented ·

Ah, I think my question was to vague.

I am talking about Custom game servers, but specifically instead of setting my path to gameserver.exe(or whatever it actually is), can I set it to serverlauncher.bat(again, just an example)?

So instead of running an exe I want to run a .bat.

0 Likes 0 ·
brendan avatar image brendan entelicon commented ·

Sorry, no - it needs to be an executable. Also, one thing to be aware of is that as soon as the executable we launch exits, that's when our service which manages the servers knows that your server has stopped running, and the instance can be cleaned up. So if you have an exe that launches a different one, you need to make sure that first one doesn't exit until the one the game instance is completely finished.

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.