diff options
author | Jacek Antonelli | 2008-08-15 23:45:19 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:19 -0500 |
commit | b235c59d60472f818a9142c0886b95a0ff4191d7 (patch) | |
tree | d323c55587584b19cc43a03f58a178823f12d3cd /linden/indra/llinventory | |
parent | Second Life viewer sources 1.18.5.3 (diff) | |
download | meta-impy-b235c59d60472f818a9142c0886b95a0ff4191d7.zip meta-impy-b235c59d60472f818a9142c0886b95a0ff4191d7.tar.gz meta-impy-b235c59d60472f818a9142c0886b95a0ff4191d7.tar.bz2 meta-impy-b235c59d60472f818a9142c0886b95a0ff4191d7.tar.xz |
Second Life viewer sources 1.18.6.0-RC
Diffstat (limited to 'linden/indra/llinventory')
-rw-r--r-- | linden/indra/llinventory/llparcel.cpp | 2760 | ||||
-rw-r--r-- | linden/indra/llinventory/llparcel.h | 24 | ||||
-rw-r--r-- | linden/indra/llinventory/llparcelflags.h | 14 |
3 files changed, 1403 insertions, 1395 deletions
diff --git a/linden/indra/llinventory/llparcel.cpp b/linden/indra/llinventory/llparcel.cpp index 7cc3e57..a20b307 100644 --- a/linden/indra/llinventory/llparcel.cpp +++ b/linden/indra/llinventory/llparcel.cpp | |||
@@ -1,33 +1,33 @@ | |||
1 | /** | 1 | /** |
2 | * @file llparcel.cpp | 2 | * @file llparcel.cpp |
3 | * @brief A land parcel. | 3 | * @brief A land parcel. |
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2002&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2002&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2002-2007, Linden Research, Inc. | 7 | * Copyright (c) 2002-2007, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
11 | * to you under the terms of the GNU General Public License, version 2.0 | 11 | * to you under the terms of the GNU General Public License, version 2.0 |
12 | * ("GPL"), unless you have obtained a separate licensing agreement | 12 | * ("GPL"), unless you have obtained a separate licensing agreement |
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | 13 | * ("Other License"), formally executed by you and Linden Lab. Terms of |
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | 14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or |
15 | * online at http://secondlife.com/developers/opensource/gplv2 | 15 | * online at http://secondlife.com/developers/opensource/gplv2 |
16 | * | 16 | * |
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at http://secondlife.com/developers/opensource/flossexception | 20 | * online at http://secondlife.com/developers/opensource/flossexception |
21 | * | 21 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 22 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 23 | * that you have read and understood your obligations described above, |
24 | * and agree to abide by those obligations. | 24 | * and agree to abide by those obligations. |
25 | * | 25 | * |
26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | 26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO |
27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
28 | * COMPLETENESS OR PERFORMANCE. | 28 | * COMPLETENESS OR PERFORMANCE. |
29 | * $/LicenseInfo$ | 29 | * $/LicenseInfo$ |
30 | */ | 30 | */ |
31 | 31 | ||
32 | #include "linden_common.h" | 32 | #include "linden_common.h" |
33 | 33 | ||
@@ -49,9 +49,9 @@ static const F32 SOME_BIG_NUMBER = 1000.0f; | |||
49 | static const F32 SOME_BIG_NEG_NUMBER = -1000.0f; | 49 | static const F32 SOME_BIG_NEG_NUMBER = -1000.0f; |
50 | static const char* PARCEL_OWNERSHIP_STATUS_STRING[LLParcel::OS_COUNT] = | 50 | static const char* PARCEL_OWNERSHIP_STATUS_STRING[LLParcel::OS_COUNT] = |
51 | { | 51 | { |
52 | "leased", | 52 | "leased", |
53 | "lease_pending", | 53 | "lease_pending", |
54 | "abandoned" | 54 | "abandoned" |
55 | }; | 55 | }; |
56 | 56 | ||
57 | // NOTE: Adding parcel categories also requires updating: | 57 | // NOTE: Adding parcel categories also requires updating: |
@@ -59,52 +59,52 @@ static const char* PARCEL_OWNERSHIP_STATUS_STRING[LLParcel::OS_COUNT] = | |||
59 | // * Web site "create event" tools | 59 | // * Web site "create event" tools |
60 | static const char* PARCEL_CATEGORY_STRING[LLParcel::C_COUNT] = | 60 | static const char* PARCEL_CATEGORY_STRING[LLParcel::C_COUNT] = |
61 | { | 61 | { |
62 | "none", | 62 | "none", |
63 | "linden", | 63 | "linden", |
64 | "adult", | 64 | "adult", |
65 | "arts", | 65 | "arts", |
66 | "store", // "business" legacy name | 66 | "store", // "business" legacy name |
67 | "educational", | 67 | "educational", |
68 | "game", // "gaming" legacy name | 68 | "game", // "gaming" legacy name |
69 | "gather", // "hangout" legacy name | 69 | "gather", // "hangout" legacy name |
70 | "newcomer", | 70 | "newcomer", |
71 | "park", | 71 | "park", |
72 | "home", // "residential" legacy name | 72 | "home", // "residential" legacy name |
73 | "shopping", | 73 | "shopping", |
74 | "stage", | 74 | "stage", |
75 | "other", | 75 | "other", |
76 | }; | 76 | }; |
77 | static const char* PARCEL_CATEGORY_UI_STRING[LLParcel::C_COUNT + 1] = | 77 | static const char* PARCEL_CATEGORY_UI_STRING[LLParcel::C_COUNT + 1] = |
78 | { | 78 | { |
79 | "None", | 79 | "None", |
80 | "Linden Location", | 80 | "Linden Location", |
81 | "Adult", | 81 | "Adult", |
82 | "Arts & Culture", | 82 | "Arts & Culture", |
83 | "Business", | 83 | "Business", |
84 | "Educational", | 84 | "Educational", |
85 | "Gaming", | 85 | "Gaming", |
86 | "Hangout", | 86 | "Hangout", |
87 | "Newcomer Friendly", | 87 | "Newcomer Friendly", |
88 | "Parks & Nature", | 88 | "Parks & Nature", |
89 | "Residential", | 89 | "Residential", |
90 | "Shopping", | 90 | "Shopping", |
91 | "Stage", | 91 | "Stage", |
92 | "Other", | 92 | "Other", |
93 | "Any", // valid string for parcel searches | 93 | "Any", // valid string for parcel searches |
94 | }; | 94 | }; |
95 | 95 | ||
96 | static const char* PARCEL_ACTION_STRING[LLParcel::A_COUNT + 1] = | 96 | static const char* PARCEL_ACTION_STRING[LLParcel::A_COUNT + 1] = |
97 | { | 97 | { |
98 | "create", | 98 | "create", |
99 | "release", | 99 | "release", |
100 | "absorb", | 100 | "absorb", |
101 | "absorbed", | 101 | "absorbed", |
102 | "divide", | 102 | "divide", |
103 | "division", | 103 | "division", |
104 | "acquire", | 104 | "acquire", |
105 | "relinquish", | 105 | "relinquish", |
106 | "confirm", | 106 | "confirm", |
107 | "unknown" | 107 | "unknown" |
108 | }; | 108 | }; |
109 | 109 | ||
110 | // Timeouts for parcels | 110 | // Timeouts for parcels |
@@ -142,369 +142,365 @@ LLParcel::ECategory category_ui_string_to_category(const char* s); | |||
142 | 142 | ||
143 | LLParcel::LLParcel() | 143 | LLParcel::LLParcel() |
144 | { | 144 | { |
145 | init(LLUUID::null, TRUE, FALSE, FALSE, 0, 0, 0, 0, 0, 1.f, 0); | 145 | init(LLUUID::null, TRUE, FALSE, FALSE, 0, 0, 0, 0, 0, 1.f, 0); |
146 | } | 146 | } |
147 | 147 | ||
148 | 148 | ||
149 | LLParcel::LLParcel(const LLUUID &owner_id, | 149 | LLParcel::LLParcel(const LLUUID &owner_id, |
150 | BOOL modify, BOOL terraform, BOOL damage, | 150 | BOOL modify, BOOL terraform, BOOL damage, |
151 | time_t claim_date, S32 claim_price_per_meter, | 151 | time_t claim_date, S32 claim_price_per_meter, |
152 | S32 rent_price_per_meter, S32 area, S32 sim_object_limit, F32 parcel_object_bonus, | 152 | S32 rent_price_per_meter, S32 area, S32 sim_object_limit, F32 parcel_object_bonus, |
153 | BOOL is_group_owned) | 153 | BOOL is_group_owned) |
154 | { | 154 | { |
155 | init( owner_id, modify, terraform, damage, claim_date, | 155 | init( owner_id, modify, terraform, damage, claim_date, |
156 | claim_price_per_meter, rent_price_per_meter, area, sim_object_limit, parcel_object_bonus, | 156 | claim_price_per_meter, rent_price_per_meter, area, sim_object_limit, parcel_object_bonus, |
157 | is_group_owned); | 157 | is_group_owned); |
158 | } | 158 | } |
159 | 159 | ||
160 | 160 | ||
161 | // virtual | 161 | // virtual |
162 | LLParcel::~LLParcel() | 162 | LLParcel::~LLParcel() |
163 | { | 163 | { |
164 | // user list cleaned up by LLDynamicArray destructor. | 164 | // user list cleaned up by LLDynamicArray destructor. |
165 | } | 165 | } |
166 | 166 | ||
167 | void LLParcel::init(const LLUUID &owner_id, | 167 | void LLParcel::init(const LLUUID &owner_id, |
168 | BOOL modify, BOOL terraform, BOOL damage, | 168 | BOOL modify, BOOL terraform, BOOL damage, |
169 | time_t claim_date, S32 claim_price_per_meter, | 169 | time_t claim_date, S32 claim_price_per_meter, |
170 | S32 rent_price_per_meter, S32 area, S32 sim_object_limit, F32 parcel_object_bonus, | 170 | S32 rent_price_per_meter, S32 area, S32 sim_object_limit, F32 parcel_object_bonus, |
171 | BOOL is_group_owned) | 171 | BOOL is_group_owned) |
172 | { | 172 | { |
173 | mID.setNull(); | 173 | mID.setNull(); |
174 | mOwnerID = owner_id; | 174 | mOwnerID = owner_id; |
175 | mGroupOwned = is_group_owned; | 175 | mGroupOwned = is_group_owned; |
176 | mClaimDate = claim_date; | 176 | mClaimDate = claim_date; |
177 | mClaimPricePerMeter = claim_price_per_meter; | 177 | mClaimPricePerMeter = claim_price_per_meter; |
178 | mRentPricePerMeter = rent_price_per_meter; | 178 | mRentPricePerMeter = rent_price_per_meter; |
179 | mArea = area; | 179 | mArea = area; |
180 | mDiscountRate = 1.0f; | 180 | mDiscountRate = 1.0f; |
181 | mDrawDistance = 512.f; | 181 | mDrawDistance = 512.f; |
182 | 182 | ||
183 | mUserLookAt.setVec(0.0f, 0.f, 0.f); | 183 | mUserLookAt.setVec(0.0f, 0.f, 0.f); |
184 | // Default to using the parcel's landing point, if any. | 184 | // Default to using the parcel's landing point, if any. |
185 | mLandingType = L_LANDING_POINT; | 185 | mLandingType = L_LANDING_POINT; |
186 | 186 | ||
187 | // *FIX: if owner_id != null, should be owned or sale pending, | 187 | // *FIX: if owner_id != null, should be owned or sale pending, |
188 | // investigate init callers. | 188 | // investigate init callers. |
189 | mStatus = OS_NONE; | 189 | mStatus = OS_NONE; |
190 | mCategory = C_NONE; | 190 | mCategory = C_NONE; |
191 | mAuthBuyerID.setNull(); | 191 | mAuthBuyerID.setNull(); |
192 | //mBuyerID.setNull(); | 192 | //mBuyerID.setNull(); |
193 | //mJoinNeighbors = 0x0; | 193 | //mJoinNeighbors = 0x0; |
194 | mSaleTimerExpires.setTimerExpirySec(0); | 194 | mSaleTimerExpires.setTimerExpirySec(0); |
195 | mSaleTimerExpires.stop(); | 195 | mSaleTimerExpires.stop(); |
196 | mGraceExtension = 0; | 196 | mGraceExtension = 0; |
197 | //mExpireAction = STEA_REVERT; | 197 | //mExpireAction = STEA_REVERT; |
198 | mRecordTransaction = FALSE; | 198 | mRecordTransaction = FALSE; |
199 | 199 | ||
200 | mAuctionID = 0; | 200 | mAuctionID = 0; |
201 | mInEscrow = false; | 201 | mInEscrow = false; |
202 | 202 | ||
203 | mParcelFlags = PF_DEFAULT; | 203 | mParcelFlags = PF_DEFAULT; |
204 | setParcelFlag(PF_CREATE_OBJECTS, modify); | 204 | setParcelFlag(PF_CREATE_OBJECTS, modify); |
205 | setParcelFlag(PF_ALLOW_TERRAFORM, terraform); | 205 | setParcelFlag(PF_ALLOW_TERRAFORM, terraform); |
206 | setParcelFlag(PF_ALLOW_DAMAGE, damage); | 206 | setParcelFlag(PF_ALLOW_DAMAGE, damage); |
207 | 207 | ||
208 | mSalePrice = 10000; | 208 | mSalePrice = 10000; |
209 | setName(NULL); | 209 | setName(NULL); |
210 | setDesc(NULL); | 210 | setDesc(NULL); |
211 | setMusicURL(NULL); | 211 | setMusicURL(NULL); |
212 | setMediaURL(NULL); | 212 | setMediaURL(NULL); |
213 | mMediaID.setNull(); | 213 | mMediaID.setNull(); |
214 | mMediaAutoScale = 0; | 214 | mMediaAutoScale = 0; |
215 | 215 | ||
216 | mGroupID.setNull(); | 216 | mGroupID.setNull(); |
217 | 217 | ||
218 | mPassPrice = PARCEL_PASS_PRICE_DEFAULT; | 218 | mPassPrice = PARCEL_PASS_PRICE_DEFAULT; |
219 | mPassHours = PARCEL_PASS_HOURS_DEFAULT; | 219 | mPassHours = PARCEL_PASS_HOURS_DEFAULT; |
220 | 220 | ||
221 | mAABBMin.setVec(SOME_BIG_NUMBER, SOME_BIG_NUMBER, SOME_BIG_NUMBER); | 221 | mAABBMin.setVec(SOME_BIG_NUMBER, SOME_BIG_NUMBER, SOME_BIG_NUMBER); |
222 | mAABBMax.setVec(SOME_BIG_NEG_NUMBER, SOME_BIG_NEG_NUMBER, SOME_BIG_NEG_NUMBER); | 222 | mAABBMax.setVec(SOME_BIG_NEG_NUMBER, SOME_BIG_NEG_NUMBER, SOME_BIG_NEG_NUMBER); |
223 | 223 | ||
224 | mLocalID = 0; | 224 | mLocalID = 0; |
225 | 225 | ||
226 | //mSimWidePrimCorrection = 0; | 226 | //mSimWidePrimCorrection = 0; |
227 | setMaxPrimCapacity((S32)(sim_object_limit * area / (F32)(REGION_WIDTH_METERS * REGION_WIDTH_METERS))); | 227 | setMaxPrimCapacity((S32)(sim_object_limit * area / (F32)(REGION_WIDTH_METERS * REGION_WIDTH_METERS))); |
228 | setSimWideMaxPrimCapacity(0); | 228 | setSimWideMaxPrimCapacity(0); |
229 | setSimWidePrimCount(0); | 229 | setSimWidePrimCount(0); |
230 | setOwnerPrimCount(0); | 230 | setOwnerPrimCount(0); |
231 | setGroupPrimCount(0); | 231 | setGroupPrimCount(0); |
232 | setOtherPrimCount(0); | 232 | setOtherPrimCount(0); |
233 | setSelectedPrimCount(0); | 233 | setSelectedPrimCount(0); |
234 | setTempPrimCount(0); | 234 | setTempPrimCount(0); |
235 | setCleanOtherTime(0); | 235 | setCleanOtherTime(0); |
236 | setParcelPrimBonus(parcel_object_bonus); | 236 | setParcelPrimBonus(parcel_object_bonus); |
237 | 237 | ||
238 | setPreviousOwnerID(LLUUID::null); | 238 | setPreviousOwnerID(LLUUID::null); |
239 | setPreviouslyGroupOwned(FALSE); | 239 | setPreviouslyGroupOwned(FALSE); |
240 | } | 240 | } |
241 | 241 | ||
242 | void LLParcel::overrideOwner(const LLUUID& owner_id, BOOL is_group_owned) | 242 | void LLParcel::overrideOwner(const LLUUID& owner_id, BOOL is_group_owned) |
243 | { | 243 | { |
244 | // Override with system permission (LLUUID::null) | 244 | // Override with system permission (LLUUID::null) |
245 | // Overridden parcels have no group | 245 | // Overridden parcels have no group |
246 | mOwnerID = owner_id; | 246 | mOwnerID = owner_id; |
247 | mGroupOwned = is_group_owned; | 247 | mGroupOwned = is_group_owned; |
248 | if(mGroupOwned) | 248 | if(mGroupOwned) |
249 | { | 249 | { |
250 | mGroupID = mOwnerID; | 250 | mGroupID = mOwnerID; |
251 | } | 251 | } |
252 | else | 252 | else |
253 | { | 253 | { |
254 | mGroupID.setNull(); | 254 | mGroupID.setNull(); |
255 | } | 255 | } |
256 | mInEscrow = false; | 256 | mInEscrow = false; |
257 | } | 257 | } |
258 | 258 | ||
259 | void LLParcel::overrideParcelFlags(U32 flags) | 259 | void LLParcel::overrideParcelFlags(U32 flags) |
260 | { | 260 | { |
261 | mParcelFlags = flags; | 261 | mParcelFlags = flags; |
262 | } | 262 | } |
263 | 263 | ||
264 | void LLParcel::setName(const LLString& name) | 264 | void LLParcel::setName(const LLString& name) |
265 | { | 265 | { |
266 | // The escaping here must match the escaping in the database | 266 | // The escaping here must match the escaping in the database |
267 | // abstraction layer. | 267 | // abstraction layer. |
268 | mName = name; | 268 | mName = name; |
269 | LLStringFn::replace_nonprintable(mName, LL_UNKNOWN_CHAR); | 269 | LLStringFn::replace_nonprintable(mName, LL_UNKNOWN_CHAR); |
270 | } | 270 | } |
271 | 271 | ||
272 | void LLParcel::setDesc(const LLString& desc) | 272 | void LLParcel::setDesc(const LLString& desc) |
273 | { | 273 | { |
274 | // The escaping here must match the escaping in the database | 274 | // The escaping here must match the escaping in the database |
275 | // abstraction layer. | 275 | // abstraction layer. |
276 | mDesc = desc; | 276 | mDesc = desc; |
277 | mDesc = rawstr_to_utf8(mDesc); | 277 | mDesc = rawstr_to_utf8(mDesc); |
278 | } | 278 | } |
279 | 279 | ||
280 | void LLParcel::setMusicURL(const LLString& url) | 280 | void LLParcel::setMusicURL(const LLString& url) |
281 | { | 281 | { |
282 | mMusicURL = url; | 282 | mMusicURL = url; |
283 | // The escaping here must match the escaping in the database | 283 | // The escaping here must match the escaping in the database |
284 | // abstraction layer. | 284 | // abstraction layer. |
285 | // This should really filter the url in some way. Other than | 285 | // This should really filter the url in some way. Other than |
286 | // simply requiring non-printable. | 286 | // simply requiring non-printable. |
287 | LLStringFn::replace_nonprintable(mMusicURL, LL_UNKNOWN_CHAR); | 287 | LLStringFn::replace_nonprintable(mMusicURL, LL_UNKNOWN_CHAR); |
288 | } | 288 | } |
289 | 289 | ||
290 | void LLParcel::setMediaURL(const LLString& url) | 290 | void LLParcel::setMediaURL(const LLString& url) |
291 | { | 291 | { |
292 | mMediaURL = url; | 292 | mMediaURL = url; |
293 | // The escaping here must match the escaping in the database | 293 | // The escaping here must match the escaping in the database |
294 | // abstraction layer if it's ever added. | 294 | // abstraction layer if it's ever added. |
295 | // This should really filter the url in some way. Other than | 295 | // This should really filter the url in some way. Other than |
296 | // simply requiring non-printable. | 296 | // simply requiring non-printable. |
297 | LLStringFn::replace_nonprintable(mMediaURL, LL_UNKNOWN_CHAR); | 297 | LLStringFn::replace_nonprintable(mMediaURL, LL_UNKNOWN_CHAR); |
298 | } | 298 | } |
299 | 299 | ||
300 | // virtual | 300 | // virtual |
301 | void LLParcel::setLocalID(S32 local_id) | 301 | void LLParcel::setLocalID(S32 local_id) |
302 | { | 302 | { |
303 | mLocalID = local_id; | 303 | mLocalID = local_id; |
304 | } | 304 | } |
305 | 305 | ||
306 | void LLParcel::setAllParcelFlags(U32 flags) | 306 | void LLParcel::setAllParcelFlags(U32 flags) |
307 | { | 307 | { |
308 | mParcelFlags = flags; | 308 | mParcelFlags = flags; |
309 | } | 309 | } |
310 | 310 | ||
311 | void LLParcel::setParcelFlag(U32 flag, BOOL b) | 311 | void LLParcel::setParcelFlag(U32 flag, BOOL b) |
312 | { | 312 | { |
313 | if (b) | 313 | if (b) |
314 | { | 314 | { |
315 | mParcelFlags |= flag; | 315 | mParcelFlags |= flag; |
316 | } | 316 | } |
317 | else | 317 | else |
318 | { | 318 | { |
319 | mParcelFlags &= ~flag; | 319 | mParcelFlags &= ~flag; |
320 | } | 320 | } |
321 | } | 321 | } |
322 | 322 | ||
323 | 323 | ||
324 | BOOL LLParcel::allowModifyBy(const LLUUID &agent_id, const LLUUID &group_id) const | 324 | BOOL LLParcel::allowModifyBy(const LLUUID &agent_id, const LLUUID &group_id) const |
325 | { | 325 | { |
326 | if (agent_id == LLUUID::null) | 326 | if (agent_id == LLUUID::null) |
327 | { | 327 | { |
328 | // system always can enter | 328 | // system always can enter |
329 | return TRUE; | 329 | return TRUE; |
330 | } | 330 | } |
331 | else if (isPublic()) | 331 | else if (isPublic()) |
332 | { | 332 | { |
333 | return TRUE; | 333 | return TRUE; |
334 | } | 334 | } |
335 | else if (agent_id == mOwnerID) | 335 | else if (agent_id == mOwnerID) |
336 | { | 336 | { |
337 | // owner can always perform operations | 337 | // owner can always perform operations |
338 | return TRUE; | 338 | return TRUE; |
339 | } | 339 | } |
340 | else if (mParcelFlags & PF_CREATE_OBJECTS) | 340 | else if (mParcelFlags & PF_CREATE_OBJECTS) |
341 | { | 341 | { |
342 | return TRUE; | 342 | return TRUE; |
343 | } | 343 | } |
344 | else if ((mParcelFlags & PF_CREATE_GROUP_OBJECTS) | 344 | else if ((mParcelFlags & PF_CREATE_GROUP_OBJECTS) |
345 | && group_id.notNull() ) | 345 | && group_id.notNull() ) |
346 | { | 346 | { |
347 | return (getGroupID() == group_id); | 347 | return (getGroupID() == group_id); |
348 | } | 348 | } |
349 | 349 | ||
350 | return FALSE; | 350 | return FALSE; |
351 | } | 351 | } |
352 | 352 | ||
353 | BOOL LLParcel::allowTerraformBy(const LLUUID &agent_id) const | 353 | BOOL LLParcel::allowTerraformBy(const LLUUID &agent_id) const |
354 | { | 354 | { |
355 | if (agent_id == LLUUID::null) | 355 | if (agent_id == LLUUID::null) |
356 | { | 356 | { |
357 | // system always can enter | 357 | // system always can enter |
358 | return TRUE; | 358 | return TRUE; |
359 | } | 359 | } |
360 | else if(OS_LEASED == mStatus) | 360 | else if(OS_LEASED == mStatus) |
361 | { | 361 | { |
362 | if(agent_id == mOwnerID) | 362 | if(agent_id == mOwnerID) |
363 | { | 363 | { |
364 | // owner can modify leased land | 364 | // owner can modify leased land |
365 | return TRUE; | 365 | return TRUE; |
366 | } | 366 | } |
367 | else | 367 | else |
368 | { | 368 | { |
369 | // otherwise check other people | 369 | // otherwise check other people |
370 | return mParcelFlags & PF_ALLOW_TERRAFORM; | 370 | return mParcelFlags & PF_ALLOW_TERRAFORM; |
371 | } | 371 | } |
372 | } | 372 | } |
373 | else | 373 | else |
374 | { | 374 | { |
375 | return FALSE; | 375 | return FALSE; |
376 | } | 376 | } |
377 | } | 377 | } |
378 | 378 | ||
379 | 379 | ||
380 | bool LLParcel::isAgentBlockedFromParcel(LLParcel* parcelp, | 380 | bool LLParcel::isAgentBlockedFromParcel(LLParcel* parcelp, |
381 | const LLUUID& agent_id, | 381 | const LLUUID& agent_id, |
382 | const std::vector<LLUUID>& group_ids, | 382 | const std::vector<LLUUID>& group_ids, |
383 | const BOOL is_agent_identified, | 383 | const BOOL is_agent_identified, |
384 | const BOOL is_agent_transacted) | 384 | const BOOL is_agent_transacted, |
385 | const BOOL is_agent_ageverified) | ||
385 | { | 386 | { |
386 | S32 current_group_access = parcelp->blockAccess(agent_id, LLUUID::null, is_agent_identified, is_agent_transacted); | 387 | S32 current_group_access = parcelp->blockAccess(agent_id, LLUUID::null, is_agent_identified, is_agent_transacted, is_agent_ageverified); |
387 | S32 count; | 388 | S32 count; |
388 | bool is_allowed = (current_group_access == BA_ALLOWED) ? true: false; | 389 | bool is_allowed = (current_group_access == BA_ALLOWED) ? true: false; |
389 | LLUUID group_id; | 390 | LLUUID group_id; |
390 | 391 | ||
391 | count = group_ids.size(); | 392 | count = group_ids.size(); |
392 | for (int i = 0; i < count && !is_allowed; i++) | 393 | for (int i = 0; i < count && !is_allowed; i++) |
393 | { | 394 | { |
394 | group_id = group_ids[i]; | 395 | group_id = group_ids[i]; |
395 | current_group_access = parcelp->blockAccess(agent_id, group_id, is_agent_identified, is_agent_transacted); | 396 | current_group_access = parcelp->blockAccess(agent_id, group_id, is_agent_identified, is_agent_transacted, is_agent_ageverified); |
396 | 397 | ||
397 | if (current_group_access == BA_ALLOWED) is_allowed = true; | 398 | if (current_group_access == BA_ALLOWED) is_allowed = true; |
398 | } | 399 | } |
399 | 400 | ||
400 | return !is_allowed; | 401 | return !is_allowed; |
401 | } | 402 | } |
402 | 403 | ||
403 | BOOL LLParcel::isAgentBanned(const LLUUID& agent_id) const | 404 | BOOL LLParcel::isAgentBanned(const LLUUID& agent_id) const |
404 | { | 405 | { |
405 | // Test ban list | 406 | // Test ban list |
406 | if (getParcelFlag(PF_USE_BAN_LIST) | 407 | if (mBanList.find(agent_id) != mBanList.end()) |
407 | && (mBanList.find(agent_id) != mBanList.end())) | ||
408 | { | 408 | { |
409 | return TRUE; | 409 | return TRUE; |
410 | } | 410 | } |
411 | 411 | ||
412 | return FALSE; | 412 | return FALSE; |
413 | } | 413 | } |
414 | |||
414 | S32 LLParcel::blockAccess(const LLUUID& agent_id, const LLUUID& group_id, | 415 | S32 LLParcel::blockAccess(const LLUUID& agent_id, const LLUUID& group_id, |
415 | const BOOL is_agent_identified, | 416 | const BOOL is_agent_identified, |
416 | const BOOL is_agent_transacted) const | 417 | const BOOL is_agent_transacted, |
418 | const BOOL is_agent_ageverified) const | ||
417 | { | 419 | { |
418 | // Test ban list | 420 | // Test ban list |
419 | if (isAgentBanned(agent_id)) | 421 | if (isAgentBanned(agent_id)) |
420 | { | 422 | { |
421 | return BA_BANNED; | 423 | return BA_BANNED; |
422 | } | 424 | } |
423 | 425 | ||
424 | // Always allow owner on (unless he banned himself, useful for | 426 | // Always allow owner on (unless he banned himself, useful for |
425 | // testing). We will also allow estate owners/managers in if they | 427 | // testing). We will also allow estate owners/managers in if they |
426 | // are not explicitly banned. | 428 | // are not explicitly banned. |
427 | if (agent_id == mOwnerID) | 429 | if (agent_id == mOwnerID) |
428 | { | 430 | { |
429 | return BA_ALLOWED; | 431 | return BA_ALLOWED; |
430 | } | 432 | } |
431 | 433 | ||
432 | // Special case when using pass list where group access is being restricted but not | 434 | // Special case when using pass list where group access is being restricted but not |
433 | // using access list. In this case group members are allowed only if they buy a pass. | 435 | // using access list. In this case group members are allowed only if they buy a pass. |
434 | // We return BA_NOT_IN_LIST if not in list | 436 | // We return BA_NOT_IN_LIST if not in list |
435 | BOOL passWithGroup = getParcelFlag(PF_USE_PASS_LIST) && !getParcelFlag(PF_USE_ACCESS_LIST) | 437 | BOOL passWithGroup = getParcelFlag(PF_USE_PASS_LIST) && !getParcelFlag(PF_USE_ACCESS_LIST) |
436 | && getParcelFlag(PF_USE_ACCESS_GROUP) && !mGroupID.isNull() && group_id == mGroupID; | 438 | && getParcelFlag(PF_USE_ACCESS_GROUP) && !mGroupID.isNull() && group_id == mGroupID; |
437 | 439 | ||
438 | 440 | ||
439 | // Test group list | 441 | // Test group list |
440 | if (getParcelFlag(PF_USE_ACCESS_GROUP) | 442 | if (getParcelFlag(PF_USE_ACCESS_GROUP) |
441 | && !mGroupID.isNull() | 443 | && !mGroupID.isNull() |
442 | && group_id == mGroupID | 444 | && group_id == mGroupID |
443 | && !passWithGroup) | 445 | && !passWithGroup) |
444 | { | 446 | { |
445 | return BA_ALLOWED; | 447 | return BA_ALLOWED; |
446 | } | 448 | } |
447 | 449 | ||
448 | // Test access list | 450 | // Test access list |
449 | if (getParcelFlag(PF_USE_ACCESS_LIST) || passWithGroup ) | 451 | if (getParcelFlag(PF_USE_ACCESS_LIST) || passWithGroup ) |
450 | { | 452 | { |
451 | if (mAccessList.find(agent_id) != mAccessList.end()) | 453 | if (mAccessList.find(agent_id) != mAccessList.end()) |
452 | { | 454 | { |
453 | return BA_ALLOWED; | 455 | return BA_ALLOWED; |
454 | } | 456 | } |
455 | 457 | ||
456 | return BA_NOT_ON_LIST; | 458 | return BA_NOT_ON_LIST; |
457 | } | 459 | } |
458 | 460 | ||
459 | // If we're not doing any other limitations, all users | 461 | // If we're not doing any other limitations, all users |
460 | // can enter, unless | 462 | // can enter, unless |
461 | if ( !getParcelFlag(PF_USE_ACCESS_GROUP) | 463 | if ( !getParcelFlag(PF_USE_ACCESS_GROUP) |
462 | && !getParcelFlag(PF_USE_ACCESS_LIST)) | 464 | && !getParcelFlag(PF_USE_ACCESS_LIST)) |
463 | { | 465 | { |
464 | //If the land is group owned, and you are in the group, bypass these checks | 466 | //If the land is group owned, and you are in the group, bypass these checks |
465 | if(getIsGroupOwned() && group_id == mGroupID) | 467 | if(getIsGroupOwned() && group_id == mGroupID) |
466 | { | 468 | { |
467 | return BA_ALLOWED; | 469 | return BA_ALLOWED; |
468 | } | 470 | } |
469 | 471 | ||
470 | // Test for "payment" access levels | 472 | // Test for "payment" access levels |
471 | // Anonymous - No Payment Info on File | 473 | // Anonymous - No Payment Info on File |
472 | if(getParcelFlag(PF_DENY_ANONYMOUS) && !is_agent_identified && !is_agent_transacted) | 474 | if(getParcelFlag(PF_DENY_ANONYMOUS) && !is_agent_identified && !is_agent_transacted) |
473 | { | 475 | { |
474 | return BA_NO_ACCESS_LEVEL; | 476 | return BA_NO_ACCESS_LEVEL; |
475 | } | 477 | } |
476 | // Identified - Payment Info on File | 478 | // AgeUnverified - Not Age Verified |
477 | // Must check to make sure we're only banning Identified, since Transacted accounts | 479 | if(getParcelFlag(PF_DENY_AGEUNVERIFIED) && !is_agent_ageverified) |
478 | // also have their identified flag set | 480 | { |
479 | if(getParcelFlag(PF_DENY_IDENTIFIED) && is_agent_identified && !is_agent_transacted) | 481 | return BA_NOT_AGE_VERIFIED; |
480 | { | 482 | } |
481 | return BA_NO_ACCESS_LEVEL; | 483 | |
482 | } | 484 | return BA_ALLOWED; |
483 | // Transacted - Payment Info Used | 485 | } |
484 | if(getParcelFlag(PF_DENY_TRANSACTED) && is_agent_transacted) | 486 | |
485 | { | 487 | return BA_NOT_IN_GROUP; |
486 | return BA_NO_ACCESS_LEVEL; | 488 | |
487 | } | ||
488 | return BA_ALLOWED; | ||
489 | } | ||
490 | |||
491 | return BA_NOT_IN_GROUP; | ||
492 | |||
493 | } | 489 | } |
494 | 490 | ||
495 | 491 | ||
496 | void LLParcel::setArea(S32 area, S32 sim_object_limit) | 492 | void LLParcel::setArea(S32 area, S32 sim_object_limit) |
497 | { | 493 | { |
498 | mArea = area; | 494 | mArea = area; |
499 | setMaxPrimCapacity((S32)(sim_object_limit * area / (F32)(REGION_WIDTH_METERS * REGION_WIDTH_METERS))); | 495 | setMaxPrimCapacity((S32)(sim_object_limit * area / (F32)(REGION_WIDTH_METERS * REGION_WIDTH_METERS))); |
500 | } | 496 | } |
501 | 497 | ||
502 | void LLParcel::setDiscountRate(F32 rate) | 498 | void LLParcel::setDiscountRate(F32 rate) |
503 | { | 499 | { |
504 | // this is to make sure that the rate is at least sane - this is | 500 | // this is to make sure that the rate is at least sane - this is |
505 | // not intended to enforce economy rules. It only enfoces that the | 501 | // not intended to enforce economy rules. It only enfoces that the |
506 | // rate is a scaler between 0 and 1. | 502 | // rate is a scaler between 0 and 1. |
507 | mDiscountRate = llclampf(rate); | 503 | mDiscountRate = llclampf(rate); |
508 | } | 504 | } |
509 | 505 | ||
510 | 506 | ||
@@ -516,909 +512,918 @@ void LLParcel::setDiscountRate(F32 rate) | |||
516 | // WARNING: Area will be wrong until you calculate it. | 512 | // WARNING: Area will be wrong until you calculate it. |
517 | BOOL LLParcel::importStream(std::istream& input_stream) | 513 | BOOL LLParcel::importStream(std::istream& input_stream) |
518 | { | 514 | { |
519 | U32 setting; | 515 | U32 setting; |
520 | S32 secs_until_revert = 0; | 516 | S32 secs_until_revert = 0; |
521 | 517 | ||
522 | skip_to_end_of_next_keyword("{", input_stream); | 518 | skip_to_end_of_next_keyword("{", input_stream); |
523 | if (!input_stream.good()) | 519 | if (!input_stream.good()) |
524 | { | 520 | { |
525 | llwarns << "LLParcel::importStream() - bad input_stream" << llendl; | 521 | llwarns << "LLParcel::importStream() - bad input_stream" << llendl; |
526 | return FALSE; | 522 | return FALSE; |
527 | } | 523 | } |
528 | 524 | ||
529 | while (input_stream.good()) | 525 | while (input_stream.good()) |
530 | { | 526 | { |
531 | skip_comments_and_emptyspace(input_stream); | 527 | skip_comments_and_emptyspace(input_stream); |
532 | LLString line, keyword, value; | 528 | LLString line, keyword, value; |
533 | get_line(line, input_stream, MAX_STRING); | 529 | get_line(line, input_stream, MAX_STRING); |
534 | get_keyword_and_value(keyword, value, line); | 530 | get_keyword_and_value(keyword, value, line); |
535 | 531 | ||
536 | if ("}" == keyword) | 532 | if ("}" == keyword) |
537 | { | 533 | { |
538 | break; | 534 | break; |
539 | } | 535 | } |
540 | else if ("parcel_id" == keyword) | 536 | else if ("parcel_id" == keyword) |
541 | { | 537 | { |
542 | mID.set(value.c_str()); | 538 | mID.set(value.c_str()); |
543 | } | 539 | } |
544 | else if ("status" == keyword) | 540 | else if ("status" == keyword) |
545 | { | 541 | { |
546 | mStatus = ownership_string_to_status(value.c_str()); | 542 | mStatus = ownership_string_to_status(value.c_str()); |
547 | } | 543 | } |
548 | else if ("category" == keyword) | 544 | else if ("category" == keyword) |
549 | { | 545 | { |
550 | mCategory = category_string_to_category(value.c_str()); | 546 | mCategory = category_string_to_category(value.c_str()); |
551 | } | 547 | } |
552 | else if ("local_id" == keyword) | 548 | else if ("local_id" == keyword) |
553 | { | 549 | { |
554 | LLString::convertToS32(value, mLocalID); | 550 | LLString::convertToS32(value, mLocalID); |
555 | } | 551 | } |
556 | else if ("name" == keyword) | 552 | else if ("name" == keyword) |
557 | { | 553 | { |
558 | setName( value ); | 554 | setName( value ); |
559 | } | 555 | } |
560 | else if ("desc" == keyword) | 556 | else if ("desc" == keyword) |
561 | { | 557 | { |
562 | setDesc( value ); | 558 | setDesc( value ); |
563 | } | 559 | } |
564 | else if ("music_url" == keyword) | 560 | else if ("music_url" == keyword) |
565 | { | 561 | { |
566 | setMusicURL( value ); | 562 | setMusicURL( value ); |
567 | } | 563 | } |
568 | else if ("media_url" == keyword) | 564 | else if ("media_url" == keyword) |
569 | { | 565 | { |
570 | setMediaURL( value ); | 566 | setMediaURL( value ); |
571 | } | 567 | } |
572 | else if ("media_id" == keyword) | 568 | else if ("media_id" == keyword) |
573 | { | 569 | { |
574 | mMediaID.set( value.c_str() ); | 570 | mMediaID.set( value.c_str() ); |
575 | } | 571 | } |
576 | else if ("media_auto_scale" == keyword) | 572 | else if ("media_auto_scale" == keyword) |
577 | { | 573 | { |
578 | LLString::convertToU8(value, mMediaAutoScale); | 574 | LLString::convertToU8(value, mMediaAutoScale); |
579 | } | 575 | } |
580 | else if ("owner_id" == keyword) | 576 | else if ("owner_id" == keyword) |
581 | { | 577 | { |
582 | mOwnerID.set( value.c_str() ); | 578 | mOwnerID.set( value.c_str() ); |
583 | } | 579 | } |
584 | else if ("group_owned" == keyword) | 580 | else if ("group_owned" == keyword) |
585 | { | 581 | { |
586 | LLString::convertToBOOL(value, mGroupOwned); | 582 | LLString::convertToBOOL(value, mGroupOwned); |
587 | } | 583 | } |
588 | else if ("clean_other_time" == keyword) | 584 | else if ("clean_other_time" == keyword) |
589 | { | 585 | { |
590 | S32 time; | 586 | S32 time; |
591 | LLString::convertToS32(value, time); | 587 | LLString::convertToS32(value, time); |
592 | setCleanOtherTime(time); | 588 | setCleanOtherTime(time); |
593 | } | 589 | } |
594 | else if ("auth_buyer_id" == keyword) | 590 | else if ("auth_buyer_id" == keyword) |
595 | { | 591 | { |
596 | mAuthBuyerID.set(value.c_str()); | 592 | mAuthBuyerID.set(value.c_str()); |
597 | } | 593 | } |
598 | else if ("snapshot_id" == keyword) | 594 | else if ("snapshot_id" == keyword) |
599 | { | 595 | { |
600 | mSnapshotID.set(value.c_str()); | 596 | mSnapshotID.set(value.c_str()); |
601 | } | 597 | } |
602 | else if ("user_location" == keyword) | 598 | else if ("user_location" == keyword) |
603 | { | 599 | { |
604 | sscanf(value.c_str(), "%f %f %f", | 600 | sscanf(value.c_str(), "%f %f %f", |
605 | &mUserLocation.mV[VX], | 601 | &mUserLocation.mV[VX], |
606 | &mUserLocation.mV[VY], | 602 | &mUserLocation.mV[VY], |
607 | &mUserLocation.mV[VZ]); | 603 | &mUserLocation.mV[VZ]); |
608 | } | 604 | } |
609 | else if ("user_look_at" == keyword) | 605 | else if ("user_look_at" == keyword) |
610 | { | 606 | { |
611 | sscanf(value.c_str(), "%f %f %f", | 607 | sscanf(value.c_str(), "%f %f %f", |
612 | &mUserLookAt.mV[VX], | 608 | &mUserLookAt.mV[VX], |
613 | &mUserLookAt.mV[VY], | 609 | &mUserLookAt.mV[VY], |
614 | &mUserLookAt.mV[VZ]); | 610 | &mUserLookAt.mV[VZ]); |
615 | } | 611 | } |
616 | else if ("landing_type" == keyword) | 612 | else if ("landing_type" == keyword) |
617 | { | 613 | { |
618 | S32 landing_type = 0; | 614 | S32 landing_type = 0; |
619 | LLString::convertToS32(value, landing_type); | 615 | LLString::convertToS32(value, landing_type); |
620 | mLandingType = (ELandingType) landing_type; | 616 | mLandingType = (ELandingType) landing_type; |
621 | } | 617 | } |
622 | else if ("join_neighbors" == keyword) | 618 | else if ("join_neighbors" == keyword) |
623 | { | 619 | { |
624 | llinfos << "found deprecated keyword join_neighbors" << llendl; | 620 | llinfos << "found deprecated keyword join_neighbors" << llendl; |
625 | } | 621 | } |
626 | else if ("revert_sale" == keyword) | 622 | else if ("revert_sale" == keyword) |
627 | { | 623 | { |
628 | LLString::convertToS32(value, secs_until_revert); | 624 | LLString::convertToS32(value, secs_until_revert); |
629 | if (secs_until_revert > 0) | 625 | if (secs_until_revert > 0) |
630 | { | 626 | { |
631 | mSaleTimerExpires.start(); | 627 | mSaleTimerExpires.start(); |
632 | mSaleTimerExpires.setTimerExpirySec((F32)secs_until_revert); | 628 | mSaleTimerExpires.setTimerExpirySec((F32)secs_until_revert); |
633 | } | 629 | } |
634 | } | 630 | } |
635 | else if("extended_grace" == keyword) | 631 | else if("extended_grace" == keyword) |
636 | { | 632 | { |
637 | LLString::convertToS32(value, mGraceExtension); | 633 | LLString::convertToS32(value, mGraceExtension); |
638 | } | 634 | } |
639 | else if ("user_list_type" == keyword) | 635 | else if ("user_list_type" == keyword) |
640 | { | 636 | { |
641 | // deprecated | 637 | // deprecated |
642 | } | 638 | } |
643 | else if("auction_id" == keyword) | 639 | else if("auction_id" == keyword) |
644 | { | 640 | { |
645 | LLString::convertToU32(value, mAuctionID); | 641 | LLString::convertToU32(value, mAuctionID); |
646 | } | 642 | } |
647 | else if ("allow_modify" == keyword) | 643 | else if ("allow_modify" == keyword) |
648 | { | 644 | { |
649 | LLString::convertToU32(value, setting); | 645 | LLString::convertToU32(value, setting); |
650 | setParcelFlag(PF_CREATE_OBJECTS, setting); | 646 | setParcelFlag(PF_CREATE_OBJECTS, setting); |
651 | } | 647 | } |
652 | else if ("allow_group_modify" == keyword) | 648 | else if ("allow_group_modify" == keyword) |
653 | { | 649 | { |
654 | LLString::convertToU32(value, setting); | 650 | LLString::convertToU32(value, setting); |
655 | setParcelFlag(PF_CREATE_GROUP_OBJECTS, setting); | 651 | setParcelFlag(PF_CREATE_GROUP_OBJECTS, setting); |
656 | } | 652 | } |
657 | else if ("allow_all_object_entry" == keyword) | 653 | else if ("allow_all_object_entry" == keyword) |
658 | { | 654 | { |
659 | LLString::convertToU32(value, setting); | 655 | LLString::convertToU32(value, setting); |
660 | setParcelFlag(PF_ALLOW_ALL_OBJECT_ENTRY, setting); | 656 | setParcelFlag(PF_ALLOW_ALL_OBJECT_ENTRY, setting); |
661 | } | 657 | } |
662 | else if ("allow_group_object_entry" == keyword) | 658 | else if ("allow_group_object_entry" == keyword) |
663 | { | 659 | { |
664 | LLString::convertToU32(value, setting); | 660 | LLString::convertToU32(value, setting); |
665 | setParcelFlag(PF_ALLOW_GROUP_OBJECT_ENTRY, setting); | 661 | setParcelFlag(PF_ALLOW_GROUP_OBJECT_ENTRY, setting); |
666 | } | 662 | } |
667 | else if ("allow_deed_to_group" == keyword) | 663 | else if ("allow_deed_to_group" == keyword) |
668 | { | 664 | { |
669 | LLString::convertToU32(value, setting); | 665 | LLString::convertToU32(value, setting); |
670 | setParcelFlag(PF_ALLOW_DEED_TO_GROUP, setting); | 666 | setParcelFlag(PF_ALLOW_DEED_TO_GROUP, setting); |
671 | } | 667 | } |
672 | else if("contribute_with_deed" == keyword) | 668 | else if("contribute_with_deed" == keyword) |
673 | { | 669 | { |
674 | LLString::convertToU32(value, setting); | 670 | LLString::convertToU32(value, setting); |
675 | setParcelFlag(PF_CONTRIBUTE_WITH_DEED, setting); | 671 | setParcelFlag(PF_CONTRIBUTE_WITH_DEED, setting); |
676 | } | 672 | } |
677 | else if ("allow_terraform" == keyword) | 673 | else if ("allow_terraform" == keyword) |
678 | { | 674 | { |
679 | LLString::convertToU32(value, setting); | 675 | LLString::convertToU32(value, setting); |
680 | setParcelFlag(PF_ALLOW_TERRAFORM, setting); | 676 | setParcelFlag(PF_ALLOW_TERRAFORM, setting); |
681 | } | 677 | } |
682 | else if ("allow_damage" == keyword) | 678 | else if ("allow_damage" == keyword) |
683 | { | 679 | { |
684 | LLString::convertToU32(value, setting); | 680 | LLString::convertToU32(value, setting); |
685 | setParcelFlag(PF_ALLOW_DAMAGE, setting); | 681 | setParcelFlag(PF_ALLOW_DAMAGE, setting); |
686 | } | 682 | } |
687 | else if ("allow_fly" == keyword) | 683 | else if ("allow_fly" == keyword) |
688 | { | 684 | { |
689 | LLString::convertToU32(value, setting); | 685 | LLString::convertToU32(value, setting); |
690 | setParcelFlag(PF_ALLOW_FLY, setting); | 686 | setParcelFlag(PF_ALLOW_FLY, setting); |
691 | } | 687 | } |
692 | else if ("allow_landmark" == keyword) | 688 | else if ("allow_landmark" == keyword) |
693 | { | 689 | { |
694 | LLString::convertToU32(value, setting); | 690 | LLString::convertToU32(value, setting); |
695 | setParcelFlag(PF_ALLOW_LANDMARK, setting); | 691 | setParcelFlag(PF_ALLOW_LANDMARK, setting); |
696 | } | 692 | } |
697 | else if ("sound_local" == keyword) | 693 | else if ("sound_local" == keyword) |
698 | { | 694 | { |
699 | LLString::convertToU32(value, setting); | 695 | LLString::convertToU32(value, setting); |
700 | setParcelFlag(PF_SOUND_LOCAL, setting); | 696 | setParcelFlag(PF_SOUND_LOCAL, setting); |
701 | } | 697 | } |
702 | else if ("allow_group_scripts" == keyword) | 698 | else if ("allow_group_scripts" == keyword) |
703 | { | 699 | { |
704 | LLString::convertToU32(value, setting); | 700 | LLString::convertToU32(value, setting); |
705 | setParcelFlag(PF_ALLOW_GROUP_SCRIPTS, setting); | 701 | setParcelFlag(PF_ALLOW_GROUP_SCRIPTS, setting); |
706 | } | 702 | } |
707 | else if ("allow_voice_chat" == keyword) | 703 | else if ("allow_voice_chat" == keyword) |
708 | { | 704 | { |
709 | LLString::convertToU32(value, setting); | 705 | LLString::convertToU32(value, setting); |
710 | setParcelFlag(PF_ALLOW_VOICE_CHAT, setting); | 706 | setParcelFlag(PF_ALLOW_VOICE_CHAT, setting); |
711 | } | 707 | } |
712 | else if ("use_estate_voice_chan" == keyword) | 708 | else if ("use_estate_voice_chan" == keyword) |
713 | { | 709 | { |
714 | LLString::convertToU32(value, setting); | 710 | LLString::convertToU32(value, setting); |
715 | setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, setting); | 711 | setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, setting); |
716 | } | 712 | } |
717 | else if ("allow_scripts" == keyword) | 713 | else if ("allow_scripts" == keyword) |
718 | { | 714 | { |
719 | LLString::convertToU32(value, setting); | 715 | LLString::convertToU32(value, setting); |
720 | setParcelFlag(PF_ALLOW_OTHER_SCRIPTS, setting); | 716 | setParcelFlag(PF_ALLOW_OTHER_SCRIPTS, setting); |
721 | } | 717 | } |
722 | else if ("for_sale" == keyword) | 718 | else if ("for_sale" == keyword) |
723 | { | 719 | { |
724 | LLString::convertToU32(value, setting); | 720 | LLString::convertToU32(value, setting); |
725 | setParcelFlag(PF_FOR_SALE, setting); | 721 | setParcelFlag(PF_FOR_SALE, setting); |
726 | } | 722 | } |
727 | else if ("sell_w_objects" == keyword) | 723 | else if ("sell_w_objects" == keyword) |
728 | { | 724 | { |
729 | LLString::convertToU32(value, setting); | 725 | LLString::convertToU32(value, setting); |
730 | setParcelFlag(PF_SELL_PARCEL_OBJECTS, setting); | 726 | setParcelFlag(PF_SELL_PARCEL_OBJECTS, setting); |
731 | } | 727 | } |
732 | else if ("use_pass_list" == keyword) | 728 | else if ("use_pass_list" == keyword) |
733 | { | 729 | { |
734 | LLString::convertToU32(value, setting); | 730 | LLString::convertToU32(value, setting); |
735 | setParcelFlag(PF_USE_PASS_LIST, setting); | 731 | setParcelFlag(PF_USE_PASS_LIST, setting); |
736 | } | 732 | } |
737 | else if ("show_directory" == keyword) | 733 | else if ("show_directory" == keyword) |
738 | { | 734 | { |
739 | LLString::convertToU32(value, setting); | 735 | LLString::convertToU32(value, setting); |
740 | setParcelFlag(PF_SHOW_DIRECTORY, setting); | 736 | setParcelFlag(PF_SHOW_DIRECTORY, setting); |
741 | } | 737 | } |
742 | else if ("allow_publish" == keyword) | 738 | else if ("allow_publish" == keyword) |
743 | { | 739 | { |
744 | LLString::convertToU32(value, setting); | 740 | LLString::convertToU32(value, setting); |
745 | setParcelFlag(PF_ALLOW_PUBLISH, setting); | 741 | setParcelFlag(PF_ALLOW_PUBLISH, setting); |
746 | } | 742 | } |
747 | else if ("mature_publish" == keyword) | 743 | else if ("mature_publish" == keyword) |
748 | { | 744 | { |
749 | LLString::convertToU32(value, setting); | 745 | LLString::convertToU32(value, setting); |
750 | setParcelFlag(PF_MATURE_PUBLISH, setting); | 746 | setParcelFlag(PF_MATURE_PUBLISH, setting); |
751 | } | 747 | } |
752 | else if ("claim_date" == keyword) | 748 | else if ("claim_date" == keyword) |
753 | { | 749 | { |
754 | // BUG: This will fail when time rolls over in 2038. | 750 | // BUG: This will fail when time rolls over in 2038. |
755 | S32 time; | 751 | S32 time; |
756 | LLString::convertToS32(value, time); | 752 | LLString::convertToS32(value, time); |
757 | mClaimDate = time; | 753 | mClaimDate = time; |
758 | } | 754 | } |
759 | else if ("claim_price" == keyword) | 755 | else if ("claim_price" == keyword) |
760 | { | 756 | { |
761 | LLString::convertToS32(value, mClaimPricePerMeter); | 757 | LLString::convertToS32(value, mClaimPricePerMeter); |
762 | } | 758 | } |
763 | else if ("rent_price" == keyword) | 759 | else if ("rent_price" == keyword) |
764 | { | 760 | { |
765 | LLString::convertToS32(value, mRentPricePerMeter); | 761 | LLString::convertToS32(value, mRentPricePerMeter); |
766 | } | 762 | } |
767 | else if ("discount_rate" == keyword) | 763 | else if ("discount_rate" == keyword) |
768 | { | 764 | { |
769 | LLString::convertToF32(value, mDiscountRate); | 765 | LLString::convertToF32(value, mDiscountRate); |
770 | } | 766 | } |
771 | else if ("draw_distance" == keyword) | 767 | else if ("draw_distance" == keyword) |
772 | { | 768 | { |
773 | LLString::convertToF32(value, mDrawDistance); | 769 | LLString::convertToF32(value, mDrawDistance); |
774 | } | 770 | } |
775 | else if ("sale_price" == keyword) | 771 | else if ("sale_price" == keyword) |
776 | { | 772 | { |
777 | LLString::convertToS32(value, mSalePrice); | 773 | LLString::convertToS32(value, mSalePrice); |
778 | } | 774 | } |
779 | else if ("pass_price" == keyword) | 775 | else if ("pass_price" == keyword) |
780 | { | 776 | { |
781 | LLString::convertToS32(value, mPassPrice); | 777 | LLString::convertToS32(value, mPassPrice); |
782 | } | 778 | } |
783 | else if ("pass_hours" == keyword) | 779 | else if ("pass_hours" == keyword) |
784 | { | 780 | { |
785 | LLString::convertToF32(value, mPassHours); | 781 | LLString::convertToF32(value, mPassHours); |
786 | } | 782 | } |
787 | else if ("box" == keyword) | 783 | else if ("box" == keyword) |
788 | { | 784 | { |
789 | // deprecated | 785 | // deprecated |
790 | } | 786 | } |
791 | else if ("aabb_min" == keyword) | 787 | else if ("aabb_min" == keyword) |
792 | { | 788 | { |
793 | sscanf(value.c_str(), "%f %f %f", | 789 | sscanf(value.c_str(), "%f %f %f", |
794 | &mAABBMin.mV[VX], &mAABBMin.mV[VY], &mAABBMin.mV[VZ]); | 790 | &mAABBMin.mV[VX], &mAABBMin.mV[VY], &mAABBMin.mV[VZ]); |
795 | } | 791 | } |
796 | else if ("use_access_group" == keyword) | 792 | else if ("use_access_group" == keyword) |
797 | { | 793 | { |
798 | LLString::convertToU32(value, setting); | 794 | LLString::convertToU32(value, setting); |
799 | setParcelFlag(PF_USE_ACCESS_GROUP, setting); | 795 | setParcelFlag(PF_USE_ACCESS_GROUP, setting); |
800 | } | 796 | } |
801 | else if ("use_access_list" == keyword) | 797 | else if ("use_access_list" == keyword) |
802 | { | 798 | { |
803 | LLString::convertToU32(value, setting); | 799 | LLString::convertToU32(value, setting); |
804 | setParcelFlag(PF_USE_ACCESS_LIST, setting); | 800 | setParcelFlag(PF_USE_ACCESS_LIST, setting); |
805 | } | 801 | } |
806 | else if ("use_ban_list" == keyword) | 802 | else if ("use_ban_list" == keyword) |
807 | { | 803 | { |
808 | LLString::convertToU32(value, setting); | 804 | LLString::convertToU32(value, setting); |
809 | setParcelFlag(PF_USE_BAN_LIST, setting); | 805 | setParcelFlag(PF_USE_BAN_LIST, setting); |
810 | } | 806 | } |
811 | else if ("group_name" == keyword) | 807 | else if ("group_name" == keyword) |
812 | { | 808 | { |
813 | llinfos << "found deprecated keyword group_name" << llendl; | 809 | llinfos << "found deprecated keyword group_name" << llendl; |
814 | } | 810 | } |
815 | else if ("group_id" == keyword) | 811 | else if ("group_id" == keyword) |
816 | { | 812 | { |
817 | mGroupID.set( value.c_str() ); | 813 | mGroupID.set( value.c_str() ); |
818 | } | 814 | } |
819 | // TODO: DEPRECATED FLAG | 815 | // TODO: DEPRECATED FLAG |
820 | // Flag removed from simstate files in 1.11.1 | 816 | // Flag removed from simstate files in 1.11.1 |
821 | // Remove at some point where we have guarenteed this flag | 817 | // Keep if statement until we have guarenteed this flag |
822 | // no longer exists anywhere in simstate files. | 818 | // no longer exists anywhere in simstate files. |
823 | else if ("require_identified" == keyword) | 819 | else if ("require_identified" == keyword) |
824 | { | 820 | { |
825 | LLString::convertToU32(value, setting); | 821 | // LLString::convertToU32(value, setting); |
826 | setParcelFlag(PF_DENY_ANONYMOUS, setting); | 822 | // setParcelFlag(PF_DENY_ANONYMOUS, setting); |
827 | } | 823 | } |
828 | // TODO: DEPRECATED FLAG | 824 | // TODO: DEPRECATED FLAG |
829 | // Flag removed from simstate files in 1.11.1 | 825 | // Flag removed from simstate files in 1.11.1 |
830 | // Remove at some point where we have guarenteed this flag | 826 | // Keep if statement until we have guarenteed this flag |
831 | // no longer exists anywhere in simstate files. | 827 | // no longer exists anywhere in simstate files. |
832 | else if ("require_transacted" == keyword) | 828 | else if ("require_transacted" == keyword) |
833 | { | 829 | { |
834 | LLString::convertToU32(value, setting); | 830 | // LLString::convertToU32(value, setting); |
835 | setParcelFlag(PF_DENY_ANONYMOUS, setting); | 831 | // setParcelFlag(PF_DENY_ANONYMOUS, setting); |
836 | setParcelFlag(PF_DENY_IDENTIFIED, setting); | 832 | // setParcelFlag(PF_DENY_IDENTIFIED, setting); |
837 | } | 833 | } |
838 | else if ("restrict_pushobject" == keyword) | 834 | else if ("restrict_pushobject" == keyword) |
839 | { | 835 | { |
840 | LLString::convertToU32(value, setting); | 836 | LLString::convertToU32(value, setting); |
841 | setParcelFlag(PF_RESTRICT_PUSHOBJECT, setting); | 837 | setParcelFlag(PF_RESTRICT_PUSHOBJECT, setting); |
842 | } | 838 | } |
843 | else if ("deny_anonymous" == keyword) | 839 | else if ("deny_anonymous" == keyword) |
844 | { | 840 | { |
845 | LLString::convertToU32(value, setting); | 841 | LLString::convertToU32(value, setting); |
846 | setParcelFlag(PF_DENY_ANONYMOUS, setting); | 842 | setParcelFlag(PF_DENY_ANONYMOUS, setting); |
847 | } | 843 | } |
844 | // TODO: DEPRECATED FLAG | ||
845 | // Keep if statement until we have guarenteed this flag | ||
846 | // no longer exists anywhere in simstate files. | ||
848 | else if ("deny_identified" == keyword) | 847 | else if ("deny_identified" == keyword) |
849 | { | 848 | { |
850 | LLString::convertToU32(value, setting); | 849 | // LLString::convertToU32(value, setting); |
851 | setParcelFlag(PF_DENY_IDENTIFIED, setting); | 850 | // setParcelFlag(PF_DENY_IDENTIFIED, setting); |
852 | } | 851 | } |
853 | else if ("deny_transacted" == keyword) | 852 | else if ("deny_transacted" == keyword) |
854 | { | 853 | { |
855 | LLString::convertToU32(value, setting); | 854 | // LLString::convertToU32(value, setting); |
856 | setParcelFlag(PF_DENY_TRANSACTED, setting); | 855 | // setParcelFlag(PF_DENY_TRANSACTED, setting); |
857 | } | 856 | } |
858 | else if ("access_list" == keyword) | 857 | else if ("deny_age_unverified" == keyword) |
859 | { | 858 | { |
860 | S32 entry_count = 0; | 859 | LLString::convertToU32(value, setting); |
861 | LLString::convertToS32(value, entry_count); | 860 | setParcelFlag(PF_DENY_AGEUNVERIFIED, setting); |
862 | for (S32 i = 0; i < entry_count; i++) | 861 | } |
863 | { | 862 | else if ("access_list" == keyword) |
864 | LLAccessEntry entry; | 863 | { |
865 | if (importAccessEntry(input_stream, &entry)) | 864 | S32 entry_count = 0; |
866 | { | 865 | LLString::convertToS32(value, entry_count); |
867 | mAccessList[entry.mID] = entry; | 866 | for (S32 i = 0; i < entry_count; i++) |
868 | } | 867 | { |
869 | } | 868 | LLAccessEntry entry; |
870 | } | 869 | if (importAccessEntry(input_stream, &entry)) |
871 | else if ("ban_list" == keyword) | 870 | { |
872 | { | 871 | mAccessList[entry.mID] = entry; |
873 | S32 entry_count = 0; | 872 | } |
874 | LLString::convertToS32(value, entry_count); | 873 | } |
875 | for (S32 i = 0; i < entry_count; i++) | 874 | } |
876 | { | 875 | else if ("ban_list" == keyword) |
877 | LLAccessEntry entry; | 876 | { |
878 | if (importAccessEntry(input_stream, &entry)) | 877 | S32 entry_count = 0; |
879 | { | 878 | LLString::convertToS32(value, entry_count); |
880 | mBanList[entry.mID] = entry; | 879 | for (S32 i = 0; i < entry_count; i++) |
881 | } | 880 | { |
882 | } | 881 | LLAccessEntry entry; |
883 | } | 882 | if (importAccessEntry(input_stream, &entry)) |
884 | else if ("renter_list" == keyword) | 883 | { |
885 | { | 884 | mBanList[entry.mID] = entry; |
886 | /* | 885 | } |
887 | S32 entry_count = 0; | 886 | } |
888 | LLString::convertToS32(value, entry_count); | 887 | } |
889 | for (S32 i = 0; i < entry_count; i++) | 888 | else if ("renter_list" == keyword) |
890 | { | 889 | { |
891 | LLAccessEntry entry; | 890 | /* |
892 | if (importAccessEntry(input_stream, &entry)) | 891 | S32 entry_count = 0; |
893 | { | 892 | LLString::convertToS32(value, entry_count); |
894 | mRenterList.put(entry); | 893 | for (S32 i = 0; i < entry_count; i++) |
895 | } | 894 | { |
896 | }*/ | 895 | LLAccessEntry entry; |
897 | } | 896 | if (importAccessEntry(input_stream, &entry)) |
898 | else if ("pass_list" == keyword) | 897 | { |
899 | { | 898 | mRenterList.put(entry); |
900 | // legacy - put into access list | 899 | } |
901 | S32 entry_count = 0; | 900 | }*/ |
902 | LLString::convertToS32(value, entry_count); | 901 | } |
903 | for (S32 i = 0; i < entry_count; i++) | 902 | else if ("pass_list" == keyword) |
904 | { | 903 | { |
905 | LLAccessEntry entry; | 904 | // legacy - put into access list |
906 | if (importAccessEntry(input_stream, &entry)) | 905 | S32 entry_count = 0; |
907 | { | 906 | LLString::convertToS32(value, entry_count); |
908 | mAccessList[entry.mID] = entry; | 907 | for (S32 i = 0; i < entry_count; i++) |
909 | } | 908 | { |
910 | } | 909 | LLAccessEntry entry; |
911 | } | 910 | if (importAccessEntry(input_stream, &entry)) |
912 | 911 | { | |
913 | else | 912 | mAccessList[entry.mID] = entry; |
914 | { | 913 | } |
915 | llwarns << "Unknown keyword in parcel section: <" | 914 | } |
916 | << keyword << ">" << llendl; | 915 | } |
917 | } | 916 | |
918 | } | 917 | else |
919 | 918 | { | |
920 | // this code block detects if we have loaded a 1.1 simstate file, | 919 | llwarns << "Unknown keyword in parcel section: <" |
921 | // and follows the conversion rules specified in | 920 | << keyword << ">" << llendl; |
922 | // design_docs/land/pay_for_parcel.txt. | 921 | } |
923 | F32 time_to_expire = 0.0f; | 922 | } |
924 | if(mID.isNull()) | 923 | |
925 | { | 924 | // this code block detects if we have loaded a 1.1 simstate file, |
926 | mID.generate(); | 925 | // and follows the conversion rules specified in |
927 | mStatus = OS_LEASE_PENDING; | 926 | // design_docs/land/pay_for_parcel.txt. |
928 | //mBuyerID = mOwnerID; | 927 | F32 time_to_expire = 0.0f; |
929 | if(getIsGroupOwned()) | 928 | if(mID.isNull()) |
930 | { | 929 | { |
931 | time_to_expire += GROUP_USEC_CONVERSION_TIMEOUT / SEC_TO_MICROSEC; | 930 | mID.generate(); |
932 | } | 931 | mStatus = OS_LEASE_PENDING; |
933 | else | 932 | //mBuyerID = mOwnerID; |
934 | { | 933 | if(getIsGroupOwned()) |
935 | time_to_expire += DEFAULT_USEC_CONVERSION_TIMEOUT / SEC_TO_MICROSEC; | 934 | { |
936 | } | 935 | time_to_expire += GROUP_USEC_CONVERSION_TIMEOUT / SEC_TO_MICROSEC; |
937 | //mExpireAction = STEA_PUBLIC; | 936 | } |
938 | mRecordTransaction = TRUE; | 937 | else |
939 | } | 938 | { |
940 | 939 | time_to_expire += DEFAULT_USEC_CONVERSION_TIMEOUT / SEC_TO_MICROSEC; | |
941 | // this code block deals with giving an extension to pending | 940 | } |
942 | // parcels to the midday of 2004-01-19 if they were originally set | 941 | //mExpireAction = STEA_PUBLIC; |
943 | // for some time on 2004-01-12. | 942 | mRecordTransaction = TRUE; |
944 | if((0 == mGraceExtension) | 943 | } |
945 | && (EXTEND_GRACE_IF_MORE_THAN_SEC < secs_until_revert)) | 944 | |
946 | { | 945 | // this code block deals with giving an extension to pending |
947 | const S32 NEW_CONVERSION_DATE = 1074538800; // 2004-01-19T11:00:00 | 946 | // parcels to the midday of 2004-01-19 if they were originally set |
948 | time_t now = time(NULL); // now in epoch | 947 | // for some time on 2004-01-12. |
949 | secs_until_revert = (S32)(NEW_CONVERSION_DATE - now); | 948 | if((0 == mGraceExtension) |
950 | time_to_expire = (F32)secs_until_revert; | 949 | && (EXTEND_GRACE_IF_MORE_THAN_SEC < secs_until_revert)) |
951 | mGraceExtension = 1; | 950 | { |
952 | } | 951 | const S32 NEW_CONVERSION_DATE = 1074538800; // 2004-01-19T11:00:00 |
953 | 952 | time_t now = time(NULL); // now in epoch | |
954 | // This code block adds yet another week to the deadline. :( | 953 | secs_until_revert = (S32)(NEW_CONVERSION_DATE - now); |
955 | if(1 == mGraceExtension) | 954 | time_to_expire = (F32)secs_until_revert; |
956 | { | 955 | mGraceExtension = 1; |
957 | time_to_expire += SEVEN_DAYS_IN_USEC / SEC_TO_MICROSEC; | 956 | } |
958 | mGraceExtension = 2; | 957 | |
959 | } | 958 | // This code block adds yet another week to the deadline. :( |
960 | 959 | if(1 == mGraceExtension) | |
961 | if (time_to_expire > 0) | 960 | { |
962 | { | 961 | time_to_expire += SEVEN_DAYS_IN_USEC / SEC_TO_MICROSEC; |
963 | mSaleTimerExpires.setTimerExpirySec(time_to_expire); | 962 | mGraceExtension = 2; |
964 | mSaleTimerExpires.start(); | 963 | } |
965 | } | 964 | |
966 | 965 | if (time_to_expire > 0) | |
967 | // successful import | 966 | { |
968 | return TRUE; | 967 | mSaleTimerExpires.setTimerExpirySec(time_to_expire); |
968 | mSaleTimerExpires.start(); | ||
969 | } | ||
970 | |||
971 | // successful import | ||
972 | return TRUE; | ||
969 | } | 973 | } |
970 | 974 | ||
971 | 975 | ||
972 | BOOL LLParcel::importAccessEntry(std::istream& input_stream, LLAccessEntry* entry) | 976 | BOOL LLParcel::importAccessEntry(std::istream& input_stream, LLAccessEntry* entry) |
973 | { | 977 | { |
974 | skip_to_end_of_next_keyword("{", input_stream); | 978 | skip_to_end_of_next_keyword("{", input_stream); |
975 | while (input_stream.good()) | 979 | while (input_stream.good()) |
976 | { | 980 | { |
977 | skip_comments_and_emptyspace(input_stream); | 981 | skip_comments_and_emptyspace(input_stream); |
978 | LLString line, keyword, value; | 982 | LLString line, keyword, value; |
979 | get_line(line, input_stream, MAX_STRING); | 983 | get_line(line, input_stream, MAX_STRING); |
980 | get_keyword_and_value(keyword, value, line); | 984 | get_keyword_and_value(keyword, value, line); |
981 | 985 | ||
982 | if ("}" == keyword) | 986 | if ("}" == keyword) |
983 | { | 987 | { |
984 | break; | 988 | break; |
985 | } | 989 | } |
986 | else if ("id" == keyword) | 990 | else if ("id" == keyword) |
987 | { | 991 | { |
988 | entry->mID.set( value.c_str() ); | 992 | entry->mID.set( value.c_str() ); |
989 | } | 993 | } |
990 | else if ("name" == keyword) | 994 | else if ("name" == keyword) |
991 | { | 995 | { |
992 | // deprecated | 996 | // deprecated |
993 | } | 997 | } |
994 | else if ("time" == keyword) | 998 | else if ("time" == keyword) |
995 | { | 999 | { |
996 | S32 when; | 1000 | S32 when; |
997 | LLString::convertToS32(value, when); | 1001 | LLString::convertToS32(value, when); |
998 | entry->mTime = when; | 1002 | entry->mTime = when; |
999 | } | 1003 | } |
1000 | else if ("flags" == keyword) | 1004 | else if ("flags" == keyword) |
1001 | { | 1005 | { |
1002 | U32 setting; | 1006 | U32 setting; |
1003 | LLString::convertToU32(value, setting); | 1007 | LLString::convertToU32(value, setting); |
1004 | entry->mFlags = setting; | 1008 | entry->mFlags = setting; |
1005 | } | 1009 | } |
1006 | else | 1010 | else |
1007 | { | 1011 | { |
1008 | llwarns << "Unknown keyword in parcel access entry section: <" | 1012 | llwarns << "Unknown keyword in parcel access entry section: <" |
1009 | << keyword << ">" << llendl; | 1013 | << keyword << ">" << llendl; |
1010 | } | 1014 | } |
1011 | } | 1015 | } |
1012 | return input_stream.good(); | 1016 | return input_stream.good(); |
1013 | } | 1017 | } |
1014 | 1018 | ||
1015 | BOOL LLParcel::exportStream(std::ostream& output_stream) | 1019 | BOOL LLParcel::exportStream(std::ostream& output_stream) |
1016 | { | 1020 | { |
1017 | S32 setting; | 1021 | S32 setting; |
1018 | char id_string[MAX_STRING]; /* Flawfinder: ignore */ | 1022 | char id_string[MAX_STRING]; /* Flawfinder: ignore */ |
1019 | 1023 | ||
1020 | std::ios::fmtflags old_flags = output_stream.flags(); | 1024 | std::ios::fmtflags old_flags = output_stream.flags(); |
1021 | output_stream.setf(std::ios::showpoint); | 1025 | output_stream.setf(std::ios::showpoint); |
1022 | output_stream << "\t{\n"; | 1026 | output_stream << "\t{\n"; |
1023 | 1027 | ||
1024 | mID.toString(id_string); | 1028 | mID.toString(id_string); |
1025 | output_stream << "\t\t parcel_id " << id_string << "\n"; | 1029 | output_stream << "\t\t parcel_id " << id_string << "\n"; |
1026 | output_stream << "\t\t status " << ownership_status_to_string(mStatus) << "\n"; | 1030 | output_stream << "\t\t status " << ownership_status_to_string(mStatus) << "\n"; |
1027 | output_stream << "\t\t category " << category_to_string(mCategory) << "\n"; | 1031 | output_stream << "\t\t category " << category_to_string(mCategory) << "\n"; |
1028 | 1032 | ||
1029 | output_stream << "\t\t local_id " << mLocalID << "\n"; | 1033 | output_stream << "\t\t local_id " << mLocalID << "\n"; |
1030 | 1034 | ||
1031 | const char* name = (mName.empty() ? "" : mName.c_str() ); | 1035 | const char* name = (mName.empty() ? "" : mName.c_str() ); |
1032 | output_stream << "\t\t name " << name << "\n"; | 1036 | output_stream << "\t\t name " << name << "\n"; |
1033 | 1037 | ||
1034 | const char* desc = (mDesc.empty() ? "" : mDesc.c_str() ); | 1038 | const char* desc = (mDesc.empty() ? "" : mDesc.c_str() ); |
1035 | output_stream << "\t\t desc " << desc << "\n"; | 1039 | output_stream << "\t\t desc " << desc << "\n"; |
1036 | 1040 | ||
1037 | const char* music_url = (mMusicURL.empty() ? "" : mMusicURL.c_str() ); | 1041 | const char* music_url = (mMusicURL.empty() ? "" : mMusicURL.c_str() ); |
1038 | output_stream << "\t\t music_url " << music_url << "\n"; | 1042 | output_stream << "\t\t music_url " << music_url << "\n"; |
1039 | 1043 | ||
1040 | const char* media_url = (mMediaURL.empty() ? "" : mMediaURL.c_str() ); | 1044 | const char* media_url = (mMediaURL.empty() ? "" : mMediaURL.c_str() ); |
1041 | output_stream << "\t\t media_url " << media_url << "\n"; | 1045 | output_stream << "\t\t media_url " << media_url << "\n"; |
1042 | 1046 | ||
1043 | output_stream << "\t\t media_auto_scale " << (mMediaAutoScale ? 1 : 0) << "\n"; | 1047 | output_stream << "\t\t media_auto_scale " << (mMediaAutoScale ? 1 : 0) << "\n"; |
1044 | 1048 | ||
1045 | mMediaID.toString(id_string); | 1049 | mMediaID.toString(id_string); |
1046 | output_stream << "\t\t media_id " << id_string << "\n"; | 1050 | output_stream << "\t\t media_id " << id_string << "\n"; |
1047 | 1051 | ||
1048 | mOwnerID.toString(id_string); | 1052 | mOwnerID.toString(id_string); |
1049 | output_stream << "\t\t owner_id " << id_string << "\n"; | 1053 | output_stream << "\t\t owner_id " << id_string << "\n"; |
1050 | output_stream << "\t\t group_owned " << (mGroupOwned ? 1 : 0) << "\n"; | 1054 | output_stream << "\t\t group_owned " << (mGroupOwned ? 1 : 0) << "\n"; |
1051 | output_stream << "\t\t clean_other_time " << getCleanOtherTime() << "\n"; | 1055 | output_stream << "\t\t clean_other_time " << getCleanOtherTime() << "\n"; |
1052 | 1056 | ||
1053 | if(!mAuthBuyerID.isNull()) | 1057 | if(!mAuthBuyerID.isNull()) |
1054 | { | 1058 | { |
1055 | mAuthBuyerID.toString(id_string); | 1059 | mAuthBuyerID.toString(id_string); |
1056 | output_stream << "\t\t auth_buyer_id " << id_string << "\n"; | 1060 | output_stream << "\t\t auth_buyer_id " << id_string << "\n"; |
1057 | } | 1061 | } |
1058 | if (!mSnapshotID.isNull()) | 1062 | if (!mSnapshotID.isNull()) |
1059 | { | 1063 | { |
1060 | mSnapshotID.toString(id_string); | 1064 | mSnapshotID.toString(id_string); |
1061 | output_stream << "\t\t snapshot_id " << id_string << "\n"; | 1065 | output_stream << "\t\t snapshot_id " << id_string << "\n"; |
1062 | } | 1066 | } |
1063 | if (!mUserLocation.isExactlyZero()) | 1067 | if (!mUserLocation.isExactlyZero()) |
1064 | { | 1068 | { |
1065 | output_stream << "\t\t user_location " | 1069 | output_stream << "\t\t user_location " |
1066 | << (F64)mUserLocation.mV[VX] | 1070 | << (F64)mUserLocation.mV[VX] |
1067 | << " " << (F64)mUserLocation.mV[VY] | 1071 | << " " << (F64)mUserLocation.mV[VY] |
1068 | << " " << (F64)mUserLocation.mV[VZ] << "\n"; | 1072 | << " " << (F64)mUserLocation.mV[VZ] << "\n"; |
1069 | output_stream << "\t\t user_look_at " | 1073 | output_stream << "\t\t user_look_at " |
1070 | << (F64)mUserLookAt.mV[VX] | 1074 | << (F64)mUserLookAt.mV[VX] |
1071 | << " " << (F64)mUserLookAt.mV[VY] | 1075 | << " " << (F64)mUserLookAt.mV[VY] |
1072 | << " " << (F64)mUserLookAt.mV[VZ] << "\n"; | 1076 | << " " << (F64)mUserLookAt.mV[VZ] << "\n"; |
1073 | } | 1077 | } |
1074 | output_stream << "\t\t landing_type " << mLandingType << "\n"; | 1078 | output_stream << "\t\t landing_type " << mLandingType << "\n"; |
1075 | //if(mJoinNeighbors) | 1079 | //if(mJoinNeighbors) |
1076 | //{ | 1080 | //{ |
1077 | // output_stream << "\t\t join_neighbors " << mJoinNeighbors << "\n"; | 1081 | // output_stream << "\t\t join_neighbors " << mJoinNeighbors << "\n"; |
1078 | //} | 1082 | //} |
1079 | if(mSaleTimerExpires.getStarted()) | 1083 | if(mSaleTimerExpires.getStarted()) |
1080 | { | 1084 | { |
1081 | S32 dt_sec = (S32) mSaleTimerExpires.getRemainingTimeF32()+60; // Add a minute to prevent race conditions | 1085 | S32 dt_sec = (S32) mSaleTimerExpires.getRemainingTimeF32()+60; // Add a minute to prevent race conditions |
1082 | output_stream << "\t\t revert_sale " << dt_sec << "\n"; | 1086 | output_stream << "\t\t revert_sale " << dt_sec << "\n"; |
1083 | //output_stream << "\t\t revert_action " << revert_action_to_string(mExpireAction) << "\n"; | 1087 | //output_stream << "\t\t revert_action " << revert_action_to_string(mExpireAction) << "\n"; |
1084 | output_stream << "\t\t extended_grace " << mGraceExtension << "\n"; | 1088 | output_stream << "\t\t extended_grace " << mGraceExtension << "\n"; |
1085 | } | 1089 | } |
1086 | 1090 | ||
1087 | if(0 != mAuctionID) | 1091 | if(0 != mAuctionID) |
1088 | { | 1092 | { |
1089 | output_stream << "\t\t auction_id " << mAuctionID << "\n"; | 1093 | output_stream << "\t\t auction_id " << mAuctionID << "\n"; |
1090 | } | 1094 | } |
1091 | 1095 | ||
1092 | output_stream << "\t\t allow_modify " << getAllowModify() << "\n"; | 1096 | output_stream << "\t\t allow_modify " << getAllowModify() << "\n"; |
1093 | output_stream << "\t\t allow_group_modify " << getAllowGroupModify() << "\n"; | 1097 | output_stream << "\t\t allow_group_modify " << getAllowGroupModify() << "\n"; |
1094 | output_stream << "\t\t allow_all_object_entry " << getAllowAllObjectEntry() << "\n"; | 1098 | output_stream << "\t\t allow_all_object_entry " << getAllowAllObjectEntry() << "\n"; |
1095 | output_stream << "\t\t allow_group_object_entry " << getAllowGroupObjectEntry() << "\n"; | 1099 | output_stream << "\t\t allow_group_object_entry " << getAllowGroupObjectEntry() << "\n"; |
1096 | output_stream << "\t\t allow_terraform " << getAllowTerraform() << "\n"; | 1100 | output_stream << "\t\t allow_terraform " << getAllowTerraform() << "\n"; |
1097 | output_stream << "\t\t allow_deed_to_group " << getAllowDeedToGroup() << "\n"; | 1101 | output_stream << "\t\t allow_deed_to_group " << getAllowDeedToGroup() << "\n"; |
1098 | output_stream << "\t\t contribute_with_deed " << getContributeWithDeed() << "\n"; | 1102 | output_stream << "\t\t contribute_with_deed " << getContributeWithDeed() << "\n"; |
1099 | output_stream << "\t\t allow_damage " << getAllowDamage() << "\n"; | 1103 | output_stream << "\t\t allow_damage " << getAllowDamage() << "\n"; |
1100 | output_stream << "\t\t claim_date " << (S32)mClaimDate << "\n"; | 1104 | output_stream << "\t\t claim_date " << (S32)mClaimDate << "\n"; |
1101 | output_stream << "\t\t claim_price " << mClaimPricePerMeter << "\n"; | 1105 | output_stream << "\t\t claim_price " << mClaimPricePerMeter << "\n"; |
1102 | output_stream << "\t\t rent_price " << mRentPricePerMeter << "\n"; | 1106 | output_stream << "\t\t rent_price " << mRentPricePerMeter << "\n"; |
1103 | output_stream << "\t\t discount_rate " << mDiscountRate << "\n"; | 1107 | output_stream << "\t\t discount_rate " << mDiscountRate << "\n"; |
1104 | output_stream << "\t\t allow_fly " << (getAllowFly() ? 1 : 0) << "\n"; | 1108 | output_stream << "\t\t allow_fly " << (getAllowFly() ? 1 : 0) << "\n"; |
1105 | output_stream << "\t\t allow_landmark " << (getAllowLandmark() ? 1 : 0) << "\n"; | 1109 | output_stream << "\t\t allow_landmark " << (getAllowLandmark() ? 1 : 0) << "\n"; |
1106 | output_stream << "\t\t sound_local " << (getSoundLocal() ? 1 : 0) << "\n"; | 1110 | output_stream << "\t\t sound_local " << (getSoundLocal() ? 1 : 0) << "\n"; |
1107 | output_stream << "\t\t allow_scripts " << (getAllowOtherScripts() ? 1 : 0) << "\n"; | 1111 | output_stream << "\t\t allow_scripts " << (getAllowOtherScripts() ? 1 : 0) << "\n"; |
1108 | output_stream << "\t\t allow_group_scripts " << (getAllowGroupScripts() ? 1 : 0) << "\n"; | 1112 | output_stream << "\t\t allow_group_scripts " << (getAllowGroupScripts() ? 1 : 0) << "\n"; |
1109 | output_stream << "\t\t allow_voice_chat " << (getVoiceEnabled() ? 1 : 0) << "\n"; | 1113 | output_stream << "\t\t allow_voice_chat " << (getVoiceEnabled() ? 1 : 0) << "\n"; |
1110 | output_stream << "\t\t use_estate_voice_chan " << (getVoiceUseEstateChannel() ? 1 : 0) << "\n"; | 1114 | output_stream << "\t\t use_estate_voice_chan " << (getVoiceUseEstateChannel() ? 1 : 0) << "\n"; |
1111 | output_stream << "\t\t for_sale " << (getForSale() ? 1 : 0) << "\n"; | 1115 | output_stream << "\t\t for_sale " << (getForSale() ? 1 : 0) << "\n"; |
1112 | output_stream << "\t\t sell_w_objects " << (getSellWithObjects() ? 1 : 0) << "\n"; | 1116 | output_stream << "\t\t sell_w_objects " << (getSellWithObjects() ? 1 : 0) << "\n"; |
1113 | output_stream << "\t\t draw_distance " << mDrawDistance << "\n"; | 1117 | output_stream << "\t\t draw_distance " << mDrawDistance << "\n"; |
1114 | output_stream << "\t\t sale_price " << mSalePrice << "\n"; | 1118 | output_stream << "\t\t sale_price " << mSalePrice << "\n"; |
1115 | 1119 | ||
1116 | setting = (getParcelFlag(PF_USE_ACCESS_GROUP) ? 1 : 0); | 1120 | setting = (getParcelFlag(PF_USE_ACCESS_GROUP) ? 1 : 0); |
1117 | output_stream << "\t\t use_access_group " << setting << "\n"; | 1121 | output_stream << "\t\t use_access_group " << setting << "\n"; |
1118 | 1122 | ||
1119 | setting = (getParcelFlag(PF_USE_ACCESS_LIST) ? 1 : 0); | 1123 | setting = (getParcelFlag(PF_USE_ACCESS_LIST) ? 1 : 0); |
1120 | output_stream << "\t\t use_access_list " << setting << "\n"; | 1124 | output_stream << "\t\t use_access_list " << setting << "\n"; |
1121 | 1125 | ||
1122 | setting = (getParcelFlag(PF_USE_BAN_LIST) ? 1 : 0); | 1126 | setting = (getParcelFlag(PF_USE_BAN_LIST) ? 1 : 0); |
1123 | output_stream << "\t\t use_ban_list " << setting << "\n"; | 1127 | output_stream << "\t\t use_ban_list " << setting << "\n"; |
1124 | 1128 | ||
1125 | mGroupID.toString(id_string); | 1129 | mGroupID.toString(id_string); |
1126 | output_stream << "\t\t group_id " << id_string << "\n"; | 1130 | output_stream << "\t\t group_id " << id_string << "\n"; |
1127 | 1131 | ||
1128 | //const char* group_name | 1132 | //const char* group_name |
1129 | // = (mGroupName.isEmpty() ? "" : mGroupName.c_str() ); | 1133 | // = (mGroupName.isEmpty() ? "" : mGroupName.c_str() ); |
1130 | //output_stream << "\t\t group_name " << group_name << "\n"; | 1134 | //output_stream << "\t\t group_name " << group_name << "\n"; |
1131 | 1135 | ||
1132 | setting = (getParcelFlag(PF_USE_PASS_LIST) ? 1 : 0); | 1136 | setting = (getParcelFlag(PF_USE_PASS_LIST) ? 1 : 0); |
1133 | output_stream << "\t\t use_pass_list " << setting << "\n"; | 1137 | output_stream << "\t\t use_pass_list " << setting << "\n"; |
1134 | 1138 | ||
1135 | output_stream << "\t\t pass_price " << mPassPrice << "\n"; | 1139 | output_stream << "\t\t pass_price " << mPassPrice << "\n"; |
1136 | output_stream << "\t\t pass_hours " << mPassHours << "\n"; | 1140 | output_stream << "\t\t pass_hours " << mPassHours << "\n"; |
1137 | 1141 | ||
1138 | setting = (getParcelFlag(PF_SHOW_DIRECTORY) ? 1 : 0); | 1142 | setting = (getParcelFlag(PF_SHOW_DIRECTORY) ? 1 : 0); |
1139 | output_stream << "\t\t show_directory " << setting << "\n"; | 1143 | output_stream << "\t\t show_directory " << setting << "\n"; |
1140 | 1144 | ||
1141 | setting = (getParcelFlag(PF_ALLOW_PUBLISH) ? 1 : 0); | 1145 | setting = (getParcelFlag(PF_ALLOW_PUBLISH) ? 1 : 0); |
1142 | output_stream << "\t\t allow_publish " << setting << "\n"; | 1146 | output_stream << "\t\t allow_publish " << setting << "\n"; |
1143 | 1147 | ||
1144 | setting = (getParcelFlag(PF_MATURE_PUBLISH) ? 1 : 0); | 1148 | setting = (getParcelFlag(PF_MATURE_PUBLISH) ? 1 : 0); |
1145 | output_stream << "\t\t mature_publish " << setting << "\n"; | 1149 | output_stream << "\t\t mature_publish " << setting << "\n"; |
1146 | 1150 | ||
1147 | setting = (getParcelFlag(PF_DENY_ANONYMOUS) ? 1 : 0); | 1151 | setting = (getParcelFlag(PF_DENY_ANONYMOUS) ? 1 : 0); |
1148 | output_stream << "\t\t deny_anonymous " << setting << "\n"; | 1152 | output_stream << "\t\t deny_anonymous " << setting << "\n"; |
1149 | 1153 | ||
1150 | setting = (getParcelFlag(PF_DENY_IDENTIFIED) ? 1 : 0); | 1154 | // setting = (getParcelFlag(PF_DENY_IDENTIFIED) ? 1 : 0); |
1151 | output_stream << "\t\t deny_identified " << setting << "\n"; | 1155 | // output_stream << "\t\t deny_identified " << setting << "\n"; |
1152 | 1156 | ||
1153 | setting = (getParcelFlag(PF_DENY_TRANSACTED) ? 1 : 0); | 1157 | // setting = (getParcelFlag(PF_DENY_TRANSACTED) ? 1 : 0); |
1154 | output_stream << "\t\t deny_transacted " << setting << "\n"; | 1158 | // output_stream << "\t\t deny_transacted " << setting << "\n"; |
1155 | 1159 | ||
1156 | setting = (getParcelFlag(PF_RESTRICT_PUSHOBJECT) ? 1 : 0); | 1160 | setting = (getParcelFlag(PF_DENY_AGEUNVERIFIED) ? 1 : 0); |
1157 | output_stream << "\t\t restrict_pushobject " << setting << "\n"; | 1161 | output_stream << "\t\t deny_age_unverified " << setting << "\n"; |
1158 | 1162 | ||
1159 | output_stream << "\t\t aabb_min " | 1163 | setting = (getParcelFlag(PF_RESTRICT_PUSHOBJECT) ? 1 : 0); |
1160 | << mAABBMin.mV[VX] | 1164 | output_stream << "\t\t restrict_pushobject " << setting << "\n"; |
1161 | << " " << mAABBMin.mV[VY] | 1165 | |
1162 | << " " << mAABBMin.mV[VZ] << "\n"; | 1166 | output_stream << "\t\t aabb_min " |
1163 | 1167 | << mAABBMin.mV[VX] | |
1164 | if (!mAccessList.empty()) | 1168 | << " " << mAABBMin.mV[VY] |
1165 | { | 1169 | << " " << mAABBMin.mV[VZ] << "\n"; |
1166 | output_stream << "\t\t access_list " << mAccessList.size() << "\n"; | 1170 | |
1167 | access_map_const_iterator cit = mAccessList.begin(); | 1171 | if (!mAccessList.empty()) |
1168 | access_map_const_iterator end = mAccessList.end(); | 1172 | { |
1169 | 1173 | output_stream << "\t\t access_list " << mAccessList.size() << "\n"; | |
1170 | for ( ; cit != end; ++cit) | 1174 | access_map_const_iterator cit = mAccessList.begin(); |
1171 | { | 1175 | access_map_const_iterator end = mAccessList.end(); |
1172 | output_stream << "\t\t{\n"; | 1176 | |
1173 | const LLAccessEntry& entry = (*cit).second; | 1177 | for ( ; cit != end; ++cit) |
1174 | entry.mID.toString(id_string); | 1178 | { |
1175 | output_stream << "\t\t\tid " << id_string << "\n"; | 1179 | output_stream << "\t\t{\n"; |
1176 | output_stream << "\t\t\ttime " << entry.mTime << "\n"; | 1180 | const LLAccessEntry& entry = (*cit).second; |
1177 | output_stream << "\t\t\tflags " << entry.mFlags << "\n"; | 1181 | entry.mID.toString(id_string); |
1178 | output_stream << "\t\t}\n"; | 1182 | output_stream << "\t\t\tid " << id_string << "\n"; |
1179 | } | 1183 | output_stream << "\t\t\ttime " << entry.mTime << "\n"; |
1180 | } | 1184 | output_stream << "\t\t\tflags " << entry.mFlags << "\n"; |
1181 | 1185 | output_stream << "\t\t}\n"; | |
1182 | if (!mBanList.empty()) | 1186 | } |
1183 | { | 1187 | } |
1184 | output_stream << "\t\t ban_list " << mBanList.size() << "\n"; | 1188 | |
1185 | access_map_const_iterator cit = mBanList.begin(); | 1189 | if (!mBanList.empty()) |
1186 | access_map_const_iterator end = mBanList.end(); | 1190 | { |
1187 | 1191 | output_stream << "\t\t ban_list " << mBanList.size() << "\n"; | |
1188 | for ( ; cit != end; ++cit) | 1192 | access_map_const_iterator cit = mBanList.begin(); |
1189 | { | 1193 | access_map_const_iterator end = mBanList.end(); |
1190 | output_stream << "\t\t{\n"; | 1194 | |
1191 | const LLAccessEntry& entry = (*cit).second; | 1195 | for ( ; cit != end; ++cit) |
1192 | entry.mID.toString(id_string); | 1196 | { |
1193 | output_stream << "\t\t\tid " << id_string << "\n"; | 1197 | output_stream << "\t\t{\n"; |
1194 | output_stream << "\t\t\ttime " << entry.mTime << "\n"; | 1198 | const LLAccessEntry& entry = (*cit).second; |
1195 | output_stream << "\t\t\tflags " << entry.mFlags << "\n"; | 1199 | entry.mID.toString(id_string); |
1196 | output_stream << "\t\t}\n"; | 1200 | output_stream << "\t\t\tid " << id_string << "\n"; |
1197 | } | 1201 | output_stream << "\t\t\ttime " << entry.mTime << "\n"; |
1198 | } | 1202 | output_stream << "\t\t\tflags " << entry.mFlags << "\n"; |
1199 | 1203 | output_stream << "\t\t}\n"; | |
1200 | /*if (mRenterList.count() > 0) | 1204 | } |
1201 | { | 1205 | } |
1202 | output_stream << "\t\t renter_list " << mRenterList.count() << "\n"; | 1206 | |
1203 | for (i = 0; i < mRenterList.count(); i++) | 1207 | /*if (mRenterList.count() > 0) |
1204 | { | 1208 | { |
1205 | output_stream << "\t\t{\n"; | 1209 | output_stream << "\t\t renter_list " << mRenterList.count() << "\n"; |
1206 | const LLAccessEntry& entry = mRenterList.get(i); | 1210 | for (i = 0; i < mRenterList.count(); i++) |
1207 | entry.mID.toString(id_string); | 1211 | { |
1208 | output_stream << "\t\t\tid " << id_string << "\n"; | 1212 | output_stream << "\t\t{\n"; |
1209 | output_stream << "\t\t\ttime " << entry.mTime << "\n"; | 1213 | const LLAccessEntry& entry = mRenterList.get(i); |
1210 | output_stream << "\t\t\tflags " << entry.mFlags << "\n"; | 1214 | entry.mID.toString(id_string); |
1211 | output_stream << "\t\t}\n"; | 1215 | output_stream << "\t\t\tid " << id_string << "\n"; |
1212 | } | 1216 | output_stream << "\t\t\ttime " << entry.mTime << "\n"; |
1213 | }*/ | 1217 | output_stream << "\t\t\tflags " << entry.mFlags << "\n"; |
1214 | 1218 | output_stream << "\t\t}\n"; | |
1215 | output_stream << "\t}\n"; | 1219 | } |
1216 | output_stream.flags(old_flags); | 1220 | }*/ |
1217 | 1221 | ||
1218 | return TRUE; | 1222 | output_stream << "\t}\n"; |
1223 | output_stream.flags(old_flags); | ||
1224 | |||
1225 | return TRUE; | ||
1219 | } | 1226 | } |
1220 | 1227 | ||
1221 | 1228 | ||
1222 | // Assumes we are in a block "ParcelData" | 1229 | // Assumes we are in a block "ParcelData" |
1223 | void LLParcel::packMessage(LLMessageSystem* msg) | 1230 | void LLParcel::packMessage(LLMessageSystem* msg) |
1224 | { | 1231 | { |
1225 | msg->addU32Fast( _PREHASH_ParcelFlags, getParcelFlags() ); | 1232 | msg->addU32Fast( _PREHASH_ParcelFlags, getParcelFlags() ); |
1226 | msg->addS32Fast( _PREHASH_SalePrice, getSalePrice() ); | 1233 | msg->addS32Fast( _PREHASH_SalePrice, getSalePrice() ); |
1227 | msg->addStringFast( _PREHASH_Name, getName() ); | 1234 | msg->addStringFast( _PREHASH_Name, getName() ); |
1228 | msg->addStringFast( _PREHASH_Desc, getDesc() ); | 1235 | msg->addStringFast( _PREHASH_Desc, getDesc() ); |
1229 | msg->addStringFast( _PREHASH_MusicURL, getMusicURL() ); | 1236 | msg->addStringFast( _PREHASH_MusicURL, getMusicURL() ); |
1230 | msg->addStringFast( _PREHASH_MediaURL, getMediaURL() ); | 1237 | msg->addStringFast( _PREHASH_MediaURL, getMediaURL() ); |
1231 | msg->addU8 ( "MediaAutoScale", getMediaAutoScale () ); | 1238 | msg->addU8 ( "MediaAutoScale", getMediaAutoScale () ); |
1232 | msg->addUUIDFast( _PREHASH_MediaID, getMediaID() ); | 1239 | msg->addUUIDFast( _PREHASH_MediaID, getMediaID() ); |
1233 | msg->addUUIDFast( _PREHASH_GroupID, getGroupID() ); | 1240 | msg->addUUIDFast( _PREHASH_GroupID, getGroupID() ); |
1234 | msg->addS32Fast( _PREHASH_PassPrice, mPassPrice ); | 1241 | msg->addS32Fast( _PREHASH_PassPrice, mPassPrice ); |
1235 | msg->addF32Fast( _PREHASH_PassHours, mPassHours ); | 1242 | msg->addF32Fast( _PREHASH_PassHours, mPassHours ); |
1236 | msg->addU8Fast( _PREHASH_Category, (U8)mCategory); | 1243 | msg->addU8Fast( _PREHASH_Category, (U8)mCategory); |
1237 | msg->addUUIDFast( _PREHASH_AuthBuyerID, mAuthBuyerID); | 1244 | msg->addUUIDFast( _PREHASH_AuthBuyerID, mAuthBuyerID); |
1238 | msg->addUUIDFast( _PREHASH_SnapshotID, mSnapshotID); | 1245 | msg->addUUIDFast( _PREHASH_SnapshotID, mSnapshotID); |
1239 | msg->addVector3Fast(_PREHASH_UserLocation, mUserLocation); | 1246 | msg->addVector3Fast(_PREHASH_UserLocation, mUserLocation); |
1240 | msg->addVector3Fast(_PREHASH_UserLookAt, mUserLookAt); | 1247 | msg->addVector3Fast(_PREHASH_UserLookAt, mUserLookAt); |
1241 | msg->addU8Fast( _PREHASH_LandingType, (U8)mLandingType); | 1248 | msg->addU8Fast( _PREHASH_LandingType, (U8)mLandingType); |
1242 | } | 1249 | } |
1243 | 1250 | ||
1244 | 1251 | ||
1245 | void LLParcel::unpackMessage(LLMessageSystem* msg) | 1252 | void LLParcel::unpackMessage(LLMessageSystem* msg) |
1246 | { | 1253 | { |
1247 | char buffer[256]; /* Flawfinder: ignore */ | 1254 | char buffer[256]; /* Flawfinder: ignore */ |
1248 | 1255 | ||
1249 | msg->getU32Fast( _PREHASH_ParcelData,_PREHASH_ParcelFlags, mParcelFlags ); | 1256 | msg->getU32Fast( _PREHASH_ParcelData,_PREHASH_ParcelFlags, mParcelFlags ); |
1250 | msg->getS32Fast( _PREHASH_ParcelData,_PREHASH_SalePrice, mSalePrice ); | 1257 | msg->getS32Fast( _PREHASH_ParcelData,_PREHASH_SalePrice, mSalePrice ); |
1251 | msg->getStringFast( _PREHASH_ParcelData,_PREHASH_Name, 256, buffer ); | 1258 | msg->getStringFast( _PREHASH_ParcelData,_PREHASH_Name, 256, buffer ); |
1252 | setName(buffer); | 1259 | setName(buffer); |
1253 | msg->getStringFast( _PREHASH_ParcelData,_PREHASH_Desc, 256, buffer ); | 1260 | msg->getStringFast( _PREHASH_ParcelData,_PREHASH_Desc, 256, buffer ); |
1254 | setDesc(buffer); | 1261 | setDesc(buffer); |
1255 | msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MusicURL, 256, buffer ); | 1262 | msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MusicURL, 256, buffer ); |
1256 | setMusicURL(buffer); | 1263 | setMusicURL(buffer); |
1257 | msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MediaURL, 256, buffer ); | 1264 | msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MediaURL, 256, buffer ); |
1258 | setMediaURL(buffer); | 1265 | setMediaURL(buffer); |
1259 | 1266 | ||
1260 | // non-optimized version | 1267 | // non-optimized version |
1261 | msg->getU8 ( "ParcelData", "MediaAutoScale", mMediaAutoScale ); | 1268 | msg->getU8 ( "ParcelData", "MediaAutoScale", mMediaAutoScale ); |
1262 | 1269 | ||
1263 | msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_MediaID, mMediaID ); | 1270 | msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_MediaID, mMediaID ); |
1264 | msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_GroupID, mGroupID ); | 1271 | msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_GroupID, mGroupID ); |
1265 | msg->getS32Fast( _PREHASH_ParcelData,_PREHASH_PassPrice, mPassPrice ); | 1272 | msg->getS32Fast( _PREHASH_ParcelData,_PREHASH_PassPrice, mPassPrice ); |
1266 | msg->getF32Fast( _PREHASH_ParcelData,_PREHASH_PassHours, mPassHours ); | 1273 | msg->getF32Fast( _PREHASH_ParcelData,_PREHASH_PassHours, mPassHours ); |
1267 | U8 category; | 1274 | U8 category; |
1268 | msg->getU8Fast( _PREHASH_ParcelData,_PREHASH_Category, category); | 1275 | msg->getU8Fast( _PREHASH_ParcelData,_PREHASH_Category, category); |
1269 | mCategory = (ECategory)category; | 1276 | mCategory = (ECategory)category; |
1270 | msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_AuthBuyerID, mAuthBuyerID); | 1277 | msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_AuthBuyerID, mAuthBuyerID); |
1271 | msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_SnapshotID, mSnapshotID); | 1278 | msg->getUUIDFast( _PREHASH_ParcelData,_PREHASH_SnapshotID, mSnapshotID); |
1272 | msg->getVector3Fast(_PREHASH_ParcelData,_PREHASH_UserLocation, mUserLocation); | 1279 | msg->getVector3Fast(_PREHASH_ParcelData,_PREHASH_UserLocation, mUserLocation); |
1273 | msg->getVector3Fast(_PREHASH_ParcelData,_PREHASH_UserLookAt, mUserLookAt); | 1280 | msg->getVector3Fast(_PREHASH_ParcelData,_PREHASH_UserLookAt, mUserLookAt); |
1274 | U8 landing_type; | 1281 | U8 landing_type; |
1275 | msg->getU8Fast( _PREHASH_ParcelData,_PREHASH_LandingType, landing_type); | 1282 | msg->getU8Fast( _PREHASH_ParcelData,_PREHASH_LandingType, landing_type); |
1276 | mLandingType = (ELandingType)landing_type; | 1283 | mLandingType = (ELandingType)landing_type; |
1277 | } | 1284 | } |
1278 | 1285 | ||
1279 | 1286 | ||
1280 | void LLParcel::packAccessEntries(LLMessageSystem* msg, | 1287 | void LLParcel::packAccessEntries(LLMessageSystem* msg, |
1281 | const std::map<LLUUID,LLAccessEntry>& list) | 1288 | const std::map<LLUUID,LLAccessEntry>& list) |
1282 | { | 1289 | { |
1283 | access_map_const_iterator cit = list.begin(); | 1290 | access_map_const_iterator cit = list.begin(); |
1284 | access_map_const_iterator end = list.end(); | 1291 | access_map_const_iterator end = list.end(); |
1285 | 1292 | ||
1286 | if (cit == end) | 1293 | if (cit == end) |
1287 | { | 1294 | { |
1288 | msg->nextBlockFast(_PREHASH_List); | 1295 | msg->nextBlockFast(_PREHASH_List); |
1289 | msg->addUUIDFast(_PREHASH_ID, LLUUID::null ); | 1296 | msg->addUUIDFast(_PREHASH_ID, LLUUID::null ); |
1290 | msg->addS32Fast(_PREHASH_Time, 0 ); | 1297 | msg->addS32Fast(_PREHASH_Time, 0 ); |
1291 | msg->addU32Fast(_PREHASH_Flags, 0 ); | 1298 | msg->addU32Fast(_PREHASH_Flags, 0 ); |
1292 | return; | 1299 | return; |
1293 | } | 1300 | } |
1294 | 1301 | ||
1295 | for ( ; cit != end; ++cit) | 1302 | for ( ; cit != end; ++cit) |
1296 | { | 1303 | { |
1297 | const LLAccessEntry& entry = (*cit).second; | 1304 | const LLAccessEntry& entry = (*cit).second; |
1298 | 1305 | ||
1299 | msg->nextBlockFast(_PREHASH_List); | 1306 | msg->nextBlockFast(_PREHASH_List); |
1300 | msg->addUUIDFast(_PREHASH_ID, entry.mID ); | 1307 | msg->addUUIDFast(_PREHASH_ID, entry.mID ); |
1301 | msg->addS32Fast(_PREHASH_Time, entry.mTime ); | 1308 | msg->addS32Fast(_PREHASH_Time, entry.mTime ); |
1302 | msg->addU32Fast(_PREHASH_Flags, entry.mFlags ); | 1309 | msg->addU32Fast(_PREHASH_Flags, entry.mFlags ); |
1303 | } | 1310 | } |
1304 | } | 1311 | } |
1305 | 1312 | ||
1306 | 1313 | ||
1307 | void LLParcel::unpackAccessEntries(LLMessageSystem* msg, | 1314 | void LLParcel::unpackAccessEntries(LLMessageSystem* msg, |
1308 | std::map<LLUUID,LLAccessEntry>* list) | 1315 | std::map<LLUUID,LLAccessEntry>* list) |
1309 | { | 1316 | { |
1310 | LLUUID id; | 1317 | LLUUID id; |
1311 | S32 time; | 1318 | S32 time; |
1312 | U32 flags; | 1319 | U32 flags; |
1313 | 1320 | ||
1314 | S32 i; | 1321 | S32 i; |
1315 | S32 count = msg->getNumberOfBlocksFast(_PREHASH_List); | 1322 | S32 count = msg->getNumberOfBlocksFast(_PREHASH_List); |
1316 | for (i = 0; i < count; i++) | 1323 | for (i = 0; i < count; i++) |
1317 | { | 1324 | { |
1318 | msg->getUUIDFast(_PREHASH_List, _PREHASH_ID, id, i); | 1325 | msg->getUUIDFast(_PREHASH_List, _PREHASH_ID, id, i); |
1319 | msg->getS32Fast( _PREHASH_List, _PREHASH_Time, time, i); | 1326 | msg->getS32Fast( _PREHASH_List, _PREHASH_Time, time, i); |
1320 | msg->getU32Fast( _PREHASH_List, _PREHASH_Flags, flags, i); | 1327 | msg->getU32Fast( _PREHASH_List, _PREHASH_Flags, flags, i); |
1321 | 1328 | ||
1322 | if (id.notNull()) | 1329 | if (id.notNull()) |
1323 | { | 1330 | { |
1324 | LLAccessEntry entry; | 1331 | LLAccessEntry entry; |
1325 | entry.mID = id; | 1332 | entry.mID = id; |
1326 | entry.mTime = time; | 1333 | entry.mTime = time; |
1327 | entry.mFlags = flags; | 1334 | entry.mFlags = flags; |
1328 | 1335 | ||
1329 | (*list)[entry.mID] = entry; | 1336 | (*list)[entry.mID] = entry; |
1330 | } | 1337 | } |
1331 | } | 1338 | } |
1332 | } | 1339 | } |
1333 | 1340 | ||
1334 | 1341 | ||
1335 | void LLParcel::expirePasses(S32 now) | 1342 | void LLParcel::expirePasses(S32 now) |
1336 | { | 1343 | { |
1337 | access_map_iterator itor = mAccessList.begin(); | 1344 | access_map_iterator itor = mAccessList.begin(); |
1338 | while (itor != mAccessList.end()) | 1345 | while (itor != mAccessList.end()) |
1339 | { | 1346 | { |
1340 | const LLAccessEntry& entry = (*itor).second; | 1347 | const LLAccessEntry& entry = (*itor).second; |
1341 | 1348 | ||
1342 | if (entry.mTime != 0 && entry.mTime < now) | 1349 | if (entry.mTime != 0 && entry.mTime < now) |
1343 | { | 1350 | { |
1344 | mAccessList.erase(itor++); | 1351 | mAccessList.erase(itor++); |
1345 | } | 1352 | } |
1346 | else | 1353 | else |
1347 | { | 1354 | { |
1348 | ++itor; | 1355 | ++itor; |
1349 | } | 1356 | } |
1350 | } | 1357 | } |
1351 | } | 1358 | } |
1352 | 1359 | ||
1353 | 1360 | ||
1354 | bool LLParcel::operator==(const LLParcel &rhs) const | 1361 | bool LLParcel::operator==(const LLParcel &rhs) const |
1355 | { | 1362 | { |
1356 | if (mOwnerID != rhs.mOwnerID) | 1363 | if (mOwnerID != rhs.mOwnerID) |
1357 | return FALSE; | 1364 | return FALSE; |
1358 | 1365 | ||
1359 | if (mParcelFlags != rhs.mParcelFlags) | 1366 | if (mParcelFlags != rhs.mParcelFlags) |
1360 | return FALSE; | 1367 | return FALSE; |
1361 | 1368 | ||
1362 | if (mClaimDate != rhs.mClaimDate) | 1369 | if (mClaimDate != rhs.mClaimDate) |
1363 | return FALSE; | 1370 | return FALSE; |
1364 | 1371 | ||
1365 | if (mClaimPricePerMeter != rhs.mClaimPricePerMeter) | 1372 | if (mClaimPricePerMeter != rhs.mClaimPricePerMeter) |
1366 | return FALSE; | 1373 | return FALSE; |
1367 | 1374 | ||
1368 | if (mRentPricePerMeter != rhs.mRentPricePerMeter) | 1375 | if (mRentPricePerMeter != rhs.mRentPricePerMeter) |
1369 | return FALSE; | 1376 | return FALSE; |
1370 | 1377 | ||
1371 | return TRUE; | 1378 | return TRUE; |
1372 | } | 1379 | } |
1373 | 1380 | ||
1374 | // Calculate rent | 1381 | // Calculate rent |
1375 | S32 LLParcel::getTotalRent() const | 1382 | S32 LLParcel::getTotalRent() const |
1376 | { | 1383 | { |
1377 | return (S32)floor(0.5f + (F32)mArea * (F32)mRentPricePerMeter * (1.0f - mDiscountRate)); | 1384 | return (S32)floor(0.5f + (F32)mArea * (F32)mRentPricePerMeter * (1.0f - mDiscountRate)); |
1378 | } | 1385 | } |
1379 | 1386 | ||
1380 | F32 LLParcel::getAdjustedRentPerMeter() const | 1387 | F32 LLParcel::getAdjustedRentPerMeter() const |
1381 | { | 1388 | { |
1382 | return ((F32)mRentPricePerMeter * (1.0f - mDiscountRate)); | 1389 | return ((F32)mRentPricePerMeter * (1.0f - mDiscountRate)); |
1383 | } | 1390 | } |
1384 | 1391 | ||
1385 | LLVector3 LLParcel::getCenterpoint() const | 1392 | LLVector3 LLParcel::getCenterpoint() const |
1386 | { | 1393 | { |
1387 | LLVector3 rv; | 1394 | LLVector3 rv; |
1388 | rv.mV[VX] = (getAABBMin().mV[VX] + getAABBMax().mV[VX]) * 0.5f; | 1395 | rv.mV[VX] = (getAABBMin().mV[VX] + getAABBMax().mV[VX]) * 0.5f; |
1389 | rv.mV[VY] = (getAABBMin().mV[VY] + getAABBMax().mV[VY]) * 0.5f; | 1396 | rv.mV[VY] = (getAABBMin().mV[VY] + getAABBMax().mV[VY]) * 0.5f; |
1390 | rv.mV[VZ] = 0.0f; | 1397 | rv.mV[VZ] = 0.0f; |
1391 | return rv; | 1398 | return rv; |
1392 | } | 1399 | } |
1393 | 1400 | ||
1394 | void LLParcel::extendAABB(const LLVector3& box_min, const LLVector3& box_max) | 1401 | void LLParcel::extendAABB(const LLVector3& box_min, const LLVector3& box_max) |
1395 | { | 1402 | { |
1396 | // Patch up min corner of AABB | 1403 | // Patch up min corner of AABB |
1397 | S32 i; | 1404 | S32 i; |
1398 | for (i=0; i<3; i++) | 1405 | for (i=0; i<3; i++) |
1399 | { | 1406 | { |
1400 | if (box_min.mV[i] < mAABBMin.mV[i]) | 1407 | if (box_min.mV[i] < mAABBMin.mV[i]) |
1401 | { | 1408 | { |
1402 | mAABBMin.mV[i] = box_min.mV[i]; | 1409 | mAABBMin.mV[i] = box_min.mV[i]; |
1403 | } | 1410 | } |
1404 | } | 1411 | } |
1405 | 1412 | ||
1406 | // Patch up max corner of AABB | 1413 | // Patch up max corner of AABB |
1407 | for (i=0; i<3; i++) | 1414 | for (i=0; i<3; i++) |
1408 | { | 1415 | { |
1409 | if (box_max.mV[i] > mAABBMax.mV[i]) | 1416 | if (box_max.mV[i] > mAABBMax.mV[i]) |
1410 | { | 1417 | { |
1411 | mAABBMax.mV[i] = box_max.mV[i]; | 1418 | mAABBMax.mV[i] = box_max.mV[i]; |
1412 | } | 1419 | } |
1413 | } | 1420 | } |
1414 | } | 1421 | } |
1415 | 1422 | ||
1416 | BOOL LLParcel::addToAccessList(const LLUUID& agent_id, S32 time) | 1423 | BOOL LLParcel::addToAccessList(const LLUUID& agent_id, S32 time) |
1417 | { | 1424 | { |
1418 | if (!((mParcelFlags & PF_USE_ACCESS_LIST) || (mParcelFlags & PF_USE_PASS_LIST)) | 1425 | if (mAccessList.size() >= (U32) PARCEL_MAX_ACCESS_LIST) |
1419 | || mAccessList.size() >= (U32) PARCEL_MAX_ACCESS_LIST) | ||
1420 | { | 1426 | { |
1421 | // Not using access list, so not a rational thing to do | ||
1422 | return FALSE; | 1427 | return FALSE; |
1423 | } | 1428 | } |
1424 | if (agent_id == getOwnerID()) | 1429 | if (agent_id == getOwnerID()) |
@@ -1447,21 +1452,20 @@ BOOL LLParcel::addToAccessList(const LLUUID& agent_id, S32 time) | |||
1447 | ++itor; | 1452 | ++itor; |
1448 | } | 1453 | } |
1449 | } | 1454 | } |
1450 | 1455 | ||
1451 | removeFromBanList(agent_id); | 1456 | removeFromBanList(agent_id); |
1452 | 1457 | ||
1453 | LLAccessEntry new_entry; | 1458 | LLAccessEntry new_entry; |
1454 | new_entry.mID = agent_id; | 1459 | new_entry.mID = agent_id; |
1455 | new_entry.mTime = time; | 1460 | new_entry.mTime = time; |
1456 | new_entry.mFlags = 0x0; | 1461 | new_entry.mFlags = 0x0; |
1457 | mAccessList[new_entry.mID] = new_entry; | 1462 | mAccessList[new_entry.mID] = new_entry; |
1458 | return TRUE; | 1463 | return TRUE; |
1459 | } | 1464 | } |
1460 | 1465 | ||
1461 | BOOL LLParcel::addToBanList(const LLUUID& agent_id, S32 time) | 1466 | BOOL LLParcel::addToBanList(const LLUUID& agent_id, S32 time) |
1462 | { | 1467 | { |
1463 | if (!(mParcelFlags & PF_USE_BAN_LIST) | 1468 | if (mBanList.size() >= (U32) PARCEL_MAX_ACCESS_LIST) |
1464 | || mBanList.size() >= (U32) PARCEL_MAX_ACCESS_LIST) | ||
1465 | { | 1469 | { |
1466 | // Not using ban list, so not a rational thing to do | 1470 | // Not using ban list, so not a rational thing to do |
1467 | return FALSE; | 1471 | return FALSE; |
@@ -1471,127 +1475,127 @@ BOOL LLParcel::addToBanList(const LLUUID& agent_id, S32 time) | |||
1471 | // Can't add owner to these lists | 1475 | // Can't add owner to these lists |
1472 | return FALSE; | 1476 | return FALSE; |
1473 | } | 1477 | } |
1474 | 1478 | ||
1475 | access_map_iterator itor = mBanList.begin(); | 1479 | access_map_iterator itor = mBanList.begin(); |
1476 | while (itor != mBanList.end()) | 1480 | while (itor != mBanList.end()) |
1477 | { | 1481 | { |
1478 | const LLAccessEntry& entry = (*itor).second; | 1482 | const LLAccessEntry& entry = (*itor).second; |
1479 | if (entry.mID == agent_id) | 1483 | if (entry.mID == agent_id) |
1480 | { | 1484 | { |
1481 | if (time == 0 || (entry.mTime != 0 && entry.mTime < time)) | 1485 | if (time == 0 || (entry.mTime != 0 && entry.mTime < time)) |
1482 | { | 1486 | { |
1483 | mBanList.erase(itor++); | 1487 | mBanList.erase(itor++); |
1484 | } | 1488 | } |
1485 | else | 1489 | else |
1486 | { | 1490 | { |
1487 | // existing one expires later | 1491 | // existing one expires later |
1488 | return FALSE; | 1492 | return FALSE; |
1489 | } | 1493 | } |
1490 | } | 1494 | } |
1491 | else | 1495 | else |
1492 | { | 1496 | { |
1493 | ++itor; | 1497 | ++itor; |
1494 | } | 1498 | } |
1495 | } | 1499 | } |
1496 | 1500 | ||
1497 | removeFromAccessList(agent_id); | 1501 | removeFromAccessList(agent_id); |
1498 | 1502 | ||
1499 | LLAccessEntry new_entry; | 1503 | LLAccessEntry new_entry; |
1500 | new_entry.mID = agent_id; | 1504 | new_entry.mID = agent_id; |
1501 | new_entry.mTime = time; | 1505 | new_entry.mTime = time; |
1502 | new_entry.mFlags = 0x0; | 1506 | new_entry.mFlags = 0x0; |
1503 | mBanList[new_entry.mID] = new_entry; | 1507 | mBanList[new_entry.mID] = new_entry; |
1504 | return TRUE; | 1508 | return TRUE; |
1505 | } | 1509 | } |
1506 | 1510 | ||
1507 | BOOL remove_from_access_array(std::map<LLUUID,LLAccessEntry>* list, | 1511 | BOOL remove_from_access_array(std::map<LLUUID,LLAccessEntry>* list, |
1508 | const LLUUID& agent_id) | 1512 | const LLUUID& agent_id) |
1509 | { | 1513 | { |
1510 | BOOL removed = FALSE; | 1514 | BOOL removed = FALSE; |
1511 | access_map_iterator itor = list->begin(); | 1515 | access_map_iterator itor = list->begin(); |
1512 | while (itor != list->end()) | 1516 | while (itor != list->end()) |
1513 | { | 1517 | { |
1514 | const LLAccessEntry& entry = (*itor).second; | 1518 | const LLAccessEntry& entry = (*itor).second; |
1515 | if (entry.mID == agent_id) | 1519 | if (entry.mID == agent_id) |
1516 | { | 1520 | { |
1517 | list->erase(itor++); | 1521 | list->erase(itor++); |
1518 | removed = TRUE; | 1522 | removed = TRUE; |
1519 | } | 1523 | } |
1520 | else | 1524 | else |
1521 | { | 1525 | { |
1522 | ++itor; | 1526 | ++itor; |
1523 | } | 1527 | } |
1524 | } | 1528 | } |
1525 | return removed; | 1529 | return removed; |
1526 | } | 1530 | } |
1527 | 1531 | ||
1528 | BOOL LLParcel::removeFromAccessList(const LLUUID& agent_id) | 1532 | BOOL LLParcel::removeFromAccessList(const LLUUID& agent_id) |
1529 | { | 1533 | { |
1530 | return remove_from_access_array(&mAccessList, agent_id); | 1534 | return remove_from_access_array(&mAccessList, agent_id); |
1531 | } | 1535 | } |
1532 | 1536 | ||
1533 | BOOL LLParcel::removeFromBanList(const LLUUID& agent_id) | 1537 | BOOL LLParcel::removeFromBanList(const LLUUID& agent_id) |
1534 | { | 1538 | { |
1535 | return remove_from_access_array(&mBanList, agent_id); | 1539 | return remove_from_access_array(&mBanList, agent_id); |
1536 | } | 1540 | } |
1537 | 1541 | ||
1538 | // static | 1542 | // static |
1539 | const char* LLParcel::getOwnershipStatusString(EOwnershipStatus status) | 1543 | const char* LLParcel::getOwnershipStatusString(EOwnershipStatus status) |
1540 | { | 1544 | { |
1541 | return ownership_status_to_string(status); | 1545 | return ownership_status_to_string(status); |
1542 | } | 1546 | } |
1543 | 1547 | ||
1544 | // static | 1548 | // static |
1545 | const char* LLParcel::getCategoryString(ECategory category) | 1549 | const char* LLParcel::getCategoryString(ECategory category) |
1546 | { | 1550 | { |
1547 | return category_to_string(category); | 1551 | return category_to_string(category); |
1548 | } | 1552 | } |
1549 | 1553 | ||
1550 | // static | 1554 | // static |
1551 | const char* LLParcel::getCategoryUIString(ECategory category) | 1555 | const char* LLParcel::getCategoryUIString(ECategory category) |
1552 | { | 1556 | { |
1553 | return category_to_ui_string(category); | 1557 | return category_to_ui_string(category); |
1554 | } | 1558 | } |
1555 | 1559 | ||
1556 | // static | 1560 | // static |
1557 | LLParcel::ECategory LLParcel::getCategoryFromString(const char* string) | 1561 | LLParcel::ECategory LLParcel::getCategoryFromString(const char* string) |
1558 | { | 1562 | { |
1559 | return category_string_to_category(string); | 1563 | return category_string_to_category(string); |
1560 | } | 1564 | } |
1561 | 1565 | ||
1562 | // static | 1566 | // static |
1563 | LLParcel::ECategory LLParcel::getCategoryFromUIString(const char* string) | 1567 | LLParcel::ECategory LLParcel::getCategoryFromUIString(const char* string) |
1564 | { | 1568 | { |
1565 | return category_ui_string_to_category(string); | 1569 | return category_ui_string_to_category(string); |
1566 | } | 1570 | } |
1567 | 1571 | ||
1568 | // static | 1572 | // static |
1569 | const char* LLParcel::getActionString(LLParcel::EAction action) | 1573 | const char* LLParcel::getActionString(LLParcel::EAction action) |
1570 | { | 1574 | { |
1571 | S32 index = 0; | 1575 | S32 index = 0; |
1572 | if((action >= 0) && (action < LLParcel::A_COUNT)) | 1576 | if((action >= 0) && (action < LLParcel::A_COUNT)) |
1573 | { | 1577 | { |
1574 | index = action; | 1578 | index = action; |
1575 | } | 1579 | } |
1576 | else | 1580 | else |
1577 | { | 1581 | { |
1578 | index = A_COUNT; | 1582 | index = A_COUNT; |
1579 | } | 1583 | } |
1580 | return PARCEL_ACTION_STRING[index]; | 1584 | return PARCEL_ACTION_STRING[index]; |
1581 | } | 1585 | } |
1582 | 1586 | ||
1583 | BOOL LLParcel::isSaleTimerExpired(const U64& time) | 1587 | BOOL LLParcel::isSaleTimerExpired(const U64& time) |
1584 | { | 1588 | { |
1585 | if (mSaleTimerExpires.getStarted() == FALSE) | 1589 | if (mSaleTimerExpires.getStarted() == FALSE) |
1586 | { | 1590 | { |
1587 | return FALSE; | 1591 | return FALSE; |
1588 | } | 1592 | } |
1589 | BOOL expired = mSaleTimerExpires.checkExpirationAndReset(0.0); | 1593 | BOOL expired = mSaleTimerExpires.checkExpirationAndReset(0.0); |
1590 | if (expired) | 1594 | if (expired) |
1591 | { | 1595 | { |
1592 | mSaleTimerExpires.stop(); | 1596 | mSaleTimerExpires.stop(); |
1593 | } | 1597 | } |
1594 | return expired; | 1598 | return expired; |
1595 | } | 1599 | } |
1596 | 1600 | ||
1597 | 1601 | ||
@@ -1623,22 +1627,22 @@ void LLParcel::startSale(const LLUUID& buyer_id, BOOL is_buyer_group) | |||
1623 | 1627 | ||
1624 | void LLParcel::expireSale(U32& type, U8& flags, LLUUID& from_id, LLUUID& to_id) | 1628 | void LLParcel::expireSale(U32& type, U8& flags, LLUUID& from_id, LLUUID& to_id) |
1625 | { | 1629 | { |
1626 | mSaleTimerExpires.setTimerExpirySec(0.0); | 1630 | mSaleTimerExpires.setTimerExpirySec(0.0); |
1627 | mSaleTimerExpires.stop(); | 1631 | mSaleTimerExpires.stop(); |
1628 | setPreviousOwnerID(LLUUID::null); | 1632 | setPreviousOwnerID(LLUUID::null); |
1629 | setPreviouslyGroupOwned(FALSE); | 1633 | setPreviouslyGroupOwned(FALSE); |
1630 | setSellWithObjects(FALSE); | 1634 | setSellWithObjects(FALSE); |
1631 | type = TRANS_LAND_RELEASE; | 1635 | type = TRANS_LAND_RELEASE; |
1632 | mStatus = OS_NONE; | 1636 | mStatus = OS_NONE; |
1633 | flags = pack_transaction_flags(mGroupOwned, FALSE); | 1637 | flags = pack_transaction_flags(mGroupOwned, FALSE); |
1634 | mAuthBuyerID.setNull(); | 1638 | mAuthBuyerID.setNull(); |
1635 | from_id = mOwnerID; | 1639 | from_id = mOwnerID; |
1636 | mOwnerID.setNull(); | 1640 | mOwnerID.setNull(); |
1637 | to_id.setNull(); | 1641 | to_id.setNull(); |
1638 | } | 1642 | } |
1639 | 1643 | ||
1640 | void LLParcel::completeSale(U32& type, U8& flags, | 1644 | void LLParcel::completeSale(U32& type, U8& flags, |
1641 | LLUUID& to_id) | 1645 | LLUUID& to_id) |
1642 | { | 1646 | { |
1643 | mSaleTimerExpires.setTimerExpirySec(0.0); | 1647 | mSaleTimerExpires.setTimerExpirySec(0.0); |
1644 | mSaleTimerExpires.stop(); | 1648 | mSaleTimerExpires.stop(); |
@@ -1660,7 +1664,6 @@ void LLParcel::completeSale(U32& type, U8& flags, | |||
1660 | //should be cleared on sale. | 1664 | //should be cleared on sale. |
1661 | mAccessList.clear(); | 1665 | mAccessList.clear(); |
1662 | mBanList.clear(); | 1666 | mBanList.clear(); |
1663 | |||
1664 | } | 1667 | } |
1665 | 1668 | ||
1666 | void LLParcel::clearSale() | 1669 | void LLParcel::clearSale() |
@@ -1685,143 +1688,144 @@ void LLParcel::clearSale() | |||
1685 | 1688 | ||
1686 | BOOL LLParcel::isPublic() const | 1689 | BOOL LLParcel::isPublic() const |
1687 | { | 1690 | { |
1688 | return (mOwnerID.isNull()); | 1691 | return (mOwnerID.isNull()); |
1689 | } | 1692 | } |
1690 | 1693 | ||
1691 | BOOL LLParcel::isBuyerAuthorized(const LLUUID& buyer_id) const | 1694 | BOOL LLParcel::isBuyerAuthorized(const LLUUID& buyer_id) const |
1692 | { | 1695 | { |
1693 | if(mAuthBuyerID.isNull()) | 1696 | if(mAuthBuyerID.isNull()) |
1694 | { | 1697 | { |
1695 | return TRUE; | 1698 | return TRUE; |
1696 | } | 1699 | } |
1697 | return (mAuthBuyerID == buyer_id); | 1700 | return (mAuthBuyerID == buyer_id); |
1698 | } | 1701 | } |
1699 | 1702 | ||
1700 | void LLParcel::clearParcel() | 1703 | void LLParcel::clearParcel() |
1701 | { | 1704 | { |
1702 | overrideParcelFlags(PF_DEFAULT); | 1705 | overrideParcelFlags(PF_DEFAULT); |
1703 | setName(NULL); | 1706 | setName(NULL); |
1704 | setDesc(NULL); | 1707 | setDesc(NULL); |
1705 | setMusicURL(NULL); | 1708 | setMusicURL(NULL); |
1706 | setMediaURL(NULL); | 1709 | setMediaURL(NULL); |
1707 | setMediaID(LLUUID::null); | 1710 | setMediaID(LLUUID::null); |
1708 | setMediaAutoScale(0); | 1711 | setMediaAutoScale(0); |
1709 | setInEscrow(FALSE); | 1712 | setInEscrow(FALSE); |
1710 | setAuthorizedBuyerID(LLUUID::null); | 1713 | setAuthorizedBuyerID(LLUUID::null); |
1711 | setCategory(C_NONE); | 1714 | setCategory(C_NONE); |
1712 | setSnapshotID(LLUUID::null); | 1715 | setSnapshotID(LLUUID::null); |
1713 | setUserLocation(LLVector3::zero); | 1716 | setUserLocation(LLVector3::zero); |
1714 | setUserLookAt(LLVector3::x_axis); | 1717 | setUserLookAt(LLVector3::x_axis); |
1715 | setLandingType(L_LANDING_POINT); | 1718 | setLandingType(L_LANDING_POINT); |
1716 | setAuctionID(0); | 1719 | setAuctionID(0); |
1717 | setGroupID(LLUUID::null); | 1720 | setGroupID(LLUUID::null); |
1718 | setPassPrice(0); | 1721 | setPassPrice(0); |
1719 | setPassHours(0.f); | 1722 | setPassHours(0.f); |
1720 | mAccessList.clear(); | 1723 | mAccessList.clear(); |
1721 | mBanList.clear(); | 1724 | mBanList.clear(); |
1722 | //mRenterList.reset(); | 1725 | //mRenterList.reset(); |
1723 | } | 1726 | } |
1724 | 1727 | ||
1725 | void LLParcel::dump() | 1728 | void LLParcel::dump() |
1726 | { | 1729 | { |
1727 | llinfos << "parcel " << mLocalID << " area " << mArea << llendl; | 1730 | llinfos << "parcel " << mLocalID << " area " << mArea << llendl; |
1728 | llinfos << " name <" << mName << ">" << llendl; | 1731 | llinfos << " name <" << mName << ">" << llendl; |
1729 | llinfos << " desc <" << mDesc << ">" << llendl; | 1732 | llinfos << " desc <" << mDesc << ">" << llendl; |
1730 | } | 1733 | } |
1731 | 1734 | ||
1732 | const char* ownership_status_to_string(LLParcel::EOwnershipStatus status) | 1735 | const char* ownership_status_to_string(LLParcel::EOwnershipStatus status) |
1733 | { | 1736 | { |
1734 | if(status >= 0 && status < LLParcel::OS_COUNT) | 1737 | if(status >= 0 && status < LLParcel::OS_COUNT) |
1735 | { | 1738 | { |
1736 | return PARCEL_OWNERSHIP_STATUS_STRING[status]; | 1739 | return PARCEL_OWNERSHIP_STATUS_STRING[status]; |
1737 | } | 1740 | } |
1738 | return "none"; | 1741 | return "none"; |
1739 | } | 1742 | } |
1740 | 1743 | ||
1741 | LLParcel::EOwnershipStatus ownership_string_to_status(const char* s) | 1744 | LLParcel::EOwnershipStatus ownership_string_to_status(const char* s) |
1742 | { | 1745 | { |
1743 | for(S32 i = 0; i < LLParcel::OS_COUNT; ++i) | 1746 | for(S32 i = 0; i < LLParcel::OS_COUNT; ++i) |
1744 | { | 1747 | { |
1745 | if(0 == strcmp(s, PARCEL_OWNERSHIP_STATUS_STRING[i])) | 1748 | if(0 == strcmp(s, PARCEL_OWNERSHIP_STATUS_STRING[i])) |
1746 | { | 1749 | { |
1747 | return (LLParcel::EOwnershipStatus)i; | 1750 | return (LLParcel::EOwnershipStatus)i; |
1748 | } | 1751 | } |
1749 | } | 1752 | } |
1750 | return LLParcel::OS_NONE; | 1753 | return LLParcel::OS_NONE; |
1751 | } | 1754 | } |
1752 | 1755 | ||
1753 | //const char* revert_action_to_string(LLParcel::ESaleTimerExpireAction action) | 1756 | //const char* revert_action_to_string(LLParcel::ESaleTimerExpireAction action) |
1754 | //{ | 1757 | //{ |
1755 | // S32 index = 0; | 1758 | // S32 index = 0; |
1756 | // if(action >= 0 && action < LLParcel::STEA_COUNT) | 1759 | // if(action >= 0 && action < LLParcel::STEA_COUNT) |
1757 | // { | 1760 | // { |
1758 | // index = action; | 1761 | // index = action; |
1759 | // } | 1762 | // } |
1760 | // return PARCEL_SALE_TIMER_ACTION[index]; | 1763 | // return PARCEL_SALE_TIMER_ACTION[index]; |
1761 | //} | 1764 | //} |
1762 | 1765 | ||
1763 | //LLParcel::ESaleTimerExpireAction revert_string_to_action(const char* s) | 1766 | //LLParcel::ESaleTimerExpireAction revert_string_to_action(const char* s) |
1764 | //{ | 1767 | //{ |
1765 | // for(S32 i = 0; i < LLParcel::STEA_COUNT; ++i) | 1768 | // for(S32 i = 0; i < LLParcel::STEA_COUNT; ++i) |
1766 | // { | 1769 | // { |
1767 | // if(0 == strcmp(s, PARCEL_SALE_TIMER_ACTION[i])) | 1770 | // if(0 == strcmp(s, PARCEL_SALE_TIMER_ACTION[i])) |
1768 | // { | 1771 | // { |
1769 | // return (LLParcel::ESaleTimerExpireAction)i; | 1772 | // return (LLParcel::ESaleTimerExpireAction)i; |
1770 | // } | 1773 | // } |
1771 | // } | 1774 | // } |
1772 | // return LLParcel::STEA_REVERT; | 1775 | // return LLParcel::STEA_REVERT; |
1773 | //} | 1776 | //} |
1774 | 1777 | ||
1775 | const char* category_to_string(LLParcel::ECategory category) | 1778 | const char* category_to_string(LLParcel::ECategory category) |
1776 | { | 1779 | { |
1777 | S32 index = 0; | 1780 | S32 index = 0; |
1778 | if((category >= 0) && (category < LLParcel::C_COUNT)) | 1781 | if((category >= 0) && (category < LLParcel::C_COUNT)) |
1779 | { | 1782 | { |
1780 | index = category; | 1783 | index = category; |
1781 | } | 1784 | } |
1782 | return PARCEL_CATEGORY_STRING[index]; | 1785 | return PARCEL_CATEGORY_STRING[index]; |
1783 | } | 1786 | } |
1784 | 1787 | ||
1785 | const char* category_to_ui_string(LLParcel::ECategory category) | 1788 | const char* category_to_ui_string(LLParcel::ECategory category) |
1786 | { | 1789 | { |
1787 | S32 index = 0; | 1790 | S32 index = 0; |
1788 | if((category >= 0) && (category < LLParcel::C_COUNT)) | 1791 | if((category >= 0) && (category < LLParcel::C_COUNT)) |
1789 | { | 1792 | { |
1790 | index = category; | 1793 | index = category; |
1791 | } | 1794 | } |
1792 | else | 1795 | else |
1793 | { | 1796 | { |
1794 | // C_ANY = -1 , but the "Any" string is at the end of the list | 1797 | // C_ANY = -1 , but the "Any" string is at the end of the list |
1795 | index = ((S32) LLParcel::C_COUNT); | 1798 | index = ((S32) LLParcel::C_COUNT); |
1796 | } | 1799 | } |
1797 | return PARCEL_CATEGORY_UI_STRING[index]; | 1800 | return PARCEL_CATEGORY_UI_STRING[index]; |
1798 | } | 1801 | } |
1799 | 1802 | ||
1800 | LLParcel::ECategory category_string_to_category(const char* s) | 1803 | LLParcel::ECategory category_string_to_category(const char* s) |
1801 | { | 1804 | { |
1802 | for(S32 i = 0; i < LLParcel::C_COUNT; ++i) | 1805 | for(S32 i = 0; i < LLParcel::C_COUNT; ++i) |
1803 | { | 1806 | { |
1804 | if(0 == strcmp(s, PARCEL_CATEGORY_STRING[i])) | 1807 | if(0 == strcmp(s, PARCEL_CATEGORY_STRING[i])) |
1805 | { | 1808 | { |
1806 | return (LLParcel::ECategory)i; | 1809 | return (LLParcel::ECategory)i; |
1807 | } | 1810 | } |
1808 | } | 1811 | } |
1809 | llwarns << "Parcel category outside of possibilities " << s << llendl; | 1812 | llwarns << "Parcel category outside of possibilities " << s << llendl; |
1810 | return LLParcel::C_NONE; | 1813 | return LLParcel::C_NONE; |
1811 | } | 1814 | } |
1812 | 1815 | ||
1813 | LLParcel::ECategory category_ui_string_to_category(const char* s) | 1816 | LLParcel::ECategory category_ui_string_to_category(const char* s) |
1814 | { | 1817 | { |
1815 | for(S32 i = 0; i < LLParcel::C_COUNT; ++i) | 1818 | for(S32 i = 0; i < LLParcel::C_COUNT; ++i) |
1816 | { | 1819 | { |
1817 | if(0 == strcmp(s, PARCEL_CATEGORY_UI_STRING[i])) | 1820 | if(0 == strcmp(s, PARCEL_CATEGORY_UI_STRING[i])) |
1818 | { | 1821 | { |
1819 | return (LLParcel::ECategory)i; | 1822 | return (LLParcel::ECategory)i; |
1820 | } | 1823 | } |
1821 | } | 1824 | } |
1822 | // "Any" is a valid category for searches, and | 1825 | // "Any" is a valid category for searches, and |
1823 | // is a distinct option from "None" and "Other" | 1826 | // is a distinct option from "None" and "Other" |
1824 | return LLParcel::C_ANY; | 1827 | return LLParcel::C_ANY; |
1825 | } | 1828 | } |
1826 | 1829 | ||
1827 | 1830 | ||
1831 | |||
diff --git a/linden/indra/llinventory/llparcel.h b/linden/indra/llinventory/llparcel.h index 3af1824..a8143f2 100644 --- a/linden/indra/llinventory/llparcel.h +++ b/linden/indra/llinventory/llparcel.h | |||
@@ -253,8 +253,7 @@ public: | |||
253 | void setForSale(BOOL b) { setParcelFlag(PF_FOR_SALE, b); } | 253 | void setForSale(BOOL b) { setParcelFlag(PF_FOR_SALE, b); } |
254 | void setSoundOnly(BOOL b) { setParcelFlag(PF_SOUND_LOCAL, b); } | 254 | void setSoundOnly(BOOL b) { setParcelFlag(PF_SOUND_LOCAL, b); } |
255 | void setDenyAnonymous(BOOL b) { setParcelFlag(PF_DENY_ANONYMOUS, b); } | 255 | void setDenyAnonymous(BOOL b) { setParcelFlag(PF_DENY_ANONYMOUS, b); } |
256 | void setDenyIdentified(BOOL b) { setParcelFlag(PF_DENY_IDENTIFIED, b); } | 256 | void setDenyAgeUnverified(BOOL b) { setParcelFlag(PF_DENY_AGEUNVERIFIED, b); } |
257 | void setDenyTransacted(BOOL b) { setParcelFlag(PF_DENY_TRANSACTED, b); } | ||
258 | void setRestrictPushObject(BOOL b) { setParcelFlag(PF_RESTRICT_PUSHOBJECT, b); } | 257 | void setRestrictPushObject(BOOL b) { setParcelFlag(PF_RESTRICT_PUSHOBJECT, b); } |
259 | 258 | ||
260 | void setDrawDistance(F32 dist) { mDrawDistance = dist; } | 259 | void setDrawDistance(F32 dist) { mDrawDistance = dist; } |
@@ -444,10 +443,8 @@ public: | |||
444 | { return mRegionPushOverride; } | 443 | { return mRegionPushOverride; } |
445 | BOOL getRegionDenyAnonymousOverride() const | 444 | BOOL getRegionDenyAnonymousOverride() const |
446 | { return mRegionDenyAnonymousOverride; } | 445 | { return mRegionDenyAnonymousOverride; } |
447 | BOOL getRegionDenyIdentifiedOverride() const | 446 | BOOL getRegionDenyAgeUnverifiedOverride() const |
448 | { return mRegionDenyIdentifiedOverride; } | 447 | { return mRegionDenyAgeUnverifiedOverride; } |
449 | BOOL getRegionDenyTransactedOverride() const | ||
450 | { return mRegionDenyTransactedOverride; } | ||
451 | 448 | ||
452 | F32 getDrawDistance() const { return mDrawDistance; } | 449 | F32 getDrawDistance() const { return mDrawDistance; } |
453 | S32 getSalePrice() const { return mSalePrice; } | 450 | S32 getSalePrice() const { return mSalePrice; } |
@@ -471,7 +468,11 @@ public: | |||
471 | BOOL allowTerraformBy(const LLUUID &agent_id) const; | 468 | BOOL allowTerraformBy(const LLUUID &agent_id) const; |
472 | 469 | ||
473 | // Returns 0 if access is OK, otherwise a BA_ return code above. | 470 | // Returns 0 if access is OK, otherwise a BA_ return code above. |
474 | S32 blockAccess(const LLUUID& agent_id, const LLUUID& group_id, const BOOL is_agent_identified, const BOOL is_agent_transacted) const; | 471 | S32 blockAccess(const LLUUID& agent_id, |
472 | const LLUUID& group_id, | ||
473 | const BOOL is_agent_identified, | ||
474 | const BOOL is_agent_transacted, | ||
475 | const BOOL is_agent_ageverified) const; | ||
475 | 476 | ||
476 | // Only checks if the agent is explicitly banned from this parcel | 477 | // Only checks if the agent is explicitly banned from this parcel |
477 | BOOL isAgentBanned(const LLUUID& agent_id) const; | 478 | BOOL isAgentBanned(const LLUUID& agent_id) const; |
@@ -480,7 +481,8 @@ public: | |||
480 | const LLUUID& agent_id, | 481 | const LLUUID& agent_id, |
481 | const std::vector<LLUUID>& group_ids, | 482 | const std::vector<LLUUID>& group_ids, |
482 | const BOOL is_agent_identified, | 483 | const BOOL is_agent_identified, |
483 | const BOOL is_agent_transacted); | 484 | const BOOL is_agent_transacted, |
485 | const BOOL is_agent_ageverified); | ||
484 | 486 | ||
485 | bool operator==(const LLParcel &rhs) const; | 487 | bool operator==(const LLParcel &rhs) const; |
486 | 488 | ||
@@ -524,8 +526,7 @@ public: | |||
524 | void setCleanOtherTime(S32 time) { mCleanOtherTime = time; } | 526 | void setCleanOtherTime(S32 time) { mCleanOtherTime = time; } |
525 | void setRegionPushOverride(BOOL override) {mRegionPushOverride = override; } | 527 | void setRegionPushOverride(BOOL override) {mRegionPushOverride = override; } |
526 | void setRegionDenyAnonymousOverride(BOOL override) { mRegionDenyAnonymousOverride = override; } | 528 | void setRegionDenyAnonymousOverride(BOOL override) { mRegionDenyAnonymousOverride = override; } |
527 | void setRegionDenyIdentifiedOverride(BOOL override) { mRegionDenyIdentifiedOverride = override; } | 529 | void setRegionDenyAgeUnverifiedOverride(BOOL override) { mRegionDenyAgeUnverifiedOverride = override; } |
528 | void setRegionDenyTransactedOverride(BOOL override) { mRegionDenyTransactedOverride = override; } | ||
529 | 530 | ||
530 | // Accessors for parcel sellWithObjects | 531 | // Accessors for parcel sellWithObjects |
531 | void setPreviousOwnerID(LLUUID prev_owner) { mPreviousOwnerID = prev_owner; } | 532 | void setPreviousOwnerID(LLUUID prev_owner) { mPreviousOwnerID = prev_owner; } |
@@ -594,8 +595,7 @@ protected: | |||
594 | S32 mCleanOtherTime; | 595 | S32 mCleanOtherTime; |
595 | BOOL mRegionPushOverride; | 596 | BOOL mRegionPushOverride; |
596 | BOOL mRegionDenyAnonymousOverride; | 597 | BOOL mRegionDenyAnonymousOverride; |
597 | BOOL mRegionDenyIdentifiedOverride; | 598 | BOOL mRegionDenyAgeUnverifiedOverride; |
598 | BOOL mRegionDenyTransactedOverride; | ||
599 | 599 | ||
600 | 600 | ||
601 | public: | 601 | public: |
diff --git a/linden/indra/llinventory/llparcelflags.h b/linden/indra/llinventory/llparcelflags.h index d691d4d..1806142 100644 --- a/linden/indra/llinventory/llparcelflags.h +++ b/linden/indra/llinventory/llparcelflags.h | |||
@@ -58,16 +58,20 @@ const U32 PF_URL_WEB_PAGE = 1 << 19; // The "media URL" is an HTML page | |||
58 | const U32 PF_URL_RAW_HTML = 1 << 20; // The "media URL" is a raw HTML string like <H1>Foo</H1> | 58 | const U32 PF_URL_RAW_HTML = 1 << 20; // The "media URL" is a raw HTML string like <H1>Foo</H1> |
59 | const U32 PF_RESTRICT_PUSHOBJECT = 1 << 21; // Restrict push object to either on agent or on scripts owned by parcel owner | 59 | const U32 PF_RESTRICT_PUSHOBJECT = 1 << 21; // Restrict push object to either on agent or on scripts owned by parcel owner |
60 | const U32 PF_DENY_ANONYMOUS = 1 << 22; // Deny all non identified/transacted accounts | 60 | const U32 PF_DENY_ANONYMOUS = 1 << 22; // Deny all non identified/transacted accounts |
61 | const U32 PF_DENY_IDENTIFIED = 1 << 23; // Deny identified accounts | 61 | // const U32 PF_DENY_IDENTIFIED = 1 << 23; // Deny identified accounts |
62 | const U32 PF_DENY_TRANSACTED = 1 << 24; // Deny identified accounts | 62 | // const U32 PF_DENY_TRANSACTED = 1 << 24; // Deny identified accounts |
63 | const U32 PF_ALLOW_GROUP_SCRIPTS = 1 << 25; // Allow scripts owned by group | 63 | const U32 PF_ALLOW_GROUP_SCRIPTS = 1 << 25; // Allow scripts owned by group |
64 | const U32 PF_CREATE_GROUP_OBJECTS = 1 << 26; // Allow object creation by group members or objects | 64 | const U32 PF_CREATE_GROUP_OBJECTS = 1 << 26; // Allow object creation by group members or objects |
65 | const U32 PF_ALLOW_ALL_OBJECT_ENTRY = 1 << 27; // Allow all objects to enter a parcel | 65 | const U32 PF_ALLOW_ALL_OBJECT_ENTRY = 1 << 27; // Allow all objects to enter a parcel |
66 | const U32 PF_ALLOW_GROUP_OBJECT_ENTRY = 1 << 28; // Only allow group (and owner) objects to enter the parcel | 66 | const U32 PF_ALLOW_GROUP_OBJECT_ENTRY = 1 << 28; // Only allow group (and owner) objects to enter the parcel |
67 | const U32 PF_ALLOW_VOICE_CHAT = 1 << 29; // Allow residents to use voice chat on this parcel | 67 | const U32 PF_ALLOW_VOICE_CHAT = 1 << 29; // Allow residents to use voice chat on this parcel |
68 | const U32 PF_USE_ESTATE_VOICE_CHAN = 1 << 30; | 68 | const U32 PF_USE_ESTATE_VOICE_CHAN = 1 << 30; |
69 | const U32 PF_DENY_AGEUNVERIFIED = 1 << 31; // Prevent residents who aren't age-verified | ||
70 | // NOTE: At one point we have used all of the bits. | ||
71 | // We have deprecated two of them in 1.19.0 which *could* be reused, | ||
72 | // but only after we are certain there are no simstates using those bits. | ||
69 | 73 | ||
70 | const U32 PF_RESERVED = 1U << 31; | 74 | //const U32 PF_RESERVED = 1U << 31; |
71 | 75 | ||
72 | // If any of these are true the parcel is restricting access in some maner. | 76 | // If any of these are true the parcel is restricting access in some maner. |
73 | const U32 PF_USE_RESTRICTED_ACCESS = PF_USE_ACCESS_GROUP | 77 | const U32 PF_USE_RESTRICTED_ACCESS = PF_USE_ACCESS_GROUP |
@@ -75,8 +79,7 @@ const U32 PF_USE_RESTRICTED_ACCESS = PF_USE_ACCESS_GROUP | |||
75 | | PF_USE_BAN_LIST | 79 | | PF_USE_BAN_LIST |
76 | | PF_USE_PASS_LIST | 80 | | PF_USE_PASS_LIST |
77 | | PF_DENY_ANONYMOUS | 81 | | PF_DENY_ANONYMOUS |
78 | | PF_DENY_IDENTIFIED | 82 | | PF_DENY_AGEUNVERIFIED; |
79 | | PF_DENY_TRANSACTED; | ||
80 | const U32 PF_NONE = 0x00000000; | 83 | const U32 PF_NONE = 0x00000000; |
81 | const U32 PF_ALL = 0x7FFFFFFF; | 84 | const U32 PF_ALL = 0x7FFFFFFF; |
82 | const U32 PF_DEFAULT = PF_ALLOW_FLY | 85 | const U32 PF_DEFAULT = PF_ALLOW_FLY |
@@ -104,6 +107,7 @@ const S32 BA_NOT_IN_GROUP = 1; | |||
104 | const S32 BA_NOT_ON_LIST = 2; | 107 | const S32 BA_NOT_ON_LIST = 2; |
105 | const S32 BA_BANNED = 3; | 108 | const S32 BA_BANNED = 3; |
106 | const S32 BA_NO_ACCESS_LEVEL = 4; | 109 | const S32 BA_NO_ACCESS_LEVEL = 4; |
110 | const S32 BA_NOT_AGE_VERIFIED = 5; | ||
107 | 111 | ||
108 | // ParcelRelease flags | 112 | // ParcelRelease flags |
109 | const U32 PR_NONE = 0x0; | 113 | const U32 PR_NONE = 0x0; |