From f9c24c9414134af04fea3dd6ff39800856aec10e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 21 Sep 2012 11:50:14 +0100 Subject: read model upload cost parameters from config [Economy] section --- .../Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 21 +++++++++++++++++++++ .../ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs | 6 ++---- 2 files changed, 23 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index a139ea8..1b47fca 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs @@ -118,6 +118,7 @@ namespace OpenSim.Region.ClientStack.Linden private string m_regionName; private int m_levelUpload = 0; private float m_PrimScaleMin = 0.001f; + private bool m_enableFreeTestModelUpload = false; private enum FileAgentInventoryState : int { @@ -142,6 +143,11 @@ namespace OpenSim.Region.ClientStack.Linden // m_ModelCost.ObjectLinkedPartsMax = ?? // m_PrimScaleMin = ?? + float modelTextureUploadFactor = m_ModelCost.ModelTextureCostFactor; + float modelUploadFactor = m_ModelCost.ModelMeshCostFactor; + float modelMinUploadCostFactor = m_ModelCost.ModelMinCostFactor; + + IConfigSource config = m_Scene.Config; if (config != null) { @@ -156,6 +162,20 @@ namespace OpenSim.Region.ClientStack.Linden { 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; @@ -912,6 +932,7 @@ namespace OpenSim.Region.ClientStack.Linden { AddNewInventoryItem(m_HostCapsObj.AgentID, item, cost); } + lock (m_ModelCost) m_FileAgentInventoryState = FileAgentInventoryState.idle; } diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs index ece40ac..830c46d 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs @@ -31,14 +31,12 @@ namespace OpenSim.Region.ClientStack.Linden public class ModelCost { - // upload fee tunning paramenters + // upload fee defaults // fees are normalized to 1.0 // 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 ModelTextureCostFactor = 0.25f; //(2.5c$) scale textures fee to basic. - // promote integration in a model - // since they will not show up in inventory + public float ModelTextureCostFactor = 1.0f; // scale textures fee to basic. public float ModelMinCostFactor = 0.5f; // minimum total model free excluding textures // itens costs in normalized values -- cgit v1.1 From 7de67d5680b2eb028bb17fae0d80d1f78ccd3a19 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 22 Sep 2012 12:00:14 +0100 Subject: removed unused data in MeshUploadFlag response --- .../ClientStack/Linden/Caps/MeshUploadFlagModule.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/MeshUploadFlagModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/MeshUploadFlagModule.cs index 44a6883..0251ac4 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/MeshUploadFlagModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/MeshUploadFlagModule.cs @@ -129,15 +129,15 @@ namespace OpenSim.Region.ClientStack.Linden // m_log.DebugFormat("[MESH UPLOAD FLAG MODULE]: MeshUploadFlag request"); OSDMap data = new OSDMap(); - ScenePresence sp = m_scene.GetScenePresence(m_agentID); - data["username"] = sp.Firstname + "." + sp.Lastname; - data["display_name_next_update"] = new OSDDate(DateTime.Now); - data["legacy_first_name"] = sp.Firstname; +// ScenePresence sp = m_scene.GetScenePresence(m_agentID); +// data["username"] = sp.Firstname + "." + sp.Lastname; +// data["display_name_next_update"] = new OSDDate(DateTime.Now); +// data["legacy_first_name"] = sp.Firstname; data["mesh_upload_status"] = "valid"; - data["display_name"] = sp.Firstname + " " + sp.Lastname; - data["legacy_last_name"] = sp.Lastname; - data["id"] = m_agentID; - data["is_display_name_default"] = true; +// data["display_name"] = sp.Firstname + " " + sp.Lastname; +// data["legacy_last_name"] = sp.Lastname; +// data["id"] = m_agentID; +// data["is_display_name_default"] = true; //Send back data Hashtable responsedata = new Hashtable(); -- cgit v1.1