public void AddRegion(Scene scene) { // Send ObjectCapacity to Scene.. Which sends it to the SimStatsReporter. scene.SetObjectCapacity(ObjectCapacity); if (m_enabled) { scene.RegisterModuleInterface<IMoneyModule>(this); IHttpServer httpServer = MainServer.Instance; lock (m_scenel) { if (m_scenel.Count == 0) { // XMLRPCHandler = scene; // To use the following you need to add: // -helperuri <ADDRESS TO HERE OR grid MONEY SERVER> // to the command line parameters you use to start up your client // This commonly looks like -helperuri http://127.0.0.1:9000/ // Local Server.. enables functionality only. httpServer.AddXmlRPCHandler("getCurrencyQuote", quote_func); httpServer.AddXmlRPCHandler("buyCurrency", buy_func); httpServer.AddXmlRPCHandler("preflightBuyLandPrep", preflightBuyLandPrep_func); httpServer.AddXmlRPCHandler("buyLandPrep", landBuy_func); } if (m_scenel.ContainsKey(scene.RegionInfo.RegionHandle)) { m_scenel[scene.RegionInfo.RegionHandle] = scene; } else { m_scenel.Add(scene.RegionInfo.RegionHandle, scene); } } scene.EventManager.OnNewClient += OnNewClient; scene.EventManager.OnMoneyTransfer += MoneyTransferAction; scene.EventManager.OnClientClosed += ClientClosed; scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; scene.EventManager.OnMakeChildAgent += MakeChildAgent; scene.EventManager.OnClientClosed += ClientLoggedOut; scene.EventManager.OnValidateLandBuy += ValidateLandBuy; scene.EventManager.OnLandBuy += processLandBuy; } }
/// <summary> /// Parse Configuration /// </summary> /// <param name="scene"></param> /// <param name="startupConfig"></param> /// <param name="config"></param> private void ReadConfigAndPopulate(Scene scene, IConfig startupConfig, string config) { if (config == "Startup" && startupConfig != null) { gridmode = startupConfig.GetBoolean("gridmode", false); m_enabled = (startupConfig.GetString("economymodule", "OpenCurrency") == "OpenCurrency"); } if (config == "Economy" && startupConfig != null) { ObjectCapacity = startupConfig.GetInt("ObjectCapacity", 45000); PriceEnergyUnit = startupConfig.GetInt("PriceEnergyUnit", 100); PriceObjectClaim = startupConfig.GetInt("PriceObjectClaim", 10); PricePublicObjectDecay = startupConfig.GetInt("PricePublicObjectDecay", 4); PricePublicObjectDelete = startupConfig.GetInt("PricePublicObjectDelete", 4); PriceParcelClaim = startupConfig.GetInt("PriceParcelClaim", 1); PriceParcelClaimFactor = startupConfig.GetFloat("PriceParcelClaimFactor", 1f); PriceUpload = startupConfig.GetInt("PriceUpload", 0); PriceRentLight = startupConfig.GetInt("PriceRentLight", 5); TeleportMinPrice = startupConfig.GetInt("TeleportMinPrice", 2); TeleportPriceExponent = startupConfig.GetFloat("TeleportPriceExponent", 2f); EnergyEfficiency = startupConfig.GetFloat("EnergyEfficiency", 1); PriceObjectRent = startupConfig.GetFloat("PriceObjectRent", 1); PriceObjectScaleFactor = startupConfig.GetFloat("PriceObjectScaleFactor", 10); PriceParcelRent = startupConfig.GetInt("PriceParcelRent", 1); PriceGroupCreate = startupConfig.GetInt("PriceGroupCreate", -1); string EconomyBaseAccount = startupConfig.GetString("EconomyBaseAccount", UUID.Zero.ToString()); // UserLevelPaysFees = startupConfig.GetInt("UserLevelPaysFees", -1); m_stipend = startupConfig.GetInt("UserStipend", 1000); m_minFundsBeforeRefresh = startupConfig.GetInt("IssueStipendWhenClientIsBelowAmount", 10); m_keepMoneyAcrossLogins = startupConfig.GetBoolean("KeepMoneyAcrossLogins", true); m_MoneyAddress = startupConfig.GetString("CurrencyServer", String.Empty); } // Send ObjectCapacity to Scene.. Which sends it to the SimStatsReporter. scene.SetObjectCapacity(ObjectCapacity); }