g = pp->game;
} else if (pp->num_observe) {
for (g = 0; g < pp->num_observe; g++) {
- pprintf(p, "%s\n", movesToString(pp->observe_list[g], 0));
+ pprintf_noformat(p, "%s\n", movesToString(pp->observe_list[g], 0));
}
return COM_OK;
} else {
pprintf(p, "Sorry, that is a private game.\n");
return COM_OK;
}
- pprintf(p, "%s\n", movesToString(g, 0)); /* pgn may break interfaces? */
+ pprintf_noformat(p, "%s\n", movesToString(g, 0)); /* pgn may break interfaces? */
return COM_OK;
}
int p1;
char subj[81];
- if (!CheckPFlag(p, PFLAG_REG)) {
- pprintf (p,"Unregistered players cannot use mailmoves.\n");
+ if (param[1].type == TYPE_NULL) {
+ if (!CheckPFlag(p, PFLAG_REG)) {
+ pprintf (p,"Unregistered players must specify their e-mail address.\n");
+ return COM_OK;
+ }
+ } else if(!safestring(param[1].val.string)) {
+ pprintf (p,"Bad e-mail address.\n");
return COM_OK;
}
return COM_OK;
}
sprintf(subj, "FICS game report %s vs %s", game_globals.garray[g].white_name, game_globals.garray[g].black_name);
- if (mail_string_to_user(p, subj,
+ if (param[1].type == TYPE_NULL ? mail_string_to_user(p, subj,
+ movesToString(g, CheckPFlag(p, PFLAG_PGN))) :
+ mail_string_to_address(param[1].val.string, subj,
movesToString(g, CheckPFlag(p, PFLAG_PGN)))) {
pprintf(p, "Moves NOT mailed, perhaps your address is incorrect.\n");
} else {
pprintf(p, "Loading from catagory: %s, board: %s.\n", category, board);
}
+ game_globals.garray[g].FENstartPos[0] = 0; // [HGM] new shuffle game
if (setup) {
board_clear(&game_globals.garray[g].game_state);
game_globals.garray[g].status = GAME_SETUP;
gg = &game_globals.garray[g];
category[0] = '\0';
board[0] = '\0';
+ game_globals.garray[g].FENstartPos[0] = 0; // [HGM] make new shuffle for now
if (board_init(g,&gg->game_state, category, board)) {
pprintf(p, "PROBLEM LOADING BOARD. Examine Aborted.\n");
d_printf( "CHESSD: PROBLEM LOADING BOARD %s %s. Examine Aborted.\n",
game_remove(g);
return -1;
}
+
+ // [HGM] OK, we retreived the game info, which includes variant name as "category/board"
+ // So now we set up the board again, this time for the proper variant (and proper shuffle)
+ sscanf(gg->variant, "%s/%s", category, board);
+ if(category[0] && !board[0]) strcpy(board, "0");
+ if (board_init(g,&gg->game_state, category, board)) {
+ pprintf(p, "PROBLEM LOADING BOARD. Examine Aborted.\n");
+ d_printf( "CHESSD: PROBLEM LOADING BOARD %s %s. Examine Aborted.\n",
+ category, board);
+ game_remove(g);
+ return -1;
+ }
} else if (ReadGameAttrs(fp, g) < 0) {
pprintf(p, "Gamefile is corrupt; please notify an admin.\n");
game_remove(g);
pp->side = WHITE; /* oh well... */
pp->game = g;
-
send_boards(g);
if (CheckPFlag(p, PFLAG_OPEN)) /* was open */
announce_notavail(p);
}
/* Assume old wild games are of type blitz - adjudicators should be
careful */
- g = ExamineStored(fp, p,'b');
+ g = ExamineStored(fp, p,'n');
fclose(fp);
if (g >= 0) {
char fileName2[MAX_FILENAME_SIZE];
FILE* fpGame;
- if (mail && !CheckPFlag(p, PFLAG_REG)) {
- pprintf (p,"Unregistered players cannot use mailstored.\n");
- return;
+ if (param[2].type == TYPE_NULL) {
+ if (!CheckPFlag(p, PFLAG_REG)) {
+ pprintf (p,"Unregistered players must specify their e-mail address.\n");
+ return COM_OK;
+ }
+ } else if(!safestring(param[2].val.string)) {
+ pprintf (p,"Bad e-mail address.\n");
+ return COM_OK;
}
if (!FindPlayer(p, param[0].val.word, &wp, &wconnected))
} else {
sprintf(subj, "FICS adjourned game %s vs %s", game_globals.garray[g].white_name, game_globals.garray[g].black_name);
}
- if (mail_string_to_user(p, subj,
+ if (param[2].type == TYPE_NULL ? mail_string_to_user(p, subj,
+ movesToString(g, CheckPFlag(p, PFLAG_PGN))) :
+ mail_string_to_address(param[2].val.string, subj,
movesToString(g, CheckPFlag(p, PFLAG_PGN))))
pprintf(p, "Moves NOT mailed, perhaps your address is incorrect.\n");
else
pprintf(p, "Moves mailed.\n");
} else {
- pprintf(p, "%s\n", movesToString(g, 0));
+ pprintf_noformat(p, "%s\n", movesToString(g, 0));
} /* Do smoves */
}
}