Subversion Repositories Games.Chess Giants

Rev

Rev 186 | Rev 193 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 186 Rev 192
Line 140... Line 140...
140
   engineprogram_t *program;
140
   engineprogram_t *program;
141
   wchar_t line_buffer[1024];
141
   wchar_t line_buffer[1024];
142
   wchar_t *line_pointer;
142
   wchar_t *line_pointer;
143
   wchar_t *move_string;
143
   wchar_t *move_string;
144
   int64_t exit_code;
144
   int64_t exit_code;
-
 
145
   int engine_index;
145
   int char_index;
146
   int char_index;
146
   int length;
147
   int length;
147
   boardmove_t move;
148
   boardmove_t move;
148
   player_t *current_player;
149
   player_t *current_player;
149
   player_t *opposite_player;
150
   player_t *opposite_player;
Line 169... Line 170...
169
      Audio_PlaySoundAtCenter (opposite_player->type == PLAYER_HUMAN ? SOUNDTYPE_VICTORY : SOUNDTYPE_DEFEAT);
170
      Audio_PlaySoundAtCenter (opposite_player->type == PLAYER_HUMAN ? SOUNDTYPE_VICTORY : SOUNDTYPE_DEFEAT);
170
 
171
 
171
      // display a crash notification dialog box
172
      // display a crash notification dialog box
172
      if (MessageBox (hMainWnd, LOCALIZE (L"Error_EngineCrashed"), LOCALIZE (L"ImportantMessage"), MB_ICONWARNING | MB_YESNO) == IDYES)
173
      if (MessageBox (hMainWnd, LOCALIZE (L"Error_EngineCrashed"), LOCALIZE (L"ImportantMessage"), MB_ICONWARNING | MB_YESNO) == IDYES)
173
      {
174
      {
174
         sprintf_s ((char *) line_buffer, sizeof (line_buffer), "engine disappeared unexpectedly (exit code %lld)", exit_code);
175
         sprintf_s ((char *) line_buffer, sizeof (line_buffer), "engine disappeared unexpectedly (exit code %lld / 0x%llx)", exit_code, exit_code);
175
         if (Debug_SendLogToAuthor ((char *) line_buffer, true))
176
         if (Debug_SendLogToAuthor ((char *) line_buffer, true))
176
            MessageBox (hMainWnd, LOCALIZE (L"MessageSent"), PROGRAM_NAME, MB_ICONINFORMATION | MB_OK); // send the game engine history to the author
177
            MessageBox (hMainWnd, LOCALIZE (L"MessageSent"), PROGRAM_NAME, MB_ICONINFORMATION | MB_OK); // send the game engine history to the author
177
         else
178
         else
178
            MessageBox (hMainWnd, LOCALIZE (L"NoInternetConnection"), LOCALIZE (L"FatalError"), MB_ICONWARNING | MB_OK); // and display an error message if failed
179
            MessageBox (hMainWnd, LOCALIZE (L"NoInternetConnection"), LOCALIZE (L"FatalError"), MB_ICONWARNING | MB_OK); // and display an error message if failed
179
      }
180
      }
Line 181... Line 182...
181
      // and display the game over dialog box
182
      // and display the game over dialog box
182
      the_board.game_state = (opposite_player->color == COLOR_BLACK ? STATE_WHITEWIN_RESIGNORFORFEIT : STATE_BLACKWIN_RESIGNORFORFEIT);
183
      the_board.game_state = (opposite_player->color == COLOR_BLACK ? STATE_WHITEWIN_RESIGNORFORFEIT : STATE_BLACKWIN_RESIGNORFORFEIT);
183
      DialogBox_EndGame ();
184
      DialogBox_EndGame ();
184
 
185
 
185
      do_update = true; // remember to update the 3D scene
186
      do_update = true; // remember to update the 3D scene
-
 
187
 
-
 
188
      // no matter what the cause was, remember this engine crashed and select the next one in list for the next game
-
 
189
      options.engine.programs[options.engine.selected_program].already_crashed = true; // remember this engine crashed
-
 
190
      for (engine_index = (options.engine.selected_program + 1) % options.engine.program_count; engine_index != options.engine.selected_program; engine_index = (engine_index + 1) % options.engine.program_count)
-
 
191
         if (!options.engine.programs[engine_index].already_crashed)
-
 
192
         {
-
 
193
            options.engine.selected_program = engine_index; // select the first next engine in list that hasn't crashed yet
-
 
194
            break; // and stop searching
-
 
195
         }
186
   }
196
   }
187
 
197
 
188
   // read from pipe (non-blocking)
198
   // read from pipe (non-blocking)
189
   PlayerEngine_Recv (player);
199
   PlayerEngine_Recv (player);
190
 
200