cannot connect to my public ip but can connect to my local ip

Options
I'm a complete beginner and there aren't a lot of tutorials about this sort of thing, i've been trying to figure this out for a week. In start i put PhotonNetwork.ConnectUsingSettings (_gameVersion); which posts to log that i connected to masterserver. I press my UI button which calls this:
public void ConnectSolo () { if (PhotonNetwork.connected) { Debug.Log ("you're connected"); PhotonNetwork.CreateRoom (null, new RoomOptions () { MaxPlayers = MaxPlayersPerRoom }, null); } else { Debug.Log ("connect using version"); PhotonNetwork.ConnectUsingSettings (_gameVersion); } }
my debug.log "you're connected" is logged then i get this log immediately "OnStatusChanged: Disconnect current State: DisconnectingFromMasterserver" and a few seconds later i get these 2 "OnStatusChanged: TimeoutDisconnect current State: ConnectingToGameserver" "OnStatusChanged: Disconnect current State: Disconnecting"
If i change the Photon Control and PhotonServerSettings asset to my local ip then i don't have this disconnect issue. I'm super confused.

Comments

  • chvetsov
    Options
    hi, @NatalieBaldwin

    i think issue is in what you call public address. i assume that you get public address using some external service and it does not belong to your machine. it belongs to your router.

    that is why on your router you need to setup port forwarding.

    best,
    ilya
  • NatalieBaldwin
    edited August 2017
    Options
    My public ip is the one that photon control displays when i look at the game server ip config. My ports are forwarded, my friends could connect when i was testing node.js to see if my ports were forwarded correctly. When using node.js the ip i used is the same one that photon control is displaying.
    My ports aren't forwarded correctly because the pinging sites can't find my server. But i forwarded everything the same way i did when i was using node.js. I've been trying to find the answer on google and suspect that i need to open several ports. There apparently used to be a URL that included the required list of ports that need to be opened for photon server to work. That URL no longer exists.
    I found a list of ports on https://doc.photonengine.com/en-us/onpremise/current/operations/tcp-and-udp-port-numbers but it appears i can only open 8 ports on my router. I don't think this is an issue within photon or unity, i think i'm doing something wrong i just don't know what it is.
    I called my ISP and they told me what was wrong, i'll need to upgrade my modem/router because i'm limited to 8 ports and your photon server needs 17. But using the magical DMZ button that opens every port, i was able to connect to the server.
  • chvetsov
    Options
    i'm glad that you found solution

    best,
    ilya