userLost null user

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

Moderators: Lapo, Bax

Post Reply
evilyummycandy
Posts: 12
Joined: 05 Mar 2010, 20:58

userLost null user

Post by evilyummycandy »

This is a strange error and hard to reproduce but I am unable to pull any data from the InternalEventObject when a user is lost in a specif way.

What I mean by that is it only happens to users who have been kicked due to extended idle time because their flash client/browser has crashed. Because this only happens to users who's flash player/browser has crashed it is not easy to reproduce. But under all other circumstances the userLost works perfectly fine, including when a user is kicked for being idle( without client crash ).

Relative server logs:
INFO | jvm 1 | 2010/08/12 11:16:22 | [EVENT NAME] : userLost
INFO | jvm 1 | 2010/08/12 11:16:22 | 11:16:22.410 - [ WARNING ] > Exception during userLost event handling: java.lang.NullPointerException
INFO | jvm 1 | 2010/08/12 11:16:22 | 11:16:22.410 - [ INFO ] > User Guest5 has been kicked.

Code: Select all

if ( evtName.equals( "userLost" )){

            //_pRemovePlayer.removeFromServer( ( User ) ieo.getObject( "user" ) );
            _pRemovePlayer.removeFromServerById( Integer.valueOf( ieo.getParam( "uid" ) ).intValue() );
            
        }
As a result of this I am unable to clear certain data related to the user because I am unable to get to the userId. I'm sure someone else has come across something similar to this by now or maybe I'm totally missing something but I'm just stuck on this at the moment and would appreciate any help.
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

Do you have <AutoReloadExtensions> set to true for your zone? If so, this probably caused the problem you're seeing since reloading extensions dynamically would probably re-initialized your local variables.
Smartfox's forum is my daily newspaper.
evilyummycandy
Posts: 12
Joined: 05 Mar 2010, 20:58

Post by evilyummycandy »

No <AutoReloadExtensions> is not set to true
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

Ah, I was thinking of an different warning message. I received something similar to yours when I reloaded my extension and then disconnected myself from SFS.

Hrm, 'Exception during userLost event handling' is a different one. In this case, I would have no clue. This havn't been reported before.

What is your SFS version?
Smartfox's forum is my daily newspaper.
evilyummycandy
Posts: 12
Joined: 05 Mar 2010, 20:58

Post by evilyummycandy »

I'm currently running 1.6.6
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Please update the server to the latest 1.6.9 and report if it helps handling the null pointer in the exception report.
http://forums.smartfoxserver.com/viewtopic.php?t=8233
Lapo
--
gotoAndPlay()
...addicted to flash games
evilyummycandy
Posts: 12
Joined: 05 Mar 2010, 20:58

Post by evilyummycandy »

Updated to 1.6.9 and the issue is still present
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Try adding a try/catch block around your code and output the stack trace so that you can see exactly where the null pointer is coming from.
Lapo
--
gotoAndPlay()
...addicted to flash games
evilyummycandy
Posts: 12
Joined: 05 Mar 2010, 20:58

Post by evilyummycandy »

After lots and lots of testing I've come to the conclusion that it is not smartfox userLost event causing the problem, it is the ending result of the problem. The problem source itself was somewhere entirely different, sorry for the mixup. This can be closed.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Ok, just to better understand could you expand on this a bit more?
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply