@@ -65,7 +65,7 @@ void Diag::Begin ( void )
65
65
if ( !( CheckForFile ( GTAPath + szFilename ) ) )
66
66
{
67
67
std::cout << " Missing GTA file: " << fileList[i].szFilename << std::endl; // output any messed up file
68
- bQuit = true ; // we need to quit since the user's GTA install is probably screwed up
68
+ // bQuit = true; // we need to quit since the user's GTA install is probably screwed up
69
69
}
70
70
std::cout << " \r Checking " << ( i + 1 ) << " out of " << ( sizeof ( fileList ) / sizeof ( fileList[0 ] ) ) << " ..." ;
71
71
}
@@ -158,9 +158,16 @@ void Diag::Begin ( void )
158
158
159
159
// write some of MTA's logs to our log
160
160
Log::WriteFileToLog ( MTAPath + " \\ MTA\\ core.log" , " core.log" );
161
+
162
+ // 1.4
161
163
Log::WriteFileToLog ( MTAPath + " \\ MTA\\ logfile.txt" , " logfile.txt" );
162
164
Log::WriteFileToLog ( MTAPath + " \\ MTA\\ logfile_old.txt" , " logfile_old.txt" );
163
165
Log::WriteFileToLog ( MTAPath + " \\ MTA\\ CEGUI.log" , " CEGUI.log" );
166
+ // 1.5
167
+ Log::WriteFileToLog ( MTAPath + " \\ MTA\\ logs\\ logfile.txt" , " logfile.txt" );
168
+ Log::WriteFileToLog ( MTAPath + " \\ MTA\\ logs\\ logfile.txt.1" , " logfile.txt.1" );
169
+ Log::WriteFileToLog ( MTAPath + " \\ MTA\\ logs\\ CEGUI.log" , " CEGUI.log" );
170
+
164
171
Log::WriteFileToLog ( MTAPath + " \\ timings.log" , " timings.log" );
165
172
Log::WriteFileToLog ( MTAPath + " \\ mods\\ deathmatch\\ resources\\ benchmark\\ output\\ bench.log" , " bench.log" ); // FPS benchmark log
166
173
if ( IsVistaOrNewer () ) { Log::WriteFileToLog ( programData + " \\ MTA San Andreas All\\ " + MTAShortVersion + " \\ report.log" , " report.log" ); }
@@ -203,7 +210,7 @@ void Diag::Begin ( void )
203
210
PasteBinResult = Curl::CreateMTAPasteBin ( files[0 ], logFileName ); // store the HTTP POST result into PasteBinResult
204
211
205
212
// upload successful; copy URL to clipboard
206
- if ( HasDigits ( PasteBinResult ) && !( strstr ( PasteBinResult.c_str (), " DOCTYPE" ) ) )
213
+ if ( HasDigits ( PasteBinResult ) && !( strstr ( PasteBinResult.c_str (), " DOCTYPE" ) ) && !( strstr ( PasteBinResult. c_str (), " error " ) ) )
207
214
{
208
215
PasteBinResult.insert ( 0 , " http://pastebin.mtasa.com/" );
209
216
if ( CopyToClipboard ( PasteBinResult ) ) // was copying to clipboard successful?
@@ -220,7 +227,7 @@ void Diag::Begin ( void )
220
227
{
221
228
std::cout << std::endl << std::endl << " Failed to upload log file to MTA Pastebin." << std::endl;
222
229
std::cout << " Error code: \" " << PasteBinResult << " \" " << std::endl;
223
- std::cout << " Please paste the contents of the opened Wordpad window at www. pastebin.mtasa.com. " << std::endl;
230
+ std::cout << " Please paste the contents of the opened Wordpad window at http:// pastebin.mtasa.com" << std::endl;
224
231
std::cout << " Include the MTA Pastebin link in your forum post." << std::endl << std::endl;
225
232
ShellExecute ( NULL , " open" , " wordpad.exe" , files[0 ].c_str (), NULL , SW_SHOW );
226
233
}
@@ -322,7 +329,7 @@ void Diag::UserPickVersion ( void )
322
329
std::cout << " You have multiple versions of MTA installed." << std::endl << " Please pick which version to diagnose by entering the number within the brackets:" << std::endl;
323
330
324
331
// iterate through currently installed MTA versions and output them
325
- for (int i = 1 ; i < CUR_MTA_VERSIONS; i++)
332
+ for (int i = 1 ; i <= CUR_MTA_VERSIONS; i++)
326
333
{
327
334
if ( !MTAVersionsInstalled[i].empty () )
328
335
std::cout << " [" << i << " ] 1." << i << std::endl;
@@ -332,10 +339,10 @@ void Diag::UserPickVersion ( void )
332
339
std::cout << " Enter version choice: " ;
333
340
std::cin >> MTAVerChoice;
334
341
335
- if ( MTAVersionsInstalled[MTAVerChoice].empty () || MTAVerChoice >= CUR_MTA_VERSIONS )
342
+ if ( MTAVersionsInstalled[MTAVerChoice].empty () || MTAVerChoice > CUR_MTA_VERSIONS )
336
343
std::cout << " Invalid choice entered." << std::endl;
337
344
338
- } while ( MTAVersionsInstalled[MTAVerChoice].empty () || MTAVerChoice >= CUR_MTA_VERSIONS );
345
+ } while ( MTAVersionsInstalled[MTAVerChoice].empty () || MTAVerChoice > CUR_MTA_VERSIONS );
339
346
}
340
347
341
348
std::string Diag::GetMTAPath ( void )
@@ -494,9 +501,13 @@ void Diag::UpdateDirectX ( void )
494
501
495
502
void Diag::DoSystemCommandWithOutput ( std::string command )
496
503
{
497
- system ( ( command + files[1 ] ).c_str () ); // do the command
504
+ Log::WriteStringToLog ( " ----------------------------------------------------------------------------------" );
505
+ int iCommandReturn = system ( ( command + files[1 ] ).c_str () ); // do the command
506
+
507
+ std::stringstream ss;
508
+ ss << command << " (returned " << iCommandReturn << " )" ;
498
509
499
- Log::WriteFileToLog ( files[1 ], command ); // write the result to the log file with the passed command argument as a description
510
+ Log::WriteFileToLog ( files[1 ], ss. str () ); // write the result to the log file with the passed command argument as a description
500
511
}
501
512
502
513
void Diag::QueryWMIC ( std::string arg1, std::string arg2, std::string arg3, std::string arg4 )
0 commit comments