diff options
author | UbitUmarov | 2018-03-05 20:57:13 +0000 |
---|---|---|
committer | UbitUmarov | 2018-03-05 20:57:13 +0000 |
commit | c408f0a38e02f5c75e79377b5f76d7b2c59a89fc (patch) | |
tree | 284592487016cc474a4991bd2c6d9f137afdef8f | |
parent | fix some LSL functions to return type Key as they should and not string (diff) | |
parent | make the setting economymodule visible on Economy section of OpenSimDefaults.... (diff) | |
download | opensim-SC-c408f0a38e02f5c75e79377b5f76d7b2c59a89fc.zip opensim-SC-c408f0a38e02f5c75e79377b5f76d7b2c59a89fc.tar.gz opensim-SC-c408f0a38e02f5c75e79377b5f76d7b2c59a89fc.tar.bz2 opensim-SC-c408f0a38e02f5c75e79377b5f76d7b2c59a89fc.tar.xz |
Merge branch 'master' into httptests
-rw-r--r-- | OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs | 82 | ||||
-rw-r--r-- | bin/OpenSim.ini.example | 4 | ||||
-rw-r--r-- | bin/OpenSimDefaults.ini | 48 |
3 files changed, 78 insertions, 56 deletions
diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index 3666c3f..b32a429 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs | |||
@@ -65,10 +65,10 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
65 | /// </summary> | 65 | /// </summary> |
66 | // private UUID EconomyBaseAccount = UUID.Zero; | 66 | // private UUID EconomyBaseAccount = UUID.Zero; |
67 | 67 | ||
68 | private float EnergyEfficiency = 0f; | 68 | private float EnergyEfficiency = 1f; |
69 | // private ObjectPaid handerOnObjectPaid; | 69 | // private ObjectPaid handerOnObjectPaid; |
70 | private bool m_enabled = true; | 70 | private bool m_enabled = true; |
71 | private bool m_sellEnabled = false; | 71 | private bool m_sellEnabled = true; |
72 | 72 | ||
73 | private IConfigSource m_gConfig; | 73 | private IConfigSource m_gConfig; |
74 | 74 | ||
@@ -85,12 +85,12 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
85 | 85 | ||
86 | private int ObjectCount = 0; | 86 | private int ObjectCount = 0; |
87 | private int PriceEnergyUnit = 0; | 87 | private int PriceEnergyUnit = 0; |
88 | private int PriceGroupCreate = 0; | 88 | private int PriceGroupCreate = -1; |
89 | private int PriceObjectClaim = 0; | 89 | private int PriceObjectClaim = 0; |
90 | private float PriceObjectRent = 0f; | 90 | private float PriceObjectRent = 0f; |
91 | private float PriceObjectScaleFactor = 0f; | 91 | private float PriceObjectScaleFactor = 10f; |
92 | private int PriceParcelClaim = 0; | 92 | private int PriceParcelClaim = 0; |
93 | private float PriceParcelClaimFactor = 0f; | 93 | private float PriceParcelClaimFactor = 1f; |
94 | private int PriceParcelRent = 0; | 94 | private int PriceParcelRent = 0; |
95 | private int PricePublicObjectDecay = 0; | 95 | private int PricePublicObjectDecay = 0; |
96 | private int PricePublicObjectDelete = 0; | 96 | private int PricePublicObjectDelete = 0; |
@@ -98,7 +98,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
98 | private int PriceUpload = 0; | 98 | private int PriceUpload = 0; |
99 | private int TeleportMinPrice = 0; | 99 | private int TeleportMinPrice = 0; |
100 | 100 | ||
101 | private float TeleportPriceExponent = 0f; | 101 | private float TeleportPriceExponent = 2f; |
102 | 102 | ||
103 | 103 | ||
104 | #region IMoneyModule Members | 104 | #region IMoneyModule Members |
@@ -124,13 +124,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
124 | public void Initialise(IConfigSource config) | 124 | public void Initialise(IConfigSource config) |
125 | { | 125 | { |
126 | m_gConfig = config; | 126 | m_gConfig = config; |
127 | 127 | ReadConfigAndPopulate(); | |
128 | IConfig startupConfig = m_gConfig.Configs["Startup"]; | ||
129 | IConfig economyConfig = m_gConfig.Configs["Economy"]; | ||
130 | |||
131 | |||
132 | ReadConfigAndPopulate(startupConfig, "Startup"); | ||
133 | ReadConfigAndPopulate(economyConfig, "Economy"); | ||
134 | } | 128 | } |
135 | 129 | ||
136 | public void AddRegion(Scene scene) | 130 | public void AddRegion(Scene scene) |
@@ -241,35 +235,51 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
241 | /// <summary> | 235 | /// <summary> |
242 | /// Parse Configuration | 236 | /// Parse Configuration |
243 | /// </summary> | 237 | /// </summary> |
244 | /// <param name="scene"></param> | 238 | private void ReadConfigAndPopulate() |
245 | /// <param name="startupConfig"></param> | ||
246 | /// <param name="config"></param> | ||
247 | private void ReadConfigAndPopulate(IConfig startupConfig, string config) | ||
248 | { | 239 | { |
249 | if (config == "Startup" && startupConfig != null) | 240 | // we are enabled by default |
241 | |||
242 | IConfig startupConfig = m_gConfig.Configs["Startup"]; | ||
243 | |||
244 | if(startupConfig == null) // should not happen | ||
245 | return; | ||
246 | |||
247 | IConfig economyConfig = m_gConfig.Configs["Economy"]; | ||
248 | |||
249 | // economymodule may be at startup or Economy (legacy) | ||
250 | string mmodule = startupConfig.GetString("economymodule",""); | ||
251 | if(String.IsNullOrEmpty(mmodule)) | ||
250 | { | 252 | { |
251 | m_enabled = (startupConfig.GetString("economymodule", "BetaGridLikeMoneyModule") == "BetaGridLikeMoneyModule"); | 253 | if(economyConfig != null) |
254 | mmodule = economyConfig.GetString("economymodule",""); | ||
252 | } | 255 | } |
253 | 256 | ||
254 | if (config == "Economy" && startupConfig != null) | 257 | if(!String.IsNullOrEmpty(mmodule) && mmodule != Name) |
255 | { | 258 | { |
256 | PriceEnergyUnit = startupConfig.GetInt("PriceEnergyUnit", 100); | 259 | // some other money module selected |
257 | PriceObjectClaim = startupConfig.GetInt("PriceObjectClaim", 10); | 260 | m_enabled = false; |
258 | PricePublicObjectDecay = startupConfig.GetInt("PricePublicObjectDecay", 4); | 261 | return; |
259 | PricePublicObjectDelete = startupConfig.GetInt("PricePublicObjectDelete", 4); | ||
260 | PriceParcelClaim = startupConfig.GetInt("PriceParcelClaim", 1); | ||
261 | PriceParcelClaimFactor = startupConfig.GetFloat("PriceParcelClaimFactor", 1f); | ||
262 | PriceUpload = startupConfig.GetInt("PriceUpload", 0); | ||
263 | PriceRentLight = startupConfig.GetInt("PriceRentLight", 5); | ||
264 | TeleportMinPrice = startupConfig.GetInt("TeleportMinPrice", 2); | ||
265 | TeleportPriceExponent = startupConfig.GetFloat("TeleportPriceExponent", 2f); | ||
266 | EnergyEfficiency = startupConfig.GetFloat("EnergyEfficiency", 1); | ||
267 | PriceObjectRent = startupConfig.GetFloat("PriceObjectRent", 1); | ||
268 | PriceObjectScaleFactor = startupConfig.GetFloat("PriceObjectScaleFactor", 10); | ||
269 | PriceParcelRent = startupConfig.GetInt("PriceParcelRent", 1); | ||
270 | PriceGroupCreate = startupConfig.GetInt("PriceGroupCreate", -1); | ||
271 | m_sellEnabled = startupConfig.GetBoolean("SellEnabled", false); | ||
272 | } | 262 | } |
263 | |||
264 | if(economyConfig == null) | ||
265 | return; | ||
266 | |||
267 | PriceEnergyUnit = economyConfig.GetInt("PriceEnergyUnit", 0); | ||
268 | PriceObjectClaim = economyConfig.GetInt("PriceObjectClaim", 0); | ||
269 | PricePublicObjectDecay = economyConfig.GetInt("PricePublicObjectDecay", 4); | ||
270 | PricePublicObjectDelete = economyConfig.GetInt("PricePublicObjectDelete", 0); | ||
271 | PriceParcelClaim = economyConfig.GetInt("PriceParcelClaim", 0); | ||
272 | PriceParcelClaimFactor = economyConfig.GetFloat("PriceParcelClaimFactor", 1f); | ||
273 | PriceUpload = economyConfig.GetInt("PriceUpload", 0); | ||
274 | PriceRentLight = economyConfig.GetInt("PriceRentLight", 0); | ||
275 | TeleportMinPrice = economyConfig.GetInt("TeleportMinPrice", 0); | ||
276 | TeleportPriceExponent = economyConfig.GetFloat("TeleportPriceExponent", 2f); | ||
277 | EnergyEfficiency = economyConfig.GetFloat("EnergyEfficiency", 1); | ||
278 | PriceObjectRent = economyConfig.GetFloat("PriceObjectRent", 0); | ||
279 | PriceObjectScaleFactor = economyConfig.GetFloat("PriceObjectScaleFactor", 10); | ||
280 | PriceParcelRent = economyConfig.GetInt("PriceParcelRent", 0); | ||
281 | PriceGroupCreate = economyConfig.GetInt("PriceGroupCreate", -1); | ||
282 | m_sellEnabled = economyConfig.GetBoolean("SellEnabled", true); | ||
273 | } | 283 | } |
274 | 284 | ||
275 | private void GetClientFunds(IClientAPI client) | 285 | private void GetClientFunds(IClientAPI client) |
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index e593c9d..dca6413 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example | |||
@@ -903,6 +903,10 @@ | |||
903 | ;DATA_SRV_MISearch = "http://metaverseink.com/cgi-bin/register.py" | 903 | ;DATA_SRV_MISearch = "http://metaverseink.com/cgi-bin/register.py" |
904 | 904 | ||
905 | [Economy] | 905 | [Economy] |
906 | ; the economy module in use | ||
907 | ; To use other modules you need to override this setting | ||
908 | ; economymodule = BetaGridLikeMoneyModule | ||
909 | |||
906 | ;# {SellEnabled} {} {Enable selling for 0?} {true false} true | 910 | ;# {SellEnabled} {} {Enable selling for 0?} {true false} true |
907 | ; The default economy module only implements just enough to allow free actions (transfer of objects, etc). | 911 | ; The default economy module only implements just enough to allow free actions (transfer of objects, etc). |
908 | ; There is no intention to implement anything further in core OpenSimulator. | 912 | ; There is no intention to implement anything further in core OpenSimulator. |
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 51f6c9c..61d7098 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini | |||
@@ -1723,40 +1723,48 @@ | |||
1723 | ; data service | 1723 | ; data service |
1724 | ;DATA_SRV_MISearch = "http://metaverseink.com/cgi-bin/register.py" | 1724 | ;DATA_SRV_MISearch = "http://metaverseink.com/cgi-bin/register.py" |
1725 | 1725 | ||
1726 | 1726 | ||
1727 | [Economy] | 1727 | [Economy] |
1728 | ; the economy module in use | ||
1729 | ; default is the provided BetaGridLikeMoneyModule | ||
1730 | ; - This module is for demonstration only - | ||
1731 | ; The default economy module only implements just enough to allow free actions (transfer of objects, etc). | ||
1732 | ; There is no intention to implement anything further in core OpenSimulator. | ||
1733 | ; This functionality has to be provided by third party modules. | ||
1734 | ; To use other modules you need to override this setting on OpenSim.ini Economy (or startup) section | ||
1735 | ; economymodule = BetaGridLikeMoneyModule | ||
1736 | |||
1728 | ; These economy values get used in the BetaGridLikeMoneyModule. - This module is for demonstration only - | 1737 | ; These economy values get used in the BetaGridLikeMoneyModule. - This module is for demonstration only - |
1729 | ; The default economy module only implements just enough to allow free actions (transfer of objects, etc). | 1738 | ; The default economy module only implements just enough to allow free actions (transfer of objects, etc). |
1730 | ; There is no intention to implement anything further in core OpenSimulator. | 1739 | ; There is no intention to implement anything further in core OpenSimulator. |
1731 | ; This functionality has to be provided by third party modules. | 1740 | ; This functionality has to be provided by third party modules. |
1732 | 1741 | ||
1733 | ;; Enables selling things for $0. Default is true. | 1742 | ;; Enables selling things for $0. Default is true. |
1734 | SellEnabled = true | 1743 | ; SellEnabled = true |
1735 | 1744 | ||
1736 | ;; Money Unit fee to upload textures, animations etc. Default is 0. | 1745 | ;; Money Unit fee to upload textures, animations etc. Default is 0. |
1737 | PriceUpload = 0 | 1746 | ;PriceUpload = 0 |
1738 | 1747 | ||
1739 | ;; Money Unit fee to create groups. Default is 0. | 1748 | ;; Money Unit fee to create groups. Default is 0. |
1740 | PriceGroupCreate = 0 | 1749 | ;PriceGroupCreate = 0 |
1741 | 1750 | ||
1742 | ; We don't really know what the rest of these values do. These get sent to the client | 1751 | ; We don't really know what the rest of these values do. These get sent to the client |
1743 | ; These taken from Agni at a Public Telehub. Change at your own risk. | 1752 | ; These taken from Agni at a Public Telehub. Change at your own risk. |
1744 | ObjectCount = 0 | 1753 | ;ObjectCount = 0 |
1745 | PriceEnergyUnit = 100 | 1754 | ;PriceEnergyUnit = 0 |
1746 | PriceObjectClaim = 10 | 1755 | ;PriceObjectClaim = 0 |
1747 | PricePublicObjectDecay = 4 | 1756 | ;PricePublicObjectDecay = 0 |
1748 | PricePublicObjectDelete = 4 | 1757 | ;PricePublicObjectDelete = 0 |
1749 | PriceParcelClaim = 1 | 1758 | ;PriceParcelClaim = 0 |
1750 | PriceParcelClaimFactor = 1 | 1759 | ;PriceParcelClaimFactor = 1 |
1751 | 1760 | ||
1752 | PriceRentLight = 5 | 1761 | ;PriceRentLight = 0 |
1753 | TeleportMinPrice = 2 | 1762 | ;TeleportMinPrice = 0 |
1754 | TeleportPriceExponent = 2 | 1763 | ;TeleportPriceExponent = 2 |
1755 | EnergyEfficiency = 1 | 1764 | ;EnergyEfficiency = 1 |
1756 | PriceObjectRent = 1 | 1765 | ;PriceObjectRent = 0 |
1757 | PriceObjectScaleFactor = 10 | 1766 | ;PriceObjectScaleFactor = 10 |
1758 | PriceParcelRent = 1 | 1767 | ;PriceParcelRent = 0 |
1759 | |||
1760 | 1768 | ||
1761 | [XEngine] | 1769 | [XEngine] |
1762 | ; Enable this engine in this OpenSim instance | 1770 | ; Enable this engine in this OpenSim instance |