aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World
diff options
context:
space:
mode:
authorOren Hurvitz2012-12-12 17:10:08 +0200
committerJustin Clark-Casey (justincc)2013-01-02 21:59:01 +0000
commit70695a6ed96064f0bfd94a6e0c6da935b6e8f908 (patch)
treeea5d7ce03ecd88fb2fb8a446e5d41e10b4141899 /OpenSim/Region/CoreModules/World
parentAdd "show animations" console command for debug purposes. (diff)
downloadopensim-SC-70695a6ed96064f0bfd94a6e0c6da935b6e8f908.zip
opensim-SC-70695a6ed96064f0bfd94a6e0c6da935b6e8f908.tar.gz
opensim-SC-70695a6ed96064f0bfd94a6e0c6da935b6e8f908.tar.bz2
opensim-SC-70695a6ed96064f0bfd94a6e0c6da935b6e8f908.tar.xz
Implemented Return Objects when it's invoked from the Top Colliders or Top Scripts dialogs
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs60
1 files changed, 55 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 7149aad..e85b7a2 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -1395,15 +1395,65 @@ namespace OpenSim.Region.CoreModules.World.Land
1395 1395
1396 public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) 1396 public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient)
1397 { 1397 {
1398 ILandObject selectedParcel = null; 1398 if (localID != -1)
1399 lock (m_landList)
1400 { 1399 {
1401 m_landList.TryGetValue(localID, out selectedParcel); 1400 ILandObject selectedParcel = null;
1401 lock (m_landList)
1402 {
1403 m_landList.TryGetValue(localID, out selectedParcel);
1404 }
1405
1406 if (selectedParcel == null) return;
1407
1408 selectedParcel.ReturnLandObjects(returnType, agentIDs, taskIDs, remoteClient);
1402 } 1409 }
1410 else
1411 {
1412 if (returnType != 1)
1413 {
1414 m_log.WarnFormat("[LAND MANAGEMENT MODULE] ReturnObjectsInParcel: unknown return type {0}", returnType);
1415 return;
1416 }
1417
1418 // We get here when the user returns objects from the list of Top Colliders or Top Scripts.
1419 // In that case we receive specific object UUID's, but no parcel ID.
1403 1420
1404 if (selectedParcel == null) return; 1421 Dictionary<UUID, HashSet<SceneObjectGroup>> returns = new Dictionary<UUID, HashSet<SceneObjectGroup>>();
1405 1422
1406 selectedParcel.ReturnLandObjects(returnType, agentIDs, taskIDs, remoteClient); 1423 foreach (UUID groupID in taskIDs)
1424 {
1425 SceneObjectGroup obj = m_scene.GetSceneObjectGroup(groupID);
1426 if (obj != null)
1427 {
1428 if (!returns.ContainsKey(obj.OwnerID))
1429 returns[obj.OwnerID] = new HashSet<SceneObjectGroup>();
1430 returns[obj.OwnerID].Add(obj);
1431 }
1432 else
1433 {
1434 m_log.WarnFormat("[LAND MANAGEMENT MODULE] ReturnObjectsInParcel: unknown object {0}", groupID);
1435 }
1436 }
1437
1438 int num = 0;
1439 foreach (HashSet<SceneObjectGroup> objs in returns.Values)
1440 num += objs.Count;
1441 m_log.DebugFormat("[LAND MANAGEMENT MODULE] Returning {0} specific object(s)", num);
1442
1443 foreach (HashSet<SceneObjectGroup> objs in returns.Values)
1444 {
1445 List<SceneObjectGroup> objs2 = new List<SceneObjectGroup>(objs);
1446 if (m_scene.Permissions.CanReturnObjects(null, remoteClient.AgentId, objs2))
1447 {
1448 m_scene.returnObjects(objs2.ToArray(), remoteClient.AgentId);
1449 }
1450 else
1451 {
1452 m_log.WarnFormat("[LAND MANAGEMENT MODULE] ReturnObjectsInParcel: not permitted to return {0} object(s) belonging to user {1}",
1453 objs2.Count, objs2[0].OwnerID);
1454 }
1455 }
1456 }
1407 } 1457 }
1408 1458
1409 public void EventManagerOnNoLandDataFromStorage() 1459 public void EventManagerOnNoLandDataFromStorage()