All UserVariable hidden

Post here your questions about the Java client / Android API for SFS2X

Moderators: Lapo, Bax

ztripez
Posts: 5
Joined: 16 Sep 2011, 13:12
Contact:

All UserVariable hidden

Postby ztripez » 06 Oct 2011, 13:14

I've tried all sorts off things server side, but all uservariables keeps beeing hidden.

For example:

Code: Select all

user.setVariable(new SFSUserVariable("face_res", 1.3f,false));


Looking at the api docs the constructor is:

Code: Select all

SFSUserVariable(String name, Object value, boolean isHidden)


The above example should set "face_res" to a public variable but when i check the zone monitor it is set to hidden.

I thought perhaps it selected the wrong constructor but i've tried all sorts:

Code: Select all

user.setVariable(new SFSUserVariable("face_res",(Object) 1.3f,false));
user.setVariable(new SFSUserVariable("face_res",(Double) 1.3f,false));
user.setVariable(new SFSUserVariable("face_res",new Double(1.3),false));

even

Code: Select all

SFSUserVariable u = new SFSUserVariable.newFromStringLiteral("face_res", "DOUBLE", "1.3");
u.setHidden(false);
user.setVariable(u);

etc...


Have i've missed anything??
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 20 Oct 2011, 14:46

Hi,

It seems you are asking a server side only question - right?

This part of the forums is for the Java API on client side. I would suggest you post your question here: viewforum.php?f=18

I'm certain someone can help you there

/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 21 Oct 2011, 07:22

You need to call the API setUserVariable(...) method.
Use the following code:

getApi().setUserVariable(...)

Please take a moment to consult the documentation here before jumping into coding :) You will find more details and links to the javadoc:
http://docs2x.smartfoxserver.com/Develo ... ension-api
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Java / Android API”

Who is online

Users browsing this forum: No registered users and 44 guests