how to get buddylist limit in serverside?

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

Moderators: Lapo, Bax

User avatar
mhdside
Posts: 236
Joined: 04 May 2008, 07:57
Location: Egypt
Contact:

how to get buddylist limit in serverside?

Postby mhdside » 01 Mar 2012, 16:42

How to get the following in the server side sfs2x:
1. the buddylist limit (as defined in the zone config)
2. the current buddies size (how many buddies are saved) in a user`s buddylist
Mahmoud Badri
Senior actionscript developer
http://www.el3ab.com
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: how to get buddylist limit in serverside?

Postby Lapo » 01 Mar 2012, 16:53

1) <YourZoneObj>.getBuddyListManager().getBuddyListMaxSize()
2) <YourBuddyObj>.getBuddyList().getSize()

Check the server-side documentation for further details on these classes:
SFSBuddyListManager, manages the buddy lists
SFSBuddyManager, manages the single buddy list

http://docs2x.smartfoxserver.com/api-do ... oc/server/
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
mhdside
Posts: 236
Joined: 04 May 2008, 07:57
Location: Egypt
Contact:

Re: how to get buddylist limit in serverside?

Postby mhdside » 01 Mar 2012, 17:49

thanks
Mahmoud Badri

Senior actionscript developer

http://www.el3ab.com
User avatar
mhdside
Posts: 236
Joined: 04 May 2008, 07:57
Location: Egypt
Contact:

Re: how to get buddylist limit in serverside?

Postby mhdside » 01 Mar 2012, 18:28

2) <YourBuddyObj>.getBuddyList().getSize()


Anyway I can use the ".getBuddyList().getSize()" with User insread of Buddy? If not, is there anyway to convert from User to Buddy?
Mahmoud Badri

Senior actionscript developer

http://www.el3ab.com
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: how to get buddylist limit in serverside?

Postby Lapo » 02 Mar 2012, 08:34

No, you can't there's no such thing on the User object.
You can't convert User to Buddy because they are two completely different classes. But you can get the Buddy object related to the User via the username.
If your user is called "Animal" you can use BuddyListManager.getBuddyList( userName )
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
mhdside
Posts: 236
Joined: 04 May 2008, 07:57
Location: Egypt
Contact:

Re: how to get buddylist limit in serverside?

Postby mhdside » 02 Mar 2012, 11:42

Lapo wrote:But you can get the Buddy object related to the User via the username.
If your user is called "Animal" you can use BuddyListManager.getBuddyList( userName )


This does the trick. thanks.
Mahmoud Badri

Senior actionscript developer

http://www.el3ab.com

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 132 guests