ictk-cvs Mailing List for ictk - Internet Chess ToolKit
chess library in java, PGN, FEN, ICS
Brought to you by:
jvarsoke
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(172) |
Sep
(30) |
Oct
(4) |
Nov
|
Dec
(5) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(6) |
Feb
(2) |
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Jason V. <jva...@us...> - 2004-04-07 20:09:27
|
Update of /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15451/src/ictk/boardgame/chess/net/ics Modified Files: ICSProtocolHandler.java Log Message: [fics] isConnected() was reporting an incorrect value on socket.closed() FICSProtocolHandler also socket.closes() on exit; it was commented out for some reason. Index: ICSProtocolHandler.java =================================================================== RCS file: /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics/ICSProtocolHandler.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ICSProtocolHandler.java 7 Dec 2003 20:11:21 -0000 1.5 --- ICSProtocolHandler.java 7 Apr 2004 19:56:24 -0000 1.6 *************** *** 67,70 **** --- 67,73 ---- protected boolean isLoggedIn; + /** if true, debug info will appear in the the output stream */ + protected boolean debugParser; + /** connection listeners interested in the status of the socket */ protected ICSConnectionListener[] conSubscribers; *************** *** 172,176 **** if (socket == null) return false; ! return socket.isClosed(); } --- 175,179 ---- if (socket == null) return false; ! return !socket.isClosed(); } *************** *** 183,186 **** --- 186,193 ---- } + public void setDebugParser (boolean t) { + debugParser = t; + } + /* setEventRouter *********************************************************/ /** sets the object to do the event routing for this connection. By default |
From: Jason V. <jva...@us...> - 2004-04-07 20:09:27
|
Update of /cvsroot/ictk/ictk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15451 Modified Files: ChangeLog Log Message: [fics] isConnected() was reporting an incorrect value on socket.closed() FICSProtocolHandler also socket.closes() on exit; it was commented out for some reason. Index: ChangeLog =================================================================== RCS file: /cvsroot/ictk/ictk/ChangeLog,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** ChangeLog 16 Feb 2004 21:20:29 -0000 1.39 --- ChangeLog 7 Apr 2004 19:56:23 -0000 1.40 *************** *** 44,47 **** --- 44,52 ---- changed text.xsl to detect when there is no ' ' in the regex line. + [sample] swapped colors for the ChannelListener in the SampleICSClient. + Admin == RED, and SRs == YELLOW now. + [fics] isConnected() was reporting an incorrect value on socket.closed() + FICSProtocolHandler also socket.closes() on exit; it was commented + out for some reason. 0.2.0 - 2003-10-03 FICS Support (limited) |
From: Jason V. <jva...@us...> - 2004-04-07 20:09:26
|
Update of /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics/fics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15451/src/ictk/boardgame/chess/net/ics/fics Modified Files: FICSProtocolHandler.java Log Message: [fics] isConnected() was reporting an incorrect value on socket.closed() FICSProtocolHandler also socket.closes() on exit; it was commented out for some reason. Index: FICSProtocolHandler.java =================================================================== RCS file: /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics/fics/FICSProtocolHandler.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** FICSProtocolHandler.java 30 Sep 2003 17:27:37 -0000 1.23 --- FICSProtocolHandler.java 7 Apr 2004 19:56:24 -0000 1.24 *************** *** 64,67 **** --- 64,68 ---- START_SESSION = "**** Starting FICS session as ", INVALID_PASSWD = "**** Invalid password! ****", + ALREADY_LOGGED_IN = "is already logged in ***", INTERFACE_NAME = "-=[ ictk ]=- v0.2 http://ictk.sourceforge.net"; *************** *** 71,74 **** --- 72,77 ---- REGEX_acct_type = "(\\(\\S*\\))?"; + protected PrintStream stdout = System.out; + //FIXME: RATING - UNR is a possiblity *************** *** 95,99 **** int i = 0; ! eventFactories = new ICSEventParser[16]; eventFactories[i++] = FICSBoardUpdateStyle12Parser.getInstance(); eventFactories[i++] = FICSMoveListParser.getInstance(); --- 98,102 ---- int i = 0; ! eventFactories = new ICSEventParser[24]; eventFactories[i++] = FICSBoardUpdateStyle12Parser.getInstance(); eventFactories[i++] = FICSMoveListParser.getInstance(); *************** *** 113,116 **** --- 116,129 ---- eventFactories[i++] = FICSChallengeParser.getInstance(); + eventFactories[i++] = FICSExamineNavigationParser.getInstance(); + eventFactories[i++] = FICSExaminerOtherParser.getInstance(); + eventFactories[i++] = FICSExaminerSelfParser.getInstance(); + eventFactories[i++] = FICSObserverSelfParser.getInstance(); + eventFactories[i++] = FICSExamineCommitParser.getInstance(); + eventFactories[i++] = FICSExamineNavigationBeginParser.getInstance(); + eventFactories[i++] = FICSExamineNavigationEndParser.getInstance(); + eventFactories[i++] = FICSExamineNavigationEndVariationParser.getInstance(); + + router = new ICSEventRouter(); } *************** *** 155,166 **** if (isLoggedIn) { setLoginVars(); processServerOutput(); } else { //close socket etc } //end thread if (socket != null && !socket.isClosed()) {} ! //socket.close(); } catch (IOException e) { --- 168,181 ---- if (isLoggedIn) { setLoginVars(); + dispatchConnectionEvent(new ICSConnectionEvent(this)); processServerOutput(); } else { + Log.error(Log.USER_ERROR, "unsuccessful login"); //close socket etc } //end thread if (socket != null && !socket.isClosed()) {} ! socket.close(); } catch (IOException e) { *************** *** 215,220 **** buffer.limit(buffer.position()); buffer.rewind(); ! System.out.print(buffer.toString()); ! System.out.flush(); buffer.clear(); } --- 230,235 ---- buffer.limit(buffer.position()); buffer.rewind(); ! stdout.print(buffer.toString()); ! stdout.flush(); buffer.clear(); } *************** *** 230,236 **** if (!seenLogin && tmp.lastIndexOf(LOGIN_PROMPT) > -1) { ! System.out.print(tmp); ! System.out.print(" "); ! System.out.flush(); buffer.rewind(); buffer.clear(); --- 245,251 ---- if (!seenLogin && tmp.lastIndexOf(LOGIN_PROMPT) > -1) { ! stdout.print(tmp); ! stdout.print(" "); ! stdout.flush(); buffer.rewind(); buffer.clear(); *************** *** 243,249 **** else if (seenLogin && !seenPasswd && tmp.lastIndexOf(PASSWD_PROMPT) > -1) { ! System.out.print(tmp); ! System.out.print(" "); ! System.out.flush(); buffer.rewind(); buffer.clear(); --- 258,264 ---- else if (seenLogin && !seenPasswd && tmp.lastIndexOf(PASSWD_PROMPT) > -1) { ! stdout.print(tmp); ! stdout.print(" "); ! stdout.flush(); buffer.rewind(); buffer.clear(); *************** *** 251,255 **** sendCommand(passwd, false); seenPasswd = true; ! System.out.println(); } --- 266,283 ---- sendCommand(passwd, false); seenPasswd = true; ! stdout.println(); ! } ! ! //guest already logged in ! else if (seenLogin && !seenPasswd ! && tmp.lastIndexOf(ALREADY_LOGGED_IN) > -1) { ! stdout.print(tmp); ! stdout.print(" "); ! stdout.flush(); ! buffer.rewind(); ! buffer.clear(); ! ! stdout.println(); ! return false; } *************** *** 257,262 **** else if (seenLogin && !seenPasswd && tmp.lastIndexOf(GUEST_PROMPT) > -1) { ! System.out.print(tmp); ! System.out.flush(); buffer.rewind(); buffer.clear(); --- 285,290 ---- else if (seenLogin && !seenPasswd && tmp.lastIndexOf(GUEST_PROMPT) > -1) { ! stdout.print(tmp); ! stdout.flush(); buffer.rewind(); buffer.clear(); *************** *** 280,285 **** //Invalid password if (tmp.lastIndexOf(INVALID_PASSWD) > -1) { ! System.out.print(tmp); ! System.out.flush(); buffer.rewind(); buffer.clear(); --- 308,313 ---- //Invalid password if (tmp.lastIndexOf(INVALID_PASSWD) > -1) { ! stdout.print(tmp); ! stdout.flush(); buffer.rewind(); buffer.clear(); *************** *** 309,314 **** + tmp); } ! System.out.print(tmp); ! System.out.flush(); buffer.rewind(); buffer.clear(); --- 337,342 ---- + tmp); } ! stdout.print(tmp); ! stdout.flush(); buffer.rewind(); buffer.clear(); *************** *** 547,552 **** */ public void sendCommand (String cmd, boolean echo) { ! if (echo) ! System.out.println(cmd); if (isBlockMode) --- 575,581 ---- */ public void sendCommand (String cmd, boolean echo) { ! //FIXME: this should go to a setable stream, not stdout ! if (echo) ! stdout.println(cmd); if (isBlockMode) *************** *** 565,568 **** --- 594,602 ---- * just gotta figure out what the message is and send it to the right * listeners. + * <br> + * It is possible that there are multiple messages in one chunk. To + * deal with this the string before and after the matched data must + * also be examined for messages. These message need to be queued up + * and then sent to the router in order. */ protected void parse (CharSequence str) { *************** *** 571,574 **** --- 605,611 ---- boolean found = false; + if (debugParser) + stdout.println("<PARSING>" + str + "</PARSING>"); + for (int i=0; i < eventFactories.length && !found; i++) { *************** *** 576,616 **** icsEvent = eventFactories[i].createICSEvent(matcher); assert icsEvent != null : "parser matched, but event null?"; - icsEvent.setServer(this); - router.dispatch(icsEvent); ! found = true; ! } ! } ! ! //SEEK_CLEAR is followed by many seek ads usually ! //SEEK_ADs are not necessarily one per chunk ! CharSequence more = str; ! while (matcher != null ! && icsEvent != null ! && (icsEvent.getEventType() == ICSEvent.SEEK_CLEAR_EVENT ! || icsEvent.getEventType() == ICSEvent.SEEK_AD_EVENT)) { ! ! matcher = FICSSeekAdParser.getInstance().match( ! more = more.subSequence(matcher.end(), more.length())); - if (matcher != null) { - icsEvent = FICSSeekAdParser.getInstance().createICSEvent(matcher); - assert icsEvent != null : "parser matched, but event null?"; icsEvent.setServer(this); router.dispatch(icsEvent); } } if (!found) ! System.out.println(str); ! ! //what's after the match? ! if (matcher != null) { ! int end = matcher.end(); ! if (end < str.length() && str.charAt(end) == '\n') ! end++; ! if (end < str.length()) ! System.out.println(str.subSequence(end, str.length())); ! } } --- 613,632 ---- icsEvent = eventFactories[i].createICSEvent(matcher); assert icsEvent != null : "parser matched, but event null?"; ! if (matcher.start() > 3) ! parse(str.subSequence(0, matcher.start())); icsEvent.setServer(this); router.dispatch(icsEvent); + + if (str.length() - matcher.end() > 3) + parse(str.subSequence(matcher.end(), str.length())); + + found = true; } } if (!found) ! stdout.println(str); } *************** *** 639,653 **** case FICSBlockMode.BLK_HISTORY: ! System.out.println(">>Got a history!"); icsEvent = history.newICSEventInstance(str); if (icsEvent == null) ! System.out.println("But it didn't match"); break; case FICSBlockMode.BLK_MOVES: ! System.out.println(">>Got moves list!"); icsEvent = movelist.newICSEventInstance(str); if (icsEvent == null) ! System.out.println("But it didn't match"); default: --- 655,669 ---- case FICSBlockMode.BLK_HISTORY: ! stdout.println(">>Got a history!"); icsEvent = history.newICSEventInstance(str); if (icsEvent == null) ! stdout.println("But it didn't match"); break; case FICSBlockMode.BLK_MOVES: ! stdout.println(">>Got moves list!"); icsEvent = movelist.newICSEventInstance(str); if (icsEvent == null) ! stdout.println("But it didn't match"); default: *************** *** 657,661 **** router.dispatch(icsEvent); else ! System.out.print("BLOCK(" + id + "/" + cmd + "): " + str.toString() + "</BLOCK>"); */ --- 673,677 ---- router.dispatch(icsEvent); else ! stdout.print("BLOCK(" + id + "/" + cmd + "): " + str.toString() + "</BLOCK>"); */ |
From: Jason V. <jva...@us...> - 2004-04-07 20:04:59
|
Update of /cvsroot/ictk/ictk/samples/simpleICSClient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14521 Modified Files: ChannelListenerExample.java Log Message: swapped colors for SRs and Admins. Admins == RED and SRs == YELLOW now. Index: ChannelListenerExample.java =================================================================== RCS file: /cvsroot/ictk/ictk/samples/simpleICSClient/ChannelListenerExample.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ChannelListenerExample.java 30 Aug 2003 04:45:57 -0000 1.1 --- ChannelListenerExample.java 7 Apr 2004 19:51:58 -0000 1.2 *************** *** 68,74 **** if (chEvt.getAccountType().is(ICSAccountType.ADMIN)) - System.out.print(BOLD_YELLOW); - else if (chEvt.getAccountType().is(ICSAccountType.SERVICE_REP)) System.out.print(BOLD_RED); else System.out.print(PLAIN); --- 68,74 ---- if (chEvt.getAccountType().is(ICSAccountType.ADMIN)) System.out.print(BOLD_RED); + else if (chEvt.getAccountType().is(ICSAccountType.SERVICE_REP)) + System.out.print(BOLD_YELLOW); else System.out.print(PLAIN); |
From: <jva...@us...> - 2004-02-16 21:28:57
|
Update of /cvsroot/ictk/ictk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6584 Modified Files: ChangeLog Log Message: [xslt] fixed 794238 - XSLT parser.xsl single line regex ignored changed text.xsl to detect when there is no ' ' in the regex line. Index: ChangeLog =================================================================== RCS file: /cvsroot/ictk/ictk/ChangeLog,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** ChangeLog 30 Jan 2004 15:47:12 -0000 1.38 --- ChangeLog 16 Feb 2004 21:20:29 -0000 1.39 *************** *** 17,20 **** --- 17,21 ---- [fics] applies to support for the www.freechess.org server [icc] applies to support for the www.chessclub.com server + [xslt] applies to xslt code generation library functions / files *IN PROGRESS* *************** *** 36,43 **** [fics] added events: examine, mex, forward, backward, revert, forward at end of game, ! back at begin of game, forward on variation. [test] removed AllTests.java for Parser tests. [test] added allTests.xsl to autogenerate the AllTest file, so we don't miss any tests. build.xml was changed to this effect. 0.2.0 - 2003-10-03 FICS Support (limited) --- 37,47 ---- [fics] added events: examine, mex, forward, backward, revert, forward at end of game, ! back at begin of game, forward on variation, observer. [test] removed AllTests.java for Parser tests. [test] added allTests.xsl to autogenerate the AllTest file, so we don't miss any tests. build.xml was changed to this effect. + [xslt] fixed 794238 - XSLT parser.xsl single line regex ignored + changed text.xsl to detect when there is no ' ' in the + regex line. 0.2.0 - 2003-10-03 FICS Support (limited) |
From: <jva...@us...> - 2004-02-16 21:28:23
|
Update of /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics/event In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6400 Modified Files: text.xsl Log Message: [xslt] fixed 794238 - XSLT parser.xsl single line regex ignored changed text.xsl to detect when there is no ' ' in the regex line. Index: text.xsl =================================================================== RCS file: /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics/event/text.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** text.xsl 19 Aug 2003 21:32:07 -0000 1.1 --- text.xsl 16 Feb 2004 21:20:00 -0000 1.2 *************** *** 121,132 **** </xsl:otherwise> </xsl:choose> - <xsl:value-of select="substring-before($line, ' ')"/> - <xsl:value-of select="$postfix"/> ! <xsl:call-template name="_mini_format"> ! <xsl:with-param name="input" select="substring-after($line, ' ')"/> ! <xsl:with-param name="prefix" select="$prefix"/> ! <xsl:with-param name="postfix" select="$postfix"/> ! </xsl:call-template> </xsl:template> --- 121,142 ---- </xsl:otherwise> </xsl:choose> ! <xsl:choose> ! ! <xsl:when test="contains($line, ' ')"> ! <xsl:value-of select="substring-before($line, ' ')"/> ! <xsl:value-of select="$postfix"/> ! <xsl:call-template name="_mini_format"> ! <xsl:with-param name="input" select="substring-after($line, ' ')"/> ! <xsl:with-param name="prefix" select="$prefix"/> ! <xsl:with-param name="postfix" select="$postfix"/> ! </xsl:call-template> ! </xsl:when> ! ! <xsl:otherwise> ! <xsl:value-of select="$line"/> ! <xsl:value-of select="$postfix"/> ! </xsl:otherwise> ! </xsl:choose> </xsl:template> |
From: <jva...@pr...> - 2004-01-31 05:34:59
|
Update of /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics/event In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23023 Added Files: genericBoard.xml Log Message: genericBoard.xml added for generation of generic board events -- mostly in examine mode. --- NEW FILE: genericBoard.xml --- <?xml version="1.0" encoding="utf-8" standalone="no"?> <!-- * ICTK - Internet Chess ToolKit * More information is available at http://ictk.sourceforge.net * Copyright (C) 2002 J. Varsoke <jva...@gh...> * All rights reserved. * * $Id: genericBoard.xml,v 1.1 2004/01/30 06:44:35 jvarsoke Exp $ * * This file is part of ICTK. * * ICTK is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * ICTK is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with ICTK; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> <!DOCTYPE ictkml SYSTEM "icsevtml.dtd" [ <!ENTITY common SYSTEM "parserCommon.xml"> ]> <icsevtml> <!-- generic board event ...............................................--> <event id="genericBoard" class="GenericBoard" enum="UNKNOWN" extends="ICSEvent"> <description> A flexible class that hosts data from various board events. This class was created to limit needless proliferation of trivial classes. The data in this cass is thus context dependent. You should check the EventType before understanding what to do with the data. </description> <implements idref="board"/> <member id="genericBoard:player" typeref="player"/> <member id="genericBoard:boardNumber" typeref="boardNumber" inherit="method"/> <member id="genericBoard:data " typeref="int" varname="data" functname="Data"/> <!--Examine Navigation parser ........................................--> <parser id="examineNavigation:parser" name="ExamineNavigation" protocol="FICS" extends="ICSEventParser" enum="EXAMINE_NAVIGATION" detectFake="no"> <description> The Data field refers to the number of moves from the current move. A negative Data number means to traverse the history list in reverse. </description> <!-- regex --> <regex> Game\s(\d+):\s <regexref ref="regex:fics:player"/> \s (goes\sforward|backs\sup) \s(\d+)\smoves?. </regex> <!-- assignMatches --> <assignMatches format="java"> <regexgroup num="2" memberref="genericBoard:boardNumber"/> <regexgroup num="3" memberref="genericBoard:player"/> <regexgroup num="5" memberref="genericBoard:data"/> if ("backs up".equals(m.group(4))) { evt.setData(evt.getData() * -1); } </assignMatches> <!-- toNative --> <toNative avgLength="46"> <code format="java"> sb.append("Game ") .append(evt.getBoardNumber()) .append(": ") .append(evt.getPlayer()); if (evt.getData() > 0) { sb.append(" goes forward ") .append(evt.getData()); } else { sb.append(" backs up ") .append(evt.getData() * -1); } if (evt.getData() == 1 || evt.getData() == -1) sb.append(" move."); else sb.append(" moves."); </code> </toNative> </parser> <!--Examine Revert parser ............................................--> <parser id="examineRevert:parser" name="ExamineRevert" protocol="FICS" extends="ICSEventParser" enum="EXAMINE_REVERT" detectFake="no"> <description> The Data field refers to the mainline move number that revert has returned us to. </description> <!-- regex --> <regex> Game\s(\d+):\s <regexref ref="regex:fics:player"/> \sreverts\sto\smain\sline\smove\s (\d+)\. </regex> <!-- assignMatches --> <assignMatches format="java"> <regexgroup num="2" memberref="genericBoard:boardNumber"/> <regexgroup num="3" memberref="genericBoard:player"/> <regexgroup num="4" memberref="genericBoard:data"/> </assignMatches> <!-- toNative --> <toNative avgLength="46"> <code format="java"> sb.append("Game ") .append(evt.getBoardNumber()) .append(": ") .append(evt.getPlayer()) .append(" reverts to main line move ") .append(evt.getData()) .append("."); </code> </toNative> </parser> </event> &common; </icsevtml> |
From: <jva...@pr...> - 2004-01-31 02:51:53
|
Update of /cvsroot/ictk/ictk/test/ictk/boardgame/chess/net/ics/fics/event In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16192 Added Files: allTests.xsl Log Message: added for AllTests.java autogeneration in Parser Tests --- NEW FILE: allTests.xsl --- <?xml version="1.0"?> <!-- * ICTK - Internet Chess ToolKit * More information is available at http://ictk.sourceforge.net * Copyright (C) 2002 J. Varsoke <jva...@gh...> * All rights reserved. * * $Id: allTests.xsl,v 1.1 2004/01/30 08:52:38 jvarsoke Exp $ * * This file is part of ICTK. * * ICTK is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * ICTK is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with ICTK; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:java="java" > <xsl:output method="text" omit-xml-declaration="yes"/> <!-- main event --> <xsl:template match="unitTest"> <xsl:text></xsl:text>/* * ICTK - Internet Chess ToolKit * More information is available at http://ictk.sourceforge.net * Copyright (C) 2003 J. Varsoke <jva...@gh...> * All rights reserved. * * This file is part of ICTK. * * ICTK is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * ICTK is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with ICTK; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package ictk.boardgame.chess.net.ics.fics.event; /*--------------------------------------------------------------------------* * This file was auto-generated * by $Id: allTests.xsl,v 1.1 2004/01/30 08:52:38 jvarsoke Exp $ * on <xsl:value-of select="java:util.Date.new()"/> *--------------------------------------------------------------------------*/ import junit.framework.*; public class AllTests { public static void main(String[] args) { junit.textui.TestRunner.run(suite()); } public static Test suite() { TestSuite suite= new TestSuite("FICS event parsers"); <xsl:apply-templates select="unit"></xsl:apply-templates> return suite; } } </xsl:template> <!-- unitTest --> <xsl:template match="unit"> <xsl:text> suite.addTest(new TestSuite(FICS</xsl:text> <xsl:value-of select="@class"/> <xsl:text>ParserTest.class)); </xsl:text> </xsl:template> </xsl:stylesheet> |
From: <jva...@pr...> - 2004-01-31 02:12:42
|
Update of /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics/event In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13076/src/ictk/boardgame/chess/net/ics/event Modified Files: ICSEvent.java parser.xsl tell.xml Log Message: added ExamineNavigation and ExamineRevert events to FICS support added auto-generation of AllTests for Parser Tests added comment for generated code in Parser templates modifed build.xml output of generated files (now shows directory) added URLs for dependencies in README Index: ICSEvent.java =================================================================== RCS file: /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics/event/ICSEvent.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ICSEvent.java 30 Sep 2003 09:39:43 -0000 1.10 --- ICSEvent.java 30 Jan 2004 08:50:38 -0000 1.11 *************** *** 53,57 **** TAKEBACK_REQUEST_EVENT = 5, - CHANNEL_EVENT = 6, SHOUT_EVENT = 7, --- 53,56 ---- *************** *** 83,87 **** PLAYER_CONNECTION_EVENT = 27, HISTORY_EVENT = 28, ! NUM_EVENTS = 29; /** each event has a type for easy casting */ --- 82,90 ---- PLAYER_CONNECTION_EVENT = 27, HISTORY_EVENT = 28, ! ! //generic board events ! EXAMINE_NAVIGATION_EVENT = 29, ! EXAMINE_REVERT_EVENT = 30, ! NUM_EVENTS = 31; /** each event has a type for easy casting */ Index: parser.xsl =================================================================== RCS file: /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics/event/parser.xsl,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** parser.xsl 25 Aug 2003 01:29:00 -0000 1.11 --- parser.xsl 30 Jan 2004 08:50:38 -0000 1.12 *************** *** 145,149 **** public ICSEvent createICSEvent (Matcher match) { ICSEvent evt = new ICS<xsl:value-of select="../@class"/>Event(); ! assignMatches(match, evt); return evt; --- 145,150 ---- public ICSEvent createICSEvent (Matcher match) { ICSEvent evt = new ICS<xsl:value-of select="../@class"/>Event(); ! <xsl:if test="@enum">evt.setEventType(ICSEvent.<xsl:value-of select="@enum"/>_EVENT); ! </xsl:if>assignMatches(match, evt); return evt; Index: tell.xml =================================================================== RCS file: /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics/event/tell.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tell.xml 20 Aug 2003 07:17:27 -0000 1.2 --- tell.xml 30 Jan 2004 08:50:38 -0000 1.3 *************** *** 39,45 **** </description> ! <member id="kibitz:player" typeref="player"/> ! <member id="kibitz:accountType" typeref="accountType"/> ! <member id="kibitz:message" typeref="message" inherit="yes"/> <!--parser--> --- 39,45 ---- </description> ! <member id="tell:player" typeref="player"/> ! <member id="tell:accountType" typeref="accountType"/> ! <member id="tell:message" typeref="message" inherit="yes"/> <!--parser--> *************** *** 60,66 **** <!-- assignMatches --> <assignMatches format="java"> ! <regexgroup num="2" memberref="kibitz:player"/> ! <regexgroup num="3" memberref="kibitz:accountType"/> ! <regexgroup num="5" memberref="kibitz:message"/> if ("tells you".equals(m.group(4))) { evt.setEventType(ICSEvent.TELL_EVENT); --- 60,66 ---- <!-- assignMatches --> <assignMatches format="java"> ! <regexgroup num="2" memberref="tell:player"/> ! <regexgroup num="3" memberref="tell:accountType"/> ! <regexgroup num="5" memberref="tell:message"/> if ("tells you".equals(m.group(4))) { evt.setEventType(ICSEvent.TELL_EVENT); |
From: <jva...@pr...> - 2004-01-31 02:12:13
|
Update of /cvsroot/ictk/ictk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13076 Modified Files: ChangeLog README build.xml Log Message: added ExamineNavigation and ExamineRevert events to FICS support added auto-generation of AllTests for Parser Tests added comment for generated code in Parser templates modifed build.xml output of generated files (now shows directory) added URLs for dependencies in README Index: ChangeLog =================================================================== RCS file: /cvsroot/ictk/ictk/ChangeLog,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** ChangeLog 7 Dec 2003 19:49:46 -0000 1.36 --- ChangeLog 30 Jan 2004 08:50:38 -0000 1.37 *************** *** 28,31 **** --- 28,43 ---- of "str:toUpper" [thanks: Jerome Zago for his persistence in proving the bug existed] + [fics] added GenericBoardEvent and bevy of Parser classes to go with it. + this is a change from the original idea of a seperate class for + every event. But that ends up being a rediculous amount of + Event classes. Instead there will be a parser for each, but + Events well be consolidated in Generic forms. You'll know which + event is which by getEventType(). + [fics] added events: + examine forward and backward + revert + [test] removed AllTests.java for Parser tests. + [test] added allTests.xsl to autogenerate the AllTest file, so we + don't miss any tests. build.xml was changed to this effect. 0.2.0 - 2003-10-03 FICS Support (limited) Index: README =================================================================== RCS file: /cvsroot/ictk/ictk/README,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** README 1 Oct 2003 06:37:18 -0000 1.5 --- README 30 Jan 2004 08:50:38 -0000 1.6 *************** *** 26,44 **** ------------ ! o JDK 1.4 or better this is mostly due to the use of "assert" throughout the source, the Regex libraries, and java.nio libraries for ictk.boardgame.chess.net. ! o Ant 1.5 or better this is because earlier versions did not support the javac -source 1.4 feature. You can do most things with Ant 1.4, but you can't generate the javadoc with it. ! o JUnit 3.8.0 or better this is only necessary if you wish to run the regression testing suite. ! o Xalan-Java 2.5.0 or better this is only necessary if you wish to generate the net events and parsers from their XML source. Really, any XSLT processor --- 26,44 ---- ------------ ! o JDK 1.4 or better http://java.sun.com/ this is mostly due to the use of "assert" throughout the source, the Regex libraries, and java.nio libraries for ictk.boardgame.chess.net. ! o Ant 1.5 or better http://ant.apache.org/ this is because earlier versions did not support the javac -source 1.4 feature. You can do most things with Ant 1.4, but you can't generate the javadoc with it. ! o JUnit 3.8.0 or better http://junit.sourceforge.net/ this is only necessary if you wish to run the regression testing suite. ! o Xalan-Java 2.5.0 or better http://xml.apache.org/xalan-j/ this is only necessary if you wish to generate the net events and parsers from their XML source. Really, any XSLT processor Index: build.xml =================================================================== RCS file: /cvsroot/ictk/ictk/build.xml,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** build.xml 7 Dec 2003 18:40:15 -0000 1.28 --- build.xml 30 Jan 2004 08:50:38 -0000 1.29 *************** *** 69,73 **** <property name="xslt.ics.event.dir" value="${source.dir}/ictk/boardgame/chess/net/ics/event"/> ! <property name="xslt.ics.event.parser.dir" value="${test.dir}/ictk/boardgame/chess/net/ics/fics/event"/> --- 69,73 ---- <property name="xslt.ics.event.dir" value="${source.dir}/ictk/boardgame/chess/net/ics/event"/> ! <property name="xslt.ics.event.parser.test.dir" value="${test.dir}/ictk/boardgame/chess/net/ics/fics/event"/> *************** *** 171,178 **** <!-- parser tests --> <xslt ! basedir="${xslt.ics.event.parser.dir}" ! destdir="${xslt.ics.event.parser.dir}" classpathref="xslt.class.path" ! style="${xslt.ics.event.parser.dir}/templateParser.xsl" includes="parserTests.xml" extension=".tmp.log" --- 171,178 ---- <!-- parser tests --> <xslt ! basedir="${xslt.ics.event.parser.test.dir}" ! destdir="${xslt.ics.event.parser.test.dir}" classpathref="xslt.class.path" ! style="${xslt.ics.event.parser.test.dir}/templateParser.xsl" includes="parserTests.xml" extension=".tmp.log" *************** *** 180,185 **** > </xslt> ! <concat destfile="${xslt.ics.event.parser.dir}/genfiles.log"> ! <fileset dir="${xslt.ics.event.parser.dir}" includes="*.tmp.log" /> --- 180,185 ---- > </xslt> ! <concat destfile="${xslt.ics.event.parser.test.dir}/genfiles.log"> ! <fileset dir="${xslt.ics.event.parser.test.dir}" includes="*.tmp.log" /> *************** *** 190,205 **** includes="*.tmp.log" /> ! <fileset dir="${xslt.ics.event.parser.dir}" includes="*.tmp.log" /> </delete> <!-- report all files --> ! <echo>Generated Files</echo> <concat> <fileset dir="${xslt.ics.event.dir}" includes="genfiles.log" /> ! <fileset dir="${xslt.ics.event.parser.dir}" includes="genfiles.log" /> --- 190,224 ---- includes="*.tmp.log" /> ! <fileset dir="${xslt.ics.event.parser.test.dir}" includes="*.tmp.log" /> </delete> + <!-- generate AllTests.java --> + <xslt + basedir="${xslt.ics.event.parser.test.dir}" + destdir="${xslt.ics.event.parser.test.dir}" + classpathref="xslt.class.path" + style="${xslt.ics.event.parser.test.dir}/allTests.xsl" + in="${xslt.ics.event.parser.test.dir}/parserTests.xml" + out="${xslt.ics.event.parser.test.dir}/AllTests.java" + force="yes" + > + </xslt> + <concat append="true" + destfile="${xslt.ics.event.parser.test.dir}/genfiles.log" + >AllTests.java</concat> + <!-- report all files --> ! <echo>Generated Files: ${xslt.ics.event.dir}</echo> <concat> <fileset dir="${xslt.ics.event.dir}" includes="genfiles.log" /> ! </concat> ! ! <echo>Generated Files: ${xslt.ics.event.parser.test.dir}</echo> ! <concat> ! <fileset dir="${xslt.ics.event.parser.test.dir}" includes="genfiles.log" /> *************** *** 518,523 **** <delete file="${output.jar}" /> <echo message="To delete generated code use (unix):"/> ! <echo message=" $ (cd src/ictk/boardgame/chess/net/ics/event && cat genfiles.log | xargs rm)"/> ! <echo message=" $ (cd test/ictk/boardgame/chess/net/ics/fics/event && cat genfiles.log | xargs rm)"/> </target> --- 537,542 ---- <delete file="${output.jar}" /> <echo message="To delete generated code use (unix):"/> ! <echo message=" $ (cd ${xslt.ics.event.dir} && cat genfiles.log | xargs rm)"/> ! <echo message=" $ (cd ${xslt.ics.event.parser.test.dir} && cat genfiles.log | xargs rm)"/> </target> |
From: <jva...@pr...> - 2004-01-31 00:02:28
|
Update of /cvsroot/ictk/ictk/test/ictk/boardgame/chess/net/ics/fics/event In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13076/test/ictk/boardgame/chess/net/ics/fics/event Modified Files: parserTests.xml templateParser.xsl Removed Files: AllTests.java Log Message: added ExamineNavigation and ExamineRevert events to FICS support added auto-generation of AllTests for Parser Tests added comment for generated code in Parser templates modifed build.xml output of generated files (now shows directory) added URLs for dependencies in README Index: parserTests.xml =================================================================== RCS file: /cvsroot/ictk/ictk/test/ictk/boardgame/chess/net/ics/fics/event/parserTests.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** parserTests.xml 30 Sep 2003 09:39:44 -0000 1.2 --- parserTests.xml 30 Jan 2004 08:50:38 -0000 1.3 *************** *** 206,208 **** --- 206,222 ---- > </unit> + + <!-- generic board - Examine Navigation.................................--> + <unit id="examineNavigation" + class="ExamineNavigation" + event="GenericBoard" + > + </unit> + + <!-- generic board - Examine Revert ....................................--> + <unit id="examineRevert" + class="ExamineRevert" + event="GenericBoard" + > + </unit> </unitTest> Index: templateParser.xsl =================================================================== RCS file: /cvsroot/ictk/ictk/test/ictk/boardgame/chess/net/ics/fics/event/templateParser.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** templateParser.xsl 26 Aug 2003 20:16:01 -0000 1.1 --- templateParser.xsl 30 Jan 2004 08:50:38 -0000 1.2 *************** *** 80,83 **** --- 80,90 ---- package ictk.boardgame.chess.net.ics.fics.event; + + /*--------------------------------------------------------------------------* + * This file was auto-generated + * by $Id$ + * on <xsl:value-of select="java:util.Date.new()"/> + *--------------------------------------------------------------------------*/ + import ictk.boardgame.chess.net.ics.event.*; import ictk.boardgame.chess.net.ics.*; --- AllTests.java DELETED --- |
From: <jva...@pr...> - 2004-01-31 00:02:28
|
Update of /cvsroot/ictk/ictk/test/ictk/boardgame/chess/net/ics/fics/event/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13076/test/ictk/boardgame/chess/net/ics/fics/event/data Added Files: FICSExamineNavigationParserTest.data FICSExamineRevertParserTest.data Log Message: added ExamineNavigation and ExamineRevert events to FICS support added auto-generation of AllTests for Parser Tests added comment for generated code in Parser templates modifed build.xml output of generated files (now shows directory) added URLs for dependencies in README --- NEW FILE: FICSExamineNavigationParserTest.data --- ##$Id: FICSExamineNavigationParserTest.data,v 1.1 2004/01/30 08:50:38 jvarsoke Exp $ ## forward 1 (forward report, then style12) Game 29: TibetianTick goes forward 1 move. ## forward N (forward report, then style12) Game 29: TibetianTick goes forward 22 moves. ## backward 1 (backward report, then style12) Game 29: TibetianTick backs up 1 move. ## backward N (backward report, then style12) Game 29: TibetianTick backs up 22 moves. ## back 999 Game 29: guesttick backs up 9999 moves. ## for 9999 Game 29: guesttick goes forward 9999 moves. --- NEW FILE: FICSExamineRevertParserTest.data --- ##$Id: FICSExamineRevertParserTest.data,v 1.1 2004/01/30 08:50:38 jvarsoke Exp $ ##revert to main line Game 29: guesttick reverts to main line move 5. |
From: <jva...@us...> - 2003-12-07 20:11:24
|
Update of /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics In directory sc8-pr-cvs1:/tmp/cvs-serv12001 Modified Files: ICSProtocolHandler.java Log Message: added documentation to differnetiate between isConnected() and isLoggedIn() Index: ICSProtocolHandler.java =================================================================== RCS file: /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics/ICSProtocolHandler.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ICSProtocolHandler.java 11 Sep 2003 02:46:43 -0000 1.4 --- ICSProtocolHandler.java 7 Dec 2003 20:11:21 -0000 1.5 *************** *** 165,169 **** /* isConnected ************************************************************/ ! /** is the program currently connected to the host. */ public boolean isConnected () { --- 165,171 ---- /* isConnected ************************************************************/ ! /** is the program currently connected to the host. Note: this does ! * not indicate if the program is logged into the server. You cannot ! * start sending commands yet. Instead you need to use isLoggedIn(); */ public boolean isConnected () { |
From: <jva...@us...> - 2003-12-07 19:49:50
|
Update of /cvsroot/ictk/ictk In directory sc8-pr-cvs1:/tmp/cvs-serv7947 Modified Files: AUTHORS ChangeLog Log Message: fixed 815393 - "ant generate" fails with newer versions of Xalan Index: AUTHORS =================================================================== RCS file: /cvsroot/ictk/ictk/AUTHORS,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AUTHORS 30 Sep 2003 20:19:52 -0000 1.4 --- AUTHORS 7 Dec 2003 19:49:46 -0000 1.5 *************** *** 23,26 **** --- 23,27 ---- David Spencer Franck (obelixft) + Jonas Forsslud --- Index: ChangeLog =================================================================== RCS file: /cvsroot/ictk/ictk/ChangeLog,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** ChangeLog 7 Dec 2003 18:40:15 -0000 1.35 --- ChangeLog 7 Dec 2003 19:49:46 -0000 1.36 *************** *** 22,26 **** than White [dev] fixed 821399 - timesealing.jar wasn't added to "bin" distro ! 0.2.0 - 2003-10-03 FICS Support (limited) --- 22,31 ---- than White [dev] fixed 821399 - timesealing.jar wasn't added to "bin" distro ! [dev] fixed 815393 - "ant generate" fails with new Xalan 2.5.1 and 2.5.2 ! While it worked with versions 2.5.0 and before, the new Xalan ! caused a "toUpper" error. The reason was a scoping problem ! in string.xsl, where the function "toUpper" was called instead ! of "str:toUpper" ! [thanks: Jerome Zago for his persistence in proving the bug existed] 0.2.0 - 2003-10-03 FICS Support (limited) |
From: <jva...@us...> - 2003-12-07 19:49:50
|
Update of /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics/event In directory sc8-pr-cvs1:/tmp/cvs-serv7947/src/ictk/boardgame/chess/net/ics/event Modified Files: string.xsl Log Message: fixed 815393 - "ant generate" fails with newer versions of Xalan Index: string.xsl =================================================================== RCS file: /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics/event/string.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** string.xsl 19 Aug 2003 21:32:07 -0000 1.1 --- string.xsl 7 Dec 2003 19:49:46 -0000 1.2 *************** *** 53,57 **** <xsl:template name="str:capitalize"> <xsl:param name="input"/> ! <xsl:call-template name="toUpper"> <xsl:with-param name="input" select="substring($input, 1, 1)"/> </xsl:call-template> --- 53,57 ---- <xsl:template name="str:capitalize"> <xsl:param name="input"/> ! <xsl:call-template name="str:toUpper"> <xsl:with-param name="input" select="substring($input, 1, 1)"/> </xsl:call-template> |
From: <jva...@us...> - 2003-12-07 19:49:49
|
Update of /cvsroot/ictk/ictk/src/ictk In directory sc8-pr-cvs1:/tmp/cvs-serv7947/src/ictk Modified Files: overview.html Log Message: fixed 815393 - "ant generate" fails with newer versions of Xalan Index: overview.html =================================================================== RCS file: /cvsroot/ictk/ictk/src/ictk/overview.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** overview.html 2 Aug 2003 18:30:27 -0000 1.1 --- overview.html 7 Dec 2003 19:49:46 -0000 1.2 *************** *** 2,6 **** <p class="bodyFont"> <span class="heading">Summary:</span> The Internet Chess ToolKit is a Java based set of libraries and widgets useful for performing common ! tasks such as reading SAN, PGN, FEN, generating legal moves, connecting to online chess server (future), and GUI widgets (future). The net libraries convert ICS (Internet Chess Server) output into java events. This library is licensed under the <a href="http://www.fsf.org/licenses/gpl.html">GPL v2</a>.</p> --- 2,6 ---- <p class="bodyFont"> <span class="heading">Summary:</span> The Internet Chess ToolKit is a Java based set of libraries and widgets useful for performing common ! tasks such as reading SAN, PGN, FEN, generating legal moves, connecting to online chess server, and GUI widgets (future). The net libraries convert ICS (Internet Chess Server) output into java events. This library is licensed under the <a href="http://www.fsf.org/licenses/gpl.html">GPL v2</a>.</p> |
From: <jva...@us...> - 2003-12-07 18:40:18
|
Update of /cvsroot/ictk/ictk In directory sc8-pr-cvs1:/tmp/cvs-serv26761 Modified Files: build.xml ChangeLog Log Message: 821399 fixed: timesealing.jar now added to "bin" distro Index: build.xml =================================================================== RCS file: /cvsroot/ictk/ictk/build.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** build.xml 1 Oct 2003 06:37:18 -0000 1.27 --- build.xml 7 Dec 2003 18:40:15 -0000 1.28 *************** *** 405,408 **** --- 405,409 ---- ${output.jar} ${samples.dir}/** + ${lib.dir}/** " /> Index: ChangeLog =================================================================== RCS file: /cvsroot/ictk/ictk/ChangeLog,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** ChangeLog 3 Oct 2003 18:46:36 -0000 1.34 --- ChangeLog 7 Dec 2003 18:40:15 -0000 1.35 *************** *** 18,21 **** --- 18,26 ---- [icc] applies to support for the www.chessclub.com server + *IN PROGRESS* + [chess] fixed 828725 - move counter incremented on Black move rather + than White + [dev] fixed 821399 - timesealing.jar wasn't added to "bin" distro + 0.2.0 - 2003-10-03 FICS Support (limited) |
From: <jva...@us...> - 2003-10-23 07:27:20
|
Update of /cvsroot/ictk/ictk/src/ictk/boardgame/chess In directory sc8-pr-cvs1:/tmp/cvs-serv30139 Modified Files: ChessMove.java Log Message: fixed: 828725 - move counter incorrectly incremented on black move Index: ChessMove.java =================================================================== RCS file: /cvsroot/ictk/ictk/src/ictk/boardgame/chess/ChessMove.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ChessMove.java 20 Aug 2003 14:29:06 -0000 1.8 --- ChessMove.java 23 Oct 2003 07:17:57 -0000 1.9 *************** *** 447,451 **** board.lastMove = this; //incr move counter ! if (piece.isBlack) board.moveNumber++; --- 447,451 ---- board.lastMove = this; //incr move counter ! if (!piece.isBlack) board.moveNumber++; *************** *** 533,537 **** board.lastMove = (ChessMove) prev; //move number ! if (piece.isBlack) board.moveNumber--; --- 533,537 ---- board.lastMove = (ChessMove) prev; //move number ! if (!piece.isBlack) board.moveNumber--; |
From: <jva...@us...> - 2003-10-03 18:46:41
|
Update of /cvsroot/ictk/ictk In directory sc8-pr-cvs1:/tmp/cvs-serv14580 Modified Files: ChangeLog NEWS Log Message: Last changes before release 0.2.0 Index: ChangeLog =================================================================== RCS file: /cvsroot/ictk/ictk/ChangeLog,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** ChangeLog 1 Oct 2003 06:37:18 -0000 1.33 --- ChangeLog 3 Oct 2003 18:46:36 -0000 1.34 *************** *** 19,23 **** ! 0.2.0 - **IN PROGRESS** FICS Support (limited) [net] added FICS support to main branch of library --- 19,23 ---- ! 0.2.0 - 2003-10-03 FICS Support (limited) [net] added FICS support to main branch of library Index: NEWS =================================================================== RCS file: /cvsroot/ictk/ictk/NEWS,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** NEWS 1 Oct 2003 06:37:18 -0000 1.6 --- NEWS 3 Oct 2003 18:46:36 -0000 1.7 *************** *** 7,12 **** account of what was changed look at the ChangeLog file. ! 0.2.0 - **IN PROGRESS** FICS Support o Limited FICS support o Timeseal support o XSLT java code generation for ICS events --- 7,15 ---- account of what was changed look at the ChangeLog file. ! 0.2.0 - 2003-10-03 FICS Support o Limited FICS support + style12, match request, kibitz, whisper, say, tell, channel tell, + shout, c/t/-shout, emote, move list, pin, gin, seek ads, seek remove, + seek clear, game results o Timeseal support o XSLT java code generation for ICS events |
From: <jva...@us...> - 2003-10-01 06:37:22
|
Update of /cvsroot/ictk/ictk In directory sc8-pr-cvs1:/tmp/cvs-serv31943 Modified Files: ChangeLog NEWS README build.xml Log Message: Updated docs about new features and build file to do distribution and hints about deleting generated source files. Index: ChangeLog =================================================================== RCS file: /cvsroot/ictk/ictk/ChangeLog,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** ChangeLog 29 Sep 2003 11:28:22 -0000 1.32 --- ChangeLog 1 Oct 2003 06:37:18 -0000 1.33 *************** *** 18,23 **** [icc] applies to support for the www.chessclub.com server ! *IN PROGRESS* [net] added FICS support to main branch of library [fics] removed BlockMode message chunking [fics] recoded login sequence to not use StringBuffer --- 18,25 ---- [icc] applies to support for the www.chessclub.com server ! ! 0.2.0 - **IN PROGRESS** FICS Support (limited) [net] added FICS support to main branch of library + [fics] removed BlockMode message chunking [fics] recoded login sequence to not use StringBuffer *************** *** 33,40 **** --- 35,47 ---- [fics] added template files for Parsers and ParserTest to auto generate these files. + [fics] added support for following events: style12, match request, + kibitz, whisper, say, tell, channel tell, shout, c/t/-shout, emote, + move list, pin, gin, seek ads, seek remove, seek clear, game results. + [net] removed most of the ICS*Event.java and FICS*EventParser.java files. [net] added XSLT java code generation for ICSEvents and FICSEventParsers Since most event objects are simple and repetitive code they are now generated using XALAN (by default). + [dev] added code generation target to build file The build file now has a XALAN dependency by default if you wish *************** *** 46,51 **** This sample program logs onto FICS and displays server output on the console (System.out). The output is ANSI color coded ! as defined by ANSIConsole. The Forte(tm) form file is also ! provided in case someone wishes to modify through that IDE. [chess] fixed 801272 - PGNWriter added superfluious results PGN standard specifies only an end result, not results for --- 53,60 ---- This sample program logs onto FICS and displays server output on the console (System.out). The output is ANSI color coded ! as defined by ANSIConsole. The sample code intends to show how ! to register to listen to events. An alternative channel listener ! is provided. ! [chess] fixed 801272 - PGNWriter added superfluious results PGN standard specifies only an end result, not results for Index: NEWS =================================================================== RCS file: /cvsroot/ictk/ictk/NEWS,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** NEWS 18 Aug 2003 06:05:41 -0000 1.5 --- NEWS 1 Oct 2003 06:37:18 -0000 1.6 *************** *** 7,10 **** --- 7,17 ---- account of what was changed look at the ChangeLog file. + 0.2.0 - **IN PROGRESS** FICS Support + o Limited FICS support + o Timeseal support + o XSLT java code generation for ICS events + o Sample ICS Client + o PGN bugs fixed + 0.1.3 - 2003-08-17 Bug fix and CLI display o Added an event structure for getting board updates Index: README =================================================================== RCS file: /cvsroot/ictk/ictk/README,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** README 30 Sep 2003 20:19:52 -0000 1.4 --- README 1 Oct 2003 06:37:18 -0000 1.5 *************** *** 87,103 **** which might look something like this: /usr/local/jdk/jre/lib/ext - * Source (generated): ! If you've downloaded the (generated) source tar-ball then just untar it ! into a directory of your choosing. From there you can use Ant to build the ! classes or the Jar file if need be. $ ant compile - * Source (non-generated): ! The non-generated version of the source tar-ball is default source ! distribution. It contains the XML source files necessary to generate the ! ICS Event parsing Java source. $ ant generate --- 87,107 ---- which might look something like this: /usr/local/jdk/jre/lib/ext ! * Source from distribution: ! ! If you've downloaded the source tar-ball then just untar it into a ! directory of your choosing. From there you can use Ant to build the class ! files, Jar file, and documentation. For the class files & documentation: $ ant compile + $ ant docs ! * Source from CVS: ! ! If you got the source code from CVS you'll notice many of the Java source ! code files are missing (and ICTK will not compile). These source files are ! generated through XML and XSTL. To do this you must have Xalan-Java installed ! then do the following: $ ant generate *************** *** 147,149 **** --- ! Last Updated: 2003-09-30 by jvarsoke --- 151,153 ---- --- ! Last Updated: 2003-10-01 by jvarsoke Index: build.xml =================================================================== RCS file: /cvsroot/ictk/ictk/build.xml,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** build.xml 30 Sep 2003 19:42:18 -0000 1.26 --- build.xml 1 Oct 2003 06:37:18 -0000 1.27 *************** *** 270,273 **** --- 270,276 ---- --> + <!-- if this fails you probably don't have $JUNIT_HOME/junit.jar in your + CLASSPATH (which is required for Ant to use the JUnit task + --> <junit fork="no" haltonerror="yes" *************** *** 394,398 **** <!-- binary distribution files --> ! <target name="bin" depends="clean,jar,jar-nonet,docs" description="create the binary release file"> <property name="bin.include" --- 397,401 ---- <!-- binary distribution files --> ! <target name="bin" depends="clean,generate,jar,jar-nonet,docs" description="create the binary release file"> <property name="bin.include" *************** *** 452,456 **** </target> - <!-- ..................................................................--> --- 455,458 ---- *************** *** 514,517 **** --- 516,522 ---- <delete dir="${docs.dir}" /> <delete file="${output.jar}" /> + <echo message="To delete generated code use (unix):"/> + <echo message=" $ (cd src/ictk/boardgame/chess/net/ics/event && cat genfiles.log | xargs rm)"/> + <echo message=" $ (cd test/ictk/boardgame/chess/net/ics/fics/event && cat genfiles.log | xargs rm)"/> </target> |
From: <jva...@us...> - 2003-10-01 06:37:22
|
Update of /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics/event In directory sc8-pr-cvs1:/tmp/cvs-serv31943/src/ictk/boardgame/chess/net/ics/event Modified Files: ICSBoardUpdateEvent.java ICSHistoryEvent.java ICSMoveListEvent.java Log Message: Updated docs about new features and build file to do distribution and hints about deleting generated source files. Index: ICSBoardUpdateEvent.java =================================================================== RCS file: /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics/event/ICSBoardUpdateEvent.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ICSBoardUpdateEvent.java 23 Aug 2003 09:08:10 -0000 1.3 --- ICSBoardUpdateEvent.java 1 Oct 2003 06:37:18 -0000 1.4 *************** *** 27,38 **** --- 27,51 ---- import ictk.boardgame.chess.net.ics.*; + /* ICSBoardUpdateEvent ******************************************************/ + /** A board representation that indicates the client should update the + * local representation of the board. An example of this is Sytle12. + */ public class ICSBoardUpdateEvent extends ICSEvent implements ICSBoardEvent { + public static final int EVENT_TYPE = ICSEvent.BOARD_UPDATE_EVENT; + + /** this is an isolated position the user is looking at. This + ** arrises as a result of "ref 3" or the "sposition" command */ public static final int ISO_POSITION_RELATION = -3, + /** this is a game being examined that the user is observing */ OBSERVING_EXAMINED_RELATION = -2, + /** this is a game the user is observing */ EXAMINING_RELATION = 2, + /** this is a game the user is playing but it is not his move */ PLAYING_NOT_MY_MOVE_RELATION = -1, + /** this is a game the user is playing and it is his move */ PLAYING_MY_MOVE_RELATION = 1, + /** this is a game being played that the user is observing */ OBSERVING_PLAY_RELATION = 0; *************** *** 51,55 **** boardNumber, moveNumber, ! /*** my relation to this game: -3 isolated position, such as for "ref 3" or the "sposition" command -2 I am observing game being examined --- 64,69 ---- boardNumber, moveNumber, ! ! /** my relation to this game: -3 isolated position, such as for "ref 3" or the "sposition" command -2 I am observing game being examined *************** *** 189,192 **** --- 203,208 ---- //////////////////////////////////////////////////////////////////////// + /** this is completely temporary and only for diagnostic purposes. + */ public String getReadable () { StringBuffer sb = new StringBuffer(80); *************** *** 237,240 **** return getReadable(); } - } --- 253,255 ---- Index: ICSHistoryEvent.java =================================================================== RCS file: /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics/event/ICSHistoryEvent.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ICSHistoryEvent.java 13 May 2003 16:01:39 -0000 1.2 --- ICSHistoryEvent.java 1 Oct 2003 06:37:18 -0000 1.3 *************** *** 29,32 **** --- 29,36 ---- import java.io.IOException; + /* ICSHistoryEvent **********************************************************/ + /** A history of games played by a particular user. This is the result + * of the "history" command. + */ public class ICSHistoryEvent extends ICSEvent { //static/////////////////////////////////////////////////////////////// *************** *** 49,55 **** public void setHistoryList (ICSGameInfo[] l) { list = l; } public String getReadable () { return "History List"; } - } --- 53,60 ---- public void setHistoryList (ICSGameInfo[] l) { list = l; } + /** doesn't do much yet. + */ public String getReadable () { return "History List"; } } Index: ICSMoveListEvent.java =================================================================== RCS file: /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics/event/ICSMoveListEvent.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ICSMoveListEvent.java 24 Aug 2003 07:16:35 -0000 1.5 --- ICSMoveListEvent.java 1 Oct 2003 06:37:18 -0000 1.6 *************** *** 31,34 **** --- 31,38 ---- import java.util.Calendar; + /* ICSMoveListEvent *********************************************************/ + /** A list of moves from a game. This is the result of the commands: + * "moves" or "smoves". + */ public class ICSMoveListEvent extends ICSEvent implements ICSBoardEvent{ |
From: <jva...@us...> - 2003-09-30 20:19:55
|
Update of /cvsroot/ictk/ictk In directory sc8-pr-cvs1:/tmp/cvs-serv19079 Modified Files: HACKING README TODO AUTHORS Log Message: updates before release. Index: HACKING =================================================================== RCS file: /cvsroot/ictk/ictk/HACKING,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HACKING 21 Jul 2003 02:40:08 -0000 1.2 --- HACKING 30 Sep 2003 20:19:52 -0000 1.3 *************** *** 46,49 **** --- 46,58 ---- + ICS EVENTS + ---------- + Most ICS event code is generated from XML through a XSTL translator against + a template. There are very few exceptions to this (style12 and movelist to + name just 2). Submitting changes to the Java code for the generated files + is okay, but it's prefered that you submit a change for the XML instead, or + at least a change that doesn't necessitate changing the template. + + DOCUMENTATION ------------- *************** *** 76,77 **** --- 85,89 ---- Best of luck to you. + + --- + Last Updated: 2003-09-30 by jvarsoke Index: README =================================================================== RCS file: /cvsroot/ictk/ictk/README,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** README 20 Jul 2003 16:06:45 -0000 1.3 --- README 30 Sep 2003 20:19:52 -0000 1.4 *************** *** 40,43 **** --- 40,49 ---- suite. + o Xalan-Java 2.5.0 or better + this is only necessary if you wish to generate the net events and + parsers from their XML source. Really, any XSLT processor + should work, but Xalan-Java is integrated into the Ant build tool + configuration files. + LICENSE ------- *************** *** 81,92 **** which might look something like this: /usr/local/jdk/jre/lib/ext ! * Source: ! If you've downloaded the source tar-ball then just untar it into a ! directory of your choosing. From there you can use Ant to build the classes or the Jar file if need be. $ ant compile DEBUGGING --- 87,107 ---- which might look something like this: /usr/local/jdk/jre/lib/ext ! * Source (generated): ! If you've downloaded the (generated) source tar-ball then just untar it ! into a directory of your choosing. From there you can use Ant to build the classes or the Jar file if need be. $ ant compile + * Source (non-generated): + + The non-generated version of the source tar-ball is default source + distribution. It contains the XML source files necessary to generate the + ICS Event parsing Java source. + + $ ant generate + $ ant compile + DEBUGGING *************** *** 130,131 **** --- 145,149 ---- version there, as well as the CVS (which is highly unstable). Enjoy the library. + + --- + Last Updated: 2003-09-30 by jvarsoke Index: TODO =================================================================== RCS file: /cvsroot/ictk/ictk/TODO,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TODO 19 Jul 2003 15:16:33 -0000 1.3 --- TODO 30 Sep 2003 20:19:52 -0000 1.4 *************** *** 7,11 **** general order of priority: ! o FICS support o Cloning support for classes o CrazyHouse --- 7,11 ---- general order of priority: ! o FICS support (continuing to implement full server protocol) o Cloning support for classes o CrazyHouse *************** *** 28,29 **** --- 28,32 ---- For a more complete and updated list, check out the Features section of the ictk.sourceforge.net project page. + + --- + Last Updated: 2003-09-30 by jvarsoke Index: AUTHORS =================================================================== RCS file: /cvsroot/ictk/ictk/AUTHORS,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AUTHORS 15 Jul 2003 01:21:56 -0000 1.3 --- AUTHORS 30 Sep 2003 20:19:52 -0000 1.4 *************** *** 22,24 **** --- 22,27 ---- ------------ David Spencer + Franck (obelixft) + --- + Last Updated: 2003-09-30 by jvarsoke |
From: <jva...@us...> - 2003-09-30 19:42:22
|
Update of /cvsroot/ictk/ictk In directory sc8-pr-cvs1:/tmp/cvs-serv11571 Modified Files: build.xml Log Message: added jar-nonet target for building a jar w/o the Net libraries. Index: build.xml =================================================================== RCS file: /cvsroot/ictk/ictk/build.xml,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** build.xml 26 Aug 2003 20:43:08 -0000 1.25 --- build.xml 30 Sep 2003 19:42:18 -0000 1.26 *************** *** 32,37 **** <!-- global properties --> ! <property name="version" value="0.1.3"/> ! <property name="cvs.tag" value="ictk-v0_1_3-Release"/> <property name="build.file.id" value="$Id$"/> <!-- if you want 'protected' docs, you should set this variable --- 32,37 ---- <!-- global properties --> ! <property name="version" value="0.2.0"/> ! <property name="cvs.tag" value="ictk-v0_2_0-Release"/> <property name="build.file.id" value="$Id$"/> <!-- if you want 'protected' docs, you should set this variable *************** *** 46,49 **** --- 46,50 ---- <property name="release.file" value="ictk-${version}"/> <property name="output.jar" value="${release.file}.jar"/> + <property name="nonet.jar" value="${release.file}-nonet.jar"/> <!--JUnit --> *************** *** 331,334 **** --- 332,345 ---- </target> + <target name="jar-nonet" depends="compile" + description="builds a jar file w/o the Net libraries"> + <jar + jarfile="${nonet.jar}" + basedir="${build.dir}" + compress="no" + excludes="**/net/**" + /> + </target> + <!-- ..................................................................--> *************** *** 383,387 **** <!-- binary distribution files --> ! <target name="bin" depends="clean,jar,docs" description="create the binary release file"> <property name="bin.include" --- 394,398 ---- <!-- binary distribution files --> ! <target name="bin" depends="clean,jar,jar-nonet,docs" description="create the binary release file"> <property name="bin.include" |
From: <jva...@us...> - 2003-09-30 17:27:43
|
Update of /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics/event In directory sc8-pr-cvs1:/tmp/cvs-serv13891/src/ictk/boardgame/chess/net/ics/event Modified Files: challenge.xml Log Message: Challenge event also knows of "abuser" status now. Index: challenge.xml =================================================================== RCS file: /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics/event/challenge.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** challenge.xml 30 Sep 2003 10:40:41 -0000 1.2 --- challenge.xml 30 Sep 2003 17:27:37 -0000 1.3 *************** *** 81,84 **** --- 81,88 ---- functname="Computer" /> + <member id="challenge:abuser" typeref="boolean" + varname="abuser" + functname="Abuser" + /> <!--parser--> *************** *** 118,122 **** (?:--\*\*\s <regexref ref="regex:fics:player"/> ! \sis\sa\s(computer)\s\*\*--\n)? <!-- computer account --> You\scan\s"accept"\sor\s"decline",\sor\spropose\sdifferent\sparameters\. </regex> --- 122,126 ---- (?:--\*\*\s <regexref ref="regex:fics:player"/> ! \sis\san?\s(computer|abuser)\s\*\*--\n)? <!-- computer/abuser account --> You\scan\s"accept"\sor\s"decline",\sor\spropose\sdifferent\sparameters\. </regex> *************** *** 141,145 **** //probably more than just "computer" here, but need to see it. if (m.group(12) != null) { ! evt.setComputer(true); } </assignMatches> --- 145,155 ---- //probably more than just "computer" here, but need to see it. if (m.group(12) != null) { ! if ("computer".equals(m.group(12))) ! evt.setComputer(true); ! else if ("abuser".equals(m.group(12))) ! evt.setAbuser(true); ! else ! Log.error(Log.PROG_WARNING, ! "unknown Challenge event alert: " + m.group(12)); } </assignMatches> *************** *** 187,190 **** --- 197,206 ---- .append(evt.getChallenger()) .append(" is a computer **--\n"); + } + + if (evt.isAbuser()) { + sb.append("--** ") + .append(evt.getChallenger()) + .append(" is an abuser **--\n"); } |
From: <jva...@us...> - 2003-09-30 17:27:42
|
Update of /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics/fics In directory sc8-pr-cvs1:/tmp/cvs-serv13891/src/ictk/boardgame/chess/net/ics/fics Modified Files: FICSProtocolHandler.java Log Message: Challenge event also knows of "abuser" status now. Index: FICSProtocolHandler.java =================================================================== RCS file: /cvsroot/ictk/ictk/src/ictk/boardgame/chess/net/ics/fics/FICSProtocolHandler.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** FICSProtocolHandler.java 30 Sep 2003 10:40:41 -0000 1.22 --- FICSProtocolHandler.java 30 Sep 2003 17:27:37 -0000 1.23 *************** *** 57,60 **** --- 57,61 ---- protected int SOCKET_DELAY = 1000; + //FIXME: this stuff is WAY too server specific protected String LOGIN_PROMPT = "login:", PASSWD_PROMPT = "password:", *************** *** 68,105 **** //common regex phrases protected final static String REGEX_handle = "([\\w]+)", ! REGEX_acct_type = "(\\(\\S*\\))?", ! REGEX_rating = "\\(\\s*([0-9+-]+[EP]?)\\)"; ! ! //NEED: RATING - UNR is a possiblity ! ! //colors ! public final static char ESC = '\u001B'; ! public final static String BLACK = "[0;30", ! RED = "[0;31m", ! GREEN = "[0;32m", ! YELLOW = "[0;33m", ! BLUE = "[0;34m", ! MAGENTA = "[0;35m", ! CYAN = "[0;36m", ! WHITE = "[0;37m", ! BOLD_BLACK = "[1;30m", ! BOLD_RED = "[1;31m", ! BOLD_GREEN = "[1;32m", ! BOLD_YELLOW = "[1;33m", ! BOLD_BLUE = "[1;34m", ! BOLD_MAGENTA = "[1;35m", ! BOLD_CYAN = "[1;36m", ! BOLD_WHITE = "[1;37m", ! PLAIN = "[0;m"; ! static final protected Pattern ! takebackPattern, ! availInfoPattern; final protected ICSEventParser[] eventFactories; - /** Telnet connection to server */ - // boolean loggedIn = false; - /** is block_mode turned on for the server protocol. */ boolean isBlockMode = false; --- 69,81 ---- //common regex phrases protected final static String REGEX_handle = "([\\w]+)", ! REGEX_acct_type = "(\\(\\S*\\))?"; ! //FIXME: RATING - UNR is a possiblity + /** parsers for various events from the server. + ** The order of the parsers should be optimized by frequency + ** of events. */ final protected ICSEventParser[] eventFactories; /** is block_mode turned on for the server protocol. */ boolean isBlockMode = false; *************** *** 113,150 **** CharBuffer buffer = CharBuffer.allocate(BUFFER_SIZE); - //constructor////////////////////////////////////////////////////////// - static { - //patterns - takebackPattern = Pattern.compile("^(" //beginning - + REGEX_handle //player - + "\\swould like to take back\\s" - + "(\\d+)" //number of half moves - + "\\shalf move\\(s\\)\\." - + ")" //end match - , Pattern.MULTILINE | Pattern.DOTALL); - - availInfoPattern = Pattern.compile("^(" //beginning - + REGEX_handle //player - + REGEX_acct_type - + "\\s" - + "(Blitz\\s?" - + REGEX_rating - + ", Std\\s?" - + REGEX_rating - + ", Wild\\s?" - + REGEX_rating - + ", Light\\s?" - + REGEX_rating - + ", Bug\\s?" - + REGEX_rating - + ")?" - + ".*is" - + "(.+)" //"now" or "no longer" - + "\\savailable for matches\\." - + ")" - , Pattern.MULTILINE | Pattern.DOTALL); - } - - //constructors///////////////////////////////////////////////////////////// public FICSProtocolHandler () { --- 89,92 ---- *************** *** 393,399 **** //isBlockMode = true; sendCommand("set prompt", false); - sendCommand("set interface " + INTERFACE_NAME, false); - sendCommand("iset ms 1", false); sendCommand("set style 12", false); sendCommand("set bell 0", false); } --- 335,341 ---- //isBlockMode = true; sendCommand("set prompt", false); sendCommand("set style 12", false); + sendCommand("iset ms 1", false); + sendCommand("set interface " + INTERFACE_NAME, false); sendCommand("set bell 0", false); } *************** *** 427,438 **** while ((b = in.read()) != -1) { ! //FIXME: diagnostics //out of range invisible characters //10 is \n //13 is \r ? if (b!= 10 && b!=13 && (b < 32 || b > 126)) { String foo = "[" + b + "]"; for (int z=0;z<foo.length();z++) buffer.put(foo.charAt(z)); } --- 369,382 ---- while ((b = in.read()) != -1) { ! //diagnostics //out of range invisible characters //10 is \n //13 is \r ? if (b!= 10 && b!=13 && (b < 32 || b > 126)) { + /* String foo = "[" + b + "]"; for (int z=0;z<foo.length();z++) buffer.put(foo.charAt(z)); + */ } *************** *** 476,480 **** e.printStackTrace(); } - //System.out.println("FICSProtocolHandler: socket connection closed"); } --- 420,423 ---- *************** *** 593,597 **** e.printStackTrace(); } - //System.out.println("FICSProtocolHandler: socket connection closed"); } --- 536,539 ---- *************** *** 660,670 **** } ! if (found) { /*no-op*/ } ! else if ((matcher = match(takebackPattern, str)) != null) ! sendTakeBackEvent(matcher); ! else if ((matcher = match(availInfoPattern, str)) != null) ! sendAvailInfoEvent(matcher); ! ! else System.out.println(str); --- 602,606 ---- } ! if (!found) System.out.println(str); *************** *** 679,682 **** --- 615,619 ---- } + /* protected Matcher match (Pattern p, CharSequence str) { Matcher m = null; *************** *** 688,694 **** return null; } //parseResponse///////////////////////////////////////////////////////////// ! protected void parseResponse (int id, int cmd, CharSequence str) { /* ICSEvent icsEvent = null; --- 625,634 ---- return null; } + */ //parseResponse///////////////////////////////////////////////////////////// ! /** <b>used for blockmode, currently disabled</b> ! */ ! private void parseResponse (int id, int cmd, CharSequence str) { /* ICSEvent icsEvent = null; *************** *** 720,753 **** + str.toString() + "</BLOCK>"); */ - } - - - //actions////////////////////////////////////////////////////////////////// - protected void sendConnectionEvent (Matcher m) { - System.out.println(ESC + BOLD_BLACK + m.group() + ESC + PLAIN); - } - - protected void sendBoardEvent (Matcher m) { - System.out.println(ESC + YELLOW + m.group() + ESC + PLAIN); - } - - protected void sendMoveListEvent (Matcher m) { - System.out.println(ESC + YELLOW + m.group() + ESC + PLAIN); - debugGroupDump(m); - } - - protected void sendTakeBackEvent (Matcher m) { - System.out.println(ESC + RED + m.group() + ESC + PLAIN); - } - - protected void sendAvailInfoEvent (Matcher m) { - System.out.println(ESC + BOLD_BLACK + m.group() + ESC + PLAIN); - } - - //debug functions//////////////////////////////////////////////////////// - private void debugGroupDump (Matcher m) { - for(int i=0; i<=m.groupCount(); i++) { - System.out.println(i + ": " + m.group(i)); - } } } --- 660,663 ---- |