I've been trying to get a Web Player build to work for a couple of days now and have had no luck despite looking in both the Unity forums and Smart Fox Server forums. I have made some progress in getting the sockets connected with the defaults, but I keep getting this error:
[SFS - ERROR] TCPSocketLayer: General exception on connection: 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 Sfs2X.Core.Sockets.TCPSocketLayer.ConnectThread () [0x00000] in <filename unknown>:0
I've looked at the Security Sandbox page provided by Unity and it explains that the webplayer only supports '*' in the domain access portion of the crossdomain.xml and that the to-ports portion is mandatory. Currently my crossdomain.xml (located in ".../SFS2X/config/crossdomain.xml) reads:
Code: Select all
<!DOCTYPE cross-domain-policy SYSTEM "/xml/dtds/cross-domain-policy.dtd">
<!-- This is a master-policy file. site-control can be all,none,master-only -->
<!-- Instead of setting to-ports="*", administrators can use ranges and commas -->
<!-- This will allow access to ports 123, 456, 457, and 458 -->
<allow-access-from domain="*" to-ports="843, 9933" />
This is just the default xml that was supplied in the installation of SmartFoxServer 2x except that I've added 'to-ports' 843 and 9933. I've added both of those ports as TCP to the socket addresses in the server configurator of the Admin tool. I've also double checked that "Use Flash Master Socket Policy" is set to true and that the Flash policy XML file is pointed at the crossdomain.xml file. I've tried everything I have found in the Unity forums and Smart Fox forums related to this. Some have said that Unity doesn't recognize the "site-control" attribute so I've tried commenting that line out, restarted SFS2X, and tried again and to no avail.
Does anyone have any ideas of what the problem could be?