Page 1 of 1

userLost null user

Posted: 12 Aug 2010, 18:28
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.

Posted: 12 Aug 2010, 21:56
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.

Posted: 12 Aug 2010, 23:13
by evilyummycandy
No <AutoReloadExtensions> is not set to true

Posted: 13 Aug 2010, 02:29
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?

Posted: 13 Aug 2010, 03:06
by evilyummycandy
I'm currently running 1.6.6

Posted: 23 Aug 2010, 20:31
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

Posted: 26 Aug 2010, 04:31
by evilyummycandy
Updated to 1.6.9 and the issue is still present

Posted: 30 Aug 2010, 05:29
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.

Posted: 03 Sep 2010, 18:35
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.

Posted: 06 Sep 2010, 12:41
by Lapo
Ok, just to better understand could you expand on this a bit more?