From df77724bbc30ab03f95508bd1b2f4539ed1206e3 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 17 Sep 2012 15:50:59 +0100 Subject: let mesh model estimator work even without money module, so other estimations can work --- .../Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 44 +++++++++++----------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index ce3ca8b..ddb69c4 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs @@ -462,35 +462,35 @@ namespace OpenSim.Region.ClientStack.Linden { IMoneyModule mm = m_Scene.RequestModuleInterface(); + int baseCost = 0; if (mm != null) + baseCost = mm.UploadCharge; + + if (llsdRequest.asset_type == "mesh") { - // XPTO: The cost should be calculated about here + string error; + int modelcost; + ModelCost mc = new ModelCost(); - if (llsdRequest.asset_type == "mesh") + if (!mc.MeshModelCost(llsdRequest.asset_resources, baseCost, out modelcost, + meshcostdata, out error)) { - string error; - int modelcost; - ModelCost mc = new ModelCost(); - - if (!mc.MeshModelCost(llsdRequest.asset_resources, mm.UploadCharge, out modelcost, - meshcostdata, out error)) - { - - client.SendAgentAlertMessage(error, false); + client.SendAgentAlertMessage(error, false); - LLSDAssetUploadResponse errorResponse = new LLSDAssetUploadResponse(); - errorResponse.uploader = ""; - errorResponse.state = "error"; - return errorResponse; - } - - cost = (uint)modelcost; - } - else - { - cost = (uint)mm.UploadCharge; + LLSDAssetUploadResponse errorResponse = new LLSDAssetUploadResponse(); + errorResponse.uploader = ""; + errorResponse.state = "error"; + return errorResponse; } + cost = (uint)modelcost; + } + else + { + cost = (uint)baseCost; + } + if (mm != null) + { if (!mm.UploadCovered(client.AgentId, (int)cost)) { client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); -- cgit v1.1