llparcel.h

Go to the documentation of this file.
00001 
00031 #ifndef LL_LLPARCEL_H
00032 #define LL_LLPARCEL_H
00033 
00034 #include <time.h>
00035 #include <iostream>
00036 
00037 #include "lluuid.h"
00038 #include "llparcelflags.h"
00039 #include "llpermissions.h"
00040 #include "v3math.h"
00041 
00042 
00043 // Grid out of which parcels taken is stepped every 4 meters.
00044 const F32 PARCEL_GRID_STEP_METERS       = 4.f;
00045 
00046 // Area of one "square" of parcel
00047 const S32 PARCEL_UNIT_AREA                      = 16;
00048 
00049 // Height _above_ground_ that parcel boundary ends
00050 const F32 PARCEL_HEIGHT = 50.f;
00051 
00052 //Height above ground which parcel boundries exist for explicitly banned avatars
00053 const F32 BAN_HEIGHT = 768.f;
00054 
00055 // Maximum number of entries in an access list
00056 const S32 PARCEL_MAX_ACCESS_LIST = 300;
00057 //Maximum number of entires in an update packet
00058 //for access/ban lists.
00059 const F32 PARCEL_MAX_ENTRIES_PER_PACKET = 48.f;
00060 
00061 // Weekly charge for listing a parcel in the directory
00062 const S32 PARCEL_DIRECTORY_FEE = 30;
00063 
00064 const S32 PARCEL_PASS_PRICE_DEFAULT = 10;
00065 const F32 PARCEL_PASS_HOURS_DEFAULT = 1.f;
00066 
00067 // Number of "chunks" in which parcel overlay data is sent
00068 // Chunk 0 = southern rows, entire width
00069 const S32 PARCEL_OVERLAY_CHUNKS = 4;
00070 
00071 // Bottom three bits are a color index for the land overlay
00072 const U8 PARCEL_COLOR_MASK      = 0x07;
00073 const U8 PARCEL_PUBLIC          = 0x00;
00074 const U8 PARCEL_OWNED           = 0x01;
00075 const U8 PARCEL_GROUP           = 0x02;
00076 const U8 PARCEL_SELF            = 0x03;
00077 const U8 PARCEL_FOR_SALE        = 0x04;
00078 const U8 PARCEL_AUCTION         = 0x05;
00079 // unused 0x06
00080 // unused 0x07
00081 // flag, unused 0x08
00082 // flag, unused 0x10
00083 const U8 PARCEL_SOUND_LOCAL = 0x20;
00084 const U8 PARCEL_WEST_LINE       = 0x40; // flag, property line on west edge
00085 const U8 PARCEL_SOUTH_LINE      = 0x80; // flag, property line on south edge
00086 
00087 // Transmission results for parcel properties
00088 const S32 PARCEL_RESULT_NO_DATA = -1;
00089 const S32 PARCEL_RESULT_SUCCESS = 0;    // got exactly one parcel
00090 const S32 PARCEL_RESULT_MULTIPLE = 1;   // got multiple parcels
00091 
00092 const S32 SELECTED_PARCEL_SEQ_ID = -10000;
00093 const S32 COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID =  -20000;
00094 const S32 COLLISION_BANNED_PARCEL_SEQ_ID = -30000;
00095 const S32 COLLISION_NOT_ON_LIST_PARCEL_SEQ_ID =  -40000;
00096 const S32 HOVERED_PARCEL_SEQ_ID =  -50000;
00097 
00098 const U32 RT_NONE       = 0x1 << 0;
00099 const U32 RT_OWNER      = 0x1 << 1;
00100 const U32 RT_GROUP      = 0x1 << 2;
00101 const U32 RT_OTHER      = 0x1 << 3;
00102 const U32 RT_LIST       = 0x1 << 4;
00103 const U32 RT_SELL       = 0x1 << 5;
00104 
00105 class LLMessageSystem;
00106 class LLSD;
00107 
00108 class LLAccessEntry
00109 {
00110 public:
00111         LLUUID          mID;
00112         S32                     mTime;
00113         U32                     mFlags;
00114 };
00115 
00116 typedef std::map<LLUUID,LLAccessEntry>::iterator access_map_iterator;
00117 typedef std::map<LLUUID,LLAccessEntry>::const_iterator access_map_const_iterator;
00118 
00119 class LLParcel
00120 {
00121 public:
00122         enum EOwnershipStatus
00123         {
00124                 OS_LEASED = 0,
00125                 OS_LEASE_PENDING = 1,
00126                 OS_ABANDONED = 2,
00127                 OS_COUNT = 3,
00128                 OS_NONE = -1
00129         };
00130         enum ECategory
00131         {
00132                 C_NONE = 0,
00133                 C_LINDEN,
00134                 C_ADULT,
00135                 C_ARTS,                 // "arts & culture"
00136                 C_BUSINESS,             // was "store"
00137                 C_EDUCATIONAL,
00138                 C_GAMING,               // was "game"
00139                 C_HANGOUT,              // was "gathering place"
00140                 C_NEWCOMER,
00141                 C_PARK,                 // "parks & nature"
00142                 C_RESIDENTIAL,  // was "homestead"
00143                 C_SHOPPING,
00144                 C_STAGE,
00145                 C_OTHER,
00146                 C_COUNT,
00147                 C_ANY = -1              // only useful in queries
00148         };
00149         enum EAction
00150         {
00151                 A_CREATE = 0,
00152                 A_RELEASE = 1,
00153                 A_ABSORB = 2,
00154                 A_ABSORBED = 3,
00155                 A_DIVIDE = 4,
00156                 A_DIVISION = 5,
00157                 A_ACQUIRE = 6,
00158                 A_RELINQUISH = 7,
00159                 A_CONFIRM = 8,
00160                 A_COUNT = 9,
00161                 A_UNKNOWN = -1
00162         };
00163 
00164         enum ELandingType
00165         {
00166                 L_NONE = 0,
00167                 L_LANDING_POINT = 1,
00168                 L_DIRECT = 2
00169         };
00170 
00171         // CREATORS
00172         LLParcel();
00173         LLParcel(
00174                 const LLUUID &owner_id,
00175                 BOOL modify,
00176                 BOOL terraform,
00177                 BOOL damage,
00178                 time_t claim_date,
00179                 S32 claim_price,
00180                 S32 rent_price,
00181                 S32 area,
00182                 S32 sim_object_limit,
00183                 F32 parcel_object_bonus,
00184                 BOOL is_group_owned = FALSE);
00185         virtual ~LLParcel();
00186 
00187         void init(
00188                 const LLUUID &owner_id,
00189                 BOOL modify,
00190                 BOOL terraform,
00191                 BOOL damage,
00192                 time_t claim_date,
00193                 S32 claim_price,
00194                 S32 rent_price,
00195                 S32 area,
00196                 S32 sim_object_limit,
00197                 F32 parcel_object_bonus,
00198                 BOOL is_group_owned = FALSE);
00199 
00200         // TODO: make an actual copy constructor for this
00201         void overrideParcelFlags(U32 flags);
00202         // if you specify an agent id here, the group id will be zeroed
00203         void overrideOwner(
00204                 const LLUUID& owner_id,
00205                 BOOL is_group_owned = FALSE);
00206         void overrideSaleTimerExpires(F32 secs_left) { mSaleTimerExpires.setTimerExpirySec(secs_left); }
00207 
00208         // MANIPULATORS
00209         void generateNewID() { mID.generate(); }
00210         void setName(const LLString& name);
00211         void setDesc(const LLString& desc);
00212         void setMusicURL(const LLString& url);
00213         void setMediaURL(const LLString& url);
00214         void    setMediaID(const LLUUID& id) { mMediaID = id; }
00215         void    setMediaAutoScale ( U8 flagIn ) { mMediaAutoScale = flagIn; }
00216         virtual void    setLocalID(S32 local_id);
00217 
00218         // blow away all the extra crap lurking in parcels, including urls, access lists, etc
00219         void clearParcel();
00220 
00221         // This value is not persisted out to the parcel file, it is only
00222         // a per-process blocker for attempts to purchase.
00223         void setInEscrow(bool in_escrow) { mInEscrow = in_escrow; }
00224 
00225         void setAuthorizedBuyerID(const LLUUID& id) { mAuthBuyerID = id; }
00226         //void overrideBuyerID(const LLUUID& id) { mBuyerID = id; }
00227         void setCategory(ECategory category) { mCategory = category; }
00228         void setSnapshotID(const LLUUID& id) { mSnapshotID = id; }
00229         void setUserLocation(const LLVector3& pos)      { mUserLocation = pos; }
00230         void setUserLookAt(const LLVector3& rot)        { mUserLookAt = rot; }
00231         void setLandingType(const ELandingType type) { mLandingType = type; }
00232 
00233         void setAuctionID(U32 auction_id) { mAuctionID = auction_id;}
00234 
00235         void    setAllParcelFlags(U32 flags);
00236         void    setParcelFlag(U32 flag, BOOL b);
00237 
00238         void    setArea(S32 area, S32 sim_object_limit);
00239         void    setDiscountRate(F32 rate);
00240 
00241         void    setAllowModify(BOOL b)  { setParcelFlag(PF_CREATE_OBJECTS, b); }
00242         void    setAllowGroupModify(BOOL b)     { setParcelFlag(PF_CREATE_GROUP_OBJECTS, b); }
00243         void    setAllowAllObjectEntry(BOOL b)  { setParcelFlag(PF_ALLOW_ALL_OBJECT_ENTRY, b); }
00244         void    setAllowGroupObjectEntry(BOOL b)        { setParcelFlag(PF_ALLOW_GROUP_OBJECT_ENTRY, b); }
00245         void    setAllowTerraform(BOOL b){setParcelFlag(PF_ALLOW_TERRAFORM, b); }
00246         void    setAllowDamage(BOOL b)  { setParcelFlag(PF_ALLOW_DAMAGE, b); }
00247         void    setAllowFly(BOOL b)             { setParcelFlag(PF_ALLOW_FLY, b); }
00248         void    setAllowLandmark(BOOL b){ setParcelFlag(PF_ALLOW_LANDMARK, b); }
00249         void    setAllowGroupScripts(BOOL b)    { setParcelFlag(PF_ALLOW_GROUP_SCRIPTS, b); }
00250         void    setAllowOtherScripts(BOOL b)    { setParcelFlag(PF_ALLOW_OTHER_SCRIPTS, b); }
00251         void    setAllowDeedToGroup(BOOL b) { setParcelFlag(PF_ALLOW_DEED_TO_GROUP, b); }
00252         void    setContributeWithDeed(BOOL b) { setParcelFlag(PF_CONTRIBUTE_WITH_DEED, b); }
00253         void    setForSale(BOOL b)              { setParcelFlag(PF_FOR_SALE, b); }
00254         void    setSoundOnly(BOOL b)    { setParcelFlag(PF_SOUND_LOCAL, b); }
00255         void    setDenyAnonymous(BOOL b) { setParcelFlag(PF_DENY_ANONYMOUS, b); }
00256         void    setDenyIdentified(BOOL b) { setParcelFlag(PF_DENY_IDENTIFIED, b); }
00257         void    setDenyTransacted(BOOL b) { setParcelFlag(PF_DENY_TRANSACTED, b); }
00258         void    setRestrictPushObject(BOOL b) { setParcelFlag(PF_RESTRICT_PUSHOBJECT, b); }
00259 
00260         void    setDrawDistance(F32 dist)       { mDrawDistance = dist; }
00261         void    setSalePrice(S32 price)         { mSalePrice = price; }
00262         void    setGroupID(const LLUUID& id)    { mGroupID = id; }
00263         //void  setGroupName(const LLString& s) { mGroupName.assign(s); }
00264         void    setPassPrice(S32 price)                         { mPassPrice = price; }
00265         void    setPassHours(F32 hours)                         { mPassHours = hours; }
00266 
00267         BOOL    importStream(std::istream& input_stream);
00268         BOOL    importAccessEntry(std::istream& input_stream, LLAccessEntry* entry);
00269         BOOL    exportStream(std::ostream& output_stream);
00270 
00271         void    packMessage(LLMessageSystem* msg);
00272         void    unpackMessage(LLMessageSystem* msg);
00273 
00274         void    packAccessEntries(LLMessageSystem* msg,
00275                                                                 const std::map<LLUUID,LLAccessEntry>& list);
00276         void    unpackAccessEntries(LLMessageSystem* msg,
00277                                                                 std::map<LLUUID,LLAccessEntry>* list);
00278 
00279         void    setAABBMin(const LLVector3& min)        { mAABBMin = min; }
00280         void    setAABBMax(const LLVector3& max)        { mAABBMax = max; }
00281 
00282         // Extend AABB to include rectangle from min to max.
00283         void extendAABB(const LLVector3& box_min, const LLVector3& box_max);
00284 
00285         void dump();
00286 
00287         // Scans the pass list and removes any items with an expiration
00288         // time earlier than "now".
00289         void expirePasses(S32 now);
00290 
00291         // Add to list, suppressing duplicates.  Returns TRUE if added.
00292         BOOL addToAccessList(const LLUUID& agent_id, S32 time);
00293         BOOL addToBanList(const LLUUID& agent_id, S32 time);
00294         BOOL removeFromAccessList(const LLUUID& agent_id);
00295         BOOL removeFromBanList(const LLUUID& agent_id);
00296 
00297         // ACCESSORS
00298         const LLUUID&   getID() const                           { return mID; }
00299         const LLString& getName() const                 { return mName; }
00300         const LLString& getDesc() const                 { return mDesc; }
00301         const LLString& getMusicURL() const             { return mMusicURL; }
00302         const LLString& getMediaURL() const             { return mMediaURL; }
00303         const LLUUID&   getMediaID() const                      { return mMediaID; }
00304         U8                              getMediaAutoScale() const       { return mMediaAutoScale; }
00305         S32                             getLocalID() const                      { return mLocalID; }
00306         const LLUUID&   getOwnerID() const                      { return mOwnerID; }
00307         const LLUUID&   getGroupID() const                      { return mGroupID; }
00308         S32                             getPassPrice() const            { return mPassPrice; }
00309         F32                             getPassHours() const            { return mPassHours; }
00310         BOOL                    getIsGroupOwned() const         { return mGroupOwned; }
00311 
00312         U32 getAuctionID() const        { return mAuctionID; }
00313         bool isInEscrow() const         { return mInEscrow; }
00314 
00315         BOOL isPublic() const;
00316 
00317         // Region-local user-specified position
00318         const LLVector3& getUserLocation() const        { return mUserLocation; }
00319         const LLVector3& getUserLookAt() const  { return mUserLookAt; }
00320         ELandingType getLandingType() const     { return mLandingType; }
00321 
00322         // User-specified snapshot
00323         const LLUUID&   getSnapshotID() const           { return mSnapshotID; }
00324 
00325         // the authorized buyer id is the person who is the only
00326         // agent/group that has authority to purchase. (ie, ui specified a
00327         // particular agent could buy the plot).
00328         const LLUUID& getAuthorizedBuyerID() const { return mAuthBuyerID; }
00329 
00330         // helper function
00331         BOOL isBuyerAuthorized(const LLUUID& buyer_id) const;
00332 
00333         // The buyer of a plot is set when someone indicates they want to
00334         // buy the plot, and the system is simply waiting for tier-up
00335         // approval
00336         //const LLUUID& getBuyerID() const { return mBuyerID; }
00337 
00338         // functions to deal with ownership status.
00339         EOwnershipStatus getOwnershipStatus() const { return mStatus; }
00340         static const char* getOwnershipStatusString(EOwnershipStatus status);
00341         void setOwnershipStatus(EOwnershipStatus status) { mStatus = status; }
00342 
00343         // dealing with parcel category information
00344         ECategory getCategory() const {return mCategory; }
00345         static const char* getCategoryString(ECategory category);
00346         static const char* getCategoryUIString(ECategory category);
00347         static ECategory getCategoryFromString(const char* string);
00348         static ECategory getCategoryFromUIString(const char* string);
00349 
00350         // functions for parcel action (used for logging)
00351         static const char* getActionString(EAction action);
00352 
00353         // dealing with sales and parcel conversion.
00354         //
00355         // the isSaleTimerExpired will trivially return FALSE if there is
00356         // no sale going on. Pass in the current time in usec which will
00357         // be used for comparison.
00358         BOOL isSaleTimerExpired(const U64& time);
00359 
00360         F32 getSaleTimerExpires() { return mSaleTimerExpires.getRemainingTimeF32(); }
00361 
00362         // should the parcel join on complete?
00363         //U32 getJoinNeighbors() const { return mJoinNeighbors; }
00364 
00365         // need to record a few things with the parcel when a sale
00366         // starts.
00367         void startSale(const LLUUID& buyer_id, BOOL is_buyer_group);
00368 
00369         // do the expiration logic, which needs to return values usable in
00370         // a L$ transaction.
00371         void expireSale(U32& type, U8& flags, LLUUID& from_id, LLUUID& to_id);
00372         void completeSale(U32& type, U8& flags, LLUUID& to_id);
00373         void clearSale();
00374 
00375         // this function returns TRUE if the parcel needs conversion to a
00376         // lease from a non-owned-status state.
00377         BOOL getRecordTransaction() const { return mRecordTransaction; }
00378         void setRecordTransaction(BOOL record) { mRecordTransaction = record; }
00379 
00380 
00381         // more accessors
00382         U32             getParcelFlags() const                  { return mParcelFlags; }
00383 
00384         BOOL    getParcelFlag(U32 flag) const
00385                                         { return (mParcelFlags & flag) ? TRUE : FALSE; }
00386 
00387         // objects can be added or modified by anyone (only parcel owner if disabled)
00388         BOOL    getAllowModify() const
00389                                         { return (mParcelFlags & PF_CREATE_OBJECTS) ? TRUE : FALSE; }
00390 
00391         // objects can be added or modified by group members
00392         BOOL    getAllowGroupModify() const
00393                                         { return (mParcelFlags & PF_CREATE_GROUP_OBJECTS) ? TRUE : FALSE; }
00394 
00395         // the parcel can be deeded to the group
00396         BOOL    getAllowDeedToGroup() const
00397                                         { return (mParcelFlags & PF_ALLOW_DEED_TO_GROUP) ? TRUE : FALSE; }
00398 
00399         // Does the owner want to make a contribution along with the deed.
00400         BOOL getContributeWithDeed() const
00401         { return (mParcelFlags & PF_CONTRIBUTE_WITH_DEED) ? TRUE : FALSE; }
00402 
00403         // heightfield can be modified
00404         BOOL    getAllowTerraform() const
00405                                         { return (mParcelFlags & PF_ALLOW_TERRAFORM) ? TRUE : FALSE; }
00406 
00407         // avatars can be hurt here
00408         BOOL    getAllowDamage() const
00409                                         { return (mParcelFlags & PF_ALLOW_DAMAGE) ? TRUE : FALSE; }
00410 
00411         BOOL    getAllowFly() const
00412                                         { return (mParcelFlags & PF_ALLOW_FLY) ? TRUE : FALSE; }
00413 
00414         BOOL    getAllowLandmark() const
00415                                         { return (mParcelFlags & PF_ALLOW_LANDMARK) ? TRUE : FALSE; }
00416 
00417         BOOL    getAllowGroupScripts() const
00418                                         { return (mParcelFlags & PF_ALLOW_GROUP_SCRIPTS) ? TRUE : FALSE; }
00419 
00420         BOOL    getAllowOtherScripts() const
00421                                         { return (mParcelFlags & PF_ALLOW_OTHER_SCRIPTS) ? TRUE : FALSE; }
00422 
00423         BOOL    getAllowAllObjectEntry() const
00424                                         { return (mParcelFlags & PF_ALLOW_ALL_OBJECT_ENTRY) ? TRUE : FALSE; }
00425 
00426         BOOL    getAllowGroupObjectEntry() const
00427                                         { return (mParcelFlags & PF_ALLOW_GROUP_OBJECT_ENTRY) ? TRUE : FALSE; }
00428 
00429         BOOL    getForSale() const
00430                                         { return (mParcelFlags & PF_FOR_SALE) ? TRUE : FALSE; }
00431         BOOL    getSoundLocal() const
00432                                         { return (mParcelFlags & PF_SOUND_LOCAL) ? TRUE : FALSE; }
00433         BOOL    getVoiceEnabled() const
00434                                         { return (mParcelFlags & PF_ALLOW_VOICE_CHAT) ? TRUE : FALSE; }
00435         BOOL    getVoiceUseEstateChannel() const
00436                                         { return (mParcelFlags & PF_USE_ESTATE_VOICE_CHAN) ? TRUE : FALSE; }
00437         BOOL    getAllowPublish() const
00438                                         { return (mParcelFlags & PF_ALLOW_PUBLISH) ? TRUE : FALSE; }
00439         BOOL    getMaturePublish() const
00440                                         { return (mParcelFlags & PF_MATURE_PUBLISH) ? TRUE : FALSE; }
00441         BOOL    getRestrictPushObject() const
00442                                         { return (mParcelFlags & PF_RESTRICT_PUSHOBJECT) ? TRUE : FALSE; }
00443         BOOL    getRegionPushOverride() const
00444                                         { return mRegionPushOverride; }
00445         BOOL    getRegionDenyAnonymousOverride() const
00446                                         { return mRegionDenyAnonymousOverride; }
00447         BOOL    getRegionDenyIdentifiedOverride() const
00448                                         { return mRegionDenyIdentifiedOverride; }
00449         BOOL    getRegionDenyTransactedOverride() const
00450                                         { return mRegionDenyTransactedOverride; }
00451 
00452         F32             getDrawDistance() const                 { return mDrawDistance; }
00453         S32             getSalePrice() const                    { return mSalePrice; }
00454         time_t  getClaimDate() const                    { return mClaimDate; }
00455         S32             getClaimPricePerMeter() const   { return mClaimPricePerMeter; }
00456         S32             getRentPricePerMeter() const    { return mRentPricePerMeter; }
00457 
00458         // Area is NOT automatically calculated.  You must calculate it
00459         // and store it with setArea.
00460         S32             getArea() const                                 { return mArea; }
00461 
00462         // deprecated 12/11/2003
00463         //F32           getDiscountRate() const                 { return mDiscountRate; }
00464 
00465         S32             getClaimPrice() const                   { return mClaimPricePerMeter * mArea; }
00466 
00467         // Can this agent create objects here?
00468         BOOL    allowModifyBy(const LLUUID &agent_id, const LLUUID &group_id) const;
00469 
00470         // Can this agent change the shape of the land?
00471         BOOL    allowTerraformBy(const LLUUID &agent_id) const;
00472 
00473         // Returns 0 if access is OK, otherwise a BA_ return code above.
00474         S32      blockAccess(const LLUUID& agent_id, const LLUUID& group_id, const BOOL is_agent_identified, const BOOL is_agent_transacted) const;
00475 
00476         // Only checks if the agent is explicitly banned from this parcel
00477         BOOL isAgentBanned(const LLUUID& agent_id) const;
00478 
00479         static bool isAgentBlockedFromParcel(LLParcel* parcelp, 
00480                                                                         const LLUUID& agent_id,
00481                                                                         const std::vector<LLUUID>& group_ids,
00482                                                                         const BOOL is_agent_identified,
00483                                                                         const BOOL is_agent_transacted);
00484 
00485         bool    operator==(const LLParcel &rhs) const;
00486 
00487         // Calculate rent - area * rent * discount rate
00488         S32             getTotalRent() const;
00489         F32             getAdjustedRentPerMeter() const;
00490 
00491         const LLVector3&        getAABBMin() const              { return mAABBMin; }
00492         const LLVector3&        getAABBMax() const              { return mAABBMax; }
00493         LLVector3 getCenterpoint() const;
00494 
00495         // simwide
00496         S32             getSimWideMaxPrimCapacity() const { return mSimWideMaxPrimCapacity; }
00497         S32 getSimWidePrimCount() const { return mSimWidePrimCount; }
00498 
00499         // this parcel only (not simwide)
00500         S32             getMaxPrimCapacity() const      { return mMaxPrimCapacity; }
00501         S32             getPrimCount() const            { return mOwnerPrimCount + mGroupPrimCount + mOtherPrimCount + mSelectedPrimCount; }
00502         S32             getOwnerPrimCount() const       { return mOwnerPrimCount; }
00503         S32             getGroupPrimCount() const       { return mGroupPrimCount; }
00504         S32             getOtherPrimCount() const       { return mOtherPrimCount; }
00505         S32             getSelectedPrimCount() const{ return mSelectedPrimCount; }
00506         S32             getTempPrimCount() const        { return mTempPrimCount; }
00507         F32             getParcelPrimBonus() const      { return mParcelPrimBonus; }
00508 
00509         S32             getCleanOtherTime() const                       { return mCleanOtherTime; }
00510 
00511         void    setMaxPrimCapacity(S32 max) { mMaxPrimCapacity = max; }
00512         // simwide
00513         void    setSimWideMaxPrimCapacity(S32 current)  { mSimWideMaxPrimCapacity = current; }
00514         void setSimWidePrimCount(S32 current) { mSimWidePrimCount = current; }
00515 
00516         // this parcel only (not simwide)
00517         void    setOwnerPrimCount(S32 current)  { mOwnerPrimCount = current; }
00518         void    setGroupPrimCount(S32 current)  { mGroupPrimCount = current; }
00519         void    setOtherPrimCount(S32 current)  { mOtherPrimCount = current; }
00520         void    setSelectedPrimCount(S32 current)       { mSelectedPrimCount = current; }
00521         void    setTempPrimCount(S32 current)   { mTempPrimCount = current; }
00522         void    setParcelPrimBonus(F32 bonus)   { mParcelPrimBonus = bonus; }
00523 
00524         void    setCleanOtherTime(S32 time)                                     { mCleanOtherTime = time; }
00525         void    setRegionPushOverride(BOOL override) {mRegionPushOverride = override; }
00526         void    setRegionDenyAnonymousOverride(BOOL override)   { mRegionDenyAnonymousOverride = override; }
00527         void    setRegionDenyIdentifiedOverride(BOOL override)  { mRegionDenyIdentifiedOverride = override; }
00528         void    setRegionDenyTransactedOverride(BOOL override)  { mRegionDenyTransactedOverride = override; }
00529 
00530         // Accessors for parcel sellWithObjects
00531         void    setPreviousOwnerID(LLUUID prev_owner)   { mPreviousOwnerID = prev_owner; }
00532         void    setPreviouslyGroupOwned(BOOL b)                 { mPreviouslyGroupOwned = b; }
00533         void    setSellWithObjects(BOOL b)                              { setParcelFlag(PF_SELL_PARCEL_OBJECTS, b); }
00534 
00535         LLUUID  getPreviousOwnerID() const              { return mPreviousOwnerID; }
00536         BOOL    getPreviouslyGroupOwned() const { return mPreviouslyGroupOwned; }
00537         BOOL    getSellWithObjects() const              { return (mParcelFlags & PF_SELL_PARCEL_OBJECTS) ? TRUE : FALSE; }
00538 
00539 protected:
00540         LLUUID mID;
00541         LLUUID                          mOwnerID;
00542         LLUUID                          mGroupID;
00543         BOOL                            mGroupOwned; // TRUE if mOwnerID is a group_id
00544         LLUUID                          mPreviousOwnerID;
00545         BOOL                            mPreviouslyGroupOwned;
00546 
00547         EOwnershipStatus mStatus;
00548         ECategory mCategory;
00549         LLUUID mAuthBuyerID;
00550         LLUUID mSnapshotID;
00551         LLVector3 mUserLocation;
00552         LLVector3 mUserLookAt;
00553         ELandingType mLandingType;
00554         LLTimer mSaleTimerExpires;
00555         S32 mGraceExtension;
00556         BOOL mRecordTransaction;
00557         
00558 
00559         // This value is non-zero if there is an auction associated with
00560         // the parcel.
00561         U32 mAuctionID;
00562 
00563         // value used to temporarily lock attempts to purchase the parcel.
00564         bool mInEscrow;
00565 
00566         time_t                          mClaimDate;                             // UTC Unix-format time
00567         S32                                     mClaimPricePerMeter;    // meter squared
00568         S32                                     mRentPricePerMeter;             // meter squared
00569         S32                                     mArea;                                  // meter squared
00570         F32                                     mDiscountRate;                  // 0.0-1.0
00571         F32                                     mDrawDistance;
00572         U32                                     mParcelFlags;
00573         S32                                     mSalePrice;                             // linden dollars
00574         LLString                        mName;
00575         LLString                        mDesc;
00576         LLString                        mMusicURL;
00577         LLString                        mMediaURL;
00578         U8                                      mMediaAutoScale;
00579         LLUUID                          mMediaID;
00580         S32                                     mPassPrice;
00581         F32                                     mPassHours;
00582         LLVector3                       mAABBMin;
00583         LLVector3                       mAABBMax;
00584         S32                                     mMaxPrimCapacity;
00585         S32                                     mSimWidePrimCount;
00586         S32                                     mSimWideMaxPrimCapacity;
00587         //S32                                   mSimWidePrimCorrection;
00588         S32                                     mOwnerPrimCount;
00589         S32                                     mGroupPrimCount;
00590         S32                                     mOtherPrimCount;
00591         S32                                     mSelectedPrimCount;
00592         S32                                     mTempPrimCount;
00593         F32                                     mParcelPrimBonus;
00594         S32                                     mCleanOtherTime;
00595         BOOL                            mRegionPushOverride;
00596         BOOL                            mRegionDenyAnonymousOverride;
00597         BOOL                            mRegionDenyIdentifiedOverride;
00598         BOOL                            mRegionDenyTransactedOverride;
00599 
00600 
00601 public:
00602         // HACK, make private
00603         S32                                     mLocalID;
00604         LLUUID                      mBanListTransactionID;
00605         LLUUID                      mAccessListTransactionID;
00606         std::map<LLUUID,LLAccessEntry>  mAccessList;
00607         std::map<LLUUID,LLAccessEntry>  mBanList;
00608         std::map<LLUUID,LLAccessEntry>  mTempBanList;
00609         std::map<LLUUID,LLAccessEntry>  mTempAccessList;
00610 };
00611 
00612 
00613 #endif

Generated on Thu Jul 1 06:08:59 2010 for Second Life Viewer by  doxygen 1.4.7