Page 2 of 2

Re: Unity 3, webplayer security model and SFS2X policy serve

Posted: 20 Jan 2013, 18:33
by wrxsti85
Hello all, this is my first time on the forums, but I doubt it will be my last.

I recently set up an AWS EC2 Ubuntu Server running SmartFoxServer2x. I downloaded the following tutorial/example:

http://docs2x.smartfoxserver.com/Exa...bject-movement

The server appears to be functioning properly, and all necessary ports are open. The client however, appears to be trying to download scripts from my local machine here. In the C# scripts I have changed the server/connection details to match those of the server, but it still shows my local directory in the web player's developer mode console. I was hoping some one could point me in the right direction.

If you would like to see the error, simply go to http://badtrollproductions.com
In the console it displays that the policy file failed to load, as I'm sure you can imagine why. If you expand the console, it will show the local directory that the unity3d project is stored on my PC. I am extremely confused, and I am rather new to unity. I've spent quite some time on google, but yielded no results. Any help would be much appreciated. Thanks in advance!

WrX

Re: Unity 3, webplayer security model and SFS2X policy serve

Posted: 27 Jan 2013, 22:28
by ThomasLund
Remember that inspector values override the code.

So if you changed something in the code and its a public variable, then the Unity inspector value takes priority!

/Thomas

Re: Unity 3, webplayer security model and SFS2X policy serve

Posted: 11 Jun 2013, 14:37
by aubreuil
Ive been having a similar problem with the Secirity.PrefetchSocketPolicy() call, which I couldn't even get working with the Unity API examples with SFS2X running on localhost. Turns out that to develop locally you must set your Unity project settings to "Web Player". Works fine now

http://forum.unity3d.com/threads/152059 ... erPort-500)-fails

Re: Unity 3, webplayer security model and SFS2X policy serve

Posted: 12 Jun 2013, 11:06
by Lapo
The whole point of the security policy is to protect cross domain access in web based applications.
Maybe it wasn't working for you because you were exporting to an executable. I would expect the policy api to work only in the web player.

Re: Unity 3, webplayer security model and SFS2X policy serve

Posted: 17 Jun 2013, 03:48
by Jake-GR
Correct the crossdomain policy is only required when using the WebPlayer.
There is another option though, Unity automatically requests the policy on port 843. With the SF server, it is enabled by default (in the Flash tab), however, the server doesnt listen. So just adding the listenning port for 843 on TCP and UDP in the server configuration allows Unity to work without calling PrefetchSocketPolicy. There is one caveat to this as well, the server must be run as root on Linux.

Re: Unity 3, webplayer security model and SFS2X policy serve

Posted: 17 Jun 2013, 07:53
by Lapo
Hi,
yes you are correct. Port 843 is not bound by default and it requires root privileges under Unix/Linux.

Cheers