SFSObject serialization issue on iOS

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

Moderators: Lapo, Bax

Post Reply
BerengerVB2S360
Posts: 3
Joined: 02 Apr 2014, 12:47

SFSObject serialization issue on iOS

Post by BerengerVB2S360 »

Hi,

We're using Unity 3.5.7 and SmartFox.Version returns 1.2.0. When using the iPad, some request are apparently blocked and we get the following warning :

[SFS - WARN] Unrecognized type in SFSObject serialization: 6684755.

However, we're are not serializing anything fancy. We put some integers, floats, bytes, string and SFSArray inside the SFSObject. Any idea what could be the problem ? Do you need more informations ? I'm a bit new to this, I'm taking up someone else's work.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SFSObject serialization issue on iOS

Post by Lapo »

Hi,
your problem looks very much like this one:
http://forums.smartfoxserver.com/viewto ... 20&t=16963

In essence it's not related with the API but it seems to be caused by Unity's iOS exporter. Specifically I think the problem is with the AOT (ahead of time) compilation process that use to transform the C# bytecode into native ARM code.

In that discussion you will notice that the user was able to solve the problem, although the solution is far from being logical. :?
Lapo
--
gotoAndPlay()
...addicted to flash games
BerengerVB2S360
Posts: 3
Joined: 02 Apr 2014, 12:47

Re: SFSObject serialization issue on iOS

Post by BerengerVB2S360 »

We saw this topic earlier, and disabled every debugs in our project, but it doesn't seem to fix it unfortunately :(
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SFSObject serialization issue on iOS

Post by Lapo »

We have a more recent version of the API available here:
http://www.smartfoxserver.com/download/sfs2x#p=client

It shouldn't really matter but since the origin of the problem is not well understood, it might be worthwhile to experiment using the latest version.
Lapo
--
gotoAndPlay()
...addicted to flash games
BerengerVB2S360
Posts: 3
Joined: 02 Apr 2014, 12:47

Re: SFSObject serialization issue on iOS

Post by BerengerVB2S360 »

Hi again,

After several days of investigations, I finally found the solution to my problem, and the solution to alien woods' as well. Prepare to be surprised ... SFSObject.ToString() function is messing things up on iOS ! I don't know what it does, but every time it's called, implicitly ("test" + sfsobj) or explicitly (sfsobj.ToString()), communications stops with the other users.

Just remove them all, and you're good ! Damn that was a tricky one to find ... Hope it can help someone else :)
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SFSObject serialization issue on iOS

Post by Lapo »

No idea why that's happening. Good to know that you have found a way to fix the issue.
We'll see if we can reproduce it and understand why it happens.

thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SFSObject serialization issue on iOS

Post by Lapo »

UPDATE: we're not able to reproduce the problem. Calling SFSObject.ToString() doesn't cause any issue.
Once again this confirms that the AOT compilation process is very likely to be the problem.
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply