System / Sockets / Reflection grief

Hello,

I’m trying to integrate my networking support using C# sockets. I’ve got a system worked up that uses some reflection and the System marshalling support to pin some memory and serialize fields into a byte array for transmission… This works in my stand-alone testbed scenes. However when integrating it back in my “real” game, I get this:

Exception: This project is using both System.dll and System.Xml.dll therefore will build only when assembly stripping is enabled (Unity iPhone Advanced feature).
Please avoid any unnecessary references to System.dll or System.Xml.dll. Common classes that should be avoided are: Stack, Sockets and Xml (...)

So it won’t build for the device without stripping, but stripping breaks all of my fancy reflection based network state tracking!!! It also breaks the C# Ani.Mate implementation because that uses reflection as well… Is there any hope for this to work? I need networking and I need reflection!!! I’m not really in the mood to re-write 2 weeks of networking junk and/or Ani.Mate :frowning:

Any help appreciated.

Stephen

thats a non topic anyway as you are a Unity iPhone Basic licensee if you see that error.

Sockets are only available to Unity iPhone Advanced.

Basic can only use WWW, no other networking at all.

Actually, we do have the advanced license. I’m using native Obj-C interfaces for the Bonjour stuff :slight_smile: And I have all the stripping options. They just break my reflection based code. The sockets and stuff work stand alone in my non-complex test environment. Integrating them with my full game leads to this message.

Thanks!

Nothing in his message denoted to me that he didn’t have Advanced, in fact he stated that ‘stripping’ in fact broke something, thus he must have used it to know that :slight_smile:

(Unity iPhone Advanced feature).

says he doesn’t have advanced.

I don’t think the issue is that he doesn’t have advanced, its that he does have it and he doesn’t want to enable that as it would strip his code…

That to me says its telling him to use an advanced feature. It is not saying that he is trying to use one that does not exist.

Grammatically speaking of course :stuck_out_tongue:

Hello Stephen,
you need to hint mono linker about the types that you use via reflection. Easiest way - just declare variables of such types somewhere in the scripts.

Hi Mantas,

I do have instances of these classes around. For instance, I use Ani.Mate to control fieldOfView on the main camera. When stripping is enabled, this field/property cannot be found by Type.GetField() or Type.GetProperty(). I even tried declaring dummy cameras. Also my network state blocks are declared and used elsewhere in the scripts, but their fields cannot be located at runtime (the get returns null). This makes Marshal.SizeOf() freak out :slight_smile:

Stephen

Bump - bump… This is really a show stopper for us.

Not sure if it helps as this is an old thread.

Anyway, I had a similar error tonight. I was using iPhone Basic, got the same error you listed above. So I decided that well, it’s time to buck up and get iPhone Advanced. After upgrading and trying to reboot Unity several times, I was still getting the error.

What worked for me was editing the Player Preferences, located in
Edit → Project Settings → Player
This opens up the player settings on the right hand side of the screen in the inspector view.

I think once you buy advanced you have access to modify a property called “iPhone Stripping Level”. I set mine to “Strip Assemblies” and was able to build to my iPod once again.

Hope this helps, if not you someone else… as I stumbled upon this post in a Google search.

-Tom

i am seeing related things, see this post:
http://forum.unity3d.com/viewtopic.php?t=42572&highlight=stripping