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.

Resolved Can't connect to my allocated dedicated server even manually by copy pasting IP and post to clients

Discussion in 'Dedicated Server' started by IntoTheSoul, Jul 2, 2023.

  1. IntoTheSoul

    IntoTheSoul

    Joined:
    Oct 31, 2018
    Posts:
    30
    Correct me if im wrong, but aren't you suppose to be able to connect to a server directly through grabbing the IP and port. I wanted to test my client and server connection before worrying too much about multiplay middleware such as matchmaking or relay. just by simply connecting to my online/allocated server has got me stumped.
     
  2. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    385
    Yes, you should be able to just connect directly to the IP/port of your server.

    Is your server build configured to accept remote connections? Assuming you're using Netcode for GameObjects, there should be a "Accept Remote Connections" checkbox under the Unity Transport component. This needs to be checked for a server to accept connections from remote clients. If you're not using Netcode for GameObjects, make sure your server is listening on address 0.0.0.0 and not say 127.0.0.1 (which would only allow local connections).

    I would also verify the firewall settings on your server to make sure it allows UDP traffic to your game's port.
     
  3. IntoTheSoul

    IntoTheSoul

    Joined:
    Oct 31, 2018
    Posts:
    30
    Hi, thanks for the reply. I've set up the checkbox for accepting remote connections and I still can't get it to work.



    upload_2023-7-6_10-11-2.png upload_2023-7-6_10-11-58.png upload_2023-7-6_10-12-45.png upload_2023-7-6_10-14-35.png

    upload_2023-7-6_10-14-46.png
     
  4. IntoTheSoul

    IntoTheSoul

    Joined:
    Oct 31, 2018
    Posts:
    30
    I am using Unity's Deditcated Server services. Is the firewall settings for the UDP traffic found in the build configuration?
     
  5. IntoTheSoul

    IntoTheSoul

    Joined:
    Oct 31, 2018
    Posts:
    30
    upload_2023-7-6_12-2-3.png

    upload_2023-7-6_12-3-0.png

    If the debug log made it this far. that should mean, the server is ready, right?
     
  6. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    385
    I'm not super familiar with our game server hosting service, maybe you'd find more knowledgeable folks in the forum section for that service. My generic advice would be to ensure your server is listening on the correct address and port (log them on the console) and if so, to test if the UDP port is reachable. On Windows you can use tools like nmap or ncat to achieve this. You could also test the SQP port (shown in the logs) in this manner to see if it's a problem with reaching the server machine in general or just the game part of it.
     
    IntoTheSoul likes this.