summaryrefslogtreecommitdiff
path: root/indra/newview/llaccountingquotamanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llaccountingquotamanager.cpp')
-rw-r--r--indra/newview/llaccountingquotamanager.cpp134
1 files changed, 74 insertions, 60 deletions
diff --git a/indra/newview/llaccountingquotamanager.cpp b/indra/newview/llaccountingquotamanager.cpp
index d11b86db15..a4f5de5632 100644
--- a/indra/newview/llaccountingquotamanager.cpp
+++ b/indra/newview/llaccountingquotamanager.cpp
@@ -2,31 +2,25 @@
* @file LLAccountingQuotaManager.cpp
* @ Handles the setting and accessing for costs associated with mesh
*
- * $LicenseInfo:firstyear=2001&license=viewergpl$
- *
- * Copyright (c) 2001-2010, Linden Research, Inc.
- *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab. Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ * Copyright (C) 2011, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
*
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at
- * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -77,12 +71,10 @@ public:
return;
}
- //Differentiate what the incoming caps could be from the data
- //bool VOContent = content.has("Objects");
+ //Differentiate what the incoming caps could be from the data
bool containsParcel = content.has("parcel");
bool containsSelection = content.has("selected");
- //bool VORegion = content.has("region");
-
+
//Loop over the stored object ids checking against the incoming data
for ( LLSD::array_iterator iter = mObjectIDs.beginArray(); iter != mObjectIDs.endArray(); ++iter )
{
@@ -97,16 +89,17 @@ public:
for(S32 i = 0; i < dataCount; i++)
{
//prep#todo verify that this is safe, otherwise just add a bool
- S32 parcelId = 0;
- S32 parcelOwner = 0;
+ LLUUID parcelId;
+ //S32 parcelOwner = 0;
if ( content["parcel"][i].has("parcel_id") )
{
- parcelId = content["parcel"][i]["parcel_id"].asInteger();
- }
- if ( content["parcel"][i].has("parcel_owner") )
- {
- parcelOwner = content["parcel"][i]["parcel_owner"].asInteger();
+ parcelId = content["parcel"][i]["parcel_id"].asUUID();
}
+
+ //if ( content["parcel"][i].has("parcel_owner") )
+ //{
+ // parcelOwner = content["parcel"][i]["parcel_owner"].asInteger();
+ //}
F32 ownerRenderCost = 0;
F32 ownerPhysicsCost = 0;
@@ -123,48 +116,69 @@ public:
F32 otherNetworkCost = 0;
F32 otherSimulationCost = 0;
- F32 totalRenderCost = 0;
- F32 totalPhysicsCost = 0;
- F32 totalNetworkCost = 0;
- F32 totalSimulationCost = 0;
+ F32 tempRenderCost = 0;
+ F32 tempPhysicsCost = 0;
+ F32 tempNetworkCost = 0;
+ F32 tempSimulationCost = 0;
+ F32 selectedRenderCost = 0;
+ F32 selectedPhysicsCost = 0;
+ F32 selectedNetworkCost = 0;
+ F32 selectedSimulationCost = 0;
+
+ F32 parcelCapacity = 0;
+
+ if ( content["parcel"][i].has("capacity") )
+ {
+ parcelCapacity = content["parcel"][i].has("capacity");
+ }
+
if ( content["parcel"][i].has("owner") )
{
- ownerRenderCost = content["parcel"][i]["owner"]["render"].asReal();
+ ownerRenderCost = content["parcel"][i]["owner"]["rendering"].asReal();
ownerPhysicsCost = content["parcel"][i]["owner"]["physics"].asReal();
- ownerNetworkCost = content["parcel"][i]["owner"]["network"].asReal();
- ownerSimulationCost = content["parcel"][i]["owner"]["simulation"].asReal();
-
+ ownerNetworkCost = content["parcel"][i]["owner"]["streaming"].asReal();
+ ownerSimulationCost = content["parcel"][i]["owner"]["simulation"].asReal();
}
+
if ( content["parcel"][i].has("group") )
{
- groupRenderCost = content["parcel"][i]["group"]["render"].asReal();
+ groupRenderCost = content["parcel"][i]["group"]["rendering"].asReal();
groupPhysicsCost = content["parcel"][i]["group"]["physics"].asReal();
- groupNetworkCost = content["parcel"][i]["group"]["network"].asReal();
+ groupNetworkCost = content["parcel"][i]["group"]["streaming"].asReal();
groupSimulationCost = content["parcel"][i]["group"]["simulation"].asReal();
}
if ( content["parcel"][i].has("other") )
{
- otherRenderCost = content["parcel"][i]["other"]["render"].asReal();
+ otherRenderCost = content["parcel"][i]["other"]["rendering"].asReal();
otherPhysicsCost = content["parcel"][i]["other"]["physics"].asReal();
- otherNetworkCost = content["parcel"][i]["other"]["network"].asReal();
+ otherNetworkCost = content["parcel"][i]["other"]["streaming"].asReal();
otherSimulationCost = content["parcel"][i]["other"]["simulation"].asReal();
}
- if ( content["parcel"][i].has("total") )
+ if ( content["parcel"][i].has("temp") )
{
- totalRenderCost = content["parcel"][i]["total"]["render"].asReal();
- totalPhysicsCost = content["parcel"][i]["total"]["physics"].asReal();
- totalNetworkCost = content["parcel"][i]["total"]["network"].asReal();
- totalSimulationCost = content["parcel"][i]["total"]["simulation"].asReal();
-
+ tempRenderCost = content["parcel"][i]["total"]["rendering"].asReal();
+ tempPhysicsCost = content["parcel"][i]["total"]["physics"].asReal();
+ tempNetworkCost = content["parcel"][i]["total"]["streaming"].asReal();
+ tempSimulationCost = content["parcel"][i]["total"]["simulation"].asReal();
+ }
+
+ if ( content["parcel"][i].has("selected") )
+ {
+ selectedRenderCost = content["parcel"][i]["total"]["rendering"].asReal();
+ selectedPhysicsCost = content["parcel"][i]["total"]["physics"].asReal();
+ selectedNetworkCost = content["parcel"][i]["total"]["streaming"].asReal();
+ selectedSimulationCost = content["parcel"][i]["total"]["simulation"].asReal();
}
- ParcelQuota parcelQuota( ownerRenderCost, ownerPhysicsCost, ownerNetworkCost, ownerSimulationCost,
- groupRenderCost, groupPhysicsCost, groupNetworkCost, groupSimulationCost,
- otherRenderCost, otherPhysicsCost, otherNetworkCost, otherSimulationCost,
- totalRenderCost, totalPhysicsCost, totalNetworkCost, totalSimulationCost );
+ ParcelQuota parcelQuota( ownerRenderCost, ownerPhysicsCost, ownerNetworkCost, ownerSimulationCost,
+ groupRenderCost, groupPhysicsCost, groupNetworkCost, groupSimulationCost,
+ otherRenderCost, otherPhysicsCost, otherNetworkCost, otherSimulationCost,
+ tempRenderCost, tempPhysicsCost, tempNetworkCost, tempSimulationCost,
+ selectedRenderCost, selectedPhysicsCost, selectedNetworkCost, selectedSimulationCost,
+ parcelCapacity );
//Update the Parcel
LLParcel* pParcel = LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel();
if ( pParcel )
@@ -185,18 +199,18 @@ public:
F32 networkCost = 0;
F32 simulationCost = 0;
- S32 localId = 0;
+ LLUUID objectId;
- localId = content["selected"][i]["local_id"].asInteger();
- renderCost = content["selected"][i]["render"].asReal();
+ objectId = content["selected"][i]["local_id"].asUUID();
+ renderCost = content["selected"][i]["rendering"].asReal();
physicsCost = content["selected"][i]["physics"].asReal();
- networkCost = content["selected"][i]["network"].asReal();
+ networkCost = content["selected"][i]["streaming"].asReal();
simulationCost = content["selected"][i]["simulation"].asReal();
- SelectionQuota selectionQuota( localId, renderCost, physicsCost, networkCost, simulationCost );
+ SelectionQuota selectionQuota( objectId, renderCost, physicsCost, networkCost, simulationCost );
//Update the objects
- //gObjectList.updateQuota( localId, selectionQuota );
+ gObjectList.updateQuota( objectId, selectionQuota );
}
}