No Valid Crossdomain Policy

Options
Hey everyone,

I just signed up on both the forums and the website of Photon and installed the Photon Cloud Plugin.

I have my ID ready and entered and it seems to be ok, what doesnt work is connecting to the cloud though: I keep getting this:
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.NConnect.StartConnection () [0x00000] in <filename unknown>:0 
UnityEngine.Debug:LogError(Object)
PhotonHandler:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:115)
NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:655)
ExitGames.Client.Photon.NConnect:StartConnection()
ExitGames.Client.Photon.EnetPeer:Connect(String, String, Byte)
ExitGames.Client.Photon.PhotonPeer:Connect(String, String, Byte)
NetworkingPeer:Connect(String, String, Byte) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:163)
PhotonNetwork:Connect(String, Int32, String, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:600)
PhotonNetwork:ConnectUsingSettings(String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:543)
MainMenu:Awake() (at Assets/Photon Unity Networking/DemoWorker/Scripts/Menu/MainMenu.cs:23)
UnityEngine.GameObject:set_active(Boolean)
EnableScript:Awake() (at Assets/Photon Unity Networking/DemoWorker/Scripts/Menu/EnableScript.cs:27)

I was under the assumption that cloud connections dont have these policy problems, so the error is (hopefully) on my side.

Any suggestions?

Thanks,
Obat ;)

Comments

  • dreamora
    Options
    The photonserver provides its own policy server and it should jsut work.

    Are you sure that you don't reconfigure the port for the policy lookup or that you by error do it manually instead of letting photon do it?

    if neither is the case then that sounds as if the cloud is having a problem right now
  • Pretty sure, yeah.

    All I did was enter my ID. I attached a screenshot of my settings.
  • Ok, this is starting to become really annoying. So far nothing of the plug-in, ready to go feeling.

    I just can't connect to the Photon Cloud. And weirdly enough i get different bugs only by switching from standalone to webplayer.

    On standalone I get:
    OnFailedToConnectToPhoton. StatusCode: TimeoutDisconnect
    UnityEngine.Debug:Log(Object)
    MainMenu:OnFailedToConnectToPhoton(Object) (at Assets/Photon Unity Networking/DemoWorker/Scripts/Menu/MainMenu.cs:170)
    UnityEngine.Component:SendMessage(String, Object, SendMessageOptions)
    NetworkingPeer:SendMonoMessage(PhotonNetworkingMessage, Object[]) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1249)
    NetworkingPeer:OnStatusChanged(StatusCode) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:974)
    ExitGames.Client.Photon.EnetPeer:SendOutgoingCommands()
    ExitGames.Client.Photon.PhotonPeer:SendOutgoingCommands()
    PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:93)
    

    Which doesn't help at all. I'm definetely connected to the internet, so I have no idea where the TimeOut is caused.

    On webplayer I get this:
    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.NConnect.StartConnection () [0x00000] in <filename unknown>:0 
    UnityEngine.Debug:LogError(Object)
    PhotonHandler:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:115)
    NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:655)
    ExitGames.Client.Photon.NConnect:StartConnection()
    ExitGames.Client.Photon.EnetPeer:Connect(String, String, Byte)
    ExitGames.Client.Photon.PhotonPeer:Connect(String, String, Byte)
    NetworkingPeer:Connect(String, String, Byte) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:163)
    PhotonNetwork:Connect(String, Int32, String, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:600)
    PhotonNetwork:ConnectUsingSettings(String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:543)
    MainMenu:Awake() (at Assets/Photon Unity Networking/DemoWorker/Scripts/Menu/MainMenu.cs:23)
    UnityEngine.GameObject:set_active(Boolean)
    EnableScript:Awake() (at Assets/Photon Unity Networking/DemoWorker/Scripts/Menu/EnableScript.cs:27)
    

    That makes even less sense, since like dreamora said there shouldnt be any policy problems. Also, I get this message right at the start, it doesnt even seem to attempt to connect.

    Note that I didnt touch any of the plugins code, nor did I change any settings. I just copy-pasted my ApplicationID (severeal times, and double checking).

    Any help is really appreciated.

    Greetings
  • dreamora
    Options
    Are you potentially behind a slow proxy or alike that might cause this?
  • Facepalm. Turns out my university is really using some kind of proxy I never knew of. I didnt have to setup anything in the browser, all applications ran without problems (even those that usually failed behind proxys).

    Well its all good. Thanks dreamora!
  • Tobias
    Options
    The reason you get different errors is Unity's security model for WebPlayers:
    A WebPlayer build will always check for a policy file before allowing any other connection to a server. If this fails (due to firewall), the result is a security issue.
    Standalone builds won't need the policy request but still fail to connect (due to firewall).

    Glad you found the cause and got around it.