iOS Serialization / Deserialization anomaly
Posted: 12 Mar 2014, 15:03
Hi,
We use Unity 4.3.2 and SmartFox SX 2.8.2. Unity code is C#, and platform is iOS.
We use a custom extension which has some problems already in topic: http://forums.smartfoxserver.com/viewto ... 8&start=15.
Our newest issue is that the SFSObject that send via SmartFox.Send() command as an extension request, has cutted out the cmd paramter from the request tcp package after the first turn around. This means the request executes for the first time, we get a correct response from the server, but for the further serialization tries fail. To try this we created a SerializableSFSType object:
We tried to serialize this before and after the first extension response processing, and there was a difference already :
And there was a difference between the first time and the second time of the serialized TCP packages:
first time pocket log with returning packet data:
second time, the cmd part "qt" is missing :
How could we reinitialize the serializer from C# code from the Unity project to make it works again correctly?
Is there any exception handling where we can check the serialization issues?
We use Unity 4.3.2 and SmartFox SX 2.8.2. Unity code is C#, and platform is iOS.
We use a custom extension which has some problems already in topic: http://forums.smartfoxserver.com/viewto ... 8&start=15.
Our newest issue is that the SFSObject that send via SmartFox.Send() command as an extension request, has cutted out the cmd paramter from the request tcp package after the first turn around. This means the request executes for the first time, we get a correct response from the server, but for the further serialization tries fail. To try this we created a SerializableSFSType object:
Code: Select all
using UnityEngine;
using System.Collections;
using Sfs2X;
using Sfs2X.Protocol.Serialization;
public class MySFS : SerializableSFSType {
public string name;
public MySFS (string s){
name = s;
}
}
Code: Select all
DefaultSFSDataSerializer serializer = DefaultSFSDataSerializer.Instance;
DefaultSFSDataSerializer.RunningAssembly = Assembly.GetExecutingAssembly();
ISFSObject obj = serializer.Cs2Sfs(new MySFS("sanyi"));
Debug.LogWarning ("serialized obj: " + obj.GetHexDump ());And there was a difference between the first time and the second time of the serialized TCP packages:
first time pocket log with returning packet data:
Code: Select all
0000 80 00 46 12 00 03 00 01 63 02 01 00 01 61 03 00 ..F.....c....a..
0010 0d 00 01 70 12 00 03 00 01 63 08 00 02 71 74 00 ...p.....c...qt.
0020 01 72 04 00 00 00 01 00 01 70 12 00 03 00 01 69 .r.......p.....i
0030 04 00 00 00 01 00 01 72 04 00 00 00 01 00 01 64 .......r.......d
0040 05 00 00 00 00 00 00 00 01 .........
Data: 800046120003000163020100016103000d00017012000300...Code: Select all
0000 80 00 3e 12 00 03 00 01 63 02 01 00 01 61 03 00 ..>.....c....a..
0010 0d 00 01 70 12 00 02 00 01 72 04 00 00 00 01 00 ...p.....r......
0020 01 70 12 00 03 00 01 69 04 00 00 00 01 00 01 72 .p.....i.......r
0030 04 00 00 00 01 00 01 64 05 00 00 00 00 00 00 00 .......d........
0040 01 .
Data: 80003e120003000163020100016103000d00017012000200...Is there any exception handling where we can check the serialization issues?