client message evaluation error

You think you've found a bug? Please report it here.

Moderators: Lapo, Bax

Post Reply
wildart
Posts: 2
Joined: 13 Jun 2007, 04:23

client message evaluation error

Post by wildart »

Hi,

Here is the bug.

I have following code in my extension:

Code: Select all

var userObj = _server.getUserByChannel(chan)
uVars = {}
uVars.sign = "00000000000000000010001110010100011"
_server.setUserVariables(userObj, uVars)
So my "sign" variable is a string and I am receiving following message on client side when I join to room:

[Received]: <msg t="sys"><body action="joinOK" r="1"><pid id="0" /><vars /><uLs r="1"><u i="23" m="0"><n>cel</n><vars><var n="sign" t="s">00000000000000000010001110010100011</var></vars></u></uLs></body></msg>

You can see that type of my variable is set to string (t="s").

But when I try to get value of my "sign" variable using getVariables() function I received string "1075871753" instead of "00000000000000000010001110010100011". It seams that your message parser does some evaluations and does not preserve exact values of variables.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Interesting :shock:
We'll investigate, meanwhile I can suggest a temporary workaround, add an alphanumeric char in front of your number sequence.
Example:

Code: Select all

uVars.sign = "00000000000000000010001110010100011" 
becomes

Code: Select all

uVars.sign = "*00000000000000000010001110010100011" 
When the string comes back to the client just eliminate the first char and there you go.
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

We have fixed the bug internally and we'll soon release a patch together with some other fixes.

Meanwhile you can easily fix the problem, following these steps:

1. open the API source file -> SmartFoxClient.as ( I assume it's the latest, version 1.4.0 )
2. reach line 2030, you'll find this:

Code: Select all

if (!isNaN(nodeValue) && node.nodeName != "txt")
3. and substitute it with:

Code: Select all

if (!isNaN(nodeValue) && node.nodeName != "txt" && node.nodeName != "var")
Now you can recompile the Flash application
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply