#include "parser_admins.h"
#include "parser_tariffs.h"
#include "parser_users.h"
+#include "parser_services.h"
#include "parser_message.h"
+#include "parser_user_info.h"
#include "parser_auth_by.h"
#include "stg/common.h"
m_admins(NULL),
m_tariffs(NULL),
m_users(NULL),
+ m_services(NULL),
+ m_corporations(NULL),
m_store(NULL),
m_port(0),
m_bindAddress("0.0.0.0"),
sigaddset(&sigmask, SIGUSR1);
sigaddset(&sigmask, SIGHUP);
pthread_sigmask(SIG_BLOCK, &sigmask, &oldmask);
--
m_listenSocket = socket(PF_INET, SOCK_STREAM, 0);
if (m_listenSocket < 0)
assert(m_admins != NULL);
assert(m_users != NULL);
assert(m_tariffs != NULL);
+ assert(m_services != NULL);
+ assert(m_corporations != NULL);
SP::GET_SERVER_INFO::FACTORY::Register(m_registry, *m_settings, *m_users, *m_tariffs);
SP::CHG_USER::FACTORY::Register(m_registry, *m_users, *m_store, *m_tariffs);
SP::CHECK_USER::FACTORY::Register(m_registry, *m_users);
+ SP::GET_SERVICES::FACTORY::Register(m_registry, *m_services);
+ SP::GET_SERVICE::FACTORY::Register(m_registry, *m_services);
+ SP::ADD_SERVICE::FACTORY::Register(m_registry, *m_services);
+ SP::DEL_SERVICE::FACTORY::Register(m_registry, *m_services);
+ SP::CHG_SERVICE::FACTORY::Register(m_registry, *m_services);
+
SP::SEND_MESSAGE::FACTORY::Register(m_registry, *m_users);
SP::AUTH_BY::FACTORY::Register(m_registry, *m_users);
+
+ SP::USER_INFO::FACTORY::Register(m_registry, *m_users);
}
int CONFIGPROTO::MaxFD() const
#include "firebird_store.h"
#include "stg/ibpp.h"
+ namespace
+ {
+
+ const int pt_mega = 1024 * 1024;
+
+ }
+
//-----------------------------------------------------------------------------
int FIREBIRD_STORE::GetTariffsList(std::vector<std::string> * tariffsList) const
{
st->Get(3, td->tariffConf.fee);
st->Get(4, td->tariffConf.free);
st->Get(5, td->tariffConf.passiveCost);
- //st->Get(6, td->tariffConf.traffType);
td->tariffConf.traffType = TARIFF::IntToTraffType(Get<int>(st, 6));
if (schemaVersion > 0)
td->tariffConf.period = TARIFF::StringToPeriod(Get<std::string>(st, 7));
st->Get(7, td->dirPrice[dir].priceNightB);
td->dirPrice[dir].priceNightB /= 1024*1024;
st->Get(8, td->dirPrice[dir].threshold);
- if (std::fabs(td->dirPrice[dir].priceDayA - td->dirPrice[dir].priceNightA) < 1.0e-3 &&
- std::fabs(td->dirPrice[dir].priceDayB - td->dirPrice[dir].priceNightB) < 1.0e-3)
+ if (std::fabs(td->dirPrice[dir].priceDayA - td->dirPrice[dir].priceNightA) < 1.0e-3 / pt_mega &&
+ std::fabs(td->dirPrice[dir].priceDayB - td->dirPrice[dir].priceNightB) < 1.0e-3 / pt_mega)
{
td->dirPrice[dir].singlePrice = true;
}
#include "stg/settings.h"
#include "stg/common.h"
- #include "stg/logger.h"
#include "stg/module_settings.h"
//-----------------------------------------------------------------------------
bool GetSpreadFee() const { return spreadFee; }
bool GetFreeMbAllowInet() const { return freeMbAllowInet; }
bool GetDayFeeIsLastDay() const { return dayFeeIsLastDay; }
+ bool GetStopOnError() const { return stopOnError; }
bool GetWriteFreeMbTraffCost() const
{ return writeFreeMbTraffCost; }
bool GetShowFeeInCash() const { return showFeeInCash; }
bool spreadFee;
bool freeMbAllowInet;
bool dayFeeIsLastDay;
+ bool stopOnError;
bool writeFreeMbTraffCost;
bool showFeeInCash;
unsigned messageTimeout;