aboutsummaryrefslogtreecommitdiffstats
path: root/FICS
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2023-12-13 17:56:50 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2023-12-13 17:56:50 +0100
commitc36126d2324e312bb3f61608f12b30f780f52f3e (patch)
treef69ee036119c75b066ac75abe1f7c56da67c7e9a /FICS
parent4a41e1010f9ca6d42b38a37d38c96d923152260e (diff)
Reformatted ExamineStored()
Diffstat (limited to 'FICS')
-rw-r--r--FICS/obsproc.c84
1 files changed, 45 insertions, 39 deletions
diff --git a/FICS/obsproc.c b/FICS/obsproc.c
index 52dbfc4..05fd3c3 100644
--- a/FICS/obsproc.c
+++ b/FICS/obsproc.c
@@ -650,51 +650,57 @@ ExamineScratch(int p, param_list param)
MakeFENpos(g, (char *)garray[g].FENstartPos);
}
-PRIVATE int ExamineStored(FILE * fp, int p, char *filename)
+PRIVATE int
+ExamineStored(FILE *fp, int p, char *filename)
{
- int g;
- char category[100], board[100];
- game *gg;
+ char board[100];
+ char category[100];
+ game *gg;
+ int g;
- unobserveAll(p);
+ unobserveAll(p);
- player_decline_offers(p, -1, PEND_MATCH);
- player_withdraw_offers(p, -1, PEND_MATCH);
- player_withdraw_offers(p, -1, PEND_SIMUL);
+ player_decline_offers(p, -1, PEND_MATCH);
+ player_withdraw_offers(p, -1, PEND_MATCH);
+ player_withdraw_offers(p, -1, PEND_SIMUL);
- g = game_new();
- gg = &garray[g];
- category[0] = '\0';
- board[0] = '\0';
- if (board_init(&gg->game_state, category, board)) {
- pprintf(p, "PROBLEM LOADING BOARD. Game Aborted.\n");
- fprintf(stderr, "FICS: PROBLEM LOADING BOARD %s %s. Game Aborted.\n",
- category, board);
- return -1;
- }
- gg->status = GAME_EXAMINE;
- if (ReadGameAttrs(fp, filename, g) < 0) {
- pprintf(p, "Gamefile is corrupt; please notify an admin.\n");
- return -1;
- }
- gg->totalHalfMoves = gg->numHalfMoves;
- gg->numHalfMoves = 0;
- gg->revertHalfMove = 0;
- gg->white = p;
- gg->black = p;
- gg->game_state.gameNum = g;
-
- gg->startTime = tenth_secs();
- gg->lastMoveTime = gg->startTime;
- gg->lastDecTime = gg->startTime;
-
- parray[p].side = WHITE; /* oh well... */
- parray[p].game = g;
+ g = game_new();
+ gg = &garray[g];
- send_boards(g);
- MakeFENpos(g, garray[g].FENstartPos);
+ board[0] = '\0';
+ category[0] = '\0';
- return g;
+ if (board_init(&gg->game_state, category, board)) {
+ pprintf(p, "PROBLEM LOADING BOARD. Game Aborted.\n");
+ fprintf(stderr, "FICS: PROBLEM LOADING BOARD %s %s. "
+ "Game Aborted.\n", category, board);
+ return -1;
+ }
+
+ gg->status = GAME_EXAMINE;
+
+ if (ReadGameAttrs(fp, filename, g) < 0) {
+ pprintf(p, "Gamefile is corrupt; please notify an admin.\n");
+ return -1;
+ }
+
+ gg->startTime = tenth_secs();
+
+ gg->black = p;
+ gg->game_state.gameNum = g;
+ gg->lastDecTime = gg->startTime;
+ gg->lastMoveTime = gg->startTime;
+ gg->numHalfMoves = 0;
+ gg->revertHalfMove = 0;
+ gg->totalHalfMoves = gg->numHalfMoves;
+ gg->white = p;
+
+ parray[p].game = g;
+ parray[p].side = WHITE;
+
+ send_boards(g);
+ MakeFENpos(g, (char *)garray[g].FENstartPos);
+ return g;
}
PRIVATE void ExamineAdjourned(int p, int p1, int p2)