aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llinventory
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:42 -0500
committerJacek Antonelli2008-08-15 23:45:42 -0500
commitce28e056c20bf2723f565bbf464b87781ec248a2 (patch)
treeef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/llinventory
parentSecond Life viewer sources 1.19.1.4b (diff)
downloadmeta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz
Second Life viewer sources 1.20.2
Diffstat (limited to 'linden/indra/llinventory')
-rw-r--r--linden/indra/llinventory/lleconomy.cpp31
-rw-r--r--linden/indra/llinventory/lleconomy.h11
-rw-r--r--linden/indra/llinventory/llinventory.cpp1
-rw-r--r--linden/indra/llinventory/llinventory.h34
-rw-r--r--linden/indra/llinventory/llparcel.cpp8
-rw-r--r--linden/indra/llinventory/llparcelflags.h2
6 files changed, 59 insertions, 28 deletions
diff --git a/linden/indra/llinventory/lleconomy.cpp b/linden/indra/llinventory/lleconomy.cpp
index 6ed0510..619c5f9 100644
--- a/linden/indra/llinventory/lleconomy.cpp
+++ b/linden/indra/llinventory/lleconomy.cpp
@@ -35,7 +35,6 @@
35#include "message.h" 35#include "message.h"
36#include "v3math.h" 36#include "v3math.h"
37 37
38LLGlobalEconomy *gGlobalEconomy = NULL;
39 38
40LLGlobalEconomy::LLGlobalEconomy() 39LLGlobalEconomy::LLGlobalEconomy()
41: mObjectCount( -1 ), 40: mObjectCount( -1 ),
@@ -55,35 +54,33 @@ LLGlobalEconomy::~LLGlobalEconomy()
55{ } 54{ }
56 55
57// static 56// static
58void LLGlobalEconomy::processEconomyData(LLMessageSystem *msg, void** user_data) 57void LLGlobalEconomy::processEconomyData(LLMessageSystem *msg, LLGlobalEconomy* econ_data)
59{ 58{
60 S32 i; 59 S32 i;
61 F32 f; 60 F32 f;
62 61
63 LLGlobalEconomy *this_ptr = (LLGlobalEconomy*)user_data;
64
65 msg->getS32Fast(_PREHASH_Info, _PREHASH_ObjectCapacity, i); 62 msg->getS32Fast(_PREHASH_Info, _PREHASH_ObjectCapacity, i);
66 this_ptr->setObjectCapacity(i); 63 econ_data->setObjectCapacity(i);
67 msg->getS32Fast(_PREHASH_Info, _PREHASH_ObjectCount, i); 64 msg->getS32Fast(_PREHASH_Info, _PREHASH_ObjectCount, i);
68 this_ptr->setObjectCount(i); 65 econ_data->setObjectCount(i);
69 msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceEnergyUnit, i); 66 msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceEnergyUnit, i);
70 this_ptr->setPriceEnergyUnit(i); 67 econ_data->setPriceEnergyUnit(i);
71 msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceObjectClaim, i); 68 msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceObjectClaim, i);
72 this_ptr->setPriceObjectClaim(i); 69 econ_data->setPriceObjectClaim(i);
73 msg->getS32Fast(_PREHASH_Info, _PREHASH_PricePublicObjectDecay, i); 70 msg->getS32Fast(_PREHASH_Info, _PREHASH_PricePublicObjectDecay, i);
74 this_ptr->setPricePublicObjectDecay(i); 71 econ_data->setPricePublicObjectDecay(i);
75 msg->getS32Fast(_PREHASH_Info, _PREHASH_PricePublicObjectDelete, i); 72 msg->getS32Fast(_PREHASH_Info, _PREHASH_PricePublicObjectDelete, i);
76 this_ptr->setPricePublicObjectDelete(i); 73 econ_data->setPricePublicObjectDelete(i);
77 msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceUpload, i); 74 msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceUpload, i);
78 this_ptr->setPriceUpload(i); 75 econ_data->setPriceUpload(i);
79 msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceRentLight, i); 76 msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceRentLight, i);
80 this_ptr->setPriceRentLight(i); 77 econ_data->setPriceRentLight(i);
81 msg->getS32Fast(_PREHASH_Info, _PREHASH_TeleportMinPrice, i); 78 msg->getS32Fast(_PREHASH_Info, _PREHASH_TeleportMinPrice, i);
82 this_ptr->setTeleportMinPrice(i); 79 econ_data->setTeleportMinPrice(i);
83 msg->getF32Fast(_PREHASH_Info, _PREHASH_TeleportPriceExponent, f); 80 msg->getF32Fast(_PREHASH_Info, _PREHASH_TeleportPriceExponent, f);
84 this_ptr->setTeleportPriceExponent(f); 81 econ_data->setTeleportPriceExponent(f);
85 msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceGroupCreate, i); 82 msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceGroupCreate, i);
86 this_ptr->setPriceGroupCreate(i); 83 econ_data->setPriceGroupCreate(i);
87} 84}
88 85
89S32 LLGlobalEconomy::calculateTeleportCost(F32 distance) const 86S32 LLGlobalEconomy::calculateTeleportCost(F32 distance) const
@@ -154,10 +151,10 @@ void LLRegionEconomy::processEconomyData(LLMessageSystem *msg, void** user_data)
154 S32 i; 151 S32 i;
155 F32 f; 152 F32 f;
156 153
157 LLGlobalEconomy::processEconomyData(msg, user_data);
158
159 LLRegionEconomy *this_ptr = (LLRegionEconomy*)user_data; 154 LLRegionEconomy *this_ptr = (LLRegionEconomy*)user_data;
160 155
156 LLGlobalEconomy::processEconomyData(msg, this_ptr);
157
161 msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceParcelClaim, i); 158 msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceParcelClaim, i);
162 this_ptr->setBasePriceParcelClaimDefault(i); 159 this_ptr->setBasePriceParcelClaimDefault(i);
163 msg->getF32(_PREHASH_Info, _PREHASH_PriceParcelClaimFactor, f); 160 msg->getF32(_PREHASH_Info, _PREHASH_PriceParcelClaimFactor, f);
diff --git a/linden/indra/llinventory/lleconomy.h b/linden/indra/llinventory/lleconomy.h
index c5caa42..dcc97b2 100644
--- a/linden/indra/llinventory/lleconomy.h
+++ b/linden/indra/llinventory/lleconomy.h
@@ -31,6 +31,8 @@
31#ifndef LL_LLECONOMY_H 31#ifndef LL_LLECONOMY_H
32#define LL_LLECONOMY_H 32#define LL_LLECONOMY_H
33 33
34#include "llmemory.h"
35
34class LLMessageSystem; 36class LLMessageSystem;
35class LLVector3; 37class LLVector3;
36 38
@@ -40,9 +42,14 @@ public:
40 LLGlobalEconomy(); 42 LLGlobalEconomy();
41 virtual ~LLGlobalEconomy(); 43 virtual ~LLGlobalEconomy();
42 44
45 // This class defines its singleton internally as a typedef instead of inheriting from
46 // LLSingleton like most others because the LLRegionEconomy sub-class might also
47 // become a singleton and this pattern will more easily disambiguate them.
48 typedef LLSingleton<LLGlobalEconomy> Singleton;
49
43 virtual void print(); 50 virtual void print();
44 51
45 static void processEconomyData(LLMessageSystem *msg, void **user_data); 52 static void processEconomyData(LLMessageSystem *msg, LLGlobalEconomy* econ_data);
46 53
47 S32 calculateTeleportCost(F32 distance) const; 54 S32 calculateTeleportCost(F32 distance) const;
48 S32 calculateLightRent(const LLVector3& object_size) const; 55 S32 calculateLightRent(const LLVector3& object_size) const;
@@ -136,6 +143,4 @@ private:
136 143
137}; 144};
138 145
139extern LLGlobalEconomy* gGlobalEconomy;
140
141#endif 146#endif
diff --git a/linden/indra/llinventory/llinventory.cpp b/linden/indra/llinventory/llinventory.cpp
index 3afa2be..4c58789 100644
--- a/linden/indra/llinventory/llinventory.cpp
+++ b/linden/indra/llinventory/llinventory.cpp
@@ -940,6 +940,7 @@ LLSD LLInventoryItem::asLLSD() const
940 } 940 }
941 else 941 else
942 { 942 {
943 // *TODO: get rid of this. Phoenix 2008-01-30
943 LLUUID shadow_id(mAssetUUID); 944 LLUUID shadow_id(mAssetUUID);
944 LLXORCipher cipher(MAGIC_ID.mData, UUID_BYTES); 945 LLXORCipher cipher(MAGIC_ID.mData, UUID_BYTES);
945 cipher.encrypt(shadow_id.mData, UUID_BYTES); 946 cipher.encrypt(shadow_id.mData, UUID_BYTES);
diff --git a/linden/indra/llinventory/llinventory.h b/linden/indra/llinventory/llinventory.h
index 1623edf..b4199db 100644
--- a/linden/indra/llinventory/llinventory.h
+++ b/linden/indra/llinventory/llinventory.h
@@ -135,15 +135,40 @@ protected:
135 S32 mCreationDate; // seconds from 1/1/1970, UTC 135 S32 mCreationDate; // seconds from 1/1/1970, UTC
136 136
137public: 137public:
138
139 /**
140 * Anonymous enumeration for specifying the inventory item flags.
141 */
138 enum 142 enum
139 { 143 {
140 // The meaning of LLInventoryItem::mFlags is distinct for each 144 // The shared flags at the top are shared among all inventory
141 // inventory type. 145 // types. After that section, all values of flags are type
146 // dependent. The shared flags will start at 2^30 and work
147 // down while item type specific flags will start at 2^0 and
148 // work up.
142 II_FLAGS_NONE = 0, 149 II_FLAGS_NONE = 0,
143 150
144 // landmark flags 151
152 //
153 // Shared flags
154 //
155 //
156
157 // This value means that the asset has only one reference in
158 // the system. If the inventory item is deleted, or the asset
159 // id updated, then we can remove the old reference.
160 II_FLAGS_SHARED_SINGLE_REFERENCE = 0x40000000,
161
162
163 //
164 // Landmark flags
165 //
145 II_FLAGS_LANDMARK_VISITED = 1, 166 II_FLAGS_LANDMARK_VISITED = 1,
146 167
168 //
169 // Object flags
170 //
171
147 // flag to indicate that object permissions should have next 172 // flag to indicate that object permissions should have next
148 // owner perm be more restrictive on rez. We bump this into 173 // owner perm be more restrictive on rez. We bump this into
149 // the second byte of the flags since the low byte is used to 174 // the second byte of the flags since the low byte is used to
@@ -169,8 +194,11 @@ public:
169 // of muiltiple items or not. 194 // of muiltiple items or not.
170 II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS = 0x200000, 195 II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS = 0x200000,
171 196
197 //
172 // wearables use the low order byte of flags to store the 198 // wearables use the low order byte of flags to store the
173 // EWearableType enumeration found in newview/llwearable.h 199 // EWearableType enumeration found in newview/llwearable.h
200 //
201 II_FLAGS_WEARABLES_MASK = 0xff,
174 }; 202 };
175 203
176protected: 204protected:
diff --git a/linden/indra/llinventory/llparcel.cpp b/linden/indra/llinventory/llparcel.cpp
index 5f8a000..1390f72 100644
--- a/linden/indra/llinventory/llparcel.cpp
+++ b/linden/indra/llinventory/llparcel.cpp
@@ -216,8 +216,8 @@ void LLParcel::init(const LLUUID &owner_id,
216 mMediaID.setNull(); 216 mMediaID.setNull();
217 mMediaAutoScale = 0; 217 mMediaAutoScale = 0;
218 mMediaLoop = TRUE; 218 mMediaLoop = TRUE;
219 mObscureMedia = 0; 219 mObscureMedia = 1;
220 mObscureMusic = 0; 220 mObscureMusic = 1;
221 mMediaWidth = 0; 221 mMediaWidth = 0;
222 mMediaHeight = 0; 222 mMediaHeight = 0;
223 223
@@ -1856,8 +1856,8 @@ void LLParcel::clearParcel()
1856 setMediaDesc(NULL); 1856 setMediaDesc(NULL);
1857 setMediaAutoScale(0); 1857 setMediaAutoScale(0);
1858 setMediaLoop(TRUE); 1858 setMediaLoop(TRUE);
1859 mObscureMedia = 0; 1859 mObscureMedia = 1;
1860 mObscureMusic = 0; 1860 mObscureMusic = 1;
1861 mMediaWidth = 0; 1861 mMediaWidth = 0;
1862 mMediaHeight = 0; 1862 mMediaHeight = 0;
1863 setMusicURL(NULL); 1863 setMusicURL(NULL);
diff --git a/linden/indra/llinventory/llparcelflags.h b/linden/indra/llinventory/llparcelflags.h
index 1bf744b..62a6acf 100644
--- a/linden/indra/llinventory/llparcelflags.h
+++ b/linden/indra/llinventory/llparcelflags.h
@@ -81,7 +81,7 @@ const U32 PF_USE_RESTRICTED_ACCESS = PF_USE_ACCESS_GROUP
81 | PF_DENY_ANONYMOUS 81 | PF_DENY_ANONYMOUS
82 | PF_DENY_AGEUNVERIFIED; 82 | PF_DENY_AGEUNVERIFIED;
83const U32 PF_NONE = 0x00000000; 83const U32 PF_NONE = 0x00000000;
84const U32 PF_ALL = 0x7FFFFFFF; 84const U32 PF_ALL = 0xFFFFFFFF;
85const U32 PF_DEFAULT = PF_ALLOW_FLY 85const U32 PF_DEFAULT = PF_ALLOW_FLY
86 | PF_ALLOW_OTHER_SCRIPTS 86 | PF_ALLOW_OTHER_SCRIPTS
87 | PF_ALLOW_GROUP_SCRIPTS 87 | PF_ALLOW_GROUP_SCRIPTS