Hi,
InvalidCastException: Cannot cast from source type to destination type. is been thrown when try to get a double when it have no decimals.
This is an example sequence:
1-> A sends an ExtensionRequest. action.PutDouble(0.0,"x");
2-> Extension (server side) gets the action and sends it to B. trace( action.getDouble("x")) -> 0.0
3 -> B receives the action but when tries to get "x" value from it, the exception is thrown. If I Debug the action this is what I get:
3.1 -> Debug.Log (action.GetData("x").Data) -> 0
3.2 -> Debug.Log (action.GetData("x").Data.GetType()) -> System.Int32
If x value is 0.3 [ action.PutDouble(0.3,"x")] , it works fine.
This issue happens on server version 2.12.0 and C# client API version 1.7.0.
Thanks
Exception GetDouble when number has no decimals (Unity C#)
Re: Exception GetDouble when number has no decimals (Unity C#)
Thanks for reporting. Oddly enough we could not replicate the issue in our dev environment but we could with an SFS2X 2.12 from the website.
Not sure what is it about. Still investigating.
Stay tuned.
Not sure what is it about. Still investigating.
Stay tuned.
Re: Exception GetDouble when number has no decimals (Unity C#)
UPDATE: found the issue.
There seem to be a different json library in the release than that we use in dev. However they have the same exact same name, which left us puzzled. In any case testing the two it is definitely the cause of the problem.
Please download the correct library from here and replace the same file under SFS2X/lib/. Then restart the server and test again.
Let us know.
Thanks
There seem to be a different json library in the release than that we use in dev. However they have the same exact same name, which left us puzzled. In any case testing the two it is definitely the cause of the problem.
Please download the correct library from here and replace the same file under SFS2X/lib/. Then restart the server and test again.
Let us know.
Thanks
Re: Exception GetDouble when number has no decimals (Unity C#)
Any news?
Did you try the provided jar file?
Thanks
Did you try the provided jar file?
Thanks
Re: Exception GetDouble when number has no decimals (Unity C#)
It seems that works.
I highly recommend release patch as soon as possible.
Thanks
I highly recommend release patch as soon as possible.
Thanks
Re: Exception GetDouble when number has no decimals (Unity C#)
Thanks for the feedback. The patch will be out later today.
Cheers
Cheers
Who is online
Users browsing this forum: No registered users and 46 guests