Changing from local testing to public deployment

Options
So I have a project that works fine when the PhotonServer applications GameServerIP is set to the local IP but when I change the setting to public IP the game no longer works the debugger is telling me that the game is connecting to my local IP for the MasterServer but when it attempts to connect to the GameServer it is attempting to connect to the public IP and that causes a timeout which obviously causes a crash. I am not sure what is wrong, I have not changed either of the loadbalancing ddl files and I am connecting with the ConnectUsingSettings command with my local IP in the server address box of the server settings. If I change that to my public IP I get a timeout so I am not sure where to go from here. Any help in transitioning from the LAN setting to a public server would be greatly appreciated.

Comments

  • chvetsov
    Options
    Hi, @NovaVR

    it is not really clear from your description what are you doing
    >I change the setting to public IP the game
    what do you do here?
    where do you connect when establish connection to master - to public ip or to local?
    what ip address you get to connect to game server - public or local?

    best,
    Ilya
  • NovaVR
    Options

    That is the window in the unity editor. I have it set so that the MasterServer is the local IP address. In the Photon Control menu (which I cannot screenshot) for the Game Server IP Config I have that set to the public IP. In my console when I try to run the game the game connects to my MasterServer on startup which is my local IP. Then I hit my Host session button which is calling the JoinOrCreate method, form here the game disconnects from the MasterServer and attempts to connect to the GameServer which has the Public IP, this is where the disconnect timeout happens. Hope this helps to clarify.
  • chvetsov
    Options
    well, i assume now i understand better, but still...

    so, how do you switch your GameServer to public ip address?

    but aside from that i assume that there is some issue on configuration. if you take a look at Photon.LoadBalancing.GameServer.GameServerSettings you will find there two settings:
    1. MasterServerIp it will help you if you need to host master on separete machine
    2. PublicIpAddress - this is address which is sent by GameServer to MasterServer. so, when you get join response from master, this response contains this address. this may be cause for your connection problems when you switch to public ips

    hope, this will help you

    best,
    ilya
  • NovaVR
    NovaVR
    edited April 2017
    Options
    I switch the GameServer to the public IP by changing the Photon.LoadBalancing.dll in Photon-OnPremise-Server-SDK_v4-0-29-11263.deploy.LoadBalancing.Gameserver.bin. I change the GameServer-to-Master connections setting titled PublicIPAddress to the public static IP that I have it is on line 151. In the Photon.loadBalancing.dll in the MasterSerber.bin folder I have the GameServer-to-Master connections public ip address (line 157) set to the local IP of the computer i think my problem is with these settings. I am trying to run the GameServer and MasterServer on the same machine, Ideally I would like whatever machine starts up the program acts as both servers. This is a custom thing so there will not be random people trying to join each other, it is all going to be behind a VPN going from connected VPN computers to other computers in the network. Also I am using a UDP connection.
  • NovaVR
    Options
    So I got it working here is my configuration. MasterServer machine hosts the Photon Masterserver but cannot be the client at the same time. The Photon Server IP should be set to the local IP. The Photon.LoadBalancing.dll.config file should have the MasterIPAddress set to the original value of 127.0.0.1 and the PublicIPAddress(line 151 and 157 in the two versions) set to the actual public IP address. This is for both the GameServer and MasterServer versions of this file. My router has the port forwarding set up so that It passes all incoming public traffic on ports 5055 and 5056 to the local IP of the MasterServer machine (I do this part because I am using a static public IP). For each client machine they have to be on a different network than the one the MasterServer is on and in the PhotonServerSettings in Unity the MasterServer address is set to the public static IP. As a note you cannot connect a client on the same network to the MasterServer because the MasterServer returns the public IP as the GameServer address, and a client on the same network cannot connect using its own network's public IP.
  • chvetsov
    Options
    good that you solved it

    best,
    ilya
  • DbVIndie
    DbVIndie
    edited August 2018
    Options
    what's "actual public IP address."? ip of computer or router?
  • chvetsov
    Options
    @DbVIndie please use search to understand what is IP address. and what is address of machine and router

    best,
    ilya