Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question What is the minimum to convert a Unity server working locally to Unity Game Server Hosting?

Discussion in 'Game Server Hosting' started by shu-yan, Feb 21, 2024.

  1. shu-yan


    Dec 1, 2022
    I am asking because from the Unity's tutorials on Game Server hosting, it seems the minimum is just to add the Multiplay SDK package to your project and link the Unity Cloud project ID. Then one can upload the files and it would be ready (at least for Test allocation)

    I did just that but my client cannot connect to the Test allocation server, and I also notice that the server would just terminate itself very soon.

    I am seeing these error in the Test Allocations Dashboard:

    Server having issues (Query didn't respond or responded incorrectly [DOWN]) for 61 seconds (Restarted 0 time(s))
    Allocated server had issues (Query didn't respond or responded incorrectly [DOWN]), stopping server and deallocating

    I am wondering is my sever unable to connect to the server (when it was running briefly) related to no SQP handling being implemented? Posts like this one ( ) seems to suggest that one need to add code to at least answer readiness SQP queries from Unity Game Server Hosting?

    However, the way to handle those SQP as given in are quite different from the way the MatchplaySample code ( ) handles it. For one, I failed to search the method ReadyServerForPlayersAsync() suggested in the SDK manual being called in the MatchplaySample code.

    Since one cannot test OnAllocate and OnDeallocate events when running locally, I followed to add a server.json file when running locally. My server code does read in the config successfully, but when it tried to call the ReadyServerForPlayersAsync() method, I got a HTTPexception:

    HttpException: (0) Cannot connect to destination host
    Unity.Services.Multiplay.Http.ResponseHandler.HandleAsyncResponse (Unity.Services.Multiplay.Http.HttpClientResponse response, System.Collections.Generic.Dictionary`2[TKey,TValue] statusCodeToTypeMap) (at ./Library/PackageCache/

    In the server,json, I have set the following
    "ip": "",
    "port": "9000",

    And my client can still connect to the server successfully at after seeing that HttpException message in the console.

    I cannot find any documentation stating why the SDK is attempting to make a connection to the IP address specified in the server.json (or may be it is suppose to be the IP address of something else!!?) And then I saw from the server log that it was actually trying to connect to:
    Curl error 7: Failed to connect to port 8086 after 0 ms: Error

    I cannot find in my codebase where the port number 8086 come from, but in the MatchplaySample, that was the PayloadProxyUrl

    At the moment, I am at a lost on how to proceed to get my server working as a single instance on Unity Game Server Hosting that would listen to my client in a single port. Am I on the correct path to try to get the SQP handling working first, or should the server be accepting connection on Unity Game Server Hosting anyway without SQP handing setup and I should dig into that instead?