Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Question How to get the Server IP?

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

  1. CodeMonkeyYT

    CodeMonkeyYT

    Joined:
    Dec 22, 2014
    Posts:
    121
    Hi there,

    I'm trying to implement Matchmaker Backfill, for that I need to call CreateBackfillTicketAsync(); which requires creating a connection string of ip:port; but looking in the MultiplayService.Instance.ServerConfig; it only has Port and no IP.
    How do I get that?

    Thanks!
     
  2. Brogan89

    Brogan89

    Joined:
    Jul 10, 2014
    Posts:
    243
    oh wow, it's the actual code monkey!

    Have you tried using
    MultiplayService.Instance.ServerConfig
    ?


    Code (CSharp):
    1.  
    2.  
    3.  
    4.             var config = MultiplayService.Instance.ServerConfig;
    5.             Debug.Log($"MultiplayService config: {JObject.FromObject(config)}");
    6.             var ip = config.IpAddress;
    7.             var port = config.Port;  
    8.  
    9.  
     
    Last edited: May 2, 2023