diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 580c005..ce3ca8b 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | |||
@@ -429,6 +429,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
429 | //m_log.Debug("asset upload request via CAPS" + llsdRequest.inventory_type + " , " + llsdRequest.asset_type); | 429 | //m_log.Debug("asset upload request via CAPS" + llsdRequest.inventory_type + " , " + llsdRequest.asset_type); |
430 | 430 | ||
431 | uint cost = 0; | 431 | uint cost = 0; |
432 | LLSDAssetUploadResponseData meshcostdata = new LLSDAssetUploadResponseData(); | ||
432 | 433 | ||
433 | if (llsdRequest.asset_type == "texture" || | 434 | if (llsdRequest.asset_type == "texture" || |
434 | llsdRequest.asset_type == "animation" || | 435 | llsdRequest.asset_type == "animation" || |
@@ -467,11 +468,15 @@ namespace OpenSim.Region.ClientStack.Linden | |||
467 | 468 | ||
468 | if (llsdRequest.asset_type == "mesh") | 469 | if (llsdRequest.asset_type == "mesh") |
469 | { | 470 | { |
470 | cost += 20; // Constant for now to test showing a price | 471 | string error; |
472 | int modelcost; | ||
473 | ModelCost mc = new ModelCost(); | ||
471 | 474 | ||
472 | if (llsdRequest.asset_resources == null) | 475 | if (!mc.MeshModelCost(llsdRequest.asset_resources, mm.UploadCharge, out modelcost, |
476 | meshcostdata, out error)) | ||
473 | { | 477 | { |
474 | client.SendAgentAlertMessage("Unable to upload asset. missing information.", false); | 478 | |
479 | client.SendAgentAlertMessage(error, false); | ||
475 | 480 | ||
476 | LLSDAssetUploadResponse errorResponse = new LLSDAssetUploadResponse(); | 481 | LLSDAssetUploadResponse errorResponse = new LLSDAssetUploadResponse(); |
477 | errorResponse.uploader = ""; | 482 | errorResponse.uploader = ""; |
@@ -479,10 +484,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
479 | return errorResponse; | 484 | return errorResponse; |
480 | } | 485 | } |
481 | 486 | ||
482 | uint textures_cost = (uint)llsdRequest.asset_resources.texture_list.Array.Count; | 487 | cost = (uint)modelcost; |
483 | textures_cost *= (uint)mm.UploadCharge; | ||
484 | |||
485 | cost += textures_cost; | ||
486 | } | 488 | } |
487 | else | 489 | else |
488 | { | 490 | { |
@@ -536,20 +538,9 @@ namespace OpenSim.Region.ClientStack.Linden | |||
536 | uploadResponse.state = "upload"; | 538 | uploadResponse.state = "upload"; |
537 | uploadResponse.upload_price = (int)cost; | 539 | uploadResponse.upload_price = (int)cost; |
538 | 540 | ||
539 | // use fake values for now | ||
540 | if (llsdRequest.asset_type == "mesh") | 541 | if (llsdRequest.asset_type == "mesh") |
541 | { | 542 | { |
542 | uploadResponse.data = new LLSDAssetUploadResponseData(); | 543 | uploadResponse.data = meshcostdata; |
543 | uploadResponse.data.model_streaming_cost = 1.0; | ||
544 | uploadResponse.data.simulation_cost = 1.5; | ||
545 | |||
546 | uploadResponse.data.physics_cost = 2.0; | ||
547 | uploadResponse.data.resource_cost = 3.0; | ||
548 | uploadResponse.data.upload_price_breakdown.mesh_instance = 1; | ||
549 | uploadResponse.data.upload_price_breakdown.mesh_physics = 2; | ||
550 | uploadResponse.data.upload_price_breakdown.mesh_streaming = 3; | ||
551 | uploadResponse.data.upload_price_breakdown.texture = 5; | ||
552 | uploadResponse.data.upload_price_breakdown.model = 4; | ||
553 | } | 544 | } |
554 | 545 | ||
555 | uploader.OnUpLoad += UploadCompleteHandler; | 546 | uploader.OnUpLoad += UploadCompleteHandler; |