Esempio n. 1
0
MTAEXPORT int Run ( int iArgumentCount, char* szArguments [] )
{
    #ifdef WIN32
        // Disable critical error message boxes
        SetErrorMode ( SEM_FAILCRITICALERRORS );
    #endif

    // Create the server
    #ifdef WIN32
        CServerImpl Server ( &g_CommandQueue );
    #else
        CServerImpl Server;
    #endif

    // Run the main func
    int iReturn;
    do
    {
        iReturn = Server.Run ( iArgumentCount, szArguments );
    }
    while ( iReturn == SERVER_RESET_RETURN );

    // Done
    return iReturn;
}
Esempio n. 2
0
MTAEXPORT int Run ( int iArgumentCount, char* szArguments [] )
{
    if ( iArgumentCount > 1 )
    {
        if ( strcmp ( szArguments[1], "--version" ) == 0 || strcmp ( szArguments[1], "-v" ) == 0 )
        {
            printf ( MTA_DM_FULL_STRING " v" MTA_DM_BUILDTAG_LONG "\n" );
            return 1;
        }
    }

    #ifdef WIN32
        // Disable critical error message boxes
        SetErrorMode ( SEM_FAILCRITICALERRORS );
    #endif

    #ifdef WIN_x86
        // Apply file hooks if not already done by the client
        bool bSkipFileHooks = false;
        for( int i = 1 ; i < iArgumentCount ; i++ )
            bSkipFileHooks |= SStringX( szArguments[i] ).Contains( "--clientfeedback" );
        if( !bSkipFileHooks )
            AddUtf8FileHooks();
    #endif

    // Create the server
    #ifdef WIN32
        CServerImpl Server ( &g_CommandQueue );
    #else
        CServerImpl Server;
    #endif

    // Run the main func
    int iReturn;
    do
    {
        iReturn = Server.Run ( iArgumentCount, szArguments );
    }
    while ( iReturn == SERVER_RESET_RETURN );

    // Done
    #ifdef WIN_x86
        RemoveUtf8FileHooks();
    #endif

    return iReturn;
}