コード例 #1
0
//
// Direct players to info about trouble
//
void SharedUtil::BrowseToSolution ( const SString& strType, bool bAskQuestion, bool bTerminateProcess, bool bDoOnExit, const SString& strMessageBoxMessage )
{
    AddReportLog ( 3200, SString ( "Trouble %s", *strType ) );

    // Put args into a string and save in the registry
    CArgMap argMap;
    argMap.Set ( "type", strType.SplitLeft ( ";" ) );
    argMap.Set ( "bAskQuestion", bAskQuestion );
    argMap.Set ( "message", strMessageBoxMessage );
    SetApplicationSetting ( "pending-browse-to-solution", argMap.ToString () );

    // Do it now if required
    if ( !bDoOnExit )
        ProcessPendingBrowseToSolution ();

    // Exit if required
    if ( bTerminateProcess )
        TerminateProcess ( GetCurrentProcess (), 1 );
}
コード例 #2
0
int DoWinMain ( HINSTANCE hLauncherInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
{
    AddUtf8FileHooks();

#if defined(_DEBUG) 
    SharedUtil_Tests ();
#endif

    //
    // Init
    //

    // Let install manager figure out what MTASA path to use
    GetInstallManager()->SetMTASAPathSource( lpCmdLine );

    // Start logging.....now
    BeginEventLog();

    // Start localization if possible
    InitLocalization( false );

    // Handle commands from the installer
    HandleSpecialLaunchOptions();

    // Check MTA is launched only once
    HandleDuplicateLaunching();

    // Show logo
    ShowSplash( g_hInstance );

    // Other init stuff
    ClearPendingBrowseToSolution();


    //
    // Update
    //

    // Continue any update procedure
    SString strCmdLine = GetInstallManager()->Continue();


    //
    // Launch
    //

    // Ensure localization is started
    InitLocalization( true );

    // Setup/test various counters and flags for monitoring problems
    PreLaunchWatchDogs();

    // Stuff
    HandleCustomStartMessage();
    ForbodenProgramsMessage();
    CycleEventLog();
    BsodDetectionPreLaunch();
    MaybeShowCopySettingsDialog ();

    // Make sure GTA is not running
    HandleIfGTAIsAlreadyRunning();

    // Find GTA path to use
    ValidateGTAPath();

    // Maybe warn user if no anti-virus running
    CheckAntiVirusStatus();

    // Ensure logo is showing
    ShowSplash( g_hInstance );

    // Check MTA files look good
    CheckDataFiles();
    CheckLibVersions();

    // Go for launch
    int iReturnCode = LaunchGame( strCmdLine );

    PostRunWatchDogs( iReturnCode );

    //
    // Quit
    //

    HandleOnQuitCommand();

    // Maybe show help if trouble was encountered
    ProcessPendingBrowseToSolution();

    AddReportLog ( 1044, SString ( "* End (0x%X)* pid:%d", iReturnCode, GetCurrentProcessId() ) );

    RemoveUtf8FileHooks();
    return iReturnCode;
}