# HG changeset patch # User pin # Date 1198223931 -32400 # Node ID d5cd4d103eea2fb2981f92b222e0a95d9e93cf1f # Parent 54334d83194a21dbb958d0228a6a971518325d17 *** empty log message *** diff -r 54334d83194a -r d5cd4d103eea rep/EditorList.java --- a/rep/EditorList.java Fri Dec 21 16:03:04 2007 +0900 +++ b/rep/EditorList.java Fri Dec 21 16:58:51 2007 +0900 @@ -82,4 +82,16 @@ } } + + public Editor getEditor(String hostport) { + // TODO Auto-generated method stub + for(Editor editor : editorList){ + String hostandport = editor.getHost() + ":" + editor.getPort(); + if(hostport.equals(hostandport)){ + return editor; + } + } + return null; + } + } diff -r 54334d83194a -r d5cd4d103eea rep/SessionManager.java --- a/rep/SessionManager.java Fri Dec 21 16:03:04 2007 +0900 +++ b/rep/SessionManager.java Fri Dec 21 16:58:51 2007 +0900 @@ -192,16 +192,29 @@ sendCommand.setEID(eid2); send.send(sendCommand); }else { - + Editor master = session.getMaster(); + master.send(receivedCommand); } break; case REP.SMCMD_SELECT_ACK: - receivedCommand.setCMD(REP.SMCMD_JOIN_ACK); - receivedCommand.setEID(receivedCommand.eid); - session = sessionlist.getSession(receivedCommand.sid); - session.sendToEditor(receivedCommand); + + String hostport = receivedCommand.string; + Editor editor2 = allEditorList.getEditor(hostport); + if(editor2 != null) { + REPCommand command2 = new REPCommand(); + command2.setCMD(REP.SMCMD_JOIN_ACK); + command2.setEID(receivedCommand.eid); + editor2.send(command2); + }else{ + smList.sendExcept(channel, receivedCommand); + } + + //receivedCommand.setCMD(REP.SMCMD_JOIN_ACK); + //receivedCommand.setEID(receivedCommand.eid); + //session = sessionlist.getSession(receivedCommand.sid); + //session.sendToEditor(receivedCommand); //Editor editor3 = session3.getEditorList().get(0); //REPPacketSend send = new REPPacketSend(editor3.getChannel()); //send.send(repCmd);