Weird error that I only see when running on Android
Posted: 15 Dec 2014, 15:39
I have been getting this error when sending an extension request from an Android device to the server. But it doesn't seem to always happen. It only happens randomly so I'm not sure what could be causing this issue.
This is the error I received;
And this is the function that's being called
Thanks!
This is the error I received;
Code: Select all
I/Unity ( 7355): InvalidCastException: Cannot cast from source type to destination type.
I/Unity ( 7355): at Sfs2X.Protocol.Serialization.DefaultSFSDataSerializer.EncodeObject (Sfs2X.Util.ByteArray buffer, Int32 typeId, System.Object data) [0x00000] in <filename unknown>:0
I/Unity ( 7355): at Sfs2X.Protocol.Serialization.DefaultSFSDataSerializer.Obj2bin (ISFSObject obj, Sfs2X.Util.ByteArray buffer) [0x00000] in <filename unknown>:0
I/Unity ( 7355): at Sfs2X.Protocol.Serialization.DefaultSFSDataSerializer.Object2Binary (ISFSObject obj) [0x00000] in <filename unknown>:0
I/Unity ( 7355): at Sfs2X.Entities.Data.SFSObject.ToBinary () [0x00000] in <filename unknown>:0
I/Unity ( 7355): at Sfs2X.Entities.Data.SFSObject.GetHexDump () [0x00000] in <filename unknown>:0
I/Unity ( 7355): at Sfs2X.Core.SFSProtocolCodec.OnPacketWrite (IMessage message) [0x00000] in <filename unknown>:0
I/Unity ( 7355): at Sfs2X.Bitswarm.BitSwarmClient.Send (IMessage message) [0x00000] in <filename unknown>:0
I/Unity ( 7355): at Sfs2X.SmartFox.Send (IRequest request) [0x00000] in <filename unknown>:0
I/Unity ( 7355): at GameManager.OnReturnToGames () [0x00000] in <filename unknown>
Code: Select all
if (smartFox.IsConnected) {
smartFox.Send(new ExtensionRequest("OnLeavingRoom", new SFSObject(), smartFox.LastJoinedRoom));
smartFox.Send(new LeaveRoomRequest());
LeaveRoom();
}