Mercurial > hg > RemoteEditor > REPSessionManager
changeset 69:9dd7471b771a
*** empty log message ***
author | pin |
---|---|
date | Sat, 17 Nov 2007 05:27:24 +0900 |
parents | 55be16853449 |
children | 248d774be113 |
files | rep/SessionManager.java |
diffstat | 1 files changed, 14 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/rep/SessionManager.java Fri Nov 16 17:25:32 2007 +0900 +++ b/rep/SessionManager.java Sat Nov 17 05:27:24 2007 +0900 @@ -125,6 +125,8 @@ private void manager(SocketChannel channel, REPCommand repCmd) { if(repCmd == null) return; + Editor editor; + Session session; switch(repCmd.cmd){ case REP.SMCMD_JOIN: @@ -147,10 +149,10 @@ break; case REP.SMCMD_PUT: - Editor editor = new Editor(channel); + editor = new Editor(channel); editor.setEID(1); editor.setName(repCmd.string); - Session session = new Session(editor); + session = new Session(editor); session.setOwner(true); session.addEditor(editor); sessionlist.addSession(session); @@ -202,13 +204,10 @@ case REP.SMCMD_SELECT_ACK: repCmd.setCMD(REP.SMCMD_JOIN_ACK); repCmd.setEID(repCmd.eid); - Session session3 = sessionlist.getSession(repCmd.sid); - Editor editor3 = session3.getEditorList().get(0); - REPPacketSend send = new REPPacketSend(editor3.getChannel()); - send.send(repCmd); - break; - - case REP.SMCMD_SESSION: + session = sessionlist.getSession(repCmd.sid); + //Editor editor3 = session3.getEditorList().get(0); + //REPPacketSend send = new REPPacketSend(editor3.getChannel()); + //send.send(repCmd); break; case REP.SMCMD_SM_JOIN: @@ -235,12 +234,12 @@ //sessionlist.addEditor(channel, sessionID2, repCmd); //sessionmanagerGUI.setComboSession(sessionID2, repCmd.string); //ComboBox‚ÉSession‚ð’ljÁ SessionXMLDecoder decoder = new SessionXMLDecoder(repCmd.string); - Editor editor1 = new Editor(channel); - editor1.setName(repCmd.string); - Session session1 = new Session(editor1); - session1.setSID(repCmd.sid); - sessionlist.addSession(session1); - sessionmanagerGUI.setComboSession(session1.getSID(), session1.getName()); + editor = new Editor(channel); + editor.setName(repCmd.string); + session = new Session(editor); + session.setSID(repCmd.sid); + sessionlist.addSession(session); + sessionmanagerGUI.setComboSession(session.getSID(), session.getName()); if(isMaster){ repCmd.setCMD(REP.SMCMD_UPDATE_ACK); smList.sendToSlave(repCmd);