Exemplo n.º 1
0
        public GiveStipends(SimpleCurrencyConfig options, IRegistryCore registry, SimpleCurrencyConnector 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;
            }
            registry.RequestModuleInterface <ISimulationBase>().EventManager.RegisterEventHandler("DeleteUserInformation", DeleteUserInformation);
            registry.RequestModuleInterface <ISimulationBase>().EventManager.RegisterEventHandler("CreateUserInformation", CreateUserInformation);
            registry.RequestModuleInterface <ISimulationBase>().EventManager.RegisterEventHandler("UpdateUserInformation", CreateUserInformation);
        }
Exemplo n.º 2
0
        public void Initialize(IConfigSource config, IRegistryCore registry)
        {
            if (config.Configs["Currency"] == null ||
                config.Configs["Currency"].GetString("Module", "") != "SimpleCurrency")
            {
                return;
            }

            m_registry  = registry;
            m_connector = Framework.Utilities.DataManager.RequestPlugin <ISimpleCurrencyConnector>() as SimpleCurrencyConnector;
            //registry.RegisterModuleInterface<IMoneyModule>(this);
        }
Exemplo n.º 3
0
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            if (config.Configs["Currency"] == null ||
                config.Configs["Currency"].GetString("Module", "") != "SimpleCurrency")
            {
                return;
            }

            // we only want this if we are local..
            bool    remoteCalls     = false;
            IConfig connectorConfig = config.Configs ["WhiteCoreConnectors"];

            if ((connectorConfig != null) && connectorConfig.Contains("DoRemoteCalls"))
            {
                remoteCalls = connectorConfig.GetBoolean("DoRemoteCalls", false);
            }

            if (remoteCalls)
            {
                return;
            }

            m_connector = Framework.Utilities.DataManager.RequestPlugin <ISimpleCurrencyConnector>() as SimpleCurrencyConnector;

            if (m_connector.GetConfig().ClientPort == 0 && MainServer.Instance == null)
            {
                return;
            }
            IHttpServer server =
                registry.RequestModuleInterface <ISimulationBase>()
                .GetHttpServer((uint)m_connector.GetConfig().ClientPort);

            server.AddXmlRPCHandler("getCurrencyQuote", QuoteFunc);
            server.AddXmlRPCHandler("buyCurrency", BuyFunc);
            server.AddXmlRPCHandler("preflightBuyLandPrep", PreflightBuyLandPrepFunc);
            server.AddXmlRPCHandler("buyLandPrep", LandBuyFunc);
            server.AddXmlRPCHandler("getBalance", GetbalanceFunc);
            server.AddXmlRPCHandler("/currency.php", GetbalanceFunc);
            server.AddXmlRPCHandler("/landtool.php", GetbalanceFunc);

            m_syncMessagePoster = registry.RequestModuleInterface <ISyncMessagePosterService>();
            m_agentInfoService  = registry.RequestModuleInterface <IAgentInfoService>();
        }