Self Hosting Server for Unity

Options
chocomurr
chocomurr
edited November 2013 in Photon Server
Sorry if I sound nooby, this is my first time making a game and hosting a server.

I was able to get my game on this web address, "https://sites.google.com/site/unitygametest346/unit", I built the game file with my local IP address in the PUN wizard, I think that's why only the computers in my local network can connect and play it. Some of my friends have tried from their computers and it just shows "Disconnected" in the game.

Did I need to build the game file with my public IP address in the PUN wizard? I tried putting in my public IP address in the PUN wizard, once I hit play this shows up:

Connect() failed: System.Security.SecurityException: Unable to connect, as no valid crossdomain policy was found
at System.Net.Sockets.Socket.Connect_internal (IntPtr sock, System.Net.SocketAddress sa, System.Int32& error, Boolean requireSocketPolicyFile) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0 at System.Net.Sockets.Socket.Connect (System.Net.IPAddress address, Int32 port) [0x00000] in <filename unknown>:0
at ExitGames.Client.Photon.SocketUdp.DnsAndConnect () [0x00000] in <filename unknown>:0

I have no clue what I'm supposed to do to fix that. Do I need to edit any config files or add more code? I just want my game server to be accessible by any computer over the internet.

Comments

  • You would need to do the following:
    - configure the game to use your public IP address.
    - make sure that your public IP address does not change. If your internet provider does not assign you a static IP address, try something like DynDNS.
    - if you server is not connected to the internet directly, you need to set up port forwarding on your router for these ports: http://doc.exitgames.com/photon-server/ ... ng_started

    If you are using the "Photon Loadbalancing" features, also make sure to set the "Game Server IP Config" to autodetect or the public IP (this can be done from Photon Control).

    You could also try to rent a cheap dedicated server at a server hosting provider, which comes with a dedicated IP - but that's probably only an option if you have some customers that are willing to pay a few bucks for your game. ;)

    Another option:
    - if you don't need any custom server-side logic, just sign up for Photon Cloud. We do all the hosting for you for up to 20 CCU for free, or for very affordable prices if you need higher amounts of CCU later on. :)
  • chocomurr
    Options
    Derp, I had to allow ports in firewall and then port forward in router, it works now :D