How can i put the user that are conected to al my server??

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

User avatar
JarochoCity
Posts: 180
Joined: 01 Dec 2005, 01:22
Location: Mexico
Contact:

How can i put the user that are conected to al my server??

Postby JarochoCity » 12 Feb 2006, 04:29

How can i put the number of users that are conected to all my server, in my html website???
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 12 Feb 2006, 15:47

A simple way could be this:

- create a small swf that connects to the server
- once you get the list of rooms cycle through it and sum the number of users in each room.
- then show it in a textfield inside the SWF
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
JarochoCity
Posts: 180
Joined: 01 Dec 2005, 01:22
Location: Mexico
Contact:

yeah, but if somebody create an extra room?

Postby JarochoCity » 12 Feb 2006, 23:57

yeah, but if somebody create an extra room?
example:

somebody make a mazegame room, or a tic tac toe room, etc.
how can i count those users???

how can i get the list of all the rooms?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 13 Feb 2006, 06:53

the list of all rooms in a Zone is sent by the server upon connection or by requesting it with a getRoomList()

yeah, but if somebody create an extra room?

I don't understand... when the web page is loaded your little flash counter will connect, get the number of users and disconnect.
If a room is created right after that you won't know it... but this is just normal, as all html pages are static. Anyway it will tell you the server of the status at the moment in which the page was loaded.

If you need realtime statistics it's going to be more complex, because your swf file inside the page should stay connected all the time and report each change... doubling the number of connected users... (each page viewed will add a user inside to the server)
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
JarochoCity
Posts: 180
Joined: 01 Dec 2005, 01:22
Location: Mexico
Contact:

ok, forget about ir i knew how to do it.... and how can i..?

Postby JarochoCity » 13 Feb 2006, 21:46

how can i add an emoticon to the textfild when somebody talk at the avatar chat... i mean if somebody wants to show a =) (happyface :D)

how can i do that?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 15 Feb 2006, 07:01

You should search for a Flash component that does that.
Check this one >> http://www.osflash.org/fosforo
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
goodguy20k
Posts: 71
Joined: 10 Jan 2006, 23:58
Location: Texas, USA
Contact:

Postby goodguy20k » 17 Feb 2006, 01:53

Another idea, based off of Lapo's for current user count is have the server write out a file everytime somebody connects or disconnects. That way, you don't tax your server with extra connections, and you have a pretty accurate number of users (in game and out of game, does not matter.) Then you can just have a little flash app on your main page keep an eye on the file being output and any time it changes, show the change. Just my two cents.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 17 Feb 2006, 06:54

Nice idea :)
Maybe instead of writing to a file on each user event I would suggest to update the count based on a fixed interval... like 20 or 30 seconds.
I know this is not as precise, but if you're running a lot of users it may be a resource waste to constantly write to a file...
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 35 guests