Implemented Return Objects when it's invoked from the Top Colliders or Top Scripts dialogs
							parent
							
								
									f283ff5949
								
							
						
					
					
						commit
						ac0f5e75bd
					
				|  | @ -1390,6 +1390,8 @@ namespace OpenSim.Region.CoreModules.World.Land | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) |         public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) | ||||||
|  |         { | ||||||
|  |             if (localID != -1) | ||||||
|             { |             { | ||||||
|                 ILandObject selectedParcel = null; |                 ILandObject selectedParcel = null; | ||||||
|                 lock (m_landList) |                 lock (m_landList) | ||||||
|  | @ -1401,6 +1403,54 @@ namespace OpenSim.Region.CoreModules.World.Land | ||||||
| 
 | 
 | ||||||
|                 selectedParcel.ReturnLandObjects(returnType, agentIDs, taskIDs, remoteClient); |                 selectedParcel.ReturnLandObjects(returnType, agentIDs, taskIDs, remoteClient); | ||||||
|             } |             } | ||||||
|  |             else | ||||||
|  |             { | ||||||
|  |                 if (returnType != 1) | ||||||
|  |                 { | ||||||
|  |                     m_log.WarnFormat("[LAND MANAGEMENT MODULE] ReturnObjectsInParcel: unknown return type {0}", returnType); | ||||||
|  |                     return; | ||||||
|  |                 } | ||||||
|  | 
 | ||||||
|  |                 // We get here when the user returns objects from the list of Top Colliders or Top Scripts. | ||||||
|  |                 // In that case we receive specific object UUID's, but no parcel ID. | ||||||
|  | 
 | ||||||
|  |                 Dictionary<UUID, HashSet<SceneObjectGroup>> returns = new Dictionary<UUID, HashSet<SceneObjectGroup>>(); | ||||||
|  | 
 | ||||||
|  |                 foreach (UUID groupID in taskIDs) | ||||||
|  |                 { | ||||||
|  |                     SceneObjectGroup obj = m_scene.GetSceneObjectGroup(groupID); | ||||||
|  |                     if (obj != null) | ||||||
|  |                     { | ||||||
|  |                         if (!returns.ContainsKey(obj.OwnerID)) | ||||||
|  |                             returns[obj.OwnerID] = new HashSet<SceneObjectGroup>(); | ||||||
|  |                         returns[obj.OwnerID].Add(obj); | ||||||
|  |                     } | ||||||
|  |                     else | ||||||
|  |                     { | ||||||
|  |                         m_log.WarnFormat("[LAND MANAGEMENT MODULE] ReturnObjectsInParcel: unknown object {0}", groupID); | ||||||
|  |                     } | ||||||
|  |                 } | ||||||
|  | 
 | ||||||
|  |                 int num = 0; | ||||||
|  |                 foreach (HashSet<SceneObjectGroup> objs in returns.Values) | ||||||
|  |                     num += objs.Count; | ||||||
|  |                 m_log.DebugFormat("[LAND MANAGEMENT MODULE] Returning {0} specific object(s)", num); | ||||||
|  | 
 | ||||||
|  |                 foreach (HashSet<SceneObjectGroup> objs in returns.Values) | ||||||
|  |                 { | ||||||
|  |                     List<SceneObjectGroup> objs2 = new List<SceneObjectGroup>(objs); | ||||||
|  |                     if (m_scene.Permissions.CanReturnObjects(null, remoteClient.AgentId, objs2)) | ||||||
|  |                     { | ||||||
|  |                         m_scene.returnObjects(objs2.ToArray(), remoteClient.AgentId); | ||||||
|  |                     } | ||||||
|  |                     else | ||||||
|  |                     { | ||||||
|  |                         m_log.WarnFormat("[LAND MANAGEMENT MODULE] ReturnObjectsInParcel: not permitted to return {0} object(s) belonging to user {1}", | ||||||
|  |                             objs2.Count, objs2[0].OwnerID); | ||||||
|  |                     } | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         } | ||||||
| 
 | 
 | ||||||
|         public void EventManagerOnNoLandDataFromStorage() |         public void EventManagerOnNoLandDataFromStorage() | ||||||
|         { |         { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Oren Hurvitz
						Oren Hurvitz