X-Git-Url: http://winboard.nl/cgi-bin?p=capablanca.git;a=blobdiff_plain;f=lasker-2.2.3%2Fsrc%2Fmatchproc.c;h=88c03666c828a8ceb2a1307a95a10d7f110f6b9e;hp=35f19371504558866616fc06f944ac3fc53c3dd2;hb=ec7b6bb32ba9632cda17b308808ce9ba1e27c090;hpb=76f1e81b3426b94e1d80c9daa309f78045e5335b diff --git a/lasker-2.2.3/src/matchproc.c b/lasker-2.2.3/src/matchproc.c index 35f1937..88c0366 100644 --- a/lasker-2.2.3/src/matchproc.c +++ b/lasker-2.2.3/src/matchproc.c @@ -23,7 +23,7 @@ #include "includes.h" const char *colorstr[] = {"", "[black] ", "[white] "}; -static const char *adjustr[] = {"", " (adjourned)"}; +const char *adjustr[] = {"", " (adjourned)"}; static void prepare_match(int g,int wt,int bt,int winc,int binc,int wp, int bp,int rated) { @@ -156,8 +156,9 @@ static void output_match_messages(int wp,int bp,int g, char* mess) player_globals.parray[bp].name, game_globals.garray[g].black_rating, rstr[game_globals.garray[g].rated], - bstr[game_globals.garray[g].type], - game_globals.garray[g].wInitTime, + //bstr[game_globals.garray[g].type], + game_globals.garray[g].variant, + game_globals.garray[g].wInitTime/600, game_globals.garray[g].wIncrement); pprintf(wp, "%s", outStr); pprintf(bp, "%s", outStr); @@ -168,7 +169,8 @@ static void output_match_messages(int wp,int bp,int g, char* mess) player_globals.parray[bp].name, mess, rstr[game_globals.garray[g].rated], - bstr[game_globals.garray[g].type]); + //bstr[game_globals.garray[g].type]); + game_globals.garray[g].variant); pprintf(wp, "%s", outStr); pprintf(bp, "%s", outStr); @@ -265,6 +267,7 @@ int create_new_match(int g, int white_player, int black_player, decline_withdraw_offers(white_player, -1, PEND_SIMUL, DO_WITHDRAW | DO_DECLINE); } + game_globals.garray[g].FENstartPos[0] = 0; // [HGM] new shuffle if (board_init(g,&game_globals.garray[g].game_state, category, board)) { pprintf(white_player, "PROBLEM LOADING BOARD. Game Aborted.\n"); pprintf(black_player, "PROBLEM LOADING BOARD. Game Aborted.\n"); @@ -279,6 +282,15 @@ int create_new_match(int g, int white_player, int black_player, else game_globals.garray[g].type = game_isblitz(wt, winc, bt, binc, category, board); + if(category && category[0]) { // [HGM] set variant string from directory for games loaded from file + if(!strcmp(category, "wild") && board) + sprintf(game_globals.garray[g].variant, "%s/%s", category, board); + else + strcpy(game_globals.garray[g].variant, category); + } + else + strcpy(game_globals.garray[g].variant, bstr[game_globals.garray[g].type]); + prepare_match(g,wt,bt,winc,binc,white_player,black_player,rated); output_match_messages(white_player,black_player,g, "Creating"); @@ -490,10 +502,50 @@ static int parse_match_string(int p, int* wt,int* bt,int* winc,int* binc, } else { strcpy(category,parsebuf); if (!strncmp("bughouse",category, strlen(category)) - && strlen(category) >= 3) { + && strlen(category) >= 3 || !strcmp("bh", category)) { strcpy(category, "bughouse"); bughouse = 1; } + // [HGM] allow some shortcuts for variant names + if(!strcmp("bh", category)) { + strcpy(category, "bughouse"); + } else + if(!strcmp("zh", category)) { + strcpy(category, "crazyhouse"); + } else + if(!strcmp("fr", category)) { + strcpy(category, "fischerandom"); + } else + if(!strcmp("sj", category)) { + strcpy(category, "shatranj"); + } else + if(!strcmp("gc", category)) { + strcpy(category, "gothic"); + } else + if(!strcmp("ca", category)) { + strcpy(category, "capablanca"); + } else + if(!strcmp("cr", category)) { + strcpy(category, "caparandom"); + } else + if(!strcmp("su", category)) { + strcpy(category, "super"); + } else + if(!strcmp("sc", category)) { + strcpy(category, "seirawan"); + } else + if(!strcmp("sg", category)) { + strcpy(category, "shogi"); + } else + if(!strcmp("km", category)) { + strcpy(category, "knightmate"); + } else + if(!strcmp("gr", category)) { + strcpy(category, "great"); + } else + if(!strcmp("xq", category)) { + strcpy(category, "xiangqi"); + } } } else confused = 1; @@ -503,6 +555,8 @@ static int parse_match_string(int p, int* wt,int* bt,int* winc,int* binc, pprintf(p, "Can't interpret %s in match command.\n", parsebuf); return 0; } + if(category && (!board || !board[0])) + strcpy(board, "0"); // [HGM] variants: always provide default board return 1; }