Rev 174 | Rev 177 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 174 | Rev 175 | ||
|---|---|---|---|
| Line 51... | Line 51... | ||
| 51 | Sleep (100); // wait for the pipe to come to life, stop as soon as it's alive |
51 | Sleep (100); // wait for the pipe to come to life, stop as soon as it's alive |
| 52 | else |
52 | else |
| 53 | break; // wait for the pipe to come to life |
53 | break; // wait for the pipe to come to life |
| 54 | if ((fpipe == NULL) || (attempt_index == 10)) |
54 | if ((fpipe == NULL) || (attempt_index == 10)) |
| 55 | { |
55 | { |
| - | 56 | dont_nag = true; // remember NOT to nag the user if he experienced any bug |
|
| - | 57 | ||
| 56 | messagebox.hWndParent = hMainWnd; |
58 | messagebox.hWndParent = hMainWnd; |
| 57 | wcscpy_s (messagebox.title, WCHAR_SIZEOF (messagebox.title), LOCALIZE (L"ImportantMessage")); |
59 | wcscpy_s (messagebox.title, WCHAR_SIZEOF (messagebox.title), LOCALIZE (L"ImportantMessage")); |
| 58 | wcscpy_s (messagebox.text, WCHAR_SIZEOF (messagebox.text), LOCALIZE (L"Error_ChessEngineInitializationFailed")); |
60 | wcscpy_s (messagebox.text, WCHAR_SIZEOF (messagebox.text), LOCALIZE (L"Error_ChessEngineInitializationFailed")); |
| 59 | messagebox.flags = MB_ICONWARNING | MB_OK; |
61 | messagebox.flags = MB_ICONWARNING | MB_OK; |
| 60 | DialogBox_Message (&messagebox); // display a modeless error message box |
62 | DialogBox_Message (&messagebox); // display a modeless error message box |
| Line 156... | Line 158... | ||
| 156 | 158 | ||
| 157 | // is the game still alive AND has the engine just died ? |
159 | // is the game still alive AND has the engine just died ? |
| 158 | if ((the_board.game_state == STATE_PLAYING) && !pipe_isalive (fpipe)) |
160 | if ((the_board.game_state == STATE_PLAYING) && !pipe_isalive (fpipe)) |
| 159 | { |
161 | { |
| 160 | Debug_Log (L"===Unrecoverable engine error: opponent wins!===\n"); |
162 | Debug_Log (L"===Unrecoverable engine error: opponent wins!===\n"); |
| - | 163 | dont_nag = true; // remember NOT to nag the user if he experienced any bug |
|
| 161 | 164 | ||
| 162 | // if opponent player is human, play the victory sound, else, play defeat sound at the center of the board |
165 | // if opponent player is human, play the victory sound, else, play defeat sound at the center of the board |
| 163 | Audio_PlaySound (opposite_player->type == PLAYER_HUMAN ? SOUNDTYPE_VICTORY : SOUNDTYPE_DEFEAT, 0.0f, 0.0f, 0.04f); |
166 | Audio_PlaySound (opposite_player->type == PLAYER_HUMAN ? SOUNDTYPE_VICTORY : SOUNDTYPE_DEFEAT, 0.0f, 0.0f, 0.04f); |
| 164 | 167 | ||
| 165 | // display a crash notification dialog box |
168 | // display a crash notification dialog box |
| Line 280... | Line 283... | ||
| 280 | 283 | ||
| 281 | // else is it an unrecoverable engine error ? |
284 | // else is it an unrecoverable engine error ? |
| 282 | else if ((wcsstr (line_buffer, L"illegal") != NULL) || (wcsstr (line_buffer, L"invalid") != NULL)) |
285 | else if ((wcsstr (line_buffer, L"illegal") != NULL) || (wcsstr (line_buffer, L"invalid") != NULL)) |
| 283 | { |
286 | { |
| 284 | Debug_Log (L"===Unrecoverable engine error: opponent wins!===\n"); |
287 | Debug_Log (L"===Unrecoverable engine error: opponent wins!===\n"); |
| - | 288 | dont_nag = true; // remember NOT to nag the user if he experienced any bug |
|
| 285 | 289 | ||
| 286 | // if opponent player is human, play the victory sound, else, play defeat sound at the center of the board |
290 | // if opponent player is human, play the victory sound, else, play defeat sound at the center of the board |
| 287 | Audio_PlaySound (opposite_player->type == PLAYER_HUMAN ? SOUNDTYPE_VICTORY : SOUNDTYPE_DEFEAT, 0.0f, 0.0f, 0.04f); |
291 | Audio_PlaySound (opposite_player->type == PLAYER_HUMAN ? SOUNDTYPE_VICTORY : SOUNDTYPE_DEFEAT, 0.0f, 0.0f, 0.04f); |
| 288 | 292 | ||
| 289 | // display a crash notification dialog box |
293 | // display a crash notification dialog box |