# HG changeset patch # User one # Date 1227551387 -32400 # Node ID 4bb04d5a9bbfdcecd29dbd767d0528045d87078e # Parent e94a3820c13a94e54a7d661d1dbf39787b6f8650 minor fix diff -r e94a3820c13a -r 4bb04d5a9bbf Todo --- a/Todo Tue Nov 25 03:10:08 2008 +0900 +++ b/Todo Tue Nov 25 03:29:47 2008 +0900 @@ -6,6 +6,8 @@ watingCommandInMerge にforwardedCommandManageから入れちゃうと、 User Editor Command と 一周して来てからのCommandを区別できない... +INSERT_USER/DELETE_USERを入れて回避。Editor側の変更も必要になるが、 +まぁ、仕方がない。 Wed Nov 19 19:21:47 JST 2008 diff -r e94a3820c13a -r 4bb04d5a9bbf rep/handler/Editor.java --- a/rep/handler/Editor.java Tue Nov 25 03:10:08 2008 +0900 +++ b/rep/handler/Editor.java Tue Nov 25 03:29:47 2008 +0900 @@ -63,19 +63,16 @@ case REPCMD_DELETE: if (command.eid == REP.MERGE_EID.id){ //マージコマンドが返ってきた - checkDouble(sentList); if(translator.checkMergeConflict(command)){ //マージ中にエディタからの割り込みがあった場合 translator.getMergeAgain(this); } checkEndMerge(); - checkDouble(sentList); return; } else if (command.eid == eid){ // 編集コマンドが一周して来た if (waitingRequired(command)) return; checkReturnedCommand(command); - checkDouble(sentList); return; } @@ -98,44 +95,40 @@ if (next==this) return; // singleton case translator.transSendCmd(command); sendEditorCommand(command); - checkDouble(sentList); return; } - private void checkDouble(List sentList) { - if (sentList.size()==0) return; - int count = 0; - REPCommand f = sentList.get(0); - for(REPCommand c:sentList) { - if (c.eid==f.eid&&c.seq==f.seq) { - count++; - } - } - assert(count==1); - if (true) return; - count = 0; - for(PacketSet c:waitingCommandInMerge) { - for(REPCommand g:sentList) { - if (c.command.eid==g.eid&&c.command.seq==g.seq) { - count++; - } - } - } - assert(count==0); - } +// private void checkDouble(List sentList) { +// if (sentList.size()==0) return; +// int count = 0; +// REPCommand f = sentList.get(0); +// for(REPCommand c:sentList) { +// if (c.eid==f.eid&&c.seq==f.seq) { +// count++; +// } +// } +// assert(count==1); +// if (true) return; +// count = 0; +// for(PacketSet c:waitingCommandInMerge) { +// for(REPCommand g:sentList) { +// if (c.command.eid==g.eid&&c.command.seq==g.seq) { +// count++; +// } +// } +// } +// assert(count==0); +// } private boolean waitingRequired(REPCommand command) { if (hasWaitingCommand()) { // We cannot do this operation before watingCommandQueue. addWaitingCommand(new PacketSet(channel, this, new REPCommand(command))); - checkDouble(sentList); return true; } else if (isMerging()) { addWaitingCommand(new PacketSet(getChannel(), this, new REPCommand(command))); - checkDouble(sentList); return true; } - checkDouble(sentList); ServerMainLoop.logger.writeLog("Editor eid:"+eid+" no waiting"); return false; } @@ -154,7 +147,6 @@ REPCommand keep = new REPCommand(command); sentList.add(keep); ServerMainLoop.logger.writeLog("Editor eid:"+eid+" sentList = "+sentList); - checkDouble(sentList); assert(sentList.size()