Comment creer un client avec paramètres (role, id, username) sous red5 ?
Creer un objet client
public class Client{
String clientId = null;
String clienName = null;
String clientRole = null;
public String getRole(){
return clientRole;
}
public String getName(){
return clientName;
}
public String getId(){
return clientId;
}
public void setRole(String role){
clientRole = role;
}
public void setName(String name){
clientName = name;
}
public void setId(String id){
clientId = id;
}
}
(…)
public boolean roomConnect(IConnection iconnection, Object params[]){
if(!super.roomConnect(iconnection, params)){
log.info((new StringBuilder()).append(”Application failed to connect room: “).append(iconnection.getScope().getName()).toString());
return false;
}
else{
log.info((new StringBuilder()).append(”Application room connect initiated for room “).append(iconnection.getScope().getName()).append(”: “).toString());
//AJouter les infos du client ici
Client client = new Client();
client.setId(params[0].toString());
client.setName(params[1].toString());
client.setRole(params[2].toString());
iconnection.getClient().setAttribute(”client”, client);
return true
}
}
public boolean roomJoin(IClient iclient, IScope iscope){
/*ICI on accede aux infos de notre client !*/
Client client = ((Client)iclient.getAttribute(”client”));
String clientName = client.getName();
String clientId = client.getId();
String clientRole = client.getRole();
return true;
}
0 Responses to “easyphp et url rewriting”
Leave a Reply