예제 #1
0
        public GiveStipends(SimpleCurrencyConfig options, IRegistryCore registry, SimpleCurrencyConnector dustCurrencyService)
        {
            m_enabled = options.GiveStipends;
            if (!m_enabled)
            {
                return;
            }

            m_currencyService  = dustCurrencyService;
            m_options          = options;
            m_registry         = registry;
            taskTimer.Interval = 360000;
            taskTimer.Elapsed += TimerElasped;
            m_scheduler        = registry.RequestModuleInterface <IScheduleService>();
            if (m_scheduler == null)
            {
                return;
            }
            m_scheduler.Register("StipendsPayout", StupendsPayOutEvent);
            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);
        }
예제 #2
0
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            if (config.Configs["Currency"] == null ||
                config.Configs["Currency"].GetString("Module", "") != "SimpleCurrency")
                return;
            if (!config.Configs["Currency"].GetBoolean("RunServer", false))
                return;

            m_connector = 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>();
        }
예제 #3
0
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            if (config.Configs["Currency"] == null ||
                config.Configs["Currency"].GetString("Module", "") != "SimpleCurrency")
            {
                return;
            }
            if (!config.Configs["Currency"].GetBoolean("RunServer", false))
            {
                return;
            }

            m_connector = 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>();
        }
        public void Initialize(IConfigSource config, IRegistryCore registry)
        {
            if (config.Configs["Currency"] == null ||
                config.Configs["Currency"].GetString("Module", "") != "SimpleCurrency")
                return;

            m_registry = registry;
            m_connector = DataManager.RequestPlugin<ISimpleCurrencyConnector>() as SimpleCurrencyConnector;

            registry.RegisterModuleInterface<IMoneyModule>(this);
        }
예제 #5
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 = DataManager.RequestPlugin <ISimpleCurrencyConnector>() as SimpleCurrencyConnector;

            registry.RegisterModuleInterface <IMoneyModule>(this);
        }
예제 #6
0
        public GiveStipends(SimpleCurrencyConfig options, IRegistryCore registry, SimpleCurrencyConnector dustCurrencyService)
        {
            m_enabled = options.GiveStipends;
            if (!m_enabled) return;

            m_currencyService = dustCurrencyService;
            m_options = options;
            m_registry = registry;
            taskTimer.Interval = 360000;
            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);
        }