read model upload cost parameters from config [Economy] section

avinationmerge
UbitUmarov 2012-09-21 11:50:14 +01:00
parent bf987f96d2
commit f9c24c9414
2 changed files with 23 additions and 4 deletions

View File

@ -118,6 +118,7 @@ namespace OpenSim.Region.ClientStack.Linden
private string m_regionName; private string m_regionName;
private int m_levelUpload = 0; private int m_levelUpload = 0;
private float m_PrimScaleMin = 0.001f; private float m_PrimScaleMin = 0.001f;
private bool m_enableFreeTestModelUpload = false;
private enum FileAgentInventoryState : int private enum FileAgentInventoryState : int
{ {
@ -142,6 +143,11 @@ namespace OpenSim.Region.ClientStack.Linden
// m_ModelCost.ObjectLinkedPartsMax = ?? // m_ModelCost.ObjectLinkedPartsMax = ??
// m_PrimScaleMin = ?? // m_PrimScaleMin = ??
float modelTextureUploadFactor = m_ModelCost.ModelTextureCostFactor;
float modelUploadFactor = m_ModelCost.ModelMeshCostFactor;
float modelMinUploadCostFactor = m_ModelCost.ModelMinCostFactor;
IConfigSource config = m_Scene.Config; IConfigSource config = m_Scene.Config;
if (config != null) if (config != null)
{ {
@ -156,6 +162,20 @@ namespace OpenSim.Region.ClientStack.Linden
{ {
m_persistBakedTextures = appearanceConfig.GetBoolean("PersistBakedTextures", m_persistBakedTextures); m_persistBakedTextures = appearanceConfig.GetBoolean("PersistBakedTextures", m_persistBakedTextures);
} }
// economy for model upload
IConfig EconomyConfig = config.Configs["Economy"];
if (EconomyConfig != null)
{
modelUploadFactor = EconomyConfig.GetFloat("MeshModelUploadCostFactor", modelUploadFactor);
modelTextureUploadFactor = EconomyConfig.GetFloat("MeshModelUploadTextureCostFactor", modelTextureUploadFactor);
modelMinUploadCostFactor = EconomyConfig.GetFloat("MeshModelMinCostFactor", modelMinUploadCostFactor);
m_enableFreeTestModelUpload = EconomyConfig.GetBoolean("MeshModelUploadAllowFreeTest", false);
m_ModelCost.ModelMeshCostFactor = modelUploadFactor;
m_ModelCost.ModelTextureCostFactor = modelTextureUploadFactor;
m_ModelCost.ModelMinCostFactor = modelMinUploadCostFactor;
}
} }
m_assetService = m_Scene.AssetService; m_assetService = m_Scene.AssetService;
@ -912,6 +932,7 @@ namespace OpenSim.Region.ClientStack.Linden
{ {
AddNewInventoryItem(m_HostCapsObj.AgentID, item, cost); AddNewInventoryItem(m_HostCapsObj.AgentID, item, cost);
} }
lock (m_ModelCost) lock (m_ModelCost)
m_FileAgentInventoryState = FileAgentInventoryState.idle; m_FileAgentInventoryState = FileAgentInventoryState.idle;
} }

View File

@ -31,14 +31,12 @@ namespace OpenSim.Region.ClientStack.Linden
public class ModelCost public class ModelCost
{ {
// upload fee tunning paramenters // upload fee defaults
// fees are normalized to 1.0 // fees are normalized to 1.0
// this parameters scale them to basic cost ( so 1.0 translates to 10 ) // this parameters scale them to basic cost ( so 1.0 translates to 10 )
public float ModelMeshCostFactor = 1.0f; // scale total cost relative to basic (excluding textures) public float ModelMeshCostFactor = 1.0f; // scale total cost relative to basic (excluding textures)
public float ModelTextureCostFactor = 0.25f; //(2.5c$) scale textures fee to basic. public float ModelTextureCostFactor = 1.0f; // scale textures fee to basic.
// promote integration in a model
// since they will not show up in inventory
public float ModelMinCostFactor = 0.5f; // minimum total model free excluding textures public float ModelMinCostFactor = 0.5f; // minimum total model free excluding textures
// itens costs in normalized values // itens costs in normalized values