Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How to run a Server using multiplay service?

Discussion in 'Game Server Hosting' started by sava-game, Feb 14, 2023.

  1. sava-game

    sava-game

    Joined:
    Feb 14, 2023
    Posts:
    21
    I created test server.json in project folder, but getting some errors.
    see the screenshot.
    I am trying to run a sample project from Matchmaker service documentation.
    How to run it on my local?
     

    Attached Files:

  2. danri

    danri

    Unity Technologies

    Joined:
    Jun 21, 2019
    Posts:
    27
    Hello,

    The sample project is attempting to connect to a localhost API that exists in the real Multiplay environment. Currently there is not a way to run this API on your local machine.

    I would suggest adjusting your server codebase to have a mechanism to check if it is running on Multiplay or not. This could be as simple as creating a new command line argument (e.g. "-local") and parsing with the GetCommandLineArgs system method - https://learn.microsoft.com/en-us/dotnet/api/system.environment.getcommandlineargs?view=net-7.0