Include steam.inf in crash metadata
This commit is contained in:
		
							parent
							
								
									d2ad4eb071
								
							
						
					
					
						commit
						e4a0c190ab
					
				| @ -54,6 +54,7 @@ char crashCommandLine[1024]; | ||||
| char crashSourceModPath[512]; | ||||
| char crashGameDirectory[256]; | ||||
| char crashExtensionVersion[32]; | ||||
| char steamInf[512]; | ||||
| 
 | ||||
| char dumpStoragePath[512]; | ||||
| char logPath[512]; | ||||
| @ -124,14 +125,17 @@ static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, | ||||
| 	sys_write(extra, crashGameDirectory, my_strlen(crashGameDirectory)); | ||||
| 	sys_write(extra, "\nExtensionVersion=", 18); | ||||
| 	sys_write(extra, crashExtensionVersion, my_strlen(crashExtensionVersion)); | ||||
| 	sys_write(extra, steamInf, my_strlen(steamInf)); | ||||
| 	sys_write(extra, "\n-------- CONFIG END --------\n", 30); | ||||
| 
 | ||||
| 	if (GetSpew) { | ||||
| 		GetSpew(spewBuffer, sizeof(spewBuffer)); | ||||
| 		if (my_strlen(spewBuffer) > 0) { | ||||
| 			sys_write(extra, "-------- CONSOLE HISTORY BEGIN --------\n", 40); | ||||
| 			sys_write(extra, spewBuffer, my_strlen(spewBuffer)); | ||||
| 			sys_write(extra, "-------- CONSOLE HISTORY END --------\n", 38); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| #if 0 | ||||
| 	char pis[64]; | ||||
| @ -270,10 +274,22 @@ static bool dumpCallback(const wchar_t* dump_path, | ||||
| 		return succeeded; | ||||
| 	} | ||||
| 
 | ||||
| 	fprintf(extra, "-------- CONFIG BEGIN --------"); | ||||
| 	fprintf(extra, "\nMap=%s", crashMap); | ||||
| 	fprintf(extra, "\nGamePath=%s", crashGamePath); | ||||
| 	fprintf(extra, "\nCommandLine=%s", crashCommandLine); | ||||
| 	fprintf(extra, "\nSourceModPath=%s", crashSourceModPath); | ||||
| 	fprintf(extra, "\nGameDirectory=%s", crashGameDirectory); | ||||
| 	fprintf(extra, "\nExtensionVersion=%s", crashExtensionVersion); | ||||
| 	fprintf(extra, "%s", steamInf); | ||||
| 	fprintf(extra, "\n-------- CONFIG END --------\n"); | ||||
| 
 | ||||
| 	if (GetSpew) { | ||||
| 		GetSpew(spewBuffer, sizeof(spewBuffer)); | ||||
| 		if (strlen(spewBuffer) > 0) { | ||||
| 			fprintf(extra, "-------- CONSOLE HISTORY BEGIN --------\n%s-------- CONSOLE HISTORY END --------\n", spewBuffer); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
|   fclose(extra); | ||||
| 
 | ||||
| @ -417,7 +433,7 @@ bool Accelerator::SDK_OnLoad(char *error, size_t maxlength, bool late) | ||||
| 	if (!gameconfs->LoadGameConfigFile("accelerator.games", &gameconfig, gameconfigError, sizeof(gameconfigError))) { | ||||
| 		smutils->LogError(myself, "WARNING: Failed to load gamedata file, console output and command line will not be included in crash reports: %s", gameconfigError); | ||||
| 	} else if (!gameconfig->GetMemSig("GetSpew", (void **)&GetSpew)) { | ||||
| 		smutils->LogError(myself, "WARNING: GetSpew not found in gamedata, console output will not be included in crash reports."); | ||||
| 		smutils->LogMessage(myself, "WARNING: GetSpew not found in gamedata, console output will not be included in crash reports."); | ||||
| 	} else if (!GetSpew) { | ||||
| 		smutils->LogError(myself, "WARNING: Sigscan for GetSpew failed, console output will not be included in crash reports."); | ||||
| 	} | ||||
| @ -534,5 +550,38 @@ void Accelerator::OnCoreMapStart(edict_t *pEdictList, int edictCount, int client | ||||
| 	strncpy(crashSourceModPath, g_pSM->GetSourceModPath(), sizeof(crashSourceModPath) - 1); | ||||
| 	strncpy(crashGameDirectory, g_pSM->GetGameFolderName(), sizeof(crashGameDirectory) - 1); | ||||
| 	strncpy(crashExtensionVersion, SMEXT_CONF_VERSION, sizeof(crashExtensionVersion) - 1); | ||||
| } | ||||
| 
 | ||||
| 	char steamInfPath[512]; | ||||
| 	g_pSM->BuildPath(Path_Game, steamInfPath, sizeof(steamInfPath), "steam.inf"); | ||||
| 
 | ||||
| 	char steamInfTemp[256] = {0}; | ||||
| 	FILE *f = fopen(steamInfPath, "rb"); | ||||
| 	fread(steamInfTemp, sizeof(char), sizeof(steamInfTemp) - 1, f); | ||||
| 	fclose(f); | ||||
| 
 | ||||
| 	// This is horrible, but I'm busy and this is
 | ||||
| 	// the first thing I thought of that would work.
 | ||||
| 	unsigned source = 0; | ||||
| 	strcat(steamInf, "\nSteam_"); | ||||
| 	unsigned target = strlen(steamInf); | ||||
| 	while (true) { | ||||
| 		if (steamInfTemp[source] == '\0') { | ||||
| 			source++; | ||||
| 			break; | ||||
| 		} | ||||
| 		if (steamInfTemp[source] == '\r') { | ||||
| 			source++; | ||||
| 			continue; | ||||
| 		} | ||||
| 		if (steamInfTemp[source] == '\n') { | ||||
| 			source++; | ||||
| 			if (steamInfTemp[source] == '\0') { | ||||
| 				break; | ||||
| 			} | ||||
| 			strcat(steamInf, "\nSteam_"); | ||||
| 			target = strlen(steamInf); | ||||
| 			continue; | ||||
| 		} | ||||
| 		steamInf[target++] = steamInfTemp[source++]; | ||||
| 	} | ||||
| } | ||||
|  | ||||
| @ -18,9 +18,9 @@ | ||||
| 
 | ||||
| #define SM_BUILD_TAG		"-manual" | ||||
| #define SM_BUILD_UNIQUEID	"[MANUAL BUILD]" | ||||
| #define SM_VERSION			"2.2.1" | ||||
| #define SM_VERSION			"2.3.0" | ||||
| #define SM_FULL_VERSION		SM_VERSION SM_BUILD_TAG | ||||
| #define SM_FILE_VERSION		2,2,1,0 | ||||
| #define SM_FILE_VERSION		2,3,0,0 | ||||
| 
 | ||||
| #endif | ||||
| 
 | ||||
|  | ||||
| @ -1 +1 @@ | ||||
| 2.2.1 | ||||
| 2.3.0 | ||||
|  | ||||
| @ -31,4 +31,3 @@ int main(int argc, char *argv[]) | ||||
| 	delete handler; | ||||
| 	return 0; | ||||
| } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user