상속: Universe.Framework.Modules.IDataTransferable
        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);
        }
예제 #2
0
        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, "BaseCurrency", true);
            }
            Framework.Utilities.DataManager.RegisterPlugin(Name, this);

            m_config = new BaseCurrencyConfig(config);

            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", "") != "SimpleCurrency")
            {
                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");

            if (!m_doRemoteCalls)
            {
                MainConsole.Instance.Commands.AddCommand(
                    "money add",
                    "money add",
                    "Adds money to a user's account.",
                    AddMoney, false, true);

                MainConsole.Instance.Commands.AddCommand(
                    "money set",
                    "money set",
                    "Sets the amount of money a user has.",
                    SetMoney, false, true);

                MainConsole.Instance.Commands.AddCommand(
                    "money get",
                    "money get",
                    "Gets the amount of money a user has.",
                    GetMoney, false, true);

                MainConsole.Instance.Commands.AddCommand(
                    "show user transactions",
                    "show user transactions",
                    "Display user transactions for a period.",
                    HandleShowTransactions, false, true);

                MainConsole.Instance.Commands.AddCommand(
                    "show user purchases",
                    "show user purchases",
                    "Display user purchases for a period.",
                    HandleShowPurchases, false, true);

                MainConsole.Instance.Commands.AddCommand(
                    "stipend set",
                    "stipend set",
                    "Sets the next date for stipend",
                    HandleStipendSet, false, true);
            }
        }
        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, "BaseCurrency", true);
            Framework.Utilities.DataManager.RegisterPlugin(Name, this);

            m_config = new BaseCurrencyConfig(config);

            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", "") != "SimpleCurrency")
                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");

            if (!m_doRemoteCalls)
            {
                MainConsole.Instance.Commands.AddCommand(
                    "money add",
                    "money add",
                    "Adds money to a user's account.",
                    AddMoney, false, true);

                MainConsole.Instance.Commands.AddCommand(
                    "money set",
                    "money set",
                    "Sets the amount of money a user has.",
                    SetMoney, false, true);

                MainConsole.Instance.Commands.AddCommand(
                    "money get",
                    "money get",
                    "Gets the amount of money a user has.",
                    GetMoney, false, true);

                MainConsole.Instance.Commands.AddCommand(
                    "show user transactions",
                    "show user transactions",
                    "Display user transactions for a period.",
                    HandleShowTransactions, false, true);

                MainConsole.Instance.Commands.AddCommand(
                    "show user purchases",
                    "show user purchases",
                    "Display user purchases for a period.",
                    HandleShowPurchases, false, true);

                MainConsole.Instance.Commands.AddCommand(
                    "stipend set",
                    "stipend set",
                    "Sets the next date for stipend",
                    HandleStipendSet, false, true);
            }
        }
        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);
        }