Unity 3, webplayer security model and SFS2X policy server

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

wrxsti85
Posts: 1
Joined: 18 Jan 2013, 04:02

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

Postby wrxsti85 » 20 Jan 2013, 18:33

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
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

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

Postby ThomasLund » 27 Jan 2013, 22:28

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
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
aubreuil
Posts: 4
Joined: 11 Jun 2013, 14:18

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

Postby aubreuil » 11 Jun 2013, 14:37

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
User avatar
Lapo
Site Admin
Posts: 20433
Joined: 21 Mar 2005, 09:50
Location: Italy

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

Postby Lapo » 12 Jun 2013, 11:06

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.
Lapo
--
gotoAndPlay()
...addicted to flash games
Jake-GR
Posts: 59
Joined: 28 Dec 2011, 22:52

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

Postby Jake-GR » 17 Jun 2013, 03:48

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.
User avatar
Lapo
Site Admin
Posts: 20433
Joined: 21 Mar 2005, 09:50
Location: Italy

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

Postby Lapo » 17 Jun 2013, 07:53

Hi,
yes you are correct. Port 843 is not bound by default and it requires root privileges under Unix/Linux.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 6 guests