[Red5] Maintain list of members in a chat room

Sebastien virtual.user at gmail.com
Sat Nov 24 11:32:23 PST 2007


This method seem to work thanks,

However,  the usernameVect don't add username of other client, it just erase
the first username with the new one.
How can I manage that ?  (My so content only the last client username)

Thanks


On Nov 13, 2007 5:06 PM, oke _ <loqi901 at yahoo.com> wrote:

> Yes, this is a java Vector object (though I could have used any
> Collections object ), and it is *stored in* a shared object on the Red5
> server - it's not the SO itself.
> You can use the SO to store many different objects - you simply store and
> retrieve them as "attributes" of the SO. (See code snippet below:)
>
> /**
>  *  this method appends a user's name to the client-side username
>  *  list object on each connected browser
>  */
> public synchronized void updateClientLists(String szUserName)
> {
>         IConnection current = Red5.getConnectionLocal();
>         IScope myScope = current.getScope();
>
>         ISharedObject mySO = getSharedObject(myScope, "roomSO");
>
>         // now update roomlist shared obj...
>         Vector<String> usernameVect =
> (Vector<String>)mySO.getAttribute("UsrList");
>         usernameVect.addElement(szUserName);
>
>        // finally, update the SO
>        mySO.setAttribute("UsrList", usernameVect);
>         :
>         :
>         :
>         //  client-side update code goes here (see previous email
> postings)
>
>
> *Sebastien <virtual.user at gmail.com>* wrote:
>
>
> Ok I made my homework and setup my development environment and read a lot
> of tutorials for java and red5 ;)
>
>
> I have small question about the "( '*usernameVect*' is a Vector
> representation of the shared object containing the names):"
> What do you mean with "Vector representation of the share object?"  The
> usernameVect is the name of my SO ?
>
> Thanks
>
> Sebas
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/red5_osflash.org/attachments/20071124/c1de9e0c/attachment.html 


More information about the Red5 mailing list