== Red5Install/Red5Chat == * /ActionScript * /DesignNew * 2011.12.16 * passing variables to swf * http://flashpanoramas.com/player/parameters * http://circlecube.com/2008/05/flashvar-tutorial/ * 2011.12.01 * http://www.red5chat.com/index.html * download * red5chatv2.1.zip * contents {{{#!vim tcheun@enk:~/chat$ ls -R .: FLA Install.txt JAVA-RED5 PHP red5chatv2.1.zip ./FLA: IconCellRenderer.as User.as css.as RemoveCellRenderer.as chat.as red5Chat.fla ./JAVA-RED5: red5-web.properties red5-web.xml src web.xml ./JAVA-RED5/src: User.as backupchat.txt chat demo.txt ./JAVA-RED5/src/chat: Application.java ./PHP: Connections create_tables.sql infouser.php testlogin.php ./PHP/Connections: con1.php }}} * testlogin.php, infouser.php * red5Chat.fla ¿¡¼­ »ç¿ë * _root.authentificateURL = "http://"+_root.IP+"/red5chat/testlogin.php"; * _root.infoUserURL="http://"+_root.IP+"/red5chat/infouser.php"; * con1.php * testlogin.php, infouser.php ¿¡¼­ »ç¿ëÇÔ. * DB °ü·Ã * red5chat database ¸¦ »ý¼ºÇØ¾ß ÇÔ * mysql -D -u -p < script.sql * flash ¸¦ ÀÌ¿ëÇÏ¿© swf ÆÄÀÏ°ú html ÆÄÀÏ »ý¼º * ãÀ» ¼ö ¾ø´Â ±Û²Ã * Arial Baltic * HandelGothic BT * PixelSix00 * Smilies-Normal * mysql À» ÀÌ¿ëÇÏ¿© »ç¿ëÀÚ µî·Ï * security ¸¦ »ý°¢ÇÏ¿© Á¶»çÇÒ °Í * ¿ì¼±Àº test * http ¼­¹ö°¡ ÇÊ¿äÇÑ°¡? * html ÆÄÀÏÀ» ¼­¹ö¾øÀÌ »ç¿ëÇصµ µÇÁö ¾Ê³ª? * red5 ¼­¹ö´Â ÇÊ¿äÇÔ. * Application À» ÄÄÆÄÀÏÇϱâ À§ÇØ eclipse ¸¦ »ç¿ëÇؾ߸¸ Çϳª? * build.xml À» »ç¿ëÇؼ­ Çصµ µÉ °Í °°±â´Â Çѵ¥..... * °øºÎÇØ¾ß ÇÒ °ÍÀÌ ¸¹À» °Í °°Àºµ¥.... * ¿ì¼± eclipse ¸¦ »ç¿ëÇÏ¿© ¸¸µéÀÚ. * red5 server ¿Í mysql ¸¸ ¼³Ä¡µÈ ¼­¹ö°¡ ¿ì¼± ÇÊ¿äÇÔ. === 2011.12.02 === * On ubuntu * fsarchiver -v restfs sda9-firmware.fsa id=0,dest=/dev/sda9 * synaptic * red5-server * error * synaptic - ÆíÁý - ÆÐÅ°Áö Á¤º¸ »õ·Î °íħ * red5-server * mysql-server * mysql-client * Application.java * public class Application extends ApplicationAdapter * public HashMap users = new HashMap(); * * public void disconnectUser(String connectionID) * public boolean connect(IConnection conn, IScope scope, Object[] params) * public void disconnect(IConnection conn, IScope scope) * public boolean appJoin(IClient client, IScope scope) * public void send_to_all_iterate() * public HashMap getUserList() * public void send_public(String from_pseudo, String msg) * public void startTalk(String whoTalks) * public void stopTalk(String whoTalks) * public int getNumberUsersConnected() * public void requestHand(String whoRequests) * public void send_private_id(String sendToId,String fromPseudo, String msg) * public void watches(String UserId) * public void ban(String _id) * public void kick(String _id) * public void send_private(String fromPseudo, String DestinationID,String msg) * public void changeProfil(String webcam,String role, String onlineStatus) * public Boolean appStart() * public boolean roomStart(IScope room) * public String whoami() * public void callclient() * public boolean appConnect( IConnection conn , Object[] params ) * public void appDisconnect( IConnection conn) * public void appStop() * nc.call {{{#!vim tcheun@enk:~/chat/FLA$ grep nc.call chat.as nc.call("closePrivateChat",null,myID,_root.privateChatterID); nc.call("stopPrivateInvitation",null,myID,_root.privateChatterID); nc.call("acceptInvitation",null,_root.user.pseudo,_root.user.id,postedBy,postedByID); nc.call("requestPrivate",null,_root.user.pseudo,_root.user.id,whoId); nc.call("changeProfil",null,_root.user.webcam,_root.user.role,_root.user.onlineStatus); //nc.call("changeStatus",null,myuser.pseudo,2); nc.call("startTalk",null,_root.user.pseudo); nc.call("stopTalk",null,_root.user.pseudo); nc.call("kick",null,who); nc.call("ban",null,who); nc.call("requestHand",null,_root.user.pseudo); nc.call("stopTalk",null,pseudo); nc.call("send_private",null,fromPseudo,destinationID,msg); nc.call("send_public",null,_root.user.pseudo,msg); nc.call("getUserList", new getUserListCallBack()); }}} * ´ÙÀ½ÀÇ 4°³ function Àº server ¿¡ ¾øÀ½ * nc.call("closePrivateChat",null,myID,_root.privateChatterID); * nc.call("stopPrivateInvitation",null,myID,_root.privateChatterID); * nc.call("acceptInvitation",null,_root.user.pseudo,_root.user.id,postedBy,postedByID); * nc.call("requestPrivate",null,_root.user.pseudo,_root.user.id,whoId); === flash === * timeline ¿¡¼­ actions layer ¿¡ ù¹ø° frame ÀÇ action script {{{#!vim stop(); onEnterFrame = function () { var loaded = Math.ceil(_root.getBytesLoaded()*100/ _root.getBytesTotal()); _root.loading_txt.text="Loading:"+loaded+"%"; if (_root.getBytesLoaded() == _root.getBytesTotal()) { delete onEnterFrame; play(); } }; }}} * preloader ÀÓ * red5Chat.swf ¸¦ ·ÎµåÇÏ´Â Á¤µµ¸¦ Ç¥½ÃÇÔ * timeline ¿¡¼­ actions layer ¿¡ µÎ¹ø° frame ÀÇ action script {{{#!vim import User; Stage.scaleMode = "exactFit"; ASSetPropFlags(Object.prototype, "copyProperties", 1); #include "css.as" #include "chat.as" _root.IP="127.0.0.1"; _root.port = 1935; _root.room="chat"; _root.debug = false; if (_root.debug == true) { _root.IP = "127.0.0.1"; _root.port = "1935"; _root.pseudo="yarek"; _root.sexe="f"; } _root.rtmpString = "rtmp://"+_root.IP+':'+_root.port+"/"+_root.room; _root.infos = true; _root.userMustPublishWebcam = true; _root.colorText = '#00000'; _root.playSounds = true; _root.serverMessages = true; _root.showToolTips = true; _root.listenToTalk=true; _root.individualPrivateMessages = true; _root.showAdminsAsNormalUsers = true; // displays infos such: "user has joined the chat": //attachAudio _root.authentificate = false; _root.showMyWebcam = false; _root.authentificateURL = "http://"+_root.IP+"/red5chat/testlogin.php"; _root.infoUserURL = "http://"+_root.IP+"/red5chat/infouser.php"; // this url is to connect to your database page testAutoconnect.php // we will provide the following information $POST["username"] and $POST["password"] // if the result ?result=ok, the user is AUTHETIFCAITED, else it is not ! // look at the testAutoconnect.php provided with the red5chat and edit it ! // //LoadVars _root.autoConnect = false; // if you put the autoconnect to true, make sure to provide the params // pseudo=nickname, status= online, offline..., role=normal, admin..., sexe=m,f,a, // room = name of room, world = world ! // if autoconnect is true, the the login panel will not be shown // PRELOADER init_rooms(); //init_chat(); stop(); }}} * _root.authentificate = false; À» true ·Î º¯°æ === chat.as === * init_rooms() {{{#!vim function init_rooms() { login_msg(""); _root.Application._visible=false; _root.login._visible=false; TransitionManager.start(rooms_mc, {type:Squeeze, direction:Transition.IN, duration:2, easing:Elastic.easeOut, dimension:1}); } }}} * rooms layer ¸¦ ¼±ÅÃÇÏ°í property¸¦ º¸¸é room_mc µ¿¿µ»ó Ŭ¸³ÀÌ ¼±ÅÃµÊ * ´õºí Ŭ¸¯Çϸé layer1, layer2, mages, txt layer ÀÌ º¸ÀÓ * mages ¸¦ ¼±ÅÃÇÑ ÈÄ °¢°¢ÀÇ button À» ¼±ÅÃÇÏ¸é ´ÙÀ½ÀÇ button ¸íÀÌ º¸ÀÓ * roomFriend_btn * roomLove_btn * roomHot_btn * layer2 ¿¡¼­ Terms of Use ¹®ÀÚ¿­À» ¼±ÅÃÇϸé * termsOfUse_btn {{{#!vim _root.Application.rooms_mc._visible = false; _root.rooms_mc.roomLove_btn.onPress=enterLoveRoom; _root.rooms_mc.roomFriend_btn.onPress=enterFriendRoom; _root.rooms_mc.roomHot_btn.onPress=enterHotRoom; _root.rooms_mc.termsOfUse_btn.onPress=termsOfUse; function termsOfUse() { getURL("termsOfUse.php","_new"); } function enterFriendRoom() { _root.room="chat"; _root.rtmpString = "rtmp://"+_root.IP+':'+_root.port+"/"+_root.room; init_chat(); TransitionManager.start(rooms_mc, {type:Squeeze, direction:1, duration:2, easing:Elastic.easeIn, dimension:1}); } function enterLoveRoom() { _root.room="chat"; _root.rtmpString = "rtmp://"+_root.IP+':'+_root.port+"/"+_root.room; init_chat(); TransitionManager.start(rooms_mc, {type:Squeeze, direction:1, duration:2, easing:Elastic.easeIn, dimension:1}); } function enterHotRoom() { _root.room="chat"; _root.rtmpString = "rtmp://"+_root.IP+':'+_root.port+"/"+_root.room; init_chat(); TransitionManager.start(rooms_mc, {type:Squeeze, direction:1, duration:2, easing:Elastic.easeIn, dimension:1}); } }}} * init_chat {{{#!vim function init_chat() { // if autoconnect =true, make sure to provide these parameters: // pseudo=nickname, status= online, offline..., role=normal, admin..., sexe=m,f,a, // room = name of room, world = world ! _root.login.sex_mc._visible=false; if (_root.authentificate==false) { _root.login.password_txt._visible=false; _root.login.password_label._visible=false; _root.login.sex_mc._visible=true; _root.Application.info_btn._visible=false; if (_root.pseudo==undefined) _root.pseudo=""; if (_root.sexe==undefined) _root.sexe="m"; if (_root.sexe=="m") { _root.login.male_rb.selected=true; } else { _root.login.female_rb.selected=true; } _root.login.login_txt.text=_root.pseudo; } TransitionManager.start(login, {type:Squeeze, direction:Transition.IN, duration:2, easing:Elastic.easeOut, dimension:1}); // nc.connect(_root.rtmpString,"connectTemp"); trace("connecting as connectTemp"); disable_GUI(); initPeopleGrid(); if (_root.autoConnect==true) { //_root.login._visible=false; TransitionManager.start(login, {type:Squeeze, direction:1, duration:1, easing:Elastic.easeIn, dimension:1}); login_chat(); } else { //no auto connect } } }}} * »ç¿ëµÇ´ÂÁö ¸ð¸£°ÚÀ½. {{{#!vim _root.login.login_txt.addEventListener("enter",loginKeyDown);^M _root.login.password_txt.addEventListener("enter",loginKeyDown);^M function loginKeyDown() {^M if (Key.isDown(Key.ENTER)) {^M _root.pseudo=_root.login.login_txt.text;^M _root.password=_root.login.password_txt.text;^M login_chat();^M } ^M } function checklogin(pseudo) {^M if (pseudo.length<2) return false;^M if (pseudo.length>20) return false;^M for (i=0; i122) return false;}^M return true ^M }^M ^M ^M _root.login.login_pb.onPress=function() { ^M _root.pseudo=_root.login.login_txt.text;^M _root.password=_root.login.password_txt.text;^M if (checklogin(_root.pseudo)) {^M login_chat();^M }^M }^M }}} * initPeopleGrid {{{#!vim function initPeopleGrid() { _root.Application.people_grd.removeAllColumns(); _root.Application.people_grd.removeAll(); _root.Application.people_grd.columnNames = ["webcam", "sex", "username"]; //customize columns var col:mx.controls.gridclasses.DataGridColumn; col = _root.Application.people_grd.getColumnAt(0); col.width = 30; col.headerText = "Cam"; col.cellRenderer = "IconCellRenderer"; col["iconFunction"] = peopleIconFunction; // col = _root.Application.people_grd.getColumnAt(1); col.width = 30; col.headerText = "Sex"; col.cellRenderer = "IconCellRenderer"; col["iconFunction"] = peopleIconFunction; // col = _root.Application.people_grd.getColumnAt(2); col.width = 250; col.headerText = "Username"; // -------------------- // Style for DataGrid // var styleObj:CSSStyleDeclaration = new mx.styles.CSSStyleDeclaration(); styleObj.styleName = "myStyle"; styleObj.fontFamily = "Verdana"; styleObj.fontWeight = "normal"; styleObj.fontSize = 10; //bold styleObj.color = 0x334455; _global.styles["myStyle"] = styleObj; _root.Application.people_grd.setStyle("styleName", "myStyle"); _root.Application.people_grd.setStyle("alternatingRowColors", Array(0xFFFFFF, 0xECF2F8)); _root.Application.people_grd.setRowHeight(24); _root.Application.people_grd.setStyle("hGridLines", false); _root.Application.people_grd.setStyle("hGridLineColor", 0xA2A6A9); _root.Application.people_grd.setStyle("vGridLines", false); _root.Application.people_grd.resizableColumns = false; //people_grd.setVScrollPolicy("off"); // themeColor //people_grd.setStyle("themeColor", "haloBlue"); // Header // No header in this example _root.Application.people_grd.setShowHeaders(true); } }}} * login_chat {{{#!vim function login_chat() { // _root.login.login_pb.enabled=false; _root.user=new User(_root.pseudo,_root.webcam,_root.password,"true",_root.role, _root.sex,_root.room,_root.world); //trace("_root.user.onlinseStatus="+_root.user.onlineStatus); //trace("_root.user.pseudo="+_root.user.pseudo); if (_root.user.pseudo=="") { login_msg("UserName is not valid !"); _root.login.login_pb.enabled=true; return; } if (_root.authentificate==true) { if (_root.user.password=="") { login_msg("Password is not valid !"); _root.login.login_pb.enabled=true; return; } login_msg(""); // authetificate : please check _root.authentificateURL and testlogin.php var myVars = new LoadVars(); myVars.pseudo = _root.user.pseudo; myVars.password = _root.user.password; //trace("*pseudo:"+myVars.pseudo+" pass="+myVars.password); //trace("authentificateURL="+_root.authentificateURL); myVars.sendAndLoad(_root.authentificateURL, myVars, ""); myVars.onLoad = function(success) { trace("myVars.status="+myVars.status); if (myVars.status=="ok") { _root.user.sex=myVars.sex; _root.user.role=myVars.role; //trace("myVars.sex="+myVars.sex); connect_chat(); } else { login_msg("Incorrect User or password "); _root.login.login_pb.enabled=true; return; } } } else { // no authentification ! if (_root.role!="a") _root.role="n"; _root.user.role=_root.role; _root.user.sex="m"; if (_root.login.female_rb.selected==true) _root.user.sex="f"; connect_chat(); } } }}} * connect_chat {{{#!vim function connect_chat() { //trace("connecting to chat"); //params = pseudo status role sexe room world //trace(_root.rtmpString+"-"+_root.user.pseudo+"-"+_root.user.status+ "-"+_root.user.role+"-"+_root.user.sex+"-"+_root.user.room+"-"+_root.user.world); _root.user.webcam=!(Camera.get().muted); trace("_root.user.webcam="+_root.user.webcam); nc.connect(_root.rtmpString,_root.user.pseudo,_root.user.webcam,_root.user.onlineStatus, _root.user.role,_root.user.sex,_root.user.room,_root.user.world); nc.onStatus = function(info){ //trace("info.code="+info.code); if (info.code == "NetConnection.Connect.Success") { enter_chat(); } else if(info.code=="NetConnection.Connect.Rejected") { login_msg("UserName already in use !"); _root.login.login_pb.enabled=true; return; } else { //login_msg("**UserName already in use !"); _root.login.login_pb.enabled=true; return; } }; } }}} * _root.login.login_pb.enabled=true; * login_pb ´Â enter button ÀÇ symbol ÀÓ. === enter_chat === * enter_chat {{{#!vim function enter_chat() { if(_root.Application.myMenuBar.initiated!=true) initMenu(); getUserList(); // get list of connected users //_root.login._visible=false; TransitionManager.start(login, {type:Squeeze, direction:1, duration:1, easing:Elastic.easeIn, dimension:1}); enable_GUI(); publishMyWebcam(); } }}} * initMenu() {{{#!vim function initMenu() {^M _root.Application.myMenuBar.initiated=true;^M var menu1 = _root.Application.myMenuBar.addMenu("My status");^M var menu2 = _root.Application.myMenuBar.addMenu("Rooms");^M var menu = _root.Application.myMenuBar.addMenu("Parameters");^M menu1.addMenuItem({type:"check", selected:_root.online, label:"OnLine", instanceName:"online"});^M menu2.addMenuItem({label:"Change Rooms", instanceName:"changeRoom"});^M menu.addMenuItem({label:"Show my webcam", instanceName:"showMyWebcam"}); menu.addMenuItem({type:"check", selected:_root.listenToTalk, label:"Listen to Talks", instanceName:"listenToTalk"}); ^M .... if (_root.user.role=="a") menu.addMenuItem({label:"Admin tools", instanceName:"admintools"});^M var menulisten = new Object();^M menu.addEventListener("change", menulisten);^M menu1.addEventListener("change", menulisten);^M menu2.addEventListener("change", menulisten);^M menulisten.change = function(evt) {^M var menu = evt.menu;^M var item = evt.menuItem;^M if (item.attributes.instanceName == "changeRoom") {^M init_rooms(); ^M } ^M if (item.attributes.instanceName == "listenToTalk") {^M _root.listenToTalk=item.attributes.selected;^M if (_root.listenToTalk==true) closeTalk();^M _root.Application.talk_btn._visible=item.attributes.selected;^M _root.Application.askHand_mc._visible=item.attributes.selected;^M } ^M if (item.attributes.instanceName == "online") {^M _root.user.onlineStatus=item.attributes.selected; ^M changeMyProfil();^M } ^M if (item.attributes.instanceName == "showMyWebcam") {^M _root.Application.av1._visible=true;^M } ^M if (item.attributes.instanceName == "sounds") {^M _root.playSounds=item.attributes.selected; ^M }^M if (item.attributes.instanceName == "serverMessages") {^M _root.serverMessages=item.attributes.selected;^M }^M if (item.attributes.instanceName == "individualPrivateMessages") {^M _root.individualPrivateMessages=item.attributes.selected;^M trace("_root.individualPrivateMessages="+_root.individualPrivateMessages);^M } ^M if (item.attributes.instanceName == "admintools") {^M _root.Application.admintools_window._visible=true;^M } ^M ^M } ^M } }}} * menu ´Â My status, Rooms, Parameters ÀÓ * My status ¸¦ click Çϸé, Online Ç׸ñÀÌ ³ª¿È * Rooms ¸¦ click Çϸé, changeRoom Ç׸ñÀÌ ³ª¿È * Parameters ¸¦ click Çϸé, À§ÀÇ Ç׸ñµéÀÌ ³ª¿È. * user °¡ admin ÀÎ °æ¿ì Admin tools Ç׸ñÀÌ Ãß°¡µÇ¾î ³ª¿È * getUserList() {{{#!vim function getUserList() {^M trace("getUserList called");^M function getUserListCallBack() {^M trace("getUserListCallBack called");^M this.onResult = function(_users) {^M for (_user in _users) {^M trace("pseudo:"+_users[_user].pseudo+" webcam:"+_users[_user].webcam);^M _root.Application.people_grd.addItem({label:_users[_user].pseudo, webcam:_users[_user].webcam, username:_users[_user].pseudo, data:_users[_user].pseudo, sex:_users[_user].sex, role:_users[_user].role, onlineStatus:_users[_user].onlineStatus, id:_users[_user].id});^M if (_root.user.pseudo==_users[_user].pseudo) _root.user.id=_users[_user].id; }^M updateNumberUsers();^M };^M ^M }^M nc.call("getUserList", new getUserListCallBack());^M } }}} * server ÀÇ getUserList ¸¦ call ÇÔ. * publishMyWebcam() {{{#!vim function publishMyWebcam() {^M //mic^M volumeID = setInterval(displayVolume, 50);^M mic = Microphone.get();^M mic.setRate(11);^M mic.useEchoSuppression=true;^M // and cam!^M cam = Camera.get();^M cam.setMode(160, 120, 5);^M cam.setQuality(0, 80);^M if (cam.muted==true) {^M if (_root.userMustPublishWebcam==true) System.showSettings(0);^M } ^M if (Camera.names.length==0) {^M trace("no webcam found!");^M } else {^M //nc.call("changeStatus",null,myuser.pseudo,2);^M trace("webcam found");^M }^M cam.onStatus = function(infoObj:Object) {^M switch (infoObj.code) {^M case 'Camera.Muted' :^M trace("Camera access is denied");^M System.showSettings(0);^M _root.user.webcam=false;^M changeMyProfil();^M break;^M case 'Camera.Unmuted' :^M trace("Camera access granted");^M _root.user.webcam=true;^M changeMyProfil();^M break;^M }^M }^M ^M _root.Application.av1.outgoing.attachVideo(cam); ^M out_stream = new NetStream(nc); ^M out_stream.attachVideo(cam);^M out_stream.attachAudio(mic); ^M out_stream.publish(_root.user.pseudo, "live"); ^M } }}} * chat.as * var nc:NetConnection = new NetConnection(); * function termsOfUse() * _root.rtmpString = "rtmp://"+_root.IP+':'+_root.port+"/"+_root.room; * init_chat(); * init_chat() * nc.connect(_root.rtmpString,"connectTemp"); * connect_chat() * nc.connect(_root.rtmpString,_root.user.pseudo,_root.user.webcam,_root.user.onlineStatus, _root.user.role,_root.user.sex,_root.user.room,_root.user.world); * enter_chat(); * enter_chat() * publishMyWebcam(); * publishMyWebcam() * out_stream = new NetStream(nc); * out_stream.publish(_root.user.pseudo, "live"); === diff Application.java === {{{#!vim tcheun@enk:~/Chat/chat/src/org/red5/core$ diff Application.java /home/tcheun/chat/JAVA-RED5/src/chat/Application.java 1c1 < package org.red5.core; --- > package chat; 8c8,12 < --- > import org.red5.server.api.so.ISharedObject; > import org.red5.server.api.ScopeUtils; > import org.red5.server.api.so.ISharedObjectService; > import org.red5.server.api.*; > import org.red5.server.api.scheduling.*; 9a14 > import org.red5.server.api.service.ServiceUtils; 10a16 > import org.red5.server.api.service.IPendingServiceCallback; 16a23,25 > import java.util.HashMap; > // > // 157d165 < /* 168,181d175 < */ < Collection> conCollection = scope.getConnections(); < for (Set cons : conCollection) { < for (IConnection conn : cons) { < if (conn != null) { < //do something with the connection < if (conn.equals(current)) continue; < if (conn instanceof IServiceCapableConnection) { < ((IServiceCapableConnection) conn).invoke("someClientMethod", new Object[]{"Hello World"}); < log.debug("sending notification to "+conn); < } < } < } < } 238d231 < /* 253,270d245 < */ < Collection> conCollection = scope.getConnections(); < log.debug("send_private to "+sendToId+" "+msg); < for (Set cons : conCollection) { < for (IConnection conn : cons) { < if (conn != null) { < //do something with the connection < String id=conn.getClient().getId(); < if (!(sendToId.equals(id))) continue; < log.info("receive_private "+sendToId+" "+msg); < if (conn instanceof IServiceCapableConnection) { < ((IServiceCapableConnection) conn).invoke("receive_private", new Object[]{msg}); < log.info("received_private "+sendToId+" "+msg); < return; < } < } < } < } 279d253 < /* 293,310d266 < */ < Collection> conCollection = scope.getConnections(); < log.debug("watches "+UserId); < for (Set cons : conCollection) { < for (IConnection conn : cons) { < if (conn != null) { < //do something with the connection < String id=conn.getClient().getId(); < < if (!(UserId.equals(id))) continue; < if (conn instanceof IServiceCapableConnection) { < ((IServiceCapableConnection) conn).invoke("watches", new Object[]{uid}); < log.info(uid+" is watching "+UserId); < return; < } < } < } < } 316d271 < /* 328,342d282 < */ < Collection> conCollection = scope.getConnections(); < for (Set cons : conCollection) { < for (IConnection conn : cons) { < if (conn != null) { < //do something with the connection < String id=conn.getClient().getId(); < if (!(_id.equals(id))) continue; < if (conn instanceof IServiceCapableConnection) { < ((IServiceCapableConnection) conn).invoke("IhaveBeenBanned", new Object[]{_id}); < log.info("ban "+_id); < } < } < } < } 348d287 < /* 360,374d298 < */ < Collection> conCollection = scope.getConnections(); < for (Set cons : conCollection) { < for (IConnection conn : cons) { < if (conn != null) { < //do something with the connection < String id=conn.getClient().getId(); < if (!(_id.equals(id))) continue; < if (conn instanceof IServiceCapableConnection) { < ((IServiceCapableConnection) conn).invoke("IhaveBeenKicked", new Object[]{_id}); < log.info("kick "+_id); < } < } < } < } 381d304 < /* 398,416d320 < */ < Collection> conCollection = scope.getConnections(); < for (Set cons : conCollection) { < for (IConnection conn : cons) { < if (conn != null) { < //do something with the connection < String id=conn.getClient().getId(); < log.debug("id="+id+ " senTO="+DestinationID); < //if (sendTo.equals(id)) log.info("PAREIL"); else log.info("differents"); < < if (!(DestinationID.equals(id))) continue; < log.info("receive_private "+DestinationID+" "+msg); < if (conn instanceof IServiceCapableConnection) { < ((IServiceCapableConnection) conn).invoke("receivePrivateMsg", new Object[]{fromPseudo, msg}); < log.info("received_private "+DestinationID+" "+msg); < } < } < } < } 465a370 > IScope scope = conn.getScope(); 485c390 < // cherche si user d�j� dans la liste --- > // cherche si user d�j� dans la liste 488c393 < application.rejectConnection(newClient, {msg:"Nom d�j� utilis�, essayez de nouveau."}); --- > application.rejectConnection(newClient, {msg:"Nom d�j� utilis�, essayez de nouveau."}); }}}