Search Unity

Question Possible to get List of Servers from inside Unity?

Discussion in 'Game Server Hosting' started by CodeMonkeyYT, Mar 8, 2023.

  1. CodeMonkeyYT

    CodeMonkeyYT

    Joined:
    Dec 22, 2014
    Posts:
    125
    Hi there!

    Is it possible to get a list of the servers from within Unity?

    Basically I was thinking that it would be possible to make a Server Browser so we could use GSHosting without using Matchmaker, but apparently that's not possible?
    The only way to do that sort of thing would be to hardcode the IP/Ports in the game itself, and manually start/restart them in the dashboard?

    Thanks!
     
    dnnkeeper likes this.
  2. danri

    danri

    Unity Technologies

    Joined:
    Jun 21, 2019
    Posts:
    27
  3. CodeMonkeyYT

    CodeMonkeyYT

    Joined:
    Dec 22, 2014
    Posts:
    125
    Oh great thanks, I did not know about that WebAPI.
    Is there any reason why this type of functionality isn't included in the Unity Multiplay package? Seems like it would be something very useful to many games. Is it to require authentication?

    Also the JSON returned from that doesn't work well with JsonUtility, I had to put it inside a dummy object with a name for it to work
    JsonUtility.FromJson<ListServers>("{\"serverList\":" + json + "}");
     
    CM_RDX and dnnkeeper like this.