Hello
i want to know is the costumer guest or real user. it there anu function for getting that?
user is guest or normal user
Re: user is guest or normal user
Yes,
it simply depends on the privilege Id.
You can read it from client side (ex: C#):
Here's the documentation about how this works:
http://docs2x.smartfoxserver.com/Advanc ... ge-manager
cheers
it simply depends on the privilege Id.
You can read it from client side (ex: C#):
Code: Select all
if (user.PrivilegeId == 0) ...
Here's the documentation about how this works:
http://docs2x.smartfoxserver.com/Advanc ... ge-manager
cheers
Re: user is guest or normal user
I need it on the server side, not the client side. now i`m checking this with username. if the username contains the prefix of the guest.
Re: user is guest or normal user
Hi,
On the server-side, on the User object, you have the .getPrivilegeId() method which does the same as the client-side version Lapo presented.
For example, your code should look something like:
where user is an User object.
For more informatio you can read getPrivilegeId() 's documentation at:
http://docs2x.smartfoxserver.com/api-docs/javadoc/server/com/smartfoxserver/v2/entities/User.html#getPrivilegeId()
Cheers
On the server-side, on the User object, you have the .getPrivilegeId() method which does the same as the client-side version Lapo presented.
For example, your code should look something like:
Code: Select all
if (user.getPrivilegeId() == 0) ...
where user is an User object.
For more informatio you can read getPrivilegeId() 's documentation at:
http://docs2x.smartfoxserver.com/api-docs/javadoc/server/com/smartfoxserver/v2/entities/User.html#getPrivilegeId()
Cheers
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Who is online
Users browsing this forum: No registered users and 42 guests