コード例 #1
0
ファイル: SharedUtil.File.hpp プロジェクト: Cazomino05/Test1
SString SharedUtil::GetDriveNameWithNotEnoughSpace( uint uiResourcesPathMinMB, uint uiDataPathMinMB )
{
    if ( GetPathFreeSpaceMB( GetMTASABaseDir() ) < uiResourcesPathMinMB )
        return GetPathDriveName( GetMTASABaseDir() );
    if ( GetPathFreeSpaceMB( GetSystemCommonAppDataPath() ) < uiDataPathMinMB )
        return GetPathDriveName( GetSystemCommonAppDataPath() );
   return ""; 
}
コード例 #2
0
SString SharedUtil::GetDriveNameWithNotEnoughSpace(uint uiResourcesPathMinMB, uint uiDataPathMinMB)
{
    SString strFileCachePath = GetCommonRegistryValue("", "File Cache Path");
    if (!strFileCachePath.empty() && DirectoryExists(PathJoin(strFileCachePath, "resources")))
        if (GetPathFreeSpaceMB(strFileCachePath) < uiResourcesPathMinMB)
            return GetPathDriveName(strFileCachePath);

    if (GetPathFreeSpaceMB(GetMTASABaseDir()) < uiResourcesPathMinMB)
        return GetPathDriveName(GetMTASABaseDir());

    if (GetPathFreeSpaceMB(GetSystemCommonAppDataPath()) < uiDataPathMinMB)
        return GetPathDriveName(GetSystemCommonAppDataPath());
    return "";
}
コード例 #3
0
ファイル: SharedUtil.hpp プロジェクト: 50p/multitheftauto
//
// Turns a relative MTASA path i.e. "MTA\file.dat"
// into an absolute MTASA path i.e. "C:\Program Files\MTA San Andreas\MTA\file.dat"
//
SString SharedUtil::CalcMTASAPath ( const SString& strPath )
{
    SString strNewPath = GetMTASABaseDir();
    strNewPath += '\\';
    strNewPath += strPath;
    return strNewPath;
}
コード例 #4
0
void CCrashDumpWriter::RunErrorTool ( CExceptionInformation* pExceptionInformation )
{
// MTA Error Reporter is now integrated into the launcher

    // Only do once
    static bool bDoneReport = false;
    if ( bDoneReport )
        return;
    bDoneReport = false;

    // Log the basic exception information
    SString strMessage ( "Crash 0x%08X 0x%08X %s"
                         " EAX=%08X EBX=%08X ECX=%08X EDX=%08X ESI=%08X"
                         " EDI=%08X EBP=%08X ESP=%08X EIP=%08X FLG=%08X"
                         " CS=%04X DS=%04X SS=%04X ES=%04X"
                         " FS=%04X GS=%04X",
                         pExceptionInformation->GetCode (),
                         pExceptionInformation->GetAddressModuleOffset (),
                         pExceptionInformation->GetModulePathName (),
                         pExceptionInformation->GetEAX (),
                         pExceptionInformation->GetEBX (),
                         pExceptionInformation->GetECX (),
                         pExceptionInformation->GetEDX (),
                         pExceptionInformation->GetESI (),
                         pExceptionInformation->GetEDI (),
                         pExceptionInformation->GetEBP (),
                         pExceptionInformation->GetESP (),
                         pExceptionInformation->GetEIP (),
                         pExceptionInformation->GetEFlags (),
                         pExceptionInformation->GetCS (),
                         pExceptionInformation->GetDS (),
                         pExceptionInformation->GetSS (),
                         pExceptionInformation->GetES (),
                         pExceptionInformation->GetFS (),
                         pExceptionInformation->GetGS ()
                        );

    AddReportLog ( 3120, strMessage );

    // Try relaunch with crashed flag
    SString strMTASAPath = GetMTASABaseDir ();
    SetCurrentDirectory ( strMTASAPath );
    SetDllDirectory( strMTASAPath );

#ifdef MTA_DEBUG
    #define MTA_EXE_NAME            "Multi Theft Auto_d.exe"
#else
    #define MTA_EXE_NAME            "Multi Theft Auto.exe"
#endif
    SString strFile = strMTASAPath + "\\" + MTA_EXE_NAME;
    ShellExecute( NULL, "open", strFile, "install_stage=crashed", NULL, SW_SHOWNORMAL );
}
コード例 #5
0
//
// Turns a relative MTASA path i.e. "MTA\file.dat"
// into an absolute MTASA path i.e. "C:\Program Files\MTA San Andreas\MTA\file.dat"
//
SString SharedUtil::CalcMTASAPath ( const SString& strPath )
{
    return PathJoin ( GetMTASABaseDir(), strPath );
}