# HG changeset patch # User pin # Date 1161539436 -32400 # Node ID 535f124c2fc38f659cd8beff0e4fa4dff20b4ad6 # Parent 0ac009f1c69e302049c62e06e0ab0478098025d8 *** empty log message *** diff -r 0ac009f1c69e -r 535f124c2fc3 src/remoteeditor/editors/RemoteEditor.java --- a/src/remoteeditor/editors/RemoteEditor.java Mon Oct 23 02:26:26 2006 +0900 +++ b/src/remoteeditor/editors/RemoteEditor.java Mon Oct 23 02:50:36 2006 +0900 @@ -74,11 +74,11 @@ public void packetReceived(RSocketEvent evt) { - final int offset = evt.getOffset(); + final int offset = evt.getLineNo(); final int length = evt.getLength(); final String text = evt.getText(); System.out.println(offset + " : " + length); - if(textOffset != offset){ + if(evt.getCmd() == REP.REP_INSERT_CMD && evt.getSeqId() != 1){ viewer.getTextWidget().getDisplay().syncExec(new Runnable() { public void run() { try { diff -r 0ac009f1c69e -r 535f124c2fc3 src/remoteeditor/network/REP.java --- a/src/remoteeditor/network/REP.java Mon Oct 23 02:26:26 2006 +0900 +++ b/src/remoteeditor/network/REP.java Mon Oct 23 02:50:36 2006 +0900 @@ -23,7 +23,7 @@ int seqid; int textsiz; - static final int REP_INSERT_CMD = 6; + public static final int REP_INSERT_CMD = 6; static final int REP_INSERT_ACK_CMD = 7; static final int REP_JOIN_CMD = 41; static final int REP_JOIN_ACK_CMD = 42; diff -r 0ac009f1c69e -r 535f124c2fc3 src/remoteeditor/network/RSocketEvent.java --- a/src/remoteeditor/network/RSocketEvent.java Mon Oct 23 02:26:26 2006 +0900 +++ b/src/remoteeditor/network/RSocketEvent.java Mon Oct 23 02:50:36 2006 +0900 @@ -3,9 +3,13 @@ public class RSocketEvent { private int length; private int lineno; + private int cmd; private String text; + private int seqid; public RSocketEvent(int cmd, int sid, int eid, int seqid, int lineno, int textsiz, String text) { + this.cmd = cmd; + this.seqid = seqid; this.length = textsiz; this.lineno = lineno; this.text = text; @@ -30,6 +34,14 @@ public String getText(){ return text; } + + public int getCmd() { + return cmd; + } + + public int getSeqId() { + return seqid; + } }