aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-04-06 02:34:51 +0100
committerJustin Clark-Casey (justincc)2013-04-06 02:34:51 +0100
commit7f070236f72058ba22d017048b978adea380f0a1 (patch)
tree946880909bc158d7aaf1e2170da2db32cf3a0278
parentWhen rezzing a coalesced object, check adjust position of all components. (diff)
downloadopensim-SC_OLD-7f070236f72058ba22d017048b978adea380f0a1.zip
opensim-SC_OLD-7f070236f72058ba22d017048b978adea380f0a1.tar.gz
opensim-SC_OLD-7f070236f72058ba22d017048b978adea380f0a1.tar.bz2
opensim-SC_OLD-7f070236f72058ba22d017048b978adea380f0a1.tar.xz
Fix taking (and rezzing) of coalesced objects in the non-root subregions of megaregions.
This fixes the combined bounding box location for regions bigger than 256x256. It also fixes the position on taking coalesced objects in the non-root regions, where position checks are properly done on rez instead. It also fixes the megaregion land channel to return null if the land does not exist, which should probably also be done for the ordinary land channels rather than returning a dummy region. Inspiration from Garmin's commit in http://opensimulator.org/mantis/view.php?id=6595. Thanks!
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs32
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs12
-rw-r--r--OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs83
4 files changed, 76 insertions, 53 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index ebada5a..f796ec9 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -357,19 +357,19 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
357 357
358 foreach (SceneObjectGroup objectGroup in objlist) 358 foreach (SceneObjectGroup objectGroup in objlist)
359 { 359 {
360 Vector3 inventoryStoredPosition = new Vector3 360// Vector3 inventoryStoredPosition = new Vector3
361 (((objectGroup.AbsolutePosition.X > (int)Constants.RegionSize) 361// (((objectGroup.AbsolutePosition.X > (int)Constants.RegionSize)
362 ? 250 362// ? 250
363 : objectGroup.AbsolutePosition.X) 363// : objectGroup.AbsolutePosition.X)
364 , 364// ,
365 (objectGroup.AbsolutePosition.Y > (int)Constants.RegionSize) 365// (objectGroup.AbsolutePosition.Y > (int)Constants.RegionSize)
366 ? 250 366// ? 250
367 : objectGroup.AbsolutePosition.Y, 367// : objectGroup.AbsolutePosition.Y,
368 objectGroup.AbsolutePosition.Z); 368// objectGroup.AbsolutePosition.Z);
369 369//
370 originalPositions[objectGroup.UUID] = objectGroup.AbsolutePosition; 370// originalPositions[objectGroup.UUID] = objectGroup.AbsolutePosition;
371 371//
372 objectGroup.AbsolutePosition = inventoryStoredPosition; 372// objectGroup.AbsolutePosition = inventoryStoredPosition;
373 373
374 // Make sure all bits but the ones we want are clear 374 // Make sure all bits but the ones we want are clear
375 // on take. 375 // on take.
@@ -397,9 +397,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
397 else 397 else
398 itemXml = SceneObjectSerializer.ToOriginalXmlFormat(objlist[0], !asAttachment); 398 itemXml = SceneObjectSerializer.ToOriginalXmlFormat(objlist[0], !asAttachment);
399 399
400 // Restore the position of each group now that it has been stored to inventory. 400// // Restore the position of each group now that it has been stored to inventory.
401 foreach (SceneObjectGroup objectGroup in objlist) 401// foreach (SceneObjectGroup objectGroup in objlist)
402 objectGroup.AbsolutePosition = originalPositions[objectGroup.UUID]; 402// objectGroup.AbsolutePosition = originalPositions[objectGroup.UUID];
403 403
404 InventoryItemBase item = CreateItemForObject(action, remoteClient, objlist[0], folderID); 404 InventoryItemBase item = CreateItemForObject(action, remoteClient, objlist[0], folderID);
405 405
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 79dd4a0..77299be 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -1453,6 +1453,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1453 1453
1454 bool permission = false; 1454 bool permission = false;
1455 1455
1456 m_log.DebugFormat("[PERMISSIONS MODULE]: Checking rez object at {0} in {1}", objectPosition, m_scene.Name);
1457
1456 ILandObject land = m_scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y); 1458 ILandObject land = m_scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y);
1457 if (land == null) return false; 1459 if (land == null) return false;
1458 1460
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 911a3e4..f50d3cd 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -5361,12 +5361,12 @@ namespace OpenSim.Region.Framework.Scenes
5361 List<SceneObjectGroup> objects, 5361 List<SceneObjectGroup> objects,
5362 out float minX, out float maxX, out float minY, out float maxY, out float minZ, out float maxZ) 5362 out float minX, out float maxX, out float minY, out float maxY, out float minZ, out float maxZ)
5363 { 5363 {
5364 minX = 256; 5364 minX = float.MaxValue;
5365 maxX = -256; 5365 maxX = float.MinValue;
5366 minY = 256; 5366 minY = float.MaxValue;
5367 maxY = -256; 5367 maxY = float.MinValue;
5368 minZ = 8192; 5368 minZ = float.MaxValue;
5369 maxZ = -256; 5369 maxZ = float.MinValue;
5370 5370
5371 List<Vector3> offsets = new List<Vector3>(); 5371 List<Vector3> offsets = new List<Vector3>();
5372 5372
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs
index b4abc1d..4bf2a82 100644
--- a/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs
+++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs
@@ -27,6 +27,8 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection;
31using log4net;
30using OpenMetaverse; 32using OpenMetaverse;
31using OpenSim.Framework; 33using OpenSim.Framework;
32using OpenSim.Region.Framework.Interfaces; 34using OpenSim.Region.Framework.Interfaces;
@@ -34,10 +36,10 @@ using OpenSim.Region.CoreModules.World.Land;
34 36
35namespace OpenSim.Region.RegionCombinerModule 37namespace OpenSim.Region.RegionCombinerModule
36{ 38{
37public class RegionCombinerLargeLandChannel : ILandChannel 39 public class RegionCombinerLargeLandChannel : ILandChannel
38 { 40 {
39 // private static readonly ILog m_log = 41// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
40 // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 42
41 private RegionData RegData; 43 private RegionData RegData;
42 private ILandChannel RootRegionLandChannel; 44 private ILandChannel RootRegionLandChannel;
43 private readonly List<RegionData> RegionConnections; 45 private readonly List<RegionData> RegionConnections;
@@ -75,40 +77,51 @@ public class RegionCombinerLargeLandChannel : ILandChannel
75 77
76 public ILandObject GetLandObject(int x, int y) 78 public ILandObject GetLandObject(int x, int y)
77 { 79 {
78 //m_log.DebugFormat("[BIGLANDTESTINT]: <{0},{1}>", x, y); 80 return GetLandObject((float)x, (float)y);
79 81
80 if (x > 0 && x <= (int)Constants.RegionSize && y > 0 && y <= (int)Constants.RegionSize) 82// m_log.DebugFormat("[BIGLANDTESTINT]: <{0},{1}>", x, y);
81 { 83//
82 return RootRegionLandChannel.GetLandObject(x, y); 84// if (x > 0 && x <= (int)Constants.RegionSize && y > 0 && y <= (int)Constants.RegionSize)
83 } 85// {
84 else 86// return RootRegionLandChannel.GetLandObject(x, y);
85 { 87// }
86 int offsetX = (x / (int)Constants.RegionSize); 88// else
87 int offsetY = (y / (int)Constants.RegionSize); 89// {
88 offsetX *= (int)Constants.RegionSize; 90// int offsetX = (x / (int)Constants.RegionSize);
89 offsetY *= (int)Constants.RegionSize; 91// int offsetY = (y / (int)Constants.RegionSize);
90 92// offsetX *= (int)Constants.RegionSize;
91 foreach (RegionData regionData in RegionConnections) 93// offsetY *= (int)Constants.RegionSize;
92 { 94//
93 if (regionData.Offset.X == offsetX && regionData.Offset.Y == offsetY) 95// foreach (RegionData regionData in RegionConnections)
94 { 96// {
95 return regionData.RegionScene.LandChannel.GetLandObject(x - offsetX, y - offsetY); 97// if (regionData.Offset.X == offsetX && regionData.Offset.Y == offsetY)
96 } 98// {
97 } 99// m_log.DebugFormat(
98 ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene); 100// "[REGION COMBINER LARGE LAND CHANNEL]: Found region {0} at offset {1},{2}",
99 obj.LandData.Name = "NO LAND"; 101// regionData.RegionScene.Name, offsetX, offsetY);
100 return obj; 102//
101 } 103// return regionData.RegionScene.LandChannel.GetLandObject(x - offsetX, y - offsetY);
104// }
105// }
106// //ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene);
107// //obj.LandData.Name = "NO LAND";
108// //return obj;
109// }
110//
111// m_log.DebugFormat("[REGION COMBINER LARGE LAND CHANNEL]: No region found at {0},{1}, returning null", x, y);
112//
113// return null;
102 } 114 }
103 115
104 public ILandObject GetLandObject(int localID) 116 public ILandObject GetLandObject(int localID)
105 { 117 {
118 // XXX: Possibly should be looking in every land channel, not just the root.
106 return RootRegionLandChannel.GetLandObject(localID); 119 return RootRegionLandChannel.GetLandObject(localID);
107 } 120 }
108 121
109 public ILandObject GetLandObject(float x, float y) 122 public ILandObject GetLandObject(float x, float y)
110 { 123 {
111 //m_log.DebugFormat("[BIGLANDTESTFLOAT]: <{0},{1}>", x, y); 124// m_log.DebugFormat("[BIGLANDTESTFLOAT]: <{0},{1}>", x, y);
112 125
113 if (x > 0 && x <= (int)Constants.RegionSize && y > 0 && y <= (int)Constants.RegionSize) 126 if (x > 0 && x <= (int)Constants.RegionSize && y > 0 && y <= (int)Constants.RegionSize)
114 { 127 {
@@ -125,14 +138,22 @@ public class RegionCombinerLargeLandChannel : ILandChannel
125 { 138 {
126 if (regionData.Offset.X == offsetX && regionData.Offset.Y == offsetY) 139 if (regionData.Offset.X == offsetX && regionData.Offset.Y == offsetY)
127 { 140 {
141// m_log.DebugFormat(
142// "[REGION COMBINER LARGE LAND CHANNEL]: Found region {0} at offset {1},{2}",
143// regionData.RegionScene.Name, offsetX, offsetY);
144
128 return regionData.RegionScene.LandChannel.GetLandObject(x - offsetX, y - offsetY); 145 return regionData.RegionScene.LandChannel.GetLandObject(x - offsetX, y - offsetY);
129 } 146 }
130 } 147 }
131 148
132 ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene); 149// ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene);
133 obj.LandData.Name = "NO LAND"; 150// obj.LandData.Name = "NO LAND";
134 return obj; 151// return obj;
135 } 152 }
153
154// m_log.DebugFormat("[REGION COMBINER LARGE LAND CHANNEL]: No region found at {0},{1}, returning null", x, y);
155
156 return null;
136 } 157 }
137 158
138 public bool IsForcefulBansAllowed() 159 public bool IsForcefulBansAllowed()