Cycling through zones

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

Moderators: Lapo, Bax

MaartenWSG
Posts: 1
Joined: 22 Sep 2010, 08:44

Cycling through zones

Postby MaartenWSG » 22 Sep 2010, 09:02

Hi there,

I'm working on a project which uses Smartfox Server and I was wondering if it's possible to cycle through the zones, so people can see how many users are on each zone and how full it is.

In the docs I've found the way to connect to Smartfox by XMLSocket in order to get the usercount for each zone, but I was wondering if there is another way to get more zone info (like zone names, capacity, usercount etc) beforehand so users can choose which zone to log onto.

Thanks in advance,

Maarten
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 24 Sep 2010, 13:42

You can obtain a list of Zones from server side in your extension, and then send the relevant data to clients. However you will first need to create a common Zone where all players are initially logged in before being able to access any other Zone.

What language do you use on the server side? Java?
If so you can use:

Code: Select all

SmartFoxServer.getInstance().getAllZones()
Lapo
--
gotoAndPlay()
...addicted to flash games
danieltjewett
Posts: 2
Joined: 31 Oct 2011, 19:09

Postby danieltjewett » 31 Oct 2011, 19:14

Is there an equivalent in ActionScript? I tried getAllZones and get a runtime error of "cannot find function." We're using SmartFoxServer v 1.6.6
User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 01 Nov 2011, 01:44

Have you tried _server.instance.getAllZones(); ?
Smartfox's forum is my daily newspaper.
danieltjewett
Posts: 2
Joined: 31 Oct 2011, 19:09

Postby danieltjewett » 01 Nov 2011, 12:05

I just tried and it works. It returns a java ArrayList (or something similar) of Zones instead of an Array like I thought. Thanks for your help!

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 32 guests