void UFlurrySettings::WriteConfigSettings() { FAnalytics::Get().WriteConfigValueToIni(GetIniName(), GetReleaseIniSection(), TEXT("FlurryApiKey"), ReleaseApiKey); FAnalytics::Get().WriteConfigValueToIni(GetIniName(), GetTestIniSection(), TEXT("FlurryApiKey"), TestApiKey); FAnalytics::Get().WriteConfigValueToIni(GetIniName(), GetDebugIniSection(), TEXT("FlurryApiKey"), DebugApiKey); FAnalytics::Get().WriteConfigValueToIni(GetIniName(), GetDevelopmentIniSection(), TEXT("FlurryApiKey"), DevelopmentApiKey); }
void UFlurrySettings::ReadConfigSettings() { FString ReadApiKey = FAnalytics::Get().GetConfigValueFromIni(GetIniName(), GetReleaseIniSection(), TEXT("FlurryApiKey"), true); ReleaseApiKey = ReadApiKey; ReadApiKey = FAnalytics::Get().GetConfigValueFromIni(GetIniName(), GetDebugIniSection(), TEXT("FlurryApiKey"), true); if (ReadApiKey.Len() == 0) { ReadApiKey = ReleaseApiKey; } DebugApiKey = ReadApiKey; ReadApiKey = FAnalytics::Get().GetConfigValueFromIni(GetIniName(), GetTestIniSection(), TEXT("FlurryApiKey"), true); if (ReadApiKey.Len() == 0) { ReadApiKey = ReleaseApiKey; } TestApiKey = ReadApiKey; ReadApiKey = FAnalytics::Get().GetConfigValueFromIni(GetIniName(), GetDevelopmentIniSection(), TEXT("FlurryApiKey"), true); if (ReadApiKey.Len() == 0) { ReadApiKey = ReleaseApiKey; } DevelopmentApiKey = ReadApiKey; }
void UApsalarSettings::WriteConfigStruct(const FString& Section, FApsalarAnalyticsConfigSetting& Source) { FAnalytics::Get().WriteConfigValueToIni(GetIniName(), Section, TEXT("ApiKey"), Source.ApiKey); FAnalytics::Get().WriteConfigValueToIni(GetIniName(), Section, TEXT("ApiSecret"), Source.ApiSecret); FAnalytics::Get().WriteConfigValueToIni(GetIniName(), Section, TEXT("SendInterval"), FString::Printf(TEXT("%d"), Source.SendInterval)); FAnalytics::Get().WriteConfigValueToIni(GetIniName(), Section, TEXT("MaxBufferSize"), FString::Printf(TEXT("%d"), Source.MaxBufferSize)); FAnalytics::Get().WriteConfigValueToIni(GetIniName(), Section, TEXT("ManuallyReportRevenue"), Source.ManuallyReportRevenue ? TEXT("true") : TEXT("false")); }
void UApsalarSettings::ReadConfigStruct(const FString& Section, FApsalarAnalyticsConfigSetting& Dest, FApsalarAnalyticsConfigSetting* Default) { const FString Key = FAnalytics::Get().GetConfigValueFromIni(GetIniName(), Section, TEXT("ApiKey"), true); if (Key.Len() == 0 && Default != nullptr) { Dest.ApiKey = Default->ApiKey; } else { Dest.ApiKey = Key; } const FString Secret = FAnalytics::Get().GetConfigValueFromIni(GetIniName(), Section, TEXT("ApiSecret"), true); if (Secret.Len() == 0 && Default != nullptr) { Dest.ApiSecret = Default->ApiSecret; } else { Dest.ApiSecret = Secret; } const FString SendInterval = FAnalytics::Get().GetConfigValueFromIni(GetIniName(), Section, TEXT("SendInterval"), false); if (SendInterval.Len() == 0 && Default != nullptr) { Dest.SendInterval = Default->SendInterval; } else { Dest.SendInterval = FCString::Atoi(*SendInterval); } const FString MaxBufferSize = FAnalytics::Get().GetConfigValueFromIni(GetIniName(), Section, TEXT("MaxBufferSize"), false); if (MaxBufferSize.Len() == 0 && Default != nullptr) { Dest.MaxBufferSize = Default->MaxBufferSize; } else { Dest.MaxBufferSize = FCString::Atoi(*MaxBufferSize); } const FString ManuallyReportRevenue = FAnalytics::Get().GetConfigValueFromIni(GetIniName(), Section, TEXT("ManuallyReportRevenue"), false); if (ManuallyReportRevenue.Len() == 0 && Default != nullptr) { Dest.ManuallyReportRevenue = Default->ManuallyReportRevenue; } else { Dest.ManuallyReportRevenue = ManuallyReportRevenue.Compare(TEXT("true"), ESearchCase::IgnoreCase) == 0; } }
BOOL IsIniChanged() // if changed then application will exit { static BOOL bFirst = TRUE; static CString static_old; CString ini; CString strIniName = GetIniName(); if(!LoadAnsiFileToString( strIniName, ini )) return FALSE; if( bFirst ) { bFirst = FALSE; static_old = ini; } return ini != static_old; }