User is null on onUserVariablesUpdate

Post here all your questions related with SmartFoxServer Java API

Moderators: Lapo, Bax

Posts: 7
Joined: 19 Sep 2010, 03:00

User is null on onUserVariablesUpdate

Postby thinknewdev » 31 Oct 2010, 18:41

I am geting an error in my Java code where when I join a room and set initial user variables everything works as expected

I then have a button that runs the following code

Code: Select all


Tell Users Actions

Map<String, SFSVariable> uVars = new HashMap<String,SFSVariable>();

uVars.put("life", new SFSVariable("200", SFSVariable.TYPE_STRING));
uVars.put("posx", new SFSVariable( "150", SFSVariable.TYPE_NUMBER));
uVars.put("posy", new SFSVariable( "200", SFSVariable.TYPE_NUMBER));

Then I have my event handler

Code: Select all


   User tuser = (User) event.getParams().get("user");

         if(battleAction != null)
  Point((stv.width/2)-48, 150));

tuser in this case ends up being null. Any reason for that to happen?


Return to “Java2SE / Android Client API”

Who is online

Users browsing this forum: No registered users and 2 guests