First time connecting from Unity failing, but works on cloud

Options
Quadgnim
edited February 2013 in Photon Server
Hi all, I have a game that's working great on the Photon Cloud. I wanted to give a local server a try so I downloaded it, installed in on a Windows Server 2008 R2 fully patched with .net 3.5 and vs installed. The server is running and the local connection test (starts 5 games/3 clients each) works fine.

Next I disabled the firewall on 2008 just to make sure there are no issues

On my Unity client side I chose Window/Photon Unity Networking, and I changed it from Cloud to the local IP of my server. Its on the same subnet and I can ping it no problem.

When running the client it spins on:

PhotonNetwork.ConnectUsingSettings();

I also tried with

PhotonNetwork.ConnectUsingSettings("v1.0");

Is there something else I need to change to make this work? Any suggestions where I went wrong?

Comments

  • I have an update. I was running the "Default" server configuration, then I found a post that for Unity I should be running the "Load Balancing (MyCloud)" configuration, so I changed it. Now I don't seem to be getting the connection error, but instead, it's just hanging the client when I issue a Create Game.

    Also, I'm running the client from the internal LAN, so I set the IP to the internal IP, not the public IP. Is this ok? I wanted to get everything working before opening ports on my firewall.
  • Ok so after some trial and error I believe I figured out my issue. In addition to choosing the Load Balancing configuration you also need to choose "Game Server IP Config" and change it to the local IP. It was set to auto which was the public IP. Furthermore, I had tried changing it but nothing happened. Turns out something was messed up with the console. I had to quit and restart the console, then it let me change the IP, start the server, and I could connect.
  • Glad you figured it out, and thanks for letting us know what you did - this might be helpful for others as well.

    regarding your questions about internal / public IPs: if you have Photon running on your LAN and all your clients are in your LAN, you should use the internal IP; if you are running Photon on a server outside your LAN and access it through the internet, you need to use the public IP.

    If you have Photon running in your LAN (behind a router) and want to access it from the internet, you need to use the public IP and configure port forwarding on your router. (eg.: xxx.xxx.xxx.xxx:5055 -> 192.168.0.2:5055, where xxx... is your router's public IP and 192.168.0.2 is your internal IP. This needs to be done for all ports used by Photon).