My basic flash code:
import mx.utils.Delegate;
var nc:NetConnection = new NetConnection();
nc.disconnect = Delegate.create(this,onClientLeave);
function onClientLeave(clientID:Number){
trace("user "+clientID+" has left...");
}
and that's all
2007/3/9, lionel breduillieard <[EMAIL PROTECTED]>:
> What I do when a client Leave
>
> public void appLeave(IConnection conn)
> {
> super.appLeave(client, scope);
> log.info("----- Client's Leaving: " + client.getId() +" from "+scope);
> IConnection current = Red5.getConnectionLocal();
> Iterator<IConnection> it = scope.getConnections();
> while (it.hasNext()){
> try{
> IConnection co = it.next();
> if (co.equals(current)) {
> continue;
> }
> IServiceCapableConnection service =
> (IServiceCapableConnection) co;
> if (co instanceof IServiceCapableConnection) {
> service.invoke("onClientLeave",new
> Object[] {
> conn.getClient().getId() }, this);
> }
> }catch(NoSuchElementException e){
> log.debug(e);
> }
> }
> }
>
>
>
>
> 2007/3/9, muriel <[EMAIL PROTECTED]>:
> > this should do the trick on ther serverside (thank you dominick):
> >
> > /**
> > * Invokes method on client
> > *
> > * @param conn Connection
> > * @param method Method name
> > * @param params Set of params to pass
> > */
> > private boolean invoke(IConnection conn, String method, Object[]
> > params) {
> > if (conn instanceof IServiceCapableConnection) {
> > IServiceCapableConnection service =
> > (IServiceCapableConnection) conn;
> > service.invoke(method, params);
> >
> > return true;
> > }
> >
> > return false;
> > }
> >
> >
> > call with invoke(connection, "clientLeft", params) and add the leaving
> > client-info in the params.
> >
> > on the client-side you then need to implement a "clientLeft" method in
> > the Connection class.
> >
> > hope this helps,
> > muriel
> >
> >
> > > On 09/03/07, Jean-Philippe DELAVALLADE <[EMAIL PROTECTED]> wrote:
> > >>
> > >> public void appLeave(IClient client,
> > >> IScope app){
> > >> log.info("Le client s'est deconnecte " + client.getId());
> > >> }
> > >>
> > >> Hi,
> > >> how i can use this serveside code in Flash ?
> > >> I would like to know IN FLASH when client leave application
> > >> Thanks
> > >> JP
> > >>
> > >> _______________________________________________
> > >> Red5 mailing list
> > >> [email protected]
> > >> http://osflash.org/mailman/listinfo/red5_osflash.org
> > >>
> > >>
> > >
> > >
> > > ------------------------------------------------------------------------
> > >
> > > _______________________________________________
> > > Red5 mailing list
> > > [email protected]
> > > http://osflash.org/mailman/listinfo/red5_osflash.org
> > >
> >
> >
> > _______________________________________________
> > Red5 mailing list
> > [email protected]
> > http://osflash.org/mailman/listinfo/red5_osflash.org
> >
>
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org