HRESULT KG3DTerrainRepresentInfo::InitDis()
{
    HRESULT hResult = E_FAIL;
    IIniFile* pFile = NULL;

    pFile = g_OpenIniFile(s_strGroundEffectConfigFile);
    KG_PROCESS_ERROR(pFile);
    
    pFile->GetFloat("ROOT","GroundEffectDis",500.0,&m_fDis);
    pFile->GetFloat("ROOT","GroundEffectWaterDis",500.0,&m_fwaterDis);

    hResult = S_OK;
Exit0:
    SAFE_RELEASE(pFile);
    return hResult;
}
HRESULT KG3DTerrainRepresentInfo::InitDefaultSfx()
{
    HRESULT hResult = E_FAIL;
    HRESULT hRetCode = E_FAIL;
    IIniFile *pFile = NULL;
    pFile = g_OpenIniFile(s_strGroundEffectConfigFile);
    KG_PROCESS_ERROR(pFile);

    pFile->GetString("ROOT","DefaultSfx1","",m_DefaultSfx.str_DefaultSfx[0],MAX_PATH);
    pFile->GetString("ROOT","DefaultSfx2","",m_DefaultSfx.str_DefaultSfx[1],MAX_PATH);
    pFile->GetString("ROOT","DefaultSfx3","",m_DefaultSfx.str_DefaultSfx[2],MAX_PATH);
    pFile->GetString("ROOT","DefaultSfx4","",m_DefaultSfx.str_DefaultSfx[3],MAX_PATH);
    pFile->GetString("ROOT","DefaultSfxTerrain","",m_DefaultSfx.str_DefaultSfxTerrain,MAX_PATH);
    pFile->GetFloat("ROOT","DefaultSfxTerrainPlayRate",0.0,&m_DefaultSfx.fPlayRate);

    hResult = S_OK;
Exit0:
    SAFE_RELEASE(pFile);
    return hResult;
}
Beispiel #3
0
BOOL KSO3GameCenterSettings::LoadRelaySettings()
{
    BOOL        bResult     = false;
    int         nRetCode    = false;	
    IIniFile*	piIniFile   = NULL;
    int			nValue      = 0;

    piIniFile = g_OpenIniFile(RELAY_SETTINGS_FILENAME);
    KGLOG_PROCESS_ERROR(piIniFile);

    // Global
    nRetCode = piIniFile->GetString(GCS_SECTION_GLOBAL, "Locale", "", m_szLocale, sizeof(m_szLocale));
    KGLOG_PROCESS_ERROR(nRetCode);

    // Gateway config
    nRetCode = piIniFile->GetString(GCS_SECTION_GATEWAY, "IP", "127.0.0.1", m_szGatewayIP, sizeof(m_szGatewayIP));
    KGLOG_PROCESS_ERROR(nRetCode);
    nRetCode = piIniFile->GetInteger(GCS_SECTION_GATEWAY, "Port", 9001, &m_nGatewayPort);
    KGLOG_PROCESS_ERROR(nRetCode);
    nRetCode = piIniFile->GetInteger(GCS_SECTION_GATEWAY, "PingCycle", 30, (int*)&m_nGatewayPingCycle);
    KGLOG_PROCESS_ERROR(nRetCode);

    // GS config
    nRetCode = piIniFile->GetInteger(GCS_SECTION_GAMESERVER, "Port", 5003, &m_nGameServerPort);
    KGLOG_PROCESS_ERROR(nRetCode);
    nRetCode = piIniFile->GetInteger(GCS_SECTION_GAMESERVER, "ConnectionTimeout", 20, &m_nConnectionTimeout);
    KGLOG_PROCESS_ERROR(nRetCode);
    nRetCode = piIniFile->GetInteger(GCS_SECTION_GAMESERVER, "MemoryLimitForCreateMap", 1400, &m_nMemoryLimitForCreateMap);
    KGLOG_PROCESS_ERROR(nRetCode);
    nRetCode = piIniFile->GetFloat(GCS_SECTION_GAMESERVER, "AveragePerformanceLimitForCreateMap", 6.0f, &m_fAveragePerformanceLimitForCreateMap);
    KGLOG_PROCESS_ERROR(nRetCode);
    nRetCode = piIniFile->GetFloat(GCS_SECTION_GAMESERVER, "ImmediatePerformanceLimitForCreateMap", 8.0f, &m_fImmediatePerformanceLimitForCreateMap);
    KGLOG_PROCESS_ERROR(nRetCode);
    nRetCode = piIniFile->GetFloat(GCS_SECTION_GAMESERVER, "AveragePerformanceLimitForNewPlayer", 4.0f, &m_fAveragePerformanceLimitForNewPlayer);
    KGLOG_PROCESS_ERROR(nRetCode);
    nRetCode = piIniFile->GetFloat(GCS_SECTION_GAMESERVER, "ImmediatePerformanceLimitForNewPlayer", 6.0f, &m_fImmediatePerformanceLimitForNewPlayer);
    KGLOG_PROCESS_ERROR(nRetCode);

    // MySQL
    nRetCode = piIniFile->GetString(GCS_SECTION_MYSQL, "IP", "127.0.0.1", m_szDBIP, sizeof(m_szDBIP));
    KGLOG_PROCESS_ERROR(nRetCode);
    nRetCode = piIniFile->GetInteger(GCS_SECTION_MYSQL, "Port", 3306, &m_nDBPort);
    KGLOG_PROCESS_ERROR(nRetCode);
    nRetCode = piIniFile->GetString(GCS_SECTION_MYSQL, "Account", "", m_szDBAcc, sizeof(m_szDBAcc));
    KGLOG_PROCESS_ERROR(nRetCode);
    nRetCode = piIniFile->GetString(GCS_SECTION_MYSQL, "Password", "", m_szDBPsw, sizeof(m_szDBPsw));
    KGLOG_PROCESS_ERROR(nRetCode);
    nRetCode = piIniFile->GetString(GCS_SECTION_MYSQL, "Database", "", m_szDBName, sizeof(m_szDBName));
    KGLOG_PROCESS_ERROR(nRetCode);

    // Apex Proxy
    nRetCode = piIniFile->GetString(
        GCS_SECTION_APEXPROXY, "IP", "127.0.0.1", m_szApexServerIP, sizeof(m_szApexServerIP)
    );
    KGLOG_PROCESS_ERROR(nRetCode);

    nRetCode = piIniFile->GetInteger(GCS_SECTION_APEXPROXY, "Port", 10001, &m_nApexServerPort);
    KGLOG_PROCESS_ERROR(nRetCode);

    nRetCode = piIniFile->GetInteger(GCS_SECTION_APEXPROXY, "PingCycle", 5, &m_nApexPingCycle);
    KGLOG_PROCESS_ERROR(nRetCode);

    nRetCode = piIniFile->GetInteger(GCS_SECTION_APEXPROXY, "MaxKickCount", 1, &m_nMaxKickCount);
    KGLOG_PROCESS_ERROR(nRetCode);

    // LogServer
    nRetCode = piIniFile->GetString(GCS_SECTION_LOGSERVER, "IP", "127.0.0.1", m_szLogServerIP, sizeof(m_szLogServerIP));
    KGLOG_PROCESS_ERROR(nRetCode);

    nRetCode = piIniFile->GetInteger(GCS_SECTION_LOGSERVER, "Port", 5100, &m_nLogServerPort);
    KGLOG_PROCESS_ERROR(nRetCode);

    nRetCode = piIniFile->GetInteger(GCS_SECTION_LOGSERVER, "PingCycle", 30, &m_nLogServerPingCycle);
    KGLOG_PROCESS_ERROR(nRetCode);

    nRetCode = piIniFile->GetString(GCS_SECTION_LOGSERVER, "Identity", "", m_szLogServerIdentity, sizeof(m_szLogServerIdentity));
    KGLOG_PROCESS_ERROR(nRetCode);

    bResult = true;
Exit0:
    KG_COM_RELEASE(piIniFile);
    return bResult;
}