diff options
author | UbitUmarov | 2012-09-17 15:50:59 +0100 |
---|---|---|
committer | UbitUmarov | 2012-09-17 15:50:59 +0100 |
commit | df77724bbc30ab03f95508bd1b2f4539ed1206e3 (patch) | |
tree | 9edaf69ac1a264b58cdc2da6d12851f8fa3d69f9 /OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps | |
parent | Make use of mesh cost functions (diff) | |
download | opensim-SC-df77724bbc30ab03f95508bd1b2f4539ed1206e3.zip opensim-SC-df77724bbc30ab03f95508bd1b2f4539ed1206e3.tar.gz opensim-SC-df77724bbc30ab03f95508bd1b2f4539ed1206e3.tar.bz2 opensim-SC-df77724bbc30ab03f95508bd1b2f4539ed1206e3.tar.xz |
let mesh model estimator work even without money module, so other
estimations can work
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 44 |
1 files changed, 22 insertions, 22 deletions
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 | |||
462 | { | 462 | { |
463 | IMoneyModule mm = m_Scene.RequestModuleInterface<IMoneyModule>(); | 463 | IMoneyModule mm = m_Scene.RequestModuleInterface<IMoneyModule>(); |
464 | 464 | ||
465 | int baseCost = 0; | ||
465 | if (mm != null) | 466 | if (mm != null) |
467 | baseCost = mm.UploadCharge; | ||
468 | |||
469 | if (llsdRequest.asset_type == "mesh") | ||
466 | { | 470 | { |
467 | // XPTO: The cost should be calculated about here | 471 | string error; |
472 | int modelcost; | ||
473 | ModelCost mc = new ModelCost(); | ||
468 | 474 | ||
469 | if (llsdRequest.asset_type == "mesh") | 475 | if (!mc.MeshModelCost(llsdRequest.asset_resources, baseCost, out modelcost, |
476 | meshcostdata, out error)) | ||
470 | { | 477 | { |
471 | string error; | 478 | client.SendAgentAlertMessage(error, false); |
472 | int modelcost; | ||
473 | ModelCost mc = new ModelCost(); | ||
474 | |||
475 | if (!mc.MeshModelCost(llsdRequest.asset_resources, mm.UploadCharge, out modelcost, | ||
476 | meshcostdata, out error)) | ||
477 | { | ||
478 | |||
479 | client.SendAgentAlertMessage(error, false); | ||
480 | 479 | ||
481 | LLSDAssetUploadResponse errorResponse = new LLSDAssetUploadResponse(); | 480 | LLSDAssetUploadResponse errorResponse = new LLSDAssetUploadResponse(); |
482 | errorResponse.uploader = ""; | 481 | errorResponse.uploader = ""; |
483 | errorResponse.state = "error"; | 482 | errorResponse.state = "error"; |
484 | return errorResponse; | 483 | return errorResponse; |
485 | } | ||
486 | |||
487 | cost = (uint)modelcost; | ||
488 | } | ||
489 | else | ||
490 | { | ||
491 | cost = (uint)mm.UploadCharge; | ||
492 | } | 484 | } |
485 | cost = (uint)modelcost; | ||
486 | } | ||
487 | else | ||
488 | { | ||
489 | cost = (uint)baseCost; | ||
490 | } | ||
493 | 491 | ||
492 | if (mm != null) | ||
493 | { | ||
494 | if (!mm.UploadCovered(client.AgentId, (int)cost)) | 494 | if (!mm.UploadCovered(client.AgentId, (int)cost)) |
495 | { | 495 | { |
496 | client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); | 496 | client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); |