Subversion Repositories Games.Chess Giants

Rev

Rev 193 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 193 Rev 194
Line 52... Line 52...
52
         Sleep (100); // wait for the pipe to come to life, stop as soon as it's alive
52
         Sleep (100); // wait for the pipe to come to life, stop as soon as it's alive
53
      else
53
      else
54
         break; // wait for the pipe to come to life
54
         break; // wait for the pipe to come to life
55
   if ((fpipe == NULL) || (attempt_index == 10))
55
   if ((fpipe == NULL) || (attempt_index == 10))
56
   {
56
   {
-
 
57
#ifndef NO_REGISTRATION
57
      dont_nag = true; // remember NOT to nag the user if he experienced any bug
58
      dont_nag = true; // remember NOT to nag the user if he experienced any bug
-
 
59
#endif // !NO_REGISTRATION
58
 
60
 
59
      messagebox.hWndParent = hMainWnd;
61
      messagebox.hWndParent = hMainWnd;
60
      wcscpy_s (messagebox.title, WCHAR_SIZEOF (messagebox.title), LOCALIZE (L"ImportantMessage"));
62
      wcscpy_s (messagebox.title, WCHAR_SIZEOF (messagebox.title), LOCALIZE (L"ImportantMessage"));
61
      wcscpy_s (messagebox.text, WCHAR_SIZEOF (messagebox.text), LOCALIZE (L"Error_ChessEngineInitializationFailed"));
63
      wcscpy_s (messagebox.text, WCHAR_SIZEOF (messagebox.text), LOCALIZE (L"Error_ChessEngineInitializationFailed"));
62
      messagebox.flags = MB_ICONWARNING | MB_OK;
64
      messagebox.flags = MB_ICONWARNING | MB_OK;
Line 162... Line 164...
162
 
164
 
163
   // is the game still alive AND has the engine just died ?
165
   // is the game still alive AND has the engine just died ?
164
   if ((the_board.game_state == STATE_PLAYING) && !pipe_isalive (fpipe, &exit_code))
166
   if ((the_board.game_state == STATE_PLAYING) && !pipe_isalive (fpipe, &exit_code))
165
   {
167
   {
166
      Debug_Log (L"===Unrecoverable engine error (engine disappeared unexpectedly with exit code %lld [0x%08x]): opponent wins!===\n", exit_code, exit_code);
168
      Debug_Log (L"===Unrecoverable engine error (engine disappeared unexpectedly with exit code %lld [0x%08x]): opponent wins!===\n", exit_code, exit_code);
-
 
169
#ifndef NO_REGISTRATION
167
      dont_nag = true; // remember NOT to nag the user if he experienced any bug
170
      dont_nag = true; // remember NOT to nag the user if he experienced any bug
-
 
171
#endif // !NO_REGISTRATION
168
 
172
 
169
      // if opponent player is human, play the victory sound, else, play defeat sound at the center of the board
173
      // if opponent player is human, play the victory sound, else, play defeat sound at the center of the board
170
      Audio_PlaySoundAtCenter (opposite_player->type == PLAYER_HUMAN ? SOUNDTYPE_VICTORY : SOUNDTYPE_DEFEAT);
174
      Audio_PlaySoundAtCenter (opposite_player->type == PLAYER_HUMAN ? SOUNDTYPE_VICTORY : SOUNDTYPE_DEFEAT);
171
 
175
 
172
      // display a crash notification dialog box
176
      // display a crash notification dialog box
Line 299... Line 303...
299
 
303
 
300
      // else is it an unrecoverable engine error ?
304
      // else is it an unrecoverable engine error ?
301
      else if ((wcsstr (line_buffer, L"illegal") != NULL) || (wcsstr (line_buffer, L"invalid") != NULL))
305
      else if ((wcsstr (line_buffer, L"illegal") != NULL) || (wcsstr (line_buffer, L"invalid") != NULL))
302
      {
306
      {
303
         Debug_Log (L"===Unrecoverable engine error: opponent wins!===\n");
307
         Debug_Log (L"===Unrecoverable engine error: opponent wins!===\n");
-
 
308
#ifndef NO_REGISTRATION
304
         dont_nag = true; // remember NOT to nag the user if he experienced any bug
309
         dont_nag = true; // remember NOT to nag the user if he experienced any bug
-
 
310
#endif // !NO_REGISTRATION
305
 
311
 
306
         // if opponent player is human, play the victory sound, else, play defeat sound at the center of the board
312
         // if opponent player is human, play the victory sound, else, play defeat sound at the center of the board
307
         Audio_PlaySoundAtCenter (opposite_player->type == PLAYER_HUMAN ? SOUNDTYPE_VICTORY : SOUNDTYPE_DEFEAT);
313
         Audio_PlaySoundAtCenter (opposite_player->type == PLAYER_HUMAN ? SOUNDTYPE_VICTORY : SOUNDTYPE_DEFEAT);
308
 
314
 
309
         // display a crash notification dialog box
315
         // display a crash notification dialog box