[BUGS][UNITY][WEBGL][CLIENT_API_1.7.1][MISMATCH DATA TYPE FROM SERVER]
-
- Posts: 4
- Joined: 06 Dec 2016, 09:06
[BUGS][UNITY][WEBGL][CLIENT_API_1.7.1][MISMATCH DATA TYPE FROM SERVER]
Our server side use Smartfox version 2.12.0 and send float to client by PutFloat function but when we receive data and log type, it always INT for number like 10.0f, 20.0f, 35.0f, 42.0f... and double for number like 42.2f, 45.5f, 50.2f... Please check this bug ASAP.
Re: [BUGS][UNITY][WEBGL][CLIENT_API_1.7.1][MISMATCH DATA TYPE FROM SERVER]
Please check this post:
viewtopic.php?f=20&t=18904
Download the jar from the provided link and report back if it solves your problem.
Thanks
viewtopic.php?f=20&t=18904
Download the jar from the provided link and report back if it solves your problem.
Thanks
-
- Posts: 4
- Joined: 06 Dec 2016, 09:06
Re: [BUGS][UNITY][WEBGL][CLIENT_API_1.7.1][MISMATCH DATA TYPE FROM SERVER]
Now it's double but we use GetFloat on client side and it's still crashed.
Re: [BUGS][UNITY][WEBGL][CLIENT_API_1.7.1][MISMATCH DATA TYPE FROM SERVER]
Can you be more specific and give us an exact example of what the problem is?
Thanks
Thanks
-
- Posts: 4
- Joined: 06 Dec 2016, 09:06
Re: [BUGS][UNITY][WEBGL][CLIENT_API_1.7.1][MISMATCH DATA TYPE FROM SERVER]
On server side, we use
then send it's to client.
Our client side use
and our WebGL client crashed when receive that packet.
We try to log type of "score" variable by Type property of SFSDataWrapper
and it's show type is 7 means DOUBLE in SFSDataType enum.
So that, our client get "InvalidCastException: Cannot cast from source type to destination type" and crash.
Code: Select all
data = new SFSObject();
data.putFloat("score", friendScore);
then send it's to client.
Our client side use
Code: Select all
ISFSObject data = getDataFromServer();
data.getFloat("score");
and our WebGL client crashed when receive that packet.
We try to log type of "score" variable by Type property of SFSDataWrapper
Code: Select all
data.GetData("score").Type
and it's show type is 7 means DOUBLE in SFSDataType enum.
So that, our client get "InvalidCastException: Cannot cast from source type to destination type" and crash.
Re: [BUGS][UNITY][WEBGL][CLIENT_API_1.7.1][MISMATCH DATA TYPE FROM SERVER]
We can't reproduce the issue.
We executed the following tests:
1)
After joining a room, we send a public message to the server containing a object with the Float value 42.2f.
When the message is received back, we can read that value using the GetFloat method.
This works both in the Editor and in the browser.
2)
We send an extension message to the server containing a object with the Float value 42.2f.
The extension creates a new SFSObject (so not reusing the one it just received) setting a Float value to 3.7f and sends a response to the client. When the extension response is received by the client, we can read that value using the GetFloat method.
Again, this works both in the Editor and in the browser.
In both cases the type of the value is System.Single (at least in the Editor, I didn't check what is reported in the browser)
Can you make the same simple tests?
We executed the following tests:
1)
After joining a room, we send a public message to the server containing a object with the Float value 42.2f.
When the message is received back, we can read that value using the GetFloat method.
This works both in the Editor and in the browser.
2)
We send an extension message to the server containing a object with the Float value 42.2f.
The extension creates a new SFSObject (so not reusing the one it just received) setting a Float value to 3.7f and sends a response to the client. When the extension response is received by the client, we can read that value using the GetFloat method.
Again, this works both in the Editor and in the browser.
In both cases the type of the value is System.Single (at least in the Editor, I didn't check what is reported in the browser)
Can you make the same simple tests?
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
-
- Posts: 4
- Joined: 06 Dec 2016, 09:06
Re: [BUGS][UNITY][WEBGL][CLIENT_API_1.7.1][MISMATCH DATA TYPE FROM SERVER]
Thank for your quickly support. The problem is solved now.
Re: [BUGS][UNITY][WEBGL][CLIENT_API_1.7.1][MISMATCH DATA TYPE FROM SERVER]
Can you please describe what the solution was? For future reference.
Thanks.
Thanks.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Who is online
Users browsing this forum: No registered users and 47 guests