Save a list of all users logged in to a file

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

Moderators: Lapo, Bax

mixart
Posts: 95
Joined: 08 Aug 2007, 20:32

Save a list of all users logged in to a file

Postby mixart » 01 May 2008, 18:09

I'm trying to think of an efficient way to display a list of all usernames that are logged in to my application on a HTML page somewhere outside of my application.

Off the top of my head, all I can think of is looping through all zones/rooms and getting usernames, then creating an extension that saves this list of users to a text file that I can then call from my html page.

A more integrated way I guess would be to update my user database table with a flag 'in=1'.

Questions:
- Can anyone think of a Smartfox method to list all usernames logged in to my application?
- Any other ideas on how to achieve what I'm after?
Last edited by mixart on 30 Mar 2010, 09:30, edited 1 time in total.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 02 May 2008, 08:17

Storing a flag in the database is probably best
Lapo
--
gotoAndPlay()
...addicted to flash games
mixart
Posts: 95
Joined: 08 Aug 2007, 20:32

Postby mixart » 08 May 2008, 23:55

The database part was not the part I was having problems with but the "getting all users in all rooms". I just noticed another thread on this subject so will follow that.

From what I briefly read it look like I would udpate the database with a flag for each user in each room each time a user enters a room (onRoomJoin I think it is).

It would be nice if there was a smartfox class for _server.GetAllUsers - I'm not sure if other people would use this or not but it would be handy for any community that has a game and they need to keep the database updated to say which users are in the game (or how many).
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 09 May 2008, 07:03

The Zone object has methods for returning all Users in all rooms, check the server side docs
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 42 guests