On request of Mike Adams I added a new zippy option, -zippyShortGame, to make life more difficult for abusers of abort and disconnect for cheating.
char *zippyVariants;
int zippyMaxGames;
int zippyReplayTimeout; /*seconds*/
+ int zippyShortGame; /* [HGM] aborter */
#endif
char *serverMovesName;
{ "zippyVariants", ArgString, (LPVOID) &appData.zippyVariants, FALSE },\r
{ "zippyMaxGames", ArgInt, (LPVOID)&appData.zippyMaxGames, FALSE },\r
{ "zippyReplayTimeout", ArgInt, (LPVOID)&appData.zippyReplayTimeout, FALSE },\r
+ { "zippyShortGame", ArgInt, (LPVOID)&appData.zippyShortGame, FALSE },\r
/* Kludge to allow winboard.ini files from buggy 4.0.4 to be read: */\r
{ "zippyReplyTimeout", ArgInt, (LPVOID)&junk, FALSE },\r
#endif\r
{ "zippyReplayTimeout", "zippyReplayTimeout", XtRInt, sizeof(int),
XtOffset(AppDataPtr, zippyReplayTimeout), XtRImmediate,
(XtPointer) ZIPPY_REPLAY_TIMEOUT },
+ { "zippyShortGame", "zippyShortGame", XtRInt, sizeof(int),
+ XtOffset(AppDataPtr, zippyShortGame), XtRImmediate,
+ (XtPointer) 0 },
#endif
{ "flashCount", "flashCount", XtRInt, sizeof(int),
XtOffset(AppDataPtr, flashCount), XtRImmediate,
{ "-zippyVariants", "zippyVariants", XrmoptionSepArg, NULL },
{ "-zippyMaxGames", "zippyMaxGames", XrmoptionSepArg, NULL },
{ "-zippyReplayTimeout", "zippyReplayTimeout", XrmoptionSepArg, NULL },
+ { "-zippyShortGame", "zippyShortGame", XrmoptionSepArg, NULL },
#endif
{ "-flashCount", "flashCount", XrmoptionSepArg, NULL },
{ "-flash", "flashCount", XrmoptionNoArg, "3" },
starts a game between Zippy and the first opponent to respond,
giving Zippy no choice about whether to accept or decline.
+ -zippyShortGame int
+ If zippyShortGame > 0, Zippy will decline all challenges
+ from an opponent that terminated a game before the given number
+ of ply (with an explanatory tell) until either someone else has
+ played or zippyReplayTimeout seconds have elapsed. Do not set
+ the number of moves to large; the number of ply during which
+ opponents can abort a game without rating change would be a
+ good setting. Default: zippyShortGame=0.
+
=====================
ENVIRONMENT VARIABLES
=====================
\r
static char zippyPartner[MSG_SIZ];\r
static char zippyLastOpp[MSG_SIZ];\r
+static char zippyOffender[MSG_SIZ]; // [HGM] aborter\r
static int zippyConsecGames;\r
static time_t zippyLastGameEnd;\r
\r
SendToICS("\n");\r
}\r
zippyLastGameEnd = time(0);\r
+ if(forwardMostMove < appData.zippyShortGame) \r
+ strcpy(zippyOffender, zippyLastOpp); else zippyOffender[0] = 0; // [HGM] aborter\r
}\r
\r
/*\r
return;\r
}\r
\r
+ /* [HGM] aborter: opponent is cheater that aborts games he doesn't like on first move. Make him wait */\r
+ if (strcmp(opponent, zippyOffender) == 0 &&\r
+ difftime(time(0), zippyLastGameEnd) < appData.zippyReplayTimeout) {\r
+ sprintf(buf, "%stell %s Sorry, your previous game against %s was rather short. "\r
+ " It will wait %d seconds to see if a tougher opponent comes along.\n%sdecline %s\n",\r
+ ics_prefix, opponent, ics_handle,\r
+ appData.zippyReplayTimeout, ics_prefix, opponent);\r
+ SendToICS(buf);\r
+ return;\r
+ }\r
+\r
/* Engine not yet initialized or still thinking about last game? */\r
if (!first.initDone || first.lastPing != first.lastPong) {\r
sprintf(buf, "%stell %s I'm not quite ready for a new game yet; try again soon.\n%sdecline %s\n",\r