X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/90e389f6ec12e60a62c362296ffcf314feb5b03d..02bcc3a0cfbd20bdbb474fc6c02057468d980276:/projects/stargazer/settings_impl.cpp diff --git a/projects/stargazer/settings_impl.cpp b/projects/stargazer/settings_impl.cpp index e0eb4639..f9135a1a 100644 --- a/projects/stargazer/settings_impl.cpp +++ b/projects/stargazer/settings_impl.cpp @@ -63,6 +63,8 @@ SETTINGS_IMPL::SETTINGS_IMPL() writeFreeMbTraffCost(false), showFeeInCash(true), messageTimeout(0), + feeChargeType(0), + reconnectOnTariffChange(false), modulesSettings(), storeModuleSettings(), logger(GetStgLogger()) @@ -93,6 +95,8 @@ SETTINGS_IMPL::SETTINGS_IMPL(const std::string & cd) writeFreeMbTraffCost(false), showFeeInCash(true), messageTimeout(0), + feeChargeType(0), + reconnectOnTariffChange(false), modulesSettings(), storeModuleSettings(), logger(GetStgLogger()) @@ -123,6 +127,8 @@ SETTINGS_IMPL::SETTINGS_IMPL(const SETTINGS_IMPL & rval) writeFreeMbTraffCost(rval.writeFreeMbTraffCost), showFeeInCash(rval.showFeeInCash), messageTimeout(rval.messageTimeout), + feeChargeType(rval.feeChargeType), + reconnectOnTariffChange(rval.reconnectOnTariffChange), modulesSettings(rval.modulesSettings), storeModuleSettings(rval.storeModuleSettings), logger(GetStgLogger()) @@ -235,9 +241,9 @@ return 0; //----------------------------------------------------------------------------- void SETTINGS_IMPL::ErrorCallback(void * data, const char * buf) { - printfd(__FILE__, buf); + printfd(__FILE__, "SETTINGS_IMPL::ErrorCallback() - %s\n", buf); SETTINGS_IMPL * settings = static_cast(data); - settings->logger(buf); + settings->logger("%s", buf); } //----------------------------------------------------------------------------- int SETTINGS_IMPL::ReadSettings() @@ -429,6 +435,24 @@ while (node) } } + if (strcasecmp(node->getName(), "FeeChargeType") == 0) + { + if (ParseUnsignedInRange(node->getValue(0), 0, 2, &feeChargeType) != 0) + { + strError = "Incorrect FeeChargeType value: \'" + string(node->getValue(0)) + "\'"; + return -1; + } + } + + if (strcasecmp(node->getName(), "ReconnectOnTariffChange") == 0) + { + if (ParseYesNo(node->getValue(0), &reconnectOnTariffChange) != 0) + { + strError = "Incorrect ReconnectOnTariffChange value: \'" + string(node->getValue(0)) + "\'"; + return -1; + } + } + if (strcasecmp(node->getName(), "DirNames") == 0) { const DOTCONFDocumentNode * child = node->getChildNode();