let mesh model estimator work even without money module, so other

estimations can work
avinationmerge
UbitUmarov 2012-09-17 15:50:59 +01:00
parent 5915dfc26f
commit df77724bbc
1 changed files with 27 additions and 27 deletions

View File

@ -462,9 +462,9 @@ namespace OpenSim.Region.ClientStack.Linden
{ {
IMoneyModule mm = m_Scene.RequestModuleInterface<IMoneyModule>(); IMoneyModule mm = m_Scene.RequestModuleInterface<IMoneyModule>();
int baseCost = 0;
if (mm != null) if (mm != null)
{ baseCost = mm.UploadCharge;
// XPTO: The cost should be calculated about here
if (llsdRequest.asset_type == "mesh") if (llsdRequest.asset_type == "mesh")
{ {
@ -472,10 +472,9 @@ namespace OpenSim.Region.ClientStack.Linden
int modelcost; int modelcost;
ModelCost mc = new ModelCost(); ModelCost mc = new ModelCost();
if (!mc.MeshModelCost(llsdRequest.asset_resources, mm.UploadCharge, out modelcost, if (!mc.MeshModelCost(llsdRequest.asset_resources, baseCost, out modelcost,
meshcostdata, out error)) meshcostdata, out error))
{ {
client.SendAgentAlertMessage(error, false); client.SendAgentAlertMessage(error, false);
LLSDAssetUploadResponse errorResponse = new LLSDAssetUploadResponse(); LLSDAssetUploadResponse errorResponse = new LLSDAssetUploadResponse();
@ -483,14 +482,15 @@ namespace OpenSim.Region.ClientStack.Linden
errorResponse.state = "error"; errorResponse.state = "error";
return errorResponse; return errorResponse;
} }
cost = (uint)modelcost; cost = (uint)modelcost;
} }
else else
{ {
cost = (uint)mm.UploadCharge; cost = (uint)baseCost;
} }
if (mm != null)
{
if (!mm.UploadCovered(client.AgentId, (int)cost)) if (!mm.UploadCovered(client.AgentId, (int)cost))
{ {
client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);