· KLDP.org · KLDP.net · KLDP Wiki · KLDP BBS ·
Red5 Install/Red5 Chat

Red5Install/Red5Chat






* download
  • red5chatv2.1.zip

* contents

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 <database name> -u <username> -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<String,User> users = new HashMap<String,User>();
  • 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<String,User> 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
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


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

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()

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

_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
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
                }
}

* 사용되는지 모르겠음.


_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; i<pseudo.length-1; i++) {^M
        var c = pseudo.charAt(i);^M
        x=(ord(c));^M
        if (x<=32)  return false;^M
        if (x>122)  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
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

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


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
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()
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()
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()
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



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<Set<IConnection>> conCollection = scope.getConnections();
<               for (Set<IConnection> 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<Set<IConnection>> conCollection = scope.getConnections();
<               log.debug("send_private to "+sendToId+" "+msg);
<               for (Set<IConnection> 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<Set<IConnection>> conCollection = scope.getConnections();
<               log.debug("watches "+UserId);
<               for (Set<IConnection> 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<Set<IConnection>> conCollection = scope.getConnections();    
<                 for (Set<IConnection> 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<Set<IConnection>> conCollection = scope.getConnections();    
<                 for (Set<IConnection> 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<Set<IConnection>> conCollection = scope.getConnections();    
<                 for (Set<IConnection> 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&#65533;j&#65533; dans la liste
---
>               // cherche si user d&#65533;j&#65533; dans la liste
488c393
<                       application.rejectConnection(newClient, {msg:"Nom d&#65533;j&#65533; utilis&#65533;, essayez de nouveau."});
---
>                       application.rejectConnection(newClient, {msg:"Nom d&#65533;j&#65533; utilis&#65533;, essayez de nouveau."});

ID
Password
Join
Troglodytism does not necessarily imply a low cultural level.


sponsored by andamiro
sponsored by cdnetworks
sponsored by HP

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2011-12-16 14:49:08
Processing time 0.0137 sec