Tuesday, July 19, 2011

Crossdomain policy file for Unity3 and SmartfoxServer

A little tip, now with Unity3, the webplayer will require a crossdomain XML policy for security (Info here). Make sure the xml file is utf-8 encoded, it saves a bunch of issues.


<?xml version="1.0"?>
<cross-domain-policy>
  <allow-access-from domain="*" />
</cross-domain-policy>


Make sure if you are using Smartfox Server (Product Website) (we use version 1.6 for our virtual classroom software) that you have auto send policy file to true. Without this, the socket connection will be block by the webplayer security model. Make sure you set the correct line in your config.xml and restart the server.


<ServerIP>*</ServerIP>
<ServerPort>9339</ServerPort>
<AutoSendPolicyFile>true</AutoSendPolicyFile>
<MaxUserIdleTime>120</MaxUserIdleTime>
<MaxSocketIdleTime>60</MaxSocketIdleTime>

No comments:

Post a Comment