Hello,
I'm trying to convert my very small app from Flash Media Server to Red5 (0.62).
So i'm lost with java. If somebody can help me to convert the code, this my
main.asc :
application.replace = function(sChaineInitiale, sSeparateurARemplacer,
sSeparateurAInserer) {
return
(sChaineInitiale.split(sSeparateurARemplacer)).join(sSeparateurAInserer);
}
application.onAppStart = function() {
this.compteur = 0;
this.listeClients = {};
this.listeNoms = "";
this.maitreConnected = false;
}
application.onConnect = function(clientObj, role) {
this.acceptConnection(clientObj);
clientObj.nom = role;
this.listeClients[role] = clientObj;
if (role != "maitre")
{
this.compteur += 1;
this.listeNoms = this.listeNoms + role + ",";
}
else
{
this.maitreConnected = true;
}
if (this.maitreConnected)
{
this.listeClients["maitre"].call("setCounter", null, this.compteur);
this.listeClients["maitre"].call("setUtilisateurs", null,
this.listeNoms);
}
clientObj.changePrenom = function(ancienPrenom, nouveauPrenom) {
application.listeClients[clientObj.nom] = null;
delete application.listeClients[clientObj.nom];
clientObj.nom = nouveauPrenom;
application.listeClients[nouveauPrenom] = clientObj;
application.listeNoms = application.replace(application.listeNoms,
ancienPrenom, nouveauPrenom);
if (application.maitreConnected)
{
application.listeClients["maitre"].call("setUtilisateurs",
null, application.listeNoms);
}
}
clientObj.maj = function() {
for(var i in application.listeClients)
{
application.listeClients[i].call("setMaj", null);
}
}
}
application.onDisconnect = function(clientObj) {
if (clientObj.nom != "maitre")
{
this.compteur -= 1;
this.listeNoms = application.replace(this.listeNoms,
clientObj.nom+",", "");
if (this.maitreConnected)
{
this.listeClients["maitre"].call("setCounter", null,
this.compteur);
this.listeClients["maitre"].call("setUtilisateurs", null,
this.listeNoms);
}
}
else
{
this.maitreConnected = false;
}
this.listeClients[clientObj.nom] = null;
delete this.listeClients[clientObj.nom];
}
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur
Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
main.asc
Description: Binary data
_______________________________________________ Red5 mailing list [email protected] http://osflash.org/mailman/listinfo/red5_osflash.org
