Page 2 of 2

Posted: 25 Nov 2010, 13:50
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 ;)

Posted: 25 Nov 2010, 16:39
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!

Posted: 27 Nov 2010, 04:11
by Carl Lydon
Any thoughts?

Posted: 27 Nov 2010, 21:30
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?

Posted: 28 Nov 2010, 14:56
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

Posted: 28 Nov 2010, 15:37
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?

Posted: 29 Nov 2010, 07:09
by Lapo
No