Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Client/core/CChat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ void CChat::Draw(bool bUseCacheTexture, bool bAllowOutline)
if (m_iReportCount < 5)
{
m_iReportCount++;
AddReportLog(6532, SString("Chat rt chatSize:%2.0f %2.0f rtsize:%d %d card:%s", chatSize.fX, chatSize.fY, iRenderTargetSizeX,
AddReportLog(ReportLogID::CHAT_RT_FAIL, SString("Chat rt chatSize:%2.0f %2.0f rtsize:%d %d card:%s", chatSize.fX, chatSize.fY, iRenderTargetSizeX,
iRenderTargetSizeY, g_pDeviceState->AdapterState.Name.c_str()));
}
}
Expand Down
12 changes: 6 additions & 6 deletions Client/core/CCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ void CCore::ShowNetErrorMessageBox(const SString& strTitle, SString strMessage,
else if (bLinkRequiresErrorCode)
strTroubleLink = ""; // No link if no error code

AddReportLog(7100, SString("Core - NetError (%s) (%s)", *strTitle, *strMessage));
AddReportLog(ReportLogID::CORE_NET_ERROR, SString("Core - NetError (%s) (%s)", *strTitle, *strMessage));
ShowErrorMessageBox(strTitle, strMessage, strTroubleLink);
}

Expand Down Expand Up @@ -906,7 +906,7 @@ void LoadModule(CModuleLoader& m_Loader, const SString& strName, const SString&
SString strDllDirectory = GetSystemDllDirectory();
if (CalcMTASAPath("mta").CompareI(strDllDirectory) == false)
{
AddReportLog(3119, SString("DllDirectory wrong: DllDirectory:'%s' Path:'%s'", *strDllDirectory, *CalcMTASAPath("mta")));
AddReportLog(ReportLogID::DLL_DIR_FAIL, SString("DllDirectory wrong: DllDirectory:'%s' Path:'%s'", *strDllDirectory, *CalcMTASAPath("mta")));
SetDllDirectory(CalcMTASAPath("mta"));
}

Expand Down Expand Up @@ -1457,7 +1457,7 @@ void CCore::Quit(bool bInstantly)
{
if (bInstantly)
{
AddReportLog(7101, "Core - Quit");
AddReportLog(ReportLogID::CORE_QUIT, "Core - Quit");
// Show that we are quiting (for the crash dump filename)
SetApplicationSettingInt("last-server-ip", 1);

Expand Down Expand Up @@ -2155,10 +2155,10 @@ void CCore::OnEnterCrashZone(uint uiId)
//
// LogEvent
//
void CCore::LogEvent(uint uiDebugId, const char* szType, const char* szContext, const char* szBody, uint uiAddReportLogId)
void CCore::LogEvent(uint uiDebugId, const char* szType, const char* szContext, const char* szBody, ReportLogID addReportLogId)
{
if (uiAddReportLogId)
AddReportLog(uiAddReportLogId, SString("%s - %s", szContext, szBody));
if (addReportLogId != ReportLogID::NONE)
AddReportLog(addReportLogId, SString("%s - %s", szContext, szBody));

if (GetDebugIdEnabled(uiDebugId))
{
Expand Down
2 changes: 1 addition & 1 deletion Client/core/CCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class CCore : public CCoreInterface, public CSingleton<CCore>
void OnDeviceRestore();
void OnCrashAverted(uint uiId);
void OnEnterCrashZone(uint uiId);
void LogEvent(uint uiDebugId, const char* szType, const char* szContext, const char* szBody, uint uiAddReportLogId = 0);
void LogEvent(uint uiDebugId, const char* szType, const char* szContext, const char* szBody, ReportLogID addReportLogId = ReportLogID::NONE);
bool GetDebugIdEnabled(uint uiDebugId);
EDiagnosticDebugType GetDiagnosticDebug();
void SetDiagnosticDebug(EDiagnosticDebugType value);
Expand Down
14 changes: 7 additions & 7 deletions Client/core/CCrashDumpWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void CCrashDumpWriter::UpdateCounters()
{
if (ms_uiInvalidParameterCount > ms_uiInvalidParameterCountLogged && ms_uiInvalidParameterCountLogged < 10)
{
AddReportLog(9206, SString("InvalidParameterCount changed from %d to %d", ms_uiInvalidParameterCountLogged, ms_uiInvalidParameterCount));
AddReportLog(ReportLogID::INVALID_PARAMETER_COUNT, SString("InvalidParameterCount changed from %d to %d", ms_uiInvalidParameterCountLogged, ms_uiInvalidParameterCount));
ms_uiInvalidParameterCountLogged = ms_uiInvalidParameterCount;
}
}
Expand Down Expand Up @@ -321,22 +321,22 @@ void CCrashDumpWriter::DumpMiniDump(_EXCEPTION_POINTERS* pException, CExceptionI
}

if (!hDll)
AddReportLog(9201, "CCrashDumpWriter::DumpMiniDump - Could not load DBGHELP.DLL");
AddReportLog(ReportLogID::DBGHELP_FAIL, "CCrashDumpWriter::DumpMiniDump - Could not load DBGHELP.DLL");

// We could load a dll?
if (hDll)
{
// Grab the MiniDumpWriteDump proc address
auto pDump = reinterpret_cast<MINIDUMPWRITEDUMP>(static_cast<void*>(GetProcAddress(hDll, "MiniDumpWriteDump")));
if (!pDump)
AddReportLog(9202, "CCrashDumpWriter::DumpMiniDump - Could not find MiniDumpWriteDump");
AddReportLog(ReportLogID::DBGHELP_MINIDUMPWRITEDUMP_FAIL, "CCrashDumpWriter::DumpMiniDump - Could not find MiniDumpWriteDump");

if (pDump)
{
// Create the file
HANDLE hFile = CreateFile(CalcMTASAPath("mta\\core.dmp"), GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
AddReportLog(9203, SString("CCrashDumpWriter::DumpMiniDump - Could not create '%s'", *CalcMTASAPath("mta\\core.dmp")));
AddReportLog(ReportLogID::CREATE_DMP_FAIL, SString("CCrashDumpWriter::DumpMiniDump - Could not create '%s'", *CalcMTASAPath("mta\\core.dmp")));

if (hFile != INVALID_HANDLE_VALUE)
{
Expand All @@ -351,7 +351,7 @@ void CCrashDumpWriter::DumpMiniDump(_EXCEPTION_POINTERS* pException, CExceptionI
(MINIDUMP_TYPE)(MiniDumpNormal | MiniDumpWithIndirectlyReferencedMemory), &ExInfo, NULL, NULL);

if (!bResult)
AddReportLog(9204, SString("CCrashDumpWriter::DumpMiniDump - MiniDumpWriteDump failed (%08x)", GetLastError()));
AddReportLog(ReportLogID::DMP_MINIDUMPWRITEDUMP_FAIL, SString("CCrashDumpWriter::DumpMiniDump - MiniDumpWriteDump failed (%08x)", GetLastError()));
else
WriteDebugEvent("CCrashDumpWriter::DumpMiniDump - MiniDumpWriteDump succeeded");

Expand Down Expand Up @@ -498,7 +498,7 @@ void CCrashDumpWriter::DumpMiniDump(_EXCEPTION_POINTERS* pException, CExceptionI
{
CVARS_SET("volumetric_shadows", false);
CCore::GetSingleton().SaveConfig();
AddReportLog(9205, "Disabled volumetric shadows");
AddReportLog(ReportLogID::DISABLE_VOLUMETRIC_SHADOWS, "Disabled volumetric shadows");
}

CNet* pNet = CCore::GetSingleton().GetNetwork();
Expand Down Expand Up @@ -529,7 +529,7 @@ void CCrashDumpWriter::RunErrorTool(CExceptionInformation* pExceptionInformation
pExceptionInformation->GetEIP(), pExceptionInformation->GetEFlags(), pExceptionInformation->GetCS(), pExceptionInformation->GetDS(),
pExceptionInformation->GetSS(), pExceptionInformation->GetES(), pExceptionInformation->GetFS(), pExceptionInformation->GetGS());

AddReportLog(3120, strMessage);
AddReportLog(ReportLogID::CRASH_INFO, strMessage);

// Try relaunch with crashed flag
SString strMTASAPath = GetMTASABaseDir();
Expand Down
2 changes: 1 addition & 1 deletion Client/core/CModManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ bool CModManager::TryStart()

if (CalcMTASAPath("mta").CompareI(dllSearchPath) == false)
{
AddReportLog(3119, SString("DllDirectory wrong: DllDirectory:'%s' Path:'%s'", *dllSearchPath, *CalcMTASAPath("mta")));
AddReportLog(ReportLogID::DLL_DIR_FAIL, SString("DllDirectory wrong: DllDirectory:'%s' Path:'%s'", *dllSearchPath, *CalcMTASAPath("mta")));
SetDllDirectory(CalcMTASAPath("mta"));
}

Expand Down
4 changes: 2 additions & 2 deletions Client/core/CModelCacheManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void CModelCacheManagerImpl::PreLoad()
// Crashed during previous PreLoad?
if (WatchDogIsSectionOpen(WD_SECTION_PRELOAD_UPGRADES))
{
AddReportLog(8545, SString("PreLoad Upgrades - Crash detect - bSlowMethod:%d iLowestUnsafeUpgrade:%d", bSlowMethod, iLowestUnsafeUpgrade));
AddReportLog(ReportLogID::PRELOAD_UPGRADE_CACHE_CRASH, SString("PreLoad Upgrades - Crash detect - bSlowMethod:%d iLowestUnsafeUpgrade:%d", bSlowMethod, iLowestUnsafeUpgrade));
iLowestUnsafeUpgrade = GetApplicationSettingInt(DIAG_PRELOAD_UPGRADE_ATTEMPT_ID);
bSlowMethod = 1;
SetApplicationSettingInt(DIAG_PRELOAD_UPGRADES_LOWEST_UNSAFE, iLowestUnsafeUpgrade);
Expand Down Expand Up @@ -193,7 +193,7 @@ void CModelCacheManagerImpl::PreLoad()
int iPrevHiScore = GetApplicationSettingInt(DIAG_PRELOAD_UPGRADES_HISCORE);
SetApplicationSettingInt(DIAG_PRELOAD_UPGRADES_HISCORE, iLowestUnsafeUpgrade);
if (iPrevHiScore > iLowestUnsafeUpgrade)
AddReportLog(8544, SString("PreLoad Upgrades - LowestUnsafeUpgrade fallen from %d to %d", iPrevHiScore, iLowestUnsafeUpgrade));
AddReportLog(ReportLogID::PRELOAD_UPGRADE_FALLEN, SString("PreLoad Upgrades - LowestUnsafeUpgrade fallen from %d to %d", iPrevHiScore, iLowestUnsafeUpgrade));

CTickCount deltaTicks = CTickCount::Now() - startTicks;
OutputDebugLine(SString("CModelCacheManagerImpl::PreLoad completed in %d ms", deltaTicks.ToInt()));
Expand Down
8 changes: 4 additions & 4 deletions Client/core/CNewsBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ CGUIWindow* CNewsBrowser::LoadLayoutAndImages(CGUIElement* pParent, const SNewsI
// Make sure we have the layout filename
if (newsItem.strLayoutFilename.empty())
{
AddReportLog(3302, SString("CNewsBrowser::LoadLayout: Problem loading %s", *newsItem.strContentFullDir));
AddReportLog(ReportLogID::NEWS_LAYOUT_FAIL, SString("CNewsBrowser::LoadLayout: Problem loading %s", *newsItem.strContentFullDir));
return NULL;
}

Expand All @@ -290,8 +290,8 @@ CGUIWindow* CNewsBrowser::LoadLayoutAndImages(CGUIElement* pParent, const SNewsI
{
if (!pManager->LoadImageset(newsItem.imagesetFilenameList[i]))
{
AddReportLog(
3303, SString("CNewsBrowser::LoadLayout: Problem with LoadImageset [%s] %s", *newsItem.strContentFullDir, *newsItem.imagesetFilenameList[i]));
AddReportLog(ReportLogID::NEWS_LAYOUT_IMAGESET_FAIL, SString("CNewsBrowser::LoadLayout: Problem with LoadImageset [%s] %s",
*newsItem.strContentFullDir, *newsItem.imagesetFilenameList[i]));
return NULL;
}
}
Expand All @@ -300,7 +300,7 @@ CGUIWindow* CNewsBrowser::LoadLayoutAndImages(CGUIElement* pParent, const SNewsI
CGUIWindow* pWindow = pManager->LoadLayout(pParent, newsItem.strLayoutFilename);
if (!pWindow)
{
AddReportLog(3304, SString("CNewsBrowser::LoadLayout: Problem with LoadLayout [%s] %s", *newsItem.strContentFullDir, *newsItem.strLayoutFilename));
AddReportLog(ReportLogID::NEW_LAYOUT_LOAD_FAIL, SString("CNewsBrowser::LoadLayout: Problem with LoadLayout [%s] %s", *newsItem.strContentFullDir, *newsItem.strLayoutFilename));
return NULL;
}
return pWindow;
Expand Down
2 changes: 1 addition & 1 deletion Client/core/CQuestionBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void CQuestionBox::Show()
m_pWindow->BringToFront();
g_pCore->RemoveMessageBox();

AddReportLog(9100, SString("QuestionBox::Show [%s] %s", m_pWindow->GetText().c_str(), *m_strMsg.Left(200).Replace("\n", "|")));
AddReportLog(ReportLogID::QUESTIONBOX_SHOW, SString("QuestionBox::Show [%s] %s", m_pWindow->GetText().c_str(), *m_strMsg.Left(200).Replace("\n", "|")));
}

void CQuestionBox::Reset()
Expand Down
8 changes: 4 additions & 4 deletions Client/core/CVersionUpdater.Util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,25 +356,25 @@ namespace
m_strTempFileName = MakeUniquePath(PathJoin(GetMTADataPath(), "temp", "buffer.xml"));
if (!FileSave(m_strTempFileName, &data[0], uiSize))
{
AddReportLog(2501, SString("CXMLBuffer::SetFromBuffer: Could not save %s", m_strTempFileName.c_str()));
AddReportLog(ReportLogID::VER_UPD_XML_SAVE_FAIL, SString("CXMLBuffer::SetFromBuffer: Could not save %s", m_strTempFileName.c_str()));
return NULL;
}

m_pXMLFile = CCore::GetSingleton().GetXML()->CreateXML(m_strTempFileName);
if (!m_pXMLFile)
{
AddReportLog(2502, SString("CXMLBuffer::SetFromBuffer: Could not CreateXML %s", m_strTempFileName.c_str()));
AddReportLog(ReportLogID::VER_UPD_XML_CREATE_FAIL, SString("CXMLBuffer::SetFromBuffer: Could not CreateXML %s", m_strTempFileName.c_str()));
return NULL;
}
if (!m_pXMLFile->Parse())
{
AddReportLog(2503, SString("CXMLBuffer::SetFromBuffer: Could not parse %s", m_strTempFileName.c_str()));
AddReportLog(ReportLogID::VER_UPD_XML_PARSE_FAIL, SString("CXMLBuffer::SetFromBuffer: Could not parse %s", m_strTempFileName.c_str()));
return NULL;
}
m_pRoot = m_pXMLFile->GetRootNode();
if (!m_pRoot)
{
AddReportLog(2504, SString("CXMLBuffer::SetFromBuffer: No root node in %s", m_strTempFileName.c_str()));
AddReportLog(ReportLogID::VER_UPD_XML_MISSING_ROOT, SString("CXMLBuffer::SetFromBuffer: No root node in %s", m_strTempFileName.c_str()));
return NULL;
}

Expand Down
Loading
Loading