X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=zippy.c;h=b2ba7c8d64991b16aa943677daddaafe98f6184f;hb=9384069316e400042076bd749ba0c6e0b07427fa;hp=81144377647a0b0e4b105bb2b919117fd6f2f45c;hpb=570f0d333ffba03730d5bc5a69ef5a509247104f;p=xboard.git diff --git a/zippy.c b/zippy.c index 8114437..b2ba7c8 100644 --- a/zippy.c +++ b/zippy.c @@ -96,6 +96,7 @@ void HandleMachineMove P((char *message, ChessProgramState *cps)); static char zippyPartner[MSG_SIZ]; static char zippyLastOpp[MSG_SIZ]; +static char zippyOffender[MSG_SIZ]; // [HGM] aborter static int zippyConsecGames; static time_t zippyLastGameEnd; @@ -768,6 +769,8 @@ void ZippyGameEnd(result, resultDetails) SendToICS("\n"); } zippyLastGameEnd = time(0); + if(forwardMostMove < appData.zippyShortGame) + strcpy(zippyOffender, zippyLastOpp); else zippyOffender[0] = 0; // [HGM] aborter } /* @@ -835,6 +838,17 @@ void ZippyHandleChallenge(srated, swild, sbase, sincrement, opponent) return; } + /* [HGM] aborter: opponent is cheater that aborts games he doesn't like on first move. Make him wait */ + if (strcmp(opponent, zippyOffender) == 0 && + difftime(time(0), zippyLastGameEnd) < appData.zippyReplayTimeout) { + sprintf(buf, "%stell %s Sorry, your previous game against %s was rather short. " + " It will wait %d seconds to see if a tougher opponent comes along.\n%sdecline %s\n", + ics_prefix, opponent, ics_handle, + appData.zippyReplayTimeout, ics_prefix, opponent); + SendToICS(buf); + return; + } + /* Engine not yet initialized or still thinking about last game? */ if (!first.initDone || first.lastPing != first.lastPong) { sprintf(buf, "%stell %s I'm not quite ready for a new game yet; try again soon.\n%sdecline %s\n",