Client can connect to master server but cannot connect to game server

So I am running a game where I have set up a computer as a dedicated server. I have it with a static public IP so that never changes and when I connect to it from my house internet it connects fine to the master server and the game server. The problem is that the other person I have testing with me is behind a VPN, we discovered that we couldnt use UPD to connect to the server so we switched to TCP. This allowed him to make a connection to the master server, we know this because we put a bunch of logs that show in the console every step of the connection. So once he reaches the master server he disconnects to find the game server which should be either my computer or his own computer (I used OPJoinOrCreate so it doesnt matter who attempts to be host but we have tried both ways), once the computer disconnects from the master server it never reaches the game server it just times out while trying to connect. Has anyone had this problem and has a solution. Alternatively if anyone knows of where in the LoadBalancing.dll.config file or the LoadBalancing api I should be looking to see if the correct address is being stores/passed along, that would be much appreciated.

Answers

  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @NovaVR,

    Thank you for choosing Photon!

    Please try setting the GameServer IP address to the public IP address of the machine, it should be done easily using PhotonControl.
  • NovaVR
    NovaVR
    edited May 2017
    I did this and now I am having this problem where once the client connects to the master server there is one call by photon which read "OnEvent: Event226" after the call it says its state is Authenticating then it calls OPAuthenticate() then after a few seconds it throws an error "Receiving failed. SocketException: Timeout". This is followed by a debug that says "OnStatusChanged: InternalReceiveException current State: Authenticating". It then tells me that it lost connection to the server and the cause seems to be a Internal Receive Exception. Then it fully disconnects. This all happens before I even try to connect to the game server, it occurs just as you are sitting in the start scene. It does not even make it into a lobby.
  • I am going to try and set the TCP timeout to 0 in the PhotonServer.dll to see if that helps. If that doesnt work im not sure where to go from there
  • hi, @NovaVR
    From your description it is not very clear what is your cluster structure.
    As i understand you have one dedicated server which is master server. and two game servers - one on your machine (possible same as master) and second on machine of your friend.

    you managed to connect to master. That is great. so i assume that your master sends you adress of gameserver which you can not connect. in order to get right address you need to set PublicIp address in LoadBalancing.dll.config.

    best,
    ilya
  • There is currently only one master server and one game server. They are both on my machine and in the photon control the Game Server IP Config is set to the public ip and in both the Game server and Master server LoadBalancing.dll.config files the PublicIPAddress setting that is under the < GameSserver to Master connections> section is set to that public IP is there another place that I have to hard code the public IP because I see several other places for IP addresses but when i have tried to change them I either lose the ability to connect to the Game server or my friend still cannot connect to the Game server. Also I tried to set the TCP Inactivity Timeout in the PhotonServer config file to 0 but that did nothing The endless loop just never ended but it never connected. Hope this clears some stufff up
  • I've removed the loopback IP from the master server PublicIPAddress setting leaving it blank. I have hard coded the public IP into the TCP Listeners in the PhotonServer config file and I've double checked my configuration against the configuration you have on photon website. So far it works on my machine that I have at the same physical location as the Master server machine (the Master server is on a business network and the machine im using for testing is on a separate private network) So far it works here so I am going to give another try from the remote location to see if anything changed.
  • So nothing has changed at the remote location it still says that it found the server then after the console says it called OPAuthenticate() it waits a few seconds then it throws the time out error and disconnects. I haven't touched the authentication so I don't know why it fails right after it tries to authenticate. Ive also tried to make a build to see if there is a problem with the speed relating to the Unity editor but even in the build the connection still failed. Is there something specific I should be looking for in the Photon logs?
  • hi, @NovaVR

    lets go step by step.
    you host game server and master on your machine. and your friend is able to connect to master, but not able to connect to game server.
    is this correct?

    best,
    ilya
  • Yes that is correct.
  • next step.
    what ip is used in order to connect to master?
    could you provide me your photonserver.config, LoadBalancing.dll.config?

    best,
    ilya
  • we use a static public IP. is there an email I can send the files to as they contain my public IP?
  • yes, please sent your request to developer at photonengine.com

    please send your photon server config and LoadBalancing.dll.config for GameServer

    best,
    ilya
  • Hi, Ilya,I also have the same problem. Can you help me?
  • usually the issue is that in LoadBalancing.dll.Config you did not set correct public address for GameServer. this address is sent to client and client can not connect to it

    best,
    ilya