Inheritance: Universe.Framework.Services.ConnectorBase, ISimpleCurrencyConnector
        public void Start (IConfigSource config, IRegistryCore registry)
        {
            if (config.Configs ["Currency"] == null ||
                config.Configs ["Currency"].GetString ("Module", "") != "BaseCurrency")
                return;

            // we only want this if we are local..
            bool remoteCalls = false;
            IConfig connectorConfig = config.Configs ["UniverseConnectors"];
            if ((connectorConfig != null) && connectorConfig.Contains ("DoRemoteCalls"))
                remoteCalls = connectorConfig.GetBoolean ("DoRemoteCalls", false);

            if (remoteCalls)
                return;

            m_connector = Framework.Utilities.DataManager.RequestPlugin<IBaseCurrencyConnector> () as BaseCurrencyConnector;
            var curPort = m_connector.GetConfig ().ClientPort;
            if (curPort == 0 && MainServer.Instance == null)
                return;

            IHttpServer server = registry.RequestModuleInterface<ISimulationBase> ().GetHttpServer ((uint)curPort);
            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 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;
            }
            registry.RequestModuleInterface <ISimulationBase>().EventManager.RegisterEventHandler("DeleteUserInformation", DeleteUserInformation);
            registry.RequestModuleInterface <ISimulationBase>().EventManager.RegisterEventHandler("CreateUserInformation", CreateUserInformation);
            registry.RequestModuleInterface <ISimulationBase>().EventManager.RegisterEventHandler("UpdateUserInformation", CreateUserInformation);
        }
        public void Initialize(IConfigSource config, IRegistryCore registry)
        {
            if (config.Configs["Currency"] == null ||
                config.Configs["Currency"].GetString("Module", "") != "BaseCurrency")
                return;

            m_registry = registry;
            m_connector = Framework.Utilities.DataManager.RequestPlugin<IBaseCurrencyConnector>() as BaseCurrencyConnector;
        }
Exemplo n.º 4
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 BaseCurrencyConnector;
        }
Exemplo n.º 5
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["UniverseConnectors"];

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

            if (remoteCalls)
            {
                return;
            }

            m_connector = Framework.Utilities.DataManager.RequestPlugin <ISimpleCurrencyConnector>() as BaseCurrencyConnector;
            var curPort = m_connector.GetConfig().ClientPort;

            if (curPort == 0 && MainServer.Instance == null)
            {
                return;
            }

            IHttpServer server = registry.RequestModuleInterface <ISimulationBase>().GetHttpServer((uint)curPort);

            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 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;
            registry.RequestModuleInterface<ISimulationBase>().EventManager.RegisterEventHandler("DeleteUserInformation", DeleteUserInformation);
            registry.RequestModuleInterface<ISimulationBase>().EventManager.RegisterEventHandler("CreateUserInformation", CreateUserInformation);
            registry.RequestModuleInterface<ISimulationBase>().EventManager.RegisterEventHandler("UpdateUserInformation", CreateUserInformation);
        }