Search Unity

Question How to Connect a Client to Unity Game Server Hosting Online?

Discussion in 'Game Server Hosting' started by donbonbon, Mar 27, 2024.

  1. donbonbon

    donbonbon

    Joined:
    May 28, 2023
    Posts:
    29
    'm currently facing a challenge in connecting a client to a game hosted on Unity's Game Server Hosting (Multiplay) over the internet. I've managed to create a dedicated server build and successfully uploaded it to Multiplay. The allocation test was positive, and I can connect to the game server locally using the Unity Editor. However, transitioning this process to work online has been confusing and unsuccessful so far.

    Here's a summary of what I've tried and the obstacles I've encountered:

    1. Direct Connection Attempt: Attempting to connect to the game server using its address and port directly hasn't worked. It seems that some form of Unity-specific client input is necessary. Do I need to create a specific client build for this purpose?

    2. WebGL Build: I've also experimented with a WebGL build but failed to establish any connection to the server. I haven't configured any WebSockets, which might be the issue if the dedicated server build doesn't set these up by default.

    3. Linux Build: Considering the server's Linux environment, I attempted a Linux build for the client. While this theoretically matches the server's environment, I couldn't make an online connection, even after bypassing graphics dependencies using the -batchmode and -nographics flags. My command line was as follows:


      Code (CSharp):
      1. ./executable.x86_64 -batchmode -nographics -logFile ./logFile.txt -ip "server-game-address" -port "9000"
    I'm at a loss for how to proceed and would greatly appreciate any guidance, advice, or resources you could share. How can I successfully connect a client to our game server hosted online through Unity's Game Server Hosting?

    Thank you in advance for your help!