Beispiel #1
0
void log_init(int argc, char** argv)
{
    std::string logFile;
#ifdef DEBUGLOGMAP
#ifdef WIN32
    logFile = "log\\map-server.log";
#else
    logFile = "log/map-server.log";
#endif
#endif
    bool defaultname = true;
    for (int i = 1; i < argc; i++)
    {
        if (strcmp(argv[i], "--ip") == 0 && defaultname)
        {
            logFile = argv[i + 1];
        }
        else if (strcmp(argv[i], "--port") == 0 && defaultname)
        {
            logFile.append(argv[i + 1]);
        }
        else if (strcmp(argv[i], "--log") == 0)
        {
            defaultname = false;
            logFile = argv[i + 1];
        }
    }
    InitializeLog(logFile);
}
Beispiel #2
0
// init global/static in single thread mode during server startup
DWORD
VMCAInitialize(
    BOOL overrideLogLevel,
    BOOL overrideLogType
    )
{
    DWORD dwError = 0;

    dwError = VMCACommonInit();
    BAIL_ON_VMCA_ERROR(dwError);

    dwError = InitializeLog(FALSE, FALSE);
    BAIL_ON_VMCA_ERROR(dwError);

    dwError = InitializeEventLog();
    BAIL_ON_VMCA_ERROR(dwError);

    dwError = InitializeDatabase();
    BAIL_ON_VMCA_ERROR(dwError);

    // Don't bail on Error , this just sets up the current state
    dwError = VMCASrvInitCA();

    dwError = VMCASrvDirSyncInit();
    BAIL_ON_VMCA_ERROR(dwError);

    dwError = VMCARPCInit();
    BAIL_ON_VMCA_ERROR(dwError);

error:

    return dwError;
}
CTeslaDecrypterApp::CTeslaDecrypterApp(void):
	g_strAppData(NULL),
	g_pLog(NULL),
	g_bConsoleAttached(FALSE),
	g_pTeslaDec(NULL)
{
	InitializeLog();
}
Beispiel #4
0
bool AppInit(CNotification * Notify, const char * BaseDirectory, int argc, char **argv)
{
    try
    {
        g_Notify = Notify;
        InitializeLog();
        WriteTrace(TraceAppInit, TraceDebug, "Starting (BaseDirectory: %s)", BaseDirectory ? BaseDirectory : "null");
        if (Notify == NULL)
        {
            WriteTrace(TraceAppInit, TraceError, "No Notification class passed");
            return false;
        }
        WriteTrace(TraceAppInit, TraceDebug, "Settings up settings");
        g_Settings = new CSettings;
        g_Settings->Initialize(BaseDirectory, AppName());

        WriteTrace(TraceAppInit, TraceDebug, "Parse Commands");
        if (!ParseCommand(argc, argv))
        {
            WriteTrace(TraceAppInit, TraceError, "Failed to Parse Commands, exiting now");
            return false;
        }

#ifdef _WIN32
        if (g_Settings->LoadBool(Setting_CheckEmuRunning) &&
            pjutil::TerminatedExistingExe())
        {
            delete g_Settings;
            g_Settings = new CSettings;
            g_Settings->Initialize(BaseDirectory, AppName());
        }
#endif

        SetupTrace();
        FixDirectories();
#ifdef _WIN32
        CMipsMemoryVM::ReserveMemory();
        IncreaseThreadPriority();
#endif

        //Create the plugin container
        WriteTrace(TraceAppInit, TraceInfo, "Create Plugins");
        g_Plugins = new CPlugins(Directory_Plugin);

        g_Lang = new CLanguage();
        g_Lang->LoadCurrentStrings();
        g_Notify->AppInitDone();
        WriteTrace(TraceAppInit, TraceDebug, "Initialized Successfully");
        return true;
    }
    catch (...)
    {
        g_Notify->DisplayError(stdstr_f("Exception caught\nFile: %s\nLine: %d", __FILE__, __LINE__).c_str());
        WriteTrace(TraceAppInit, TraceError, "Exception caught, Init was not successfull");
        return false;
    }
}
Beispiel #5
0
void log_init(int argc, char** argv)
{
    std::string logFile;

#ifdef DEBUGLOGLOGIN
#ifdef WIN32
    logFile = "log\\login-server.log";
#else
    logFile = "log/login-server.log";
#endif
#endif
    for (int i = 1; i < argc; i++)
    {
        if (strcmp(argv[i], "--log") == 0)
        {
            logFile = argv[i + 1];
        }
    }
    InitializeLog(logFile);
}
Beispiel #6
0
// init global/static in single thread mode during server startup
DWORD
LwCAInitialize(
    BOOL overrideLogLevel,
    BOOL overrideLogType
    )
{
    DWORD dwError = 0;

    //LwCAEnableSuidDumpable();

    //dwError = LwCACommonInit();
    //BAIL_ON_LWCA_ERROR(dwError);

    dwError = InitializeLog(FALSE, FALSE);
    BAIL_ON_LWCA_ERROR(dwError);

    dwError = OidcClientGlobalInit();
    BAIL_ON_LWCA_ERROR(dwError);

    // TODO: When final implementation is in place, don't bail on Error , this
    // just sets up the current state
    dwError = LwCASrvInitCA();
    BAIL_ON_LWCA_ERROR(dwError);

    dwError = LwCAMetricsInitialize();
    BAIL_ON_LWCA_ERROR(dwError);

#ifdef REST_ENABLED
    dwError = LwCARestServerInit();
    BAIL_ON_LWCA_ERROR(dwError);
#endif

error:

    return dwError;
}
Beispiel #7
0
CEditorApplication::CEditorApplication()
: CWinApp("Sphere Editor")	
{
  InitializeLog();
}