public void Initialize(IGenericData GenericData, IConfigSource source, IRegistryCore registry, string defaultConnectionString) { GD = GenericData; m_registry = registry; IConfig config = source.Configs["Currency"]; if (config == null || source.Configs["Currency"].GetString("Module", "") != "BaseCurrency") { return; } IConfig gridInfo = source.Configs["GridInfoService"]; if (gridInfo != null) { InWorldCurrency = gridInfo.GetString("CurrencySymbol", string.Empty) + " "; RealCurrency = gridInfo.GetString("RealCurrencySymbol", string.Empty) + " "; } if (source.Configs[Name] != null) { defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString); } if (GenericData != null) { GenericData.ConnectToDatabase(defaultConnectionString, "SimpleCurrency", true); } Framework.Utilities.DataManager.RegisterPlugin(Name, this); m_config = new BaseCurrencyConfig(config); m_userInfoService = m_registry.RequestModuleInterface <IAgentInfoService>(); m_userAccountService = m_registry.RequestModuleInterface <IUserAccountService> (); Init(m_registry, Name, "", "/currency/", "CurrencyServerURI"); }
public void Initialize(IGenericData GenericData, IConfigSource source, IRegistryCore registry, string defaultConnectionString) { m_gd = GenericData; m_registry = registry; IConfig config = source.Configs["Currency"]; if (config == null || source.Configs["Currency"].GetString("Module", "") != "BaseCurrency") return; IConfig gridInfo = source.Configs["GridInfoService"]; if (gridInfo != null) { InWorldCurrency = gridInfo.GetString ("CurrencySymbol", String.Empty) + " "; RealCurrency = gridInfo.GetString ("RealCurrencySymbol", String.Empty) + " "; } if (source.Configs[Name] != null) defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString); if (GenericData != null) GenericData.ConnectToDatabase(defaultConnectionString, "SimpleCurrency", true); Framework.Utilities.DataManager.RegisterPlugin(Name, this); m_config = new BaseCurrencyConfig(config); Init(m_registry, Name, "", "/currency/", "CurrencyServerURI"); }
/* static public DateTime StipendDate { get { return NextStipendDate(); } set { SetStipendDate(value); } } */ public GiveStipends(BaseCurrencyConfig options, IRegistryCore registry, BaseCurrencyConnector CurrencyService) { m_enabled = options.GiveStipends; if (!m_enabled) return; m_currencyService = CurrencyService; m_options = options; m_registry = registry; taskTimer.Interval = m_options.SchedulerInterval; taskTimer.Elapsed += TimerElapsed; m_scheduler = registry.RequestModuleInterface<IScheduleService> (); if (m_scheduler == null) return; m_scheduler.Register ("StipendsPayout", StipendsPayOutEvent); if (m_options.StipendsLoadOldUsers) taskTimer.Enabled = true; var simBase = registry.RequestModuleInterface<ISimulationBase> (); simBase.EventManager.RegisterEventHandler ("DeleteUserInformation", DeleteUserInformation); simBase.EventManager.RegisterEventHandler ("CreateUserInformation", CreateUserInformation); simBase.EventManager.RegisterEventHandler ("UpdateUserInformation", CreateUserInformation); }