connecting by public ip

Options
brian661
edited April 2014 in Photon Server
I have complete my game with Photon server while I am just connecting with local IP address, which get from Photon Server--> Game Server IP Config-->set local: 192.168.0.100

In the code, my game is connecting using
this.peer.Connect("192.168.0.100:5055", "EZServer")
and everything work prefect.

While now i would like to public my game by connecting with public address.
but connecting is fail.

How can I solve this problem?

Comments

  • chvetsov
    Options
    Hi, brian661
    Solution depends on how do you host your server. if you use cloud then you should get all connection parameters from our support team. if you use your own server you should fix public ip for it and use it in your game client
  • I am not using Cloud and using my own server .
    How can i "fix public ip"?
    i have try
    this.peer.Connect("219.79.231.217:5055", "EZServer")
    where the ip is copy from what i can see in the Photon control-->game server ip config-->set public
    but seem I cannot connect to the server
  • chvetsov
    Options
    you should setup ip for your server in server config
    find section <UDPListeners> for UDP and <TCPListeners> for TCP
    you should have doc about server configuration, please read carrefully
  • http://doc.exitgames.com/en/onpremise/c ... ver-config
    I tried to follow the instruction in the UDPListener and set the following setting
    (both on around line 35 and line 157)
    gpX8Sls.png
    and define the application following the sample code.

    while both i get the exception
    2204: 19:38:54.900 - CService::OnException() - Exception: CSocket::Bind() 219.79.231.217:5055 - 內容中所要求的位址不正確。
    (should be meaning that the ip address is not correct, while i copy the address from Photon Control's IP config)

    Sorry for asking a lot of question, this is the first time I code something related to interent connection and the first time i heard about UDP or TCP
  • chvetsov
    Options
    According what i can see from your messages config is correct. I assume that you forgot to configure your firewall. I belive that if you are not expirienced in this, it will better to switch it off. and later when everything will work, you may switch it on and setup correctly with someones help
  • No, this is not related to the firewall, and you don't need to set anything in the PhotonServer.config.

    In the Photon config, keep "IPAddress="0.0.0.0". This means that Photon listens to all available network interface cards.

    The public IP address belongs to your router, not to your machine: You need to configure port-forwarding in your router, so that it passes all traffic to "219.79.231.217:5055" forward to your machine ("192.168.0.100:5055"). In Photon Control, you need to set the GameServer config to "Auto-Detect (Public IP)".

    You can search for port-forwarding on this forum, the topic has been discussed multiple times. Several people reported that they did not manage to set this up successfully because it seems that some internet providers are dropping UDP traffic to customer endpoints - so I hope you have luck with your setup.

    If not, you might want to rent a cheap virtual server with a dedicated IP for your testing.