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 Is there any way to check at runtime whether or not a certain service is enabled for a project?

Discussion in 'Unity Gaming Services General Discussion' started by anglerge, Mar 16, 2023.

  1. anglerge

    anglerge

    Joined:
    Dec 18, 2020
    Posts:
    15
    So, long story short, making a game for a client, using Unity Gaming Services as matchmaking infrastructure (and offering the ability to join/host by entering IP addresses as a fallback), however, the client has said that they only want to run the UGS relay/lobby stuff for a fixed period of time.

    Considering this, I want to be able to make the game itself able to detect whether or not Relay and Lobby are currently enabled/disabled at runtime, so I can pre-emptively disable the UI elements that the player uses to do things that use these services (and show a warning that the services are currently disabled), to ensure that players do not get greeted with unhelpful error messages after attempting to start/join a game via the Relay/Lobby matchmaking services, by preventing them from attempting to use these services in the first place when they aren't currently enabled.

    So, is 'checking if Relay/Lobby are currently enabled when the game is launched' doable, and, if so, how would one go about doing that?

    (and yes, I've just asked this over in the Relay and Lobby subforums as well, but seeing as it is ultimately about UGS itself, I figured that there's no harm in asking it here as well)
     
  2. SebT_Unity

    SebT_Unity

    Unity Technologies

    Joined:
    Jun 21, 2021
    Posts:
    279
    Hi anglerge,
    Thanks for posting on the forums and interesting use case.

    I would recommend integrating Remote config into your project. Free to use and easy to setup you can remotely disable UI/Parameters and more. You can easily set a date/time with Game Overrides
    • Create a remote config of type boolean to enable/disable UI
    • Wrap your UI for Relay/Lobby inside of that boolean
    This should help with you enabling or disabling relay/lobby from afar at a specific time