// PatchBuilder.cpp : ÀÀ¿ë ÇÁ·Î±×·¥¿¡ ´ëÇÑ Å¬·¡½º µ¿ÀÛÀ» Á¤ÀÇÇÕ´Ï´Ù. // #include "stdafx.h" #include "SundriesFunc.h" #include "PatchBuilder.h" #include "PatchBuilderDlg.h" #include "tinyxml.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // CPatchBuilderApp BEGIN_MESSAGE_MAP(CPatchBuilderApp, CWinApp) ON_COMMAND(ID_HELP, &CWinApp::OnHelp) END_MESSAGE_MAP() int __cdecl DefautAllocHook( int, void *, size_t, int, long, const unsigned char *, int ) { return 1; } int __cdecl MyAllocHook( int nAllocType, void * pvData, size_t nSize, int nBlockUse, long lRequest, const unsigned char * szFileName, int nLine ) { if( nAllocType == _HOOK_ALLOC && nSize == 2844 ) { int a = 0; } return 1; } // CPatchBuilderApp »ý¼º CPatchBuilderApp::CPatchBuilderApp() { // TODO: ¿©±â¿¡ »ý¼º Äڵ带 Ãß°¡ÇÕ´Ï´Ù. // InitInstance¿¡ ¸ðµç Áß¿äÇÑ ÃʱâÈ­ ÀÛ¾÷À» ¹èÄ¡ÇÕ´Ï´Ù. // _CrtSetAllocHook( MyAllocHook ); // _CrtSetBreakAlloc(59925); } CPatchBuilderApp::~CPatchBuilderApp() { LogWnd::DestroyLog(); } // À¯ÀÏÇÑ CPatchBuilderApp °³Ã¼ÀÔ´Ï´Ù. CPatchBuilderApp theApp; // CPatchBuilderApp ÃʱâÈ­ BOOL CPatchBuilderApp::InitInstance() { // ÀÀ¿ë ÇÁ·Î±×·¥ ¸Å´ÏÆä½ºÆ®°¡ ComCtl32.dll ¹öÀü 6 ÀÌ»óÀ» »ç¿ëÇÏ¿© ºñÁÖ¾ó ½ºÅ¸ÀÏÀ» // »ç¿ëÇϵµ·Ï ÁöÁ¤ÇÏ´Â °æ¿ì, Windows XP »ó¿¡¼­ ¹Ýµå½Ã InitCommonControlsEx()°¡ ÇÊ¿äÇÕ´Ï´Ù. // InitCommonControlsEx()¸¦ »ç¿ëÇÏÁö ¾ÊÀ¸¸é âÀ» ¸¸µé ¼ö ¾ø½À´Ï´Ù. INITCOMMONCONTROLSEX InitCtrls; InitCtrls.dwSize = sizeof(InitCtrls); // ÀÀ¿ë ÇÁ·Î±×·¥¿¡¼­ »ç¿ëÇÒ ¸ðµç °ø¿ë ÄÁÆ®·Ñ Ŭ·¡½º¸¦ Æ÷ÇÔÇϵµ·Ï // ÀÌ Ç׸ñÀ» ¼³Á¤ÇϽʽÿÀ. InitCtrls.dwICC = ICC_WIN95_CLASSES; InitCommonControlsEx(&InitCtrls); CWinApp::InitInstance(); AfxEnableControlContainer(); m_RegProfile.LoadProfile(); CPatchBuilderDlg dlg; m_pMainWnd = &dlg; UseLogFile(); if( m_RegProfile.GetProfileCount() ) { SProfile *pProfile = m_RegProfile.GetProfile( 0 ); dlg.m_szSVNUrl = pProfile->szSVNUrl.c_str(); dlg.m_szSVNUrlBuildSet = pProfile->szSVNUrlBuildSet.c_str(); dlg.m_szSVNUrlServer = pProfile->szSVNUrlServer.c_str(); dlg.m_szSVNUpdateFolder = pProfile->szSVNUpdateFolder.c_str(); dlg.m_szPatchFolder = pProfile->szPatchFolder.c_str(); dlg.m_szRMakeCmd = pProfile->szRMakeCmd.c_str(); dlg.m_szManualPatchExe = pProfile->szManualPatchExe.c_str(); dlg.m_szCountryCode = pProfile->szCountryCode.c_str(); } else { dlg.m_szSVNUrl = "http://depot.eyedentitygames.com/svn/dragonnest/stable/client"; dlg.m_szSVNUrlBuildSet = "http://depot.eyedentitygames.com/svn/dragonnest/stable/client"; dlg.m_szSVNUrlServer = "http://depot.eyedentitygames.com/svn/dragonnest/stable/client"; dlg.m_szSVNUpdateFolder = "c:\\SVNUpdateFolder"; dlg.m_szPatchFolder = "c:\\PatchFolder"; dlg.m_szRMakeCmd = "\\\\192.168.0.11\\tooldata\\Utility\\RMakeCmd.exe"; dlg.m_szCountryCode = "Kor"; dlg.m_szSVNUrlBuildSet = "http://depot.eyedentitygames.com/svn/dragonnest/stable/server"; dlg.m_szManualPatchExe = "\\\\192.168.0.11\\tooldata\\Utility\\DnManualUpdater_KR.exe"; } DWORD dwValue; GetRegistryNumber( HKEY_CURRENT_USER, REG_SUBKEY, "MakeFullVersion", dwValue ); if( dwValue ) dlg.m_bMakeFullVersion = TRUE; GetRegistryNumber( HKEY_CURRENT_USER, REG_SUBKEY, "MakeServerData", dwValue ); if( dwValue ) dlg.m_bCopyServerData = TRUE; GetRegistryNumber( HKEY_CURRENT_USER, REG_SUBKEY, "RollBack", dwValue ); if( dwValue ) dlg.m_bRollBack = TRUE; GetRegistryNumber( HKEY_CURRENT_USER, REG_SUBKEY, "ManualPatch", dwValue ); if( dwValue ) dlg.m_bManualPatch = TRUE; if( strlen( m_lpCmdLine ) ) { char *pFindPtr; pFindPtr = strstr( m_lpCmdLine, "Profile:" ); if( pFindPtr ) { pFindPtr += strlen( "Profile:" ); int nProfile = atoi( pFindPtr ); dlg.m_nDefaultProfile = nProfile; dlg.m_bAutoStart = TRUE; } pFindPtr = strstr( m_lpCmdLine, "/MakeFull:true" ); if( pFindPtr ) { dlg.m_bMakeFullVersion = TRUE; } else { pFindPtr = strstr( m_lpCmdLine, "/MakeFull:false" ); if( pFindPtr ) { dlg.m_bMakeFullVersion = FALSE; } } pFindPtr = strstr( m_lpCmdLine, "/CopyServerData:true" ); if( pFindPtr ) { dlg.m_bCopyServerData = TRUE; } else { pFindPtr = strstr( m_lpCmdLine, "/CopyServerData:false" ); if( pFindPtr ) { dlg.m_bCopyServerData = FALSE; } } pFindPtr = strstr( m_lpCmdLine, "/RollBack:true" ); if( pFindPtr ) { dlg.m_bRollBack = TRUE; } else { pFindPtr = strstr( m_lpCmdLine, "/RollBack:false" ); if( pFindPtr ) { dlg.m_bRollBack = FALSE; } } pFindPtr = strstr( m_lpCmdLine, "/ManualPatch:true" ); if( pFindPtr ) { dlg.m_bManualPatch = TRUE; } else { pFindPtr = strstr( m_lpCmdLine, "/ManualPatch:false" ); if( pFindPtr ) { dlg.m_bManualPatch = FALSE; } } } INT_PTR nResponse = dlg.DoModal(); if (nResponse == IDOK) { } else if (nResponse == IDCANCEL) { } return FALSE; } void CPatchBuilderApp::UseLogFile() { TCHAR szCurFileName[MAX_PATH]= {0,}; ::GetModuleFileName( NULL, szCurFileName, MAX_PATH ); TCHAR szDrive[MAX_PATH] = { 0, }; TCHAR szDir[MAX_PATH] = { 0, }; TCHAR szFileName[MAX_PATH] = { 0, }; TCHAR szExt[MAX_PATH] = { 0, }; _splitpath_s( szCurFileName, szDrive, szDir, szFileName, szExt ); CString _szCurPath; _szCurPath.Format( _T("%s%s\\Log"), szDrive, szDir ); if( GetFileAttributes( _szCurPath.GetBuffer() ) != FILE_ATTRIBUTE_DIRECTORY ) CreateDirectory( _szCurPath.GetBuffer(), NULL); LogWnd::CreateLog( true, LogWnd::LOG_TARGET_FILE ); }