Web Player Security and Threading

Hi there :slight_smile:

I have a problem trying to get a c# networking library i have running correctly in the unity webplayer.

I’ve mentioned this in another thread in the scripting forum
http://forum.unity3d.com/viewtopic.php?t=7730

essentially i’m getting an error thrown by the unity webplayer as follows

SecurityException: This method is not supported in the unity web player for security reasons.
System.Threading.AutoResetEvent..ctor (bool) <0x00017>
(wrapper remoting-invoke-with-check) System.Threading.AutoResetEvent..ctor (bool) <0x0003c>
smartnetlib.NetworkManager..ctor (smartnetlib.Connection) <0x000a0> 

<snip...>

(the full trace is in my previous forum post)

I’ve now removed references to System.Threading.AutoResetEvent in the called NetworkManager class. However some still exist elsewhere in the dll I have imported, the webplayer is still throwing an error even though the code containing these other references is not called.

How are these security checks done in the webplayer? does it look at libraries required by the dll when its first loaded ? If i remove all references to the AutoResetEvent will i then discover other restrictions placed on the threading by the Unity webplayer?

I can’t seem to find any documentation on what is actually allowed so any info would be most appreciated.

Rob

bump, still interested in an answer to this one if anyone has any ideas ?

I believe this security exception will be fixed in Unity 2.1.

Excellent :slight_smile: I’ll give it a try

this bug i listed above seems to have reappeared with Unity 3.0, is this intentional ?