#pragma once #include "SystemInfo.h" #include "RyeolHttpClient.h" #include "../Utility/AssertX.h" #include "../Utility/CriticalSection.h" #include using namespace Ryeol; class ExceptionCallback { public: virtual void OnException(_EXCEPTION_POINTERS* pExceptionInfo) { } }; /* »¶ ³ª¸é ´ýÇÁÆÄÀϰú ¹ö±×¸®Æ÷ÆÃ ÆÄÀÏÀ» ³²±â°í À¥À¸·Î Àü¼ÛÇØÁִ Ŭ·¡½º */ class BugReporter { public: enum DumpLevel { eMiniDumpNormal = 0, eMiniDumpWithDataSegs = 1, eMiniDumpWithFullMemory = 2, }; struct ReportingServerInfo { ReportingServerInfo() { // kb ´ÜÀ§ nMaxReportSize = 20000; // ±âº»°ª 20¸Þ°¡ ¤»¤» #if defined(_CH) szViewServerURL = "";//"http://116.211.21.173/ReportList.aspx"; szServerURL = "http://116.211.21.173/BugReport/BugProcess.aspx"; szSIDURL = "http://116.211.21.173/BugReport/dumpprocess.aspx"; // #elif defined(_JP) // szViewServerURL = ""; // szServerURL = "bugreport.hangame.co.jp/BugProcess.aspx"; // szSIDURL = "bugreport.hangame.co.jp/dumpprocess.aspx"; // #elif defined(_TW) // szViewServerURL = ""; // szServerURL = "http://112.121.85.5/BugTrace.aspx"; // szSIDURL = "http://112.121.85.5/dumpprocess.aspx"; // #elif defined(_US) // szViewServerURL = ""; // szServerURL = "http://208.85.111.192/BugProcess.aspx"; // szSIDURL = "http://208.85.111.192/dumpprocess.aspx"; // #elif defined(_SG) // szViewServerURL = ""; // szServerURL = "http://bugrpt.dn.cherrycredits.com/BugProcess.aspx"; // szSIDURL = "http://bugrpt.dn.cherrycredits.com/dumpprocess.aspx"; #elif defined(_KRAZ) szViewServerURL = ""; szServerURL = "http://61.251.164.138/BugProcess.aspx"; //¿ä³ÑÀÌ ½ÇÀç·Î º¸³»Áö´Â°Í szSIDURL = "http://61.251.164.138/BugReport/dumpprocess.aspx"; //´ýÇÁ ¹ß»ý½Ã º¸³»Áö ¾ÊÀ½À» ¼±ÅÃÇÒ¶§ ¹ß»ýȽ¼ö¸¸ üũÇÏ´Â°Í #else szViewServerURL = ""; szServerURL = ""; szSIDURL = ""; #endif szNoticeMsg = L""; bUseAutoView = false; bSaveLocal = false; // À¯ÀúÀÇ Çϵ忡 ´ýÇÁ¿Í ·Î±×¸¦ ³²±æ°ÍÀΰ¡. bUseConfirm = false; hWnd = NULL; hAppIcon = 0; hInst = 0; } std::string szServerURL; std::string szViewServerURL; std::string szSIDURL; std::wstring szAppName; std::wstring szNoticeTitle; std::wstring szNoticeMsg; std::wstring szSendButtonStr; std::wstring szNotSendButtonStr; HICON hAppIcon; DWORD nMaxReportSize; bool bUseAutoView; // ¸®Æ÷ÆÃ ¸®½ºÆ®¸¦ º¼°ÍÀÎÁö bool bSaveLocal; // ¸®Æ÷ÆÃÈÄ Çϵ忡 ÀúÀåÇÒ°ÍÀÎÁö bool bUseConfirm; // ¹°¾îº¸°í µî·ÏÇÒ°ÍÀÎÁö ¿É¼Ç HWND hWnd; HINSTANCE hInst; bool bEnableReporting; // ¸®Æ÷ÆÃ ¿©ºÎ }; BugReporter(); virtual ~BugReporter(); // ¹ö±×¸®Æ÷ÆÃÇÒ url void SetReportingServerInfo(ReportingServerInfo& info) { m_ReportHttpInfo = info; } ReportingServerInfo& GetReportingServerInfo() { return m_ReportHttpInfo; } // ¹öÀüÀ» ±¸ºÐÇϱâÀ§ÇÑ ¹®ÀÚ¿­ void SetBuildVersion(std::string& szBuildVersion) { m_szBuildVersion = szBuildVersion; } /* Ä¿½ºÅÒ µð¹ö±ë Á¤º¸¸¦ ¸®Æ÷Æ®¿¡ Ãß°¡Çϱâ À§Çؼ­ »ç¿ëÇÑ´Ù. ex ) std::string g_szUserNickname; BugReporter.AddDebugData(&g_szUserNickname); // Æ÷ÀÎÅ͸¦ µî·ÏÇÑ´Ù. g_szUserNickname Àº ·Î±×ÀÎ ¿Ï·á ¼­¹ö ÆÐŶÀ» ¹ÞÀ¸¸é À¯Àú´Ð³×ÀÓÀ» µî·ÏÇØµÐ´Ù. UserNick = [´øÈú] UserGuild = [ÇÁ·Î½ºÆ®±æµå] ¿À·ù ¹ß»ýÈÄ ¸®Æ÷ÆÃµÈ ÆÄÀÏ¿¡ UserDebugData Ç׸ñ¿¡ º¸¸é ÇØ´ç Á¤º¸¸¦ È®ÀÎÇÒ¼ö ÀÖ´Ù. */ void AddDebugData(std::string* pStr) { m_UserDataArray.push_back(pStr); } // ÀÎÁõÀ̶ó´øÁö ±âŸ Ãß°¡ÀûÀ¸·Î È®ÀÎÇÒ ·Î±×¸¦ ³Ö¾îµÐ´Ù. ³Ê¹« ¸¹Àº ·Î±×¸¦ ¾²¸é ¸®Æ÷ÆÃ ÆÄÀÏÀÌ ³Ê¹« Ä¿Áö¹Ç·Î ²À ÇÊ¿äÇϰí Áß¿äÇÑ ³»¿ë¸¸ ·Î±×·Î Ãß°¡ÇÑ´Ù. void AddLogA(char* fmt, ... ); void AttachCurrentTimeLog(); void AddLogW(WCHAR* fmt, ... ); void Enable(DumpLevel level = eMiniDumpWithDataSegs ); void Disable(); static DWORD WINAPI _StackOverflowException( LPVOID pParam ); static LONG __stdcall Exception_Minidump(_EXCEPTION_POINTERS* pExceptionInfo); static void __cdecl DefaultBadAllocFilter(); long BugReport(_EXCEPTION_POINTERS* pExceptionInfo); long MakeBugReportText(_EXCEPTION_POINTERS* pExceptionInfo); long MakeDumpFile(_EXCEPTION_POINTERS* pExceptionInfo); long HttpReporting(); long SIDReporting(); void SetSID( char *szSID ); void EnableCompressDump( bool bEnable ) { m_bEnableCompress = bEnable; } void ConfirmDialog(); // ÀͼÁ¼ÇÀÌ ³­ »óȲÀº ¾Æ´ÏÁö¸¸ ±×³É °­Á¦·Î ·Î±×¸¦ ¹Þ¾Æº¸±â À§Çؼ­ ¸®Æ÷ÆÃ ÇÏ´Â ±â´ÉÀÌ´Ù. long ForceReporting(); void SetExceptionCallBack(ExceptionCallback* pCallback) { m_pExceptionCallback = pCallback; } private: private: int m_nDumpLevel; bool m_bEnableDump; bool m_bEnableCompress; // ·Î±×¸¦ ³²°Ü¼­ º¸³»´Â ±â´ÉÀ» Ãß°¡Çϸ鼭,, ¿©·¯ ½º·¹µå¿¡¼­ ·Î±×¸¦ ³²±æ ¼ö ÀÖÀ¸¹Ç·Î µ¿±âÈ­ 󸮸¦ ÇÔ. // ½ÇÁ¦·Î ¸®Æ÷ÆÃÇÏ´Â ºÎºÐµµ(BugReport()) ÃßÈÄ¿¡ ¿©·¯ ½º·¹µå¿¡¼­ ÇÒ ¼ö ÀÖ°Ô µÈ´Ù¸é µ¿±âÈ­ 󸮸¦ ÇØ¾ßÇÑ´Ù. CSyncLock m_LogLock; bool m_bForceLogReporting; static LPTOP_LEVEL_EXCEPTION_FILTER m_pExceptionFilter; static _invalid_parameter_handler m_pInvalidParameterHandler; static _purecall_handler m_pPureCallHandler; SystemInfo m_SystemInfo; std::string m_szProcessName; std::string m_szBuildVersion; std::string m_szUserLog; std::string m_szReport; std::string m_szStartTime; std::string m_szReportingTime; std::string m_szFileTime; std::string m_szDumpFileName; std::string m_szCompressDumpFileName; std::string m_szReportFileName; std::vector m_UserDataArray; ReportingServerInfo m_ReportHttpInfo; CHttpClientA m_HttpClient; CHttpClientA m_HttpClientForSID; ExceptionCallback* m_pExceptionCallback; char m_szSID[256]; }; extern BugReporter gs_BugReporter;