setUserVariables can't update client

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

Moderators: Lapo, Bax

haha0738
Posts: 11
Joined: 20 Nov 2009, 04:30

setUserVariables can't update client

Postby haha0738 » 31 Aug 2010, 10:12

This is my server code

Code: Select all

user.setVariable("nick_name", request.nick_name, UserVariable.TYPE_STRING);
ExtensionHelper.instance().setUserVariables(user, user.getVariables(), true);


This is what I receive in client

Code: Select all

[ RECEIVED ]: <msg t='sys'><body action='uVarsUpdate' r='1'><vars></vars><user id='0' /></body></msg>


I print the length of Hashtable in SFSEvent.onUserVariablesUpdate.
the length is zero

Have anyone can tell me what is the problem? please..[/code]
User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 01 Sep 2010, 05:31

Does this work for you?

Code: Select all

HashMap vars = new HashMap();                           
vars.put("nick_name", request.nick_name);
ExtensionHelper.instance().setUserVariables(user, vars, true);


No need to use user.setVariable of you use helper.setUserVariables to set the user's variables.
Smartfox's forum is my daily newspaper.
haha0738
Posts: 11
Joined: 20 Nov 2009, 04:30

Postby haha0738 » 01 Sep 2010, 07:29

BigFIsh wrote:Does this work for you?

Code: Select all

HashMap vars = new HashMap();                           
vars.put("nick_name", request.nick_name);
ExtensionHelper.instance().setUserVariables(user, vars, true);


No need to use user.setVariable of you use helper.setUserVariables to set the user's variables.


Thank you.
It works now ^^.

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 51 guests