the handleUserLeaveRoom null pointer bug

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

Moderators: Lapo, Bax

Post Reply
flarb
Posts: 131
Joined: 15 Oct 2007, 21:07
Location: Home of the Body Bag
Contact:

the handleUserLeaveRoom null pointer bug

Post by flarb »

This just keeps coming up.

I've read several thread about it--but it's hard to reproduce and there doesn't seem to be a real solution for it.

I tend to get this error:

Code: Select all

TypeError: Error #1009: Cannot access a property or method of a null object reference.
	at it.gotoandplay.smartfoxserver.handlers::SysHandler/handleUserLeaveRoom()
	at Function/http://adobe.com/AS3/2006/builtin::apply()
	at it.gotoandplay.smartfoxserver.handlers::SysHandler/handleMessage()
	at it.gotoandplay.smartfoxserver::SmartFoxClient/xmlReceived()
	at it.gotoandplay.smartfoxserver::SmartFoxClient/handleMessage()
	at it.gotoandplay.smartfoxserver::SmartFoxClient/handleSocketData()
Whenever the creator/owner of the game room closes the browser. The other client gets some kind of malformed XML error and then this pops up in the browser. Which comes down to that one line of code where the user is null.

Now, in my application the users are always connected to 2 rooms. One lobby and one game room. I don't know if that has anything to do with it....as there seem to be other bugs with being in two rooms at once (the room vars which still hasn't been patched)

Most of the bugs related to this call seem to be in calling getroomlist--but I only call it once. I call it when searching for a private game room to join. And that's it.

My theory is that there's a bug where SFS is using the wrong room reference when trying to pull out the leaving user to post the userleave message. Or--the user has already been deleted by SFS before SFS makes the event call. I think that because I'm quitting out of the browser entirely--the user is being deleted because he's disconnected...but it's still sending the userleave message...however since the user has completely closed the browser, SFS has already deleted the user object.

I really really would like to get this resolved as it's making my game completely unstable.
flarb
Posts: 131
Joined: 15 Oct 2007, 21:07
Location: Home of the Body Bag
Contact:

Post by flarb »

*BUMP*

Hey Lapo--do you have any insight on this? It's pretty reproducible in my case. Has nobody else experienced this bug when closing the browser on an app where you are in two zones at once?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Now, in my application the users are always connected to 2 rooms. One lobby and one game room. I don't know if that has anything to do with it....as there seem to be other bugs with being in two rooms at once
We are not aware of problems like these. I also took some time to run a test with users connecting and disconneting from multiple rooms and no problems were found.

Please send us a stripped-down example FLA that reproduces the problem and will look into it.
(the room vars which still hasn't been patched)
I am not sure about which problem you are talking about. Which bug is it?
Lapo
--
gotoAndPlay()
...addicted to flash games
flarb
Posts: 131
Joined: 15 Oct 2007, 21:07
Location: Home of the Body Bag
Contact:

Post by flarb »

There was a thread somewhere about how you get a null user or something when you update a room variable when the users ares connected to multiple rooms. I'll have to go find it--but you mentioned it will be fixed in the next patch. But there hasn't been a patch yet. I'll dig around and see if I can find the thread.
flarb
Posts: 131
Joined: 15 Oct 2007, 21:07
Location: Home of the Body Bag
Contact:

Post by flarb »

http://forums.smartfoxserver.com/viewto ... ght=#11271

This thread--looks like you did post the workaround, I just didn't see it.

Anyway--I'll have to figure out how to let you have a peek at this FLA. I've got a bajillion source files and it wil be kind of tricky to test. You can't do anything with just the FLA and no source files can you?
Post Reply