USER_DISCONNECT return null user

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

grhwood
Posts: 116
Joined: 15 Mar 2011, 04:43

USER_DISCONNECT return null user

Postby grhwood » 18 Apr 2013, 12:32

Hi,

I have a ServerEventHandler that catch the USER_DISCONNECT event like the following code:

Code: Select all

public void handleServerEvent(ISFSEvent event) throws SFSException {
      User user = (User) event.getParameter(SFSEventParam.USER);
      List<Room> joinedRooms = (List<Room>) event.getParameter(SFSEventParam.JOINED_ROOMS);
   }


The problem is I get the user variable null sometime.

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

Re: USER_DISCONNECT return null user

Postby Lapo » 18 Apr 2013, 13:53

Hi,
this one sounds perplexing. Unless you are using (maybe) a very old version of the server there doesn't seem to be any possibility for this to happen.
If the user object is null there is no way that an event will be dispatched because no action is taken to begin with.

Are you absolutely sure that this is what is happening?
Can you verify that you're running a recent version of the server, possibly the latest? (version 2.6.x)

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
grhwood
Posts: 116
Joined: 15 Mar 2011, 04:43

Re: USER_DISCONNECT return null user

Postby grhwood » 18 Apr 2013, 14:01

Yes, I'm using the latest 2.6.0
User avatar
Lapo
Site Admin
Posts: 21680
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: USER_DISCONNECT return null user

Postby Lapo » 18 Apr 2013, 14:26

Can you show the NullPointerException that you are getting with the full stack trace? You should have it in the logs.
Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
grhwood
Posts: 116
Joined: 15 Mar 2011, 04:43

Re: USER_DISCONNECT return null user

Postby grhwood » 22 Apr 2013, 09:34

Hi, sorry for the delay, I've double check it, I attached the wrong event handler to event :(

Thanks,

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 27 guests