diff options
author | mingchen | 2008-05-13 16:22:57 +0000 |
---|---|---|
committer | mingchen | 2008-05-13 16:22:57 +0000 |
commit | 32785921d0a4a074b92da0f4ec322cf451a4642f (patch) | |
tree | ae93cc8fb09a5d7b991e323617e3324042e30a8d /OpenSim/Region/Environment/Modules/World/Land/LandObject.cs | |
parent | * Remove old historical grid inventory code (diff) | |
download | opensim-SC_OLD-32785921d0a4a074b92da0f4ec322cf451a4642f.zip opensim-SC_OLD-32785921d0a4a074b92da0f4ec322cf451a4642f.tar.gz opensim-SC_OLD-32785921d0a4a074b92da0f4ec322cf451a4642f.tar.bz2 opensim-SC_OLD-32785921d0a4a074b92da0f4ec322cf451a4642f.tar.xz |
*Complete redo of the permissions module
*Removed hardcoded permissions checks
*Added permissions checks where needed
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Land/LandObject.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Land/LandObject.cs | 82 |
1 files changed, 47 insertions, 35 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs index 2d3359c..0236e5f 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs | |||
@@ -127,12 +127,19 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
127 | 127 | ||
128 | public void updateLandProperties(LandUpdateArgs args, IClientAPI remote_client) | 128 | public void updateLandProperties(LandUpdateArgs args, IClientAPI remote_client) |
129 | { | 129 | { |
130 | if (remote_client.AgentId == landData.ownerID) | 130 | if (m_scene.ExternalChecks.ExternalChecksCanEditParcel(remote_client.AgentId,this)) |
131 | { | 131 | { |
132 | //Needs later group support | 132 | //Needs later group support |
133 | LandData newData = landData.Copy(); | 133 | LandData newData = landData.Copy(); |
134 | 134 | ||
135 | newData.authBuyerID = args.AuthBuyerID; | 135 | if (args.AuthBuyerID != newData.authBuyerID || args.SalePrice != newData.salePrice) |
136 | { | ||
137 | if (m_scene.ExternalChecks.ExternalChecksCanSellParcel(remote_client.AgentId, this)) | ||
138 | { | ||
139 | newData.authBuyerID = args.AuthBuyerID; | ||
140 | newData.salePrice = args.SalePrice; | ||
141 | } | ||
142 | } | ||
136 | newData.category = args.Category; | 143 | newData.category = args.Category; |
137 | newData.landDesc = args.Desc; | 144 | newData.landDesc = args.Desc; |
138 | newData.groupID = args.GroupID; | 145 | newData.groupID = args.GroupID; |
@@ -145,7 +152,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
145 | newData.landFlags = args.ParcelFlags; | 152 | newData.landFlags = args.ParcelFlags; |
146 | newData.passHours = args.PassHours; | 153 | newData.passHours = args.PassHours; |
147 | newData.passPrice = args.PassPrice; | 154 | newData.passPrice = args.PassPrice; |
148 | newData.salePrice = args.SalePrice; | ||
149 | newData.snapshotID = args.SnapshotID; | 155 | newData.snapshotID = args.SnapshotID; |
150 | newData.userLocation = args.UserLocation; | 156 | newData.userLocation = args.UserLocation; |
151 | newData.userLookAt = args.UserLookAt; | 157 | newData.userLookAt = args.UserLookAt; |
@@ -587,27 +593,30 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
587 | 593 | ||
588 | public void sendForceObjectSelect(int local_id, int request_type, IClientAPI remote_client) | 594 | public void sendForceObjectSelect(int local_id, int request_type, IClientAPI remote_client) |
589 | { | 595 | { |
590 | List<uint> resultLocalIDs = new List<uint>(); | 596 | if (m_scene.ExternalChecks.ExternalChecksCanEditParcel(remote_client.AgentId, this)) |
591 | foreach (SceneObjectGroup obj in primsOverMe) | ||
592 | { | 597 | { |
593 | if (obj.LocalId > 0) | 598 | List<uint> resultLocalIDs = new List<uint>(); |
599 | foreach (SceneObjectGroup obj in primsOverMe) | ||
594 | { | 600 | { |
595 | if (request_type == LandChannel.LAND_SELECT_OBJECTS_OWNER && obj.OwnerID == landData.ownerID) | 601 | if (obj.LocalId > 0) |
596 | { | 602 | { |
597 | resultLocalIDs.Add(obj.LocalId); | 603 | if (request_type == LandChannel.LAND_SELECT_OBJECTS_OWNER && obj.OwnerID == landData.ownerID) |
598 | } | 604 | { |
605 | resultLocalIDs.Add(obj.LocalId); | ||
606 | } | ||
599 | // else if (request_type == LandManager.LAND_SELECT_OBJECTS_GROUP && ...) // TODO: group support | 607 | // else if (request_type == LandManager.LAND_SELECT_OBJECTS_GROUP && ...) // TODO: group support |
600 | // { | 608 | // { |
601 | // } | 609 | // } |
602 | else if (request_type == LandChannel.LAND_SELECT_OBJECTS_OTHER && | 610 | else if (request_type == LandChannel.LAND_SELECT_OBJECTS_OTHER && |
603 | obj.OwnerID != remote_client.AgentId) | 611 | obj.OwnerID != remote_client.AgentId) |
604 | { | 612 | { |
605 | resultLocalIDs.Add(obj.LocalId); | 613 | resultLocalIDs.Add(obj.LocalId); |
614 | } | ||
606 | } | 615 | } |
607 | } | 616 | } |
608 | } | ||
609 | 617 | ||
610 | remote_client.sendForceClientSelectObjects(resultLocalIDs); | 618 | remote_client.sendForceClientSelectObjects(resultLocalIDs); |
619 | } | ||
611 | } | 620 | } |
612 | 621 | ||
613 | /// <summary> | 622 | /// <summary> |
@@ -620,32 +629,35 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
620 | /// </param> | 629 | /// </param> |
621 | public void sendLandObjectOwners(IClientAPI remote_client) | 630 | public void sendLandObjectOwners(IClientAPI remote_client) |
622 | { | 631 | { |
623 | Dictionary<LLUUID, int> primCount = new Dictionary<LLUUID, int>(); | 632 | if (m_scene.ExternalChecks.ExternalChecksCanEditParcel(remote_client.AgentId, this)) |
624 | |||
625 | foreach (SceneObjectGroup obj in primsOverMe) | ||
626 | { | 633 | { |
627 | try | 634 | Dictionary<LLUUID, int> primCount = new Dictionary<LLUUID, int>(); |
635 | |||
636 | foreach (SceneObjectGroup obj in primsOverMe) | ||
628 | { | 637 | { |
629 | if (!primCount.ContainsKey(obj.OwnerID)) | 638 | try |
630 | { | 639 | { |
631 | primCount.Add(obj.OwnerID, 0); | 640 | if (!primCount.ContainsKey(obj.OwnerID)) |
641 | { | ||
642 | primCount.Add(obj.OwnerID, 0); | ||
643 | } | ||
644 | } | ||
645 | catch (NullReferenceException) | ||
646 | { | ||
647 | m_log.Info("[LAND]: " + "Got Null Reference when searching land owners from the parcel panel"); | ||
648 | } | ||
649 | try | ||
650 | { | ||
651 | primCount[obj.OwnerID] += obj.PrimCount; | ||
652 | } | ||
653 | catch (KeyNotFoundException) | ||
654 | { | ||
655 | m_log.Error("[LAND]: Unable to match a prim with it's owner."); | ||
632 | } | 656 | } |
633 | } | 657 | } |
634 | catch (NullReferenceException) | ||
635 | { | ||
636 | m_log.Info("[LAND]: " + "Got Null Reference when searching land owners from the parcel panel"); | ||
637 | } | ||
638 | try | ||
639 | { | ||
640 | primCount[obj.OwnerID] += obj.PrimCount; | ||
641 | } | ||
642 | catch (KeyNotFoundException) | ||
643 | { | ||
644 | m_log.Error("[LAND]: Unable to match a prim with it's owner."); | ||
645 | } | ||
646 | } | ||
647 | 658 | ||
648 | remote_client.sendLandObjectOwners(primCount); | 659 | remote_client.sendLandObjectOwners(primCount); |
660 | } | ||
649 | } | 661 | } |
650 | 662 | ||
651 | public Dictionary<LLUUID, int> getLandObjectOwners() | 663 | public Dictionary<LLUUID, int> getLandObjectOwners() |