question

Michael Coker avatar image
Michael Coker asked

How to use PlayFabMultiplayerAPI CreateBuildWithProcessBasedServer in python?

I'm having trouble with the port specification. I get 2 different errors whether the port number is set or not. Here is my call

def createBuild():
    regions = [{ 'Region':'WestUs', 'MaxServers':2, 'StandbyServers':1, 'DynamicStandbySettings':{ 'IsEnabled':False }}]
    requestBody = {
        'BuildName':buildname,
        'GameAssetReferences': [{ 'FileName':filename }],
        'MultiplayerServerCountPerVm':1,
        'Ports':[{'Name':'game', 'Num':7777, 'Protocol':'UDP'}],
        'RegionConfigurations':regions,
        'GameWorkingDirectory':"C:\\Assets",
        'StartMultiplayerServerCommand':"C:\\Assets\\MyGame.exe -ipaddress 127.0.0.1 -port 7777 -useplayfab",
        'VmSize':'Standard_A1_v2',
        'OsPlatform':'Windows',
        'Metadata':{},
    }
    PlayFabMultiplayerAPI.CreateBuildWithProcessBasedServer(requestBody, createBuildCallback)

If I submit the above, I get:

{'Error': ['Specifying port number is not allowed.']}

Without 'Num' on port entry, I get:

{'Ports[0].Num': ['The Num field is required.']}

It's unclear to me what the solution is.

sdks
10 |1200

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

Sarah Zhang avatar image
Sarah Zhang answered

Currently, this API CreateBuildWithProcessBasedServer hasn’t yet available. There is no specific documentation about its usage. If you want to create a build via API, please use CreateBuildWithCustomContainer or CreateBuildWithManagedContainer. Apologies for the confusion. If you have any other questions about these two API functions, please feel free to post the questions.

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.

Michael Coker avatar image Michael Coker commented ·

ok, that's fine. I switched to CreateBuildWithManagedContainer and now get

{ "code": 500, "status": "InternalServerError", "error": "MultiplayerServerInternalServerError", "errorCode": 1387, "errorMessage": "MultiplayerServerInternalServerError" }

I dropped my config down to the bare minimal and get this.

 
                  
  1. {
  2. "BuildName":"testing",
  3. "GameAssetReferences":[{"FileName":"build67.zip"}],
  4. "MultiplayerServerCountPerVm":1,
  5. "Ports":[{"Name":"game","Num":7777,"Protocol":"UDP"}],
  6. "RegionConfigurations":[{"Region":"WestUs","MaxServers":2,"StandbyServers":1}],
  7. "StartMultiplayerServerCommand":"C:\\Assets\\Nexus.exe -spinupdedi -ipaddress 127.0.0.1 -port 7777 -maxconnections 50 -playtest -useplayfab"
  8. }

If I go delete a required parameter it helpfully tells me it is missing, but errors when it's there.

0 Likes 0 ·
Michael Coker avatar image Michael Coker commented ·

GameAssetReference was missing the MountPath, but I didn't get that back as an error. Just the internal error.

0 Likes 0 ·
Michael Coker avatar image
Michael Coker answered

ok, that's fine. I switched to CreateBuildWithManagedContainer and now get

{ "code": 500, "status": "InternalServerError", "error": "MultiplayerServerInternalServerError", "errorCode": 1387, "errorMessage": "MultiplayerServerInternalServerError" }

I dropped my config down to the bare minimal and get this.

{
    "BuildName":"testing",
    "GameAssetReferences": [{ "FileName":"build67.zip" }],
    "MultiplayerServerCountPerVm":1,
    "Ports":[{"Name":"game", "Num":7777, "Protocol":"UDP"}],
    "RegionConfigurations":[{ "Region":"WestUs", "MaxServers":2, "StandbyServers":1}],
    "StartMultiplayerServerCommand":"C:\\Assets\\Nexus.exe -spinupdedi -ipaddress 127.0.0.1 -port 7777 -maxconnections 50 -playtest -useplayfab"
}

If I go delete a required parameter it helpfully tells me it is missing, but errors when it's there.

10 |1200

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

radek avatar image
radek answered

I have the same issue, but using `CreateBuildWithManagerContainer` or `CreateBuildWithCustomContainer` is not an option as we want to create a process based server. Will the issue be fixed in a near future? Is there a workaround for it which I could use now?

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.