Search Unity

Extract Data Center from matchInfoSnapshot

Discussion in 'Multiplayer' started by Klounas, Mar 21, 2017.

  1. Klounas

    Klounas

    Joined:
    Oct 10, 2013
    Posts:
    7
    Hello,

    I'm making a networked game, I can easily get all the matches from across the three data centers, but when trying to connect to them, my NetworkManager must be set to the match's current data center. However, I cannot find a way to extract the address of the data center from a match / matchinfosnapshot.

    Is there a way to connect to some one else's match without having the NetworkManager set to their data center or is there a way to extract the address?

    Thank you.
     
  2. JeremyUnity

    JeremyUnity

    Joined:
    Mar 4, 2014
    Posts:
    147
    The data center is based on the URI, and we have 3 region specific ones. This is in addition to the default one (mm.unet.unity3d.com) which will route your requests to the lowest latency one automatically, which is generally closest.

    The 3 data centers are eu1-mm.unet.unity3d.com, us1-mm.unet.unity3d.com and ap1-mm.unet.unity3d.com.
    If you wanted to connect to a specific data center use one of those for the URI. The list match response doesnt contain which data center you're talking to now, but it could and i'll add that for a future update. For now you could use part of the name string to denote what data center the match is in if you use the region specific URI's to create the match, e.g. eu-<name>, and then join the match using the region specific URI.
     
    Klounas likes this.
  3. Klounas

    Klounas

    Joined:
    Oct 10, 2013
    Posts:
    7
    I thought of that solution, however here's the problem. When you host a match under mm.unet.unity3D.com, you do not know before hand which one of the three it will connect you to. Meaning you cannot add "EU-/US-/ASIA-" in your match name tag and do a string search. Unless you manually decide to pick EU,US,ASIA, etc, which defeats the purpose of using mm-unet.unity3d.com.

    Just trying to make as automated as possible :) If I could extract the data center from the list match, it would avoid that one extra manual step for the user.

    Thank you for the reply.
     
  4. JeremyUnity

    JeremyUnity

    Joined:
    Mar 4, 2014
    Posts:
    147
    You're right, i was more suggesting doing the determination yourself and manually doing a create match via the region specific URI's, then you can listmatch via the default URI and join using the region specific one based on the match name. It's much more a work around than a solution, i'll make sure that data center info gets added to the ListMatch response.
     
    Klounas likes this.