setUserVariables messes up ?

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Ehmmmm... this is almost a 2 years+ old thing :D
What are you referring to exactly?
As usual ... please always include your API and server versions ;)
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Carl Lydon
Posts: 298
Joined: 12 Nov 2007, 16:15
Location: NYC

Post by Carl Lydon »

Hey Lapo,

Yea, I generally try to add to an existing thread, even if it's old :-). From a google search, seems this error comes up often enough for various reasons.

SF server and client 1.66.

Problem: When a user with a slow connection enter a room, we get:

Code: Select all

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at it.gotoandplay.smartfoxserver.handlers::SysHandler/handleUserVarsUpdate()
And then:

Code: Select all

TypeError: Error #1088: The markup in the document following the root element must be well-formed.
over and over. At this point everyone in the room becomes unable to chat, as the sendPublic message stops working. Sending objects continues to work.

It seems that this error can come up for more reasons than not capturing the room list before entering the room. I believe I'm doing that.

My flow for user is:

1. Connects
2. Handles connection
3. Logs into extension
4. Receives response
5. Receives onRoomListUpdate
6. Joins lobby / map room
7. User clicks on a map location
8. Map sets user x,y variables, sends userVars, then joins new room
9. Clients build the avatar in the correct x,y location

What I think might be happening with the very slow connection is, since the sendvars happens just before joining the room, maybe the user is "between" rooms when the vars are received?

So, what I tried last night, not sure if it will work, is I'm sending the vars just before, and just after the roomJoin. Waiting to see if it will work. I tested simulating 56k modem in flash, but won't know until real users get back to me.

I don't know of a simple or elegant way to wait or check to see if the vars have been received before joining a room...

The other thing I considered doing is putting a half second delay on the map buttons, so the vars have a chance to set before joining the room.

As I mentioned, this only happens for users with very slow connections, but it ruins thing for everyone else in the room.

I'm not even sure if this is the real reason it's happening. It took me a number of days to even capture the error, since it happened only when certain people came on.

Thanks!
User avatar
Carl Lydon
Posts: 298
Joined: 12 Nov 2007, 16:15
Location: NYC

Post by Carl Lydon »

Any thoughts?
User avatar
Carl Lydon
Posts: 298
Joined: 12 Nov 2007, 16:15
Location: NYC

Post by Carl Lydon »

Any thoughts on this? Can setting variables just before entering a room cause this error? I tried adding a delay between setting the variables and joining the next room.

Isn't this really a bug? And isn't it a security problem that one person sending a malformed xml object can crash everyone else?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Please update tp 1.6.9, it should get rid of that problem. I remember we discussed it in several occasions an through various versions, 1.6.6 to 1.6.8
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Carl Lydon
Posts: 298
Joined: 12 Nov 2007, 16:15
Location: NYC

Post by Carl Lydon »

Great, thanks. But what about my other question? Is it possible for a hacker to purposefully mess up a whole room by sending malformed xml?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

No
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply