Merge branch 'master' into httptests

httptests
UbitUmarov 2018-03-05 20:57:13 +00:00
commit c408f0a38e
3 changed files with 77 additions and 55 deletions

View File

@ -65,10 +65,10 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
/// </summary> /// </summary>
// private UUID EconomyBaseAccount = UUID.Zero; // private UUID EconomyBaseAccount = UUID.Zero;
private float EnergyEfficiency = 0f; private float EnergyEfficiency = 1f;
// private ObjectPaid handerOnObjectPaid; // private ObjectPaid handerOnObjectPaid;
private bool m_enabled = true; private bool m_enabled = true;
private bool m_sellEnabled = false; private bool m_sellEnabled = true;
private IConfigSource m_gConfig; private IConfigSource m_gConfig;
@ -85,12 +85,12 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
private int ObjectCount = 0; private int ObjectCount = 0;
private int PriceEnergyUnit = 0; private int PriceEnergyUnit = 0;
private int PriceGroupCreate = 0; private int PriceGroupCreate = -1;
private int PriceObjectClaim = 0; private int PriceObjectClaim = 0;
private float PriceObjectRent = 0f; private float PriceObjectRent = 0f;
private float PriceObjectScaleFactor = 0f; private float PriceObjectScaleFactor = 10f;
private int PriceParcelClaim = 0; private int PriceParcelClaim = 0;
private float PriceParcelClaimFactor = 0f; private float PriceParcelClaimFactor = 1f;
private int PriceParcelRent = 0; private int PriceParcelRent = 0;
private int PricePublicObjectDecay = 0; private int PricePublicObjectDecay = 0;
private int PricePublicObjectDelete = 0; private int PricePublicObjectDelete = 0;
@ -98,7 +98,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
private int PriceUpload = 0; private int PriceUpload = 0;
private int TeleportMinPrice = 0; private int TeleportMinPrice = 0;
private float TeleportPriceExponent = 0f; private float TeleportPriceExponent = 2f;
#region IMoneyModule Members #region IMoneyModule Members
@ -124,13 +124,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
public void Initialise(IConfigSource config) public void Initialise(IConfigSource config)
{ {
m_gConfig = config; m_gConfig = config;
ReadConfigAndPopulate();
IConfig startupConfig = m_gConfig.Configs["Startup"];
IConfig economyConfig = m_gConfig.Configs["Economy"];
ReadConfigAndPopulate(startupConfig, "Startup");
ReadConfigAndPopulate(economyConfig, "Economy");
} }
public void AddRegion(Scene scene) public void AddRegion(Scene scene)
@ -241,35 +235,51 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
/// <summary> /// <summary>
/// Parse Configuration /// Parse Configuration
/// </summary> /// </summary>
/// <param name="scene"></param> private void ReadConfigAndPopulate()
/// <param name="startupConfig"></param>
/// <param name="config"></param>
private void ReadConfigAndPopulate(IConfig startupConfig, string config)
{ {
if (config == "Startup" && startupConfig != null) // we are enabled by default
IConfig startupConfig = m_gConfig.Configs["Startup"];
if(startupConfig == null) // should not happen
return;
IConfig economyConfig = m_gConfig.Configs["Economy"];
// economymodule may be at startup or Economy (legacy)
string mmodule = startupConfig.GetString("economymodule","");
if(String.IsNullOrEmpty(mmodule))
{ {
m_enabled = (startupConfig.GetString("economymodule", "BetaGridLikeMoneyModule") == "BetaGridLikeMoneyModule"); if(economyConfig != null)
mmodule = economyConfig.GetString("economymodule","");
} }
if (config == "Economy" && startupConfig != null) if(!String.IsNullOrEmpty(mmodule) && mmodule != Name)
{ {
PriceEnergyUnit = startupConfig.GetInt("PriceEnergyUnit", 100); // some other money module selected
PriceObjectClaim = startupConfig.GetInt("PriceObjectClaim", 10); m_enabled = false;
PricePublicObjectDecay = startupConfig.GetInt("PricePublicObjectDecay", 4); return;
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);
m_sellEnabled = startupConfig.GetBoolean("SellEnabled", false);
} }
if(economyConfig == null)
return;
PriceEnergyUnit = economyConfig.GetInt("PriceEnergyUnit", 0);
PriceObjectClaim = economyConfig.GetInt("PriceObjectClaim", 0);
PricePublicObjectDecay = economyConfig.GetInt("PricePublicObjectDecay", 4);
PricePublicObjectDelete = economyConfig.GetInt("PricePublicObjectDelete", 0);
PriceParcelClaim = economyConfig.GetInt("PriceParcelClaim", 0);
PriceParcelClaimFactor = economyConfig.GetFloat("PriceParcelClaimFactor", 1f);
PriceUpload = economyConfig.GetInt("PriceUpload", 0);
PriceRentLight = economyConfig.GetInt("PriceRentLight", 0);
TeleportMinPrice = economyConfig.GetInt("TeleportMinPrice", 0);
TeleportPriceExponent = economyConfig.GetFloat("TeleportPriceExponent", 2f);
EnergyEfficiency = economyConfig.GetFloat("EnergyEfficiency", 1);
PriceObjectRent = economyConfig.GetFloat("PriceObjectRent", 0);
PriceObjectScaleFactor = economyConfig.GetFloat("PriceObjectScaleFactor", 10);
PriceParcelRent = economyConfig.GetInt("PriceParcelRent", 0);
PriceGroupCreate = economyConfig.GetInt("PriceGroupCreate", -1);
m_sellEnabled = economyConfig.GetBoolean("SellEnabled", true);
} }
private void GetClientFunds(IClientAPI client) private void GetClientFunds(IClientAPI client)

View File

@ -903,6 +903,10 @@
;DATA_SRV_MISearch = "http://metaverseink.com/cgi-bin/register.py" ;DATA_SRV_MISearch = "http://metaverseink.com/cgi-bin/register.py"
[Economy] [Economy]
; the economy module in use
; To use other modules you need to override this setting
; economymodule = BetaGridLikeMoneyModule
;# {SellEnabled} {} {Enable selling for 0?} {true false} true ;# {SellEnabled} {} {Enable selling for 0?} {true false} true
; The default economy module only implements just enough to allow free actions (transfer of objects, etc). ; The default economy module only implements just enough to allow free actions (transfer of objects, etc).
; There is no intention to implement anything further in core OpenSimulator. ; There is no intention to implement anything further in core OpenSimulator.

View File

@ -1723,40 +1723,48 @@
; data service ; data service
;DATA_SRV_MISearch = "http://metaverseink.com/cgi-bin/register.py" ;DATA_SRV_MISearch = "http://metaverseink.com/cgi-bin/register.py"
[Economy] [Economy]
; the economy module in use
; default is the provided BetaGridLikeMoneyModule
; - This module is for demonstration only -
; The default economy module only implements just enough to allow free actions (transfer of objects, etc).
; There is no intention to implement anything further in core OpenSimulator.
; This functionality has to be provided by third party modules.
; To use other modules you need to override this setting on OpenSim.ini Economy (or startup) section
; economymodule = BetaGridLikeMoneyModule
; These economy values get used in the BetaGridLikeMoneyModule. - This module is for demonstration only - ; These economy values get used in the BetaGridLikeMoneyModule. - This module is for demonstration only -
; The default economy module only implements just enough to allow free actions (transfer of objects, etc). ; The default economy module only implements just enough to allow free actions (transfer of objects, etc).
; There is no intention to implement anything further in core OpenSimulator. ; There is no intention to implement anything further in core OpenSimulator.
; This functionality has to be provided by third party modules. ; This functionality has to be provided by third party modules.
;; Enables selling things for $0. Default is true. ;; Enables selling things for $0. Default is true.
SellEnabled = true ; SellEnabled = true
;; Money Unit fee to upload textures, animations etc. Default is 0. ;; Money Unit fee to upload textures, animations etc. Default is 0.
PriceUpload = 0 ;PriceUpload = 0
;; Money Unit fee to create groups. Default is 0. ;; Money Unit fee to create groups. Default is 0.
PriceGroupCreate = 0 ;PriceGroupCreate = 0
; We don't really know what the rest of these values do. These get sent to the client ; We don't really know what the rest of these values do. These get sent to the client
; These taken from Agni at a Public Telehub. Change at your own risk. ; These taken from Agni at a Public Telehub. Change at your own risk.
ObjectCount = 0 ;ObjectCount = 0
PriceEnergyUnit = 100 ;PriceEnergyUnit = 0
PriceObjectClaim = 10 ;PriceObjectClaim = 0
PricePublicObjectDecay = 4 ;PricePublicObjectDecay = 0
PricePublicObjectDelete = 4 ;PricePublicObjectDelete = 0
PriceParcelClaim = 1 ;PriceParcelClaim = 0
PriceParcelClaimFactor = 1 ;PriceParcelClaimFactor = 1
PriceRentLight = 5
TeleportMinPrice = 2
TeleportPriceExponent = 2
EnergyEfficiency = 1
PriceObjectRent = 1
PriceObjectScaleFactor = 10
PriceParcelRent = 1
;PriceRentLight = 0
;TeleportMinPrice = 0
;TeleportPriceExponent = 2
;EnergyEfficiency = 1
;PriceObjectRent = 0
;PriceObjectScaleFactor = 10
;PriceParcelRent = 0
[XEngine] [XEngine]
; Enable this engine in this OpenSim instance ; Enable this engine in this OpenSim instance