aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorMelanie2009-10-02 19:04:46 +0100
committerMelanie2009-10-02 19:04:46 +0100
commit46955f42608ceb2b76731432f536e04e85521a12 (patch)
tree37e8591bd95de33ad0c485626c6f40f7d4bd91b5 /OpenSim/Region/Framework
parentRevert "* Adding Scale to EntityBase * Fixing the incorrect initialization of... (diff)
parentAdded a default for grid services in standalone. (diff)
downloadopensim-SC_OLD-46955f42608ceb2b76731432f536e04e85521a12.zip
opensim-SC_OLD-46955f42608ceb2b76731432f536e04e85521a12.tar.gz
opensim-SC_OLD-46955f42608ceb2b76731432f536e04e85521a12.tar.bz2
opensim-SC_OLD-46955f42608ceb2b76731432f536e04e85521a12.tar.xz
Merge branch 'master' into vehicles
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/ILandObject.cs72
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs18
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs12
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs31
4 files changed, 70 insertions, 63 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/ILandObject.cs b/OpenSim/Region/Framework/Interfaces/ILandObject.cs
index a4e90d2..c2b1292 100644
--- a/OpenSim/Region/Framework/Interfaces/ILandObject.cs
+++ b/OpenSim/Region/Framework/Interfaces/ILandObject.cs
@@ -37,49 +37,49 @@ namespace OpenSim.Region.Framework.Interfaces
37 37
38 public interface ILandObject 38 public interface ILandObject
39 { 39 {
40 int getParcelMaxPrimCount(ILandObject thisObject); 40 int GetParcelMaxPrimCount(ILandObject thisObject);
41 int getSimulatorMaxPrimCount(ILandObject thisObject); 41 int GetSimulatorMaxPrimCount(ILandObject thisObject);
42 42
43 LandData landData { get; set; } 43 LandData LandData { get; set; }
44 bool[,] landBitmap { get; set; } 44 bool[,] LandBitmap { get; set; }
45 UUID regionUUID { get; } 45 UUID RegionUUID { get; }
46 bool containsPoint(int x, int y); 46 bool ContainsPoint(int x, int y);
47 ILandObject Copy(); 47 ILandObject Copy();
48 48
49 void sendLandUpdateToAvatarsOverMe(); 49 void SendLandUpdateToAvatarsOverMe();
50 50
51 void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client); 51 void SendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client);
52 void updateLandProperties(LandUpdateArgs args, IClientAPI remote_client); 52 void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client);
53 bool isEitherBannedOrRestricted(UUID avatar); 53 bool IsEitherBannedOrRestricted(UUID avatar);
54 bool isBannedFromLand(UUID avatar); 54 bool IsBannedFromLand(UUID avatar);
55 bool isRestrictedFromLand(UUID avatar); 55 bool IsRestrictedFromLand(UUID avatar);
56 void sendLandUpdateToClient(IClientAPI remote_client); 56 void SendLandUpdateToClient(IClientAPI remote_client);
57 List<UUID> createAccessListArrayByFlag(AccessList flag); 57 List<UUID> CreateAccessListArrayByFlag(AccessList flag);
58 void sendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, IClientAPI remote_client); 58 void SendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, IClientAPI remote_client);
59 void updateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client); 59 void UpdateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client);
60 void updateLandBitmapByteArray(); 60 void UpdateLandBitmapByteArray();
61 void setLandBitmapFromByteArray(); 61 void SetLandBitmapFromByteArray();
62 bool[,] getLandBitmap(); 62 bool[,] GetLandBitmap();
63 void forceUpdateLandInfo(); 63 void ForceUpdateLandInfo();
64 void setLandBitmap(bool[,] bitmap); 64 void SetLandBitmap(bool[,] bitmap);
65 65
66 bool[,] basicFullRegionLandBitmap(); 66 bool[,] BasicFullRegionLandBitmap();
67 bool[,] getSquareLandBitmap(int start_x, int start_y, int end_x, int end_y); 67 bool[,] GetSquareLandBitmap(int start_x, int start_y, int end_x, int end_y);
68 bool[,] modifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y, bool set_value); 68 bool[,] ModifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y, bool set_value);
69 bool[,] mergeLandBitmaps(bool[,] bitmap_base, bool[,] bitmap_add); 69 bool[,] MergeLandBitmaps(bool[,] bitmap_base, bool[,] bitmap_add);
70 void sendForceObjectSelect(int local_id, int request_type, List<UUID> returnIDs, IClientAPI remote_client); 70 void SendForceObjectSelect(int local_id, int request_type, List<UUID> returnIDs, IClientAPI remote_client);
71 void sendLandObjectOwners(IClientAPI remote_client); 71 void SendLandObjectOwners(IClientAPI remote_client);
72 void returnObject(SceneObjectGroup obj); 72 void ReturnObject(SceneObjectGroup obj);
73 void returnLandObjects(uint type, UUID[] owners, UUID[] tasks, IClientAPI remote_client); 73 void ReturnLandObjects(uint type, UUID[] owners, UUID[] tasks, IClientAPI remote_client);
74 void resetLandPrimCounts(); 74 void ResetLandPrimCounts();
75 void addPrimToCount(SceneObjectGroup obj); 75 void AddPrimToCount(SceneObjectGroup obj);
76 void removePrimFromCount(SceneObjectGroup obj); 76 void RemovePrimFromCount(SceneObjectGroup obj);
77 void updateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area); 77 void UpdateLandSold(UUID avatarID, UUID groupID, bool groupOwned, uint AuctionID, int claimprice, int area);
78 78
79 void deedToGroup(UUID groupID); 79 void DeedToGroup(UUID groupID);
80 80
81 void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel); 81 void SetParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel);
82 void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel); 82 void SetSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel);
83 83
84 /// <summary> 84 /// <summary>
85 /// Set the media url for this land parcel 85 /// Set the media url for this land parcel
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 9db2240..c06a58f 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3206,9 +3206,9 @@ namespace OpenSim.Region.Framework.Scenes
3206 ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); 3206 ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
3207 if (land != null) 3207 if (land != null)
3208 { 3208 {
3209 if (land.landData.LandingType == (byte)1 && land.landData.UserLocation != Vector3.Zero) 3209 if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero)
3210 { 3210 {
3211 agent.startpos = land.landData.UserLocation; 3211 agent.startpos = land.LandData.UserLocation;
3212 } 3212 }
3213 } 3213 }
3214 } 3214 }
@@ -3846,13 +3846,13 @@ namespace OpenSim.Region.Framework.Scenes
3846 3846
3847 public LandData GetLandData(float x, float y) 3847 public LandData GetLandData(float x, float y)
3848 { 3848 {
3849 return LandChannel.GetLandObject(x, y).landData; 3849 return LandChannel.GetLandObject(x, y).LandData;
3850 } 3850 }
3851 3851
3852 public LandData GetLandData(uint x, uint y) 3852 public LandData GetLandData(uint x, uint y)
3853 { 3853 {
3854 m_log.DebugFormat("[SCENE]: returning land for {0},{1}", x, y); 3854 m_log.DebugFormat("[SCENE]: returning land for {0},{1}", x, y);
3855 return LandChannel.GetLandObject((int)x, (int)y).landData; 3855 return LandChannel.GetLandObject((int)x, (int)y).LandData;
3856 } 3856 }
3857 3857
3858 3858
@@ -3880,14 +3880,14 @@ namespace OpenSim.Region.Framework.Scenes
3880 { 3880 {
3881 if (parcel != null) 3881 if (parcel != null)
3882 { 3882 {
3883 if ((parcel.landData.Flags & (uint)ParcelFlags.AllowOtherScripts) != 0) 3883 if ((parcel.LandData.Flags & (uint)ParcelFlags.AllowOtherScripts) != 0)
3884 { 3884 {
3885 return true; 3885 return true;
3886 } 3886 }
3887 else if ((parcel.landData.Flags & (uint)ParcelFlags.AllowGroupScripts) != 0) 3887 else if ((parcel.LandData.Flags & (uint)ParcelFlags.AllowGroupScripts) != 0)
3888 { 3888 {
3889 if (part.OwnerID == parcel.landData.OwnerID 3889 if (part.OwnerID == parcel.LandData.OwnerID
3890 || (parcel.landData.IsGroupOwned && part.GroupID == parcel.landData.GroupID) 3890 || (parcel.LandData.IsGroupOwned && part.GroupID == parcel.LandData.GroupID)
3891 || Permissions.IsGod(part.OwnerID)) 3891 || Permissions.IsGod(part.OwnerID))
3892 { 3892 {
3893 return true; 3893 return true;
@@ -3899,7 +3899,7 @@ namespace OpenSim.Region.Framework.Scenes
3899 } 3899 }
3900 else 3900 else
3901 { 3901 {
3902 if (part.OwnerID == parcel.landData.OwnerID) 3902 if (part.OwnerID == parcel.LandData.OwnerID)
3903 { 3903 {
3904 return true; 3904 return true;
3905 } 3905 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 9f44f92..be8a6c9 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1327,15 +1327,15 @@ namespace OpenSim.Region.Framework.Scenes
1327 ILandObject parcel = m_scene.LandChannel.GetLandObject( 1327 ILandObject parcel = m_scene.LandChannel.GetLandObject(
1328 m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y); 1328 m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y);
1329 1329
1330 if (parcel != null && parcel.landData != null && 1330 if (parcel != null && parcel.LandData != null &&
1331 parcel.landData.OtherCleanTime != 0) 1331 parcel.LandData.OtherCleanTime != 0)
1332 { 1332 {
1333 if (parcel.landData.OwnerID != OwnerID && 1333 if (parcel.LandData.OwnerID != OwnerID &&
1334 (parcel.landData.GroupID != GroupID || 1334 (parcel.LandData.GroupID != GroupID ||
1335 parcel.landData.GroupID == UUID.Zero)) 1335 parcel.LandData.GroupID == UUID.Zero))
1336 { 1336 {
1337 if ((DateTime.Now - RootPart.Rezzed).TotalMinutes > 1337 if ((DateTime.Now - RootPart.Rezzed).TotalMinutes >
1338 parcel.landData.OtherCleanTime) 1338 parcel.LandData.OtherCleanTime)
1339 { 1339 {
1340 DetachFromBackup(); 1340 DetachFromBackup();
1341 m_log.InfoFormat("[SCENE]: Returning object {0} due to parcel auto return", RootPart.UUID.ToString()); 1341 m_log.InfoFormat("[SCENE]: Returning object {0} due to parcel auto return", RootPart.UUID.ToString());
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
index b3d10df..709cca2 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
@@ -94,10 +94,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests
94 } 94 }
95 95
96 // root part should have no offset position or rotation 96 // root part should have no offset position or rotation
97 Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity); 97 Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity,
98 "root part should have no offset position or rotation");
98 99
99 // offset position should be root part position - part2.absolute position. 100 // offset position should be root part position - part2.absolute position.
100 Assert.That(part2.OffsetPosition == new Vector3(-10, -10, -10)); 101 Assert.That(part2.OffsetPosition == new Vector3(-10, -10, -10),
102 "offset position should be root part position - part2.absolute position.");
101 103
102 float roll = 0; 104 float roll = 0;
103 float pitch = 0; 105 float pitch = 0;
@@ -116,7 +118,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests
116 if (debugtest) 118 if (debugtest)
117 m_log.Debug(rotEuler2); 119 m_log.Debug(rotEuler2);
118 120
119 Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f)); 121 Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f),
122 "Not exactly sure what this is asserting...");
120 123
121 // Delink part 2 124 // Delink part 2
122 grp1.DelinkFromGroup(part2.LocalId); 125 grp1.DelinkFromGroup(part2.LocalId);
@@ -125,7 +128,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
125 m_log.Debug("Group2: Prim2: OffsetPosition:" + part2.AbsolutePosition + ", OffsetRotation:" + part2.RotationOffset); 128 m_log.Debug("Group2: Prim2: OffsetPosition:" + part2.AbsolutePosition + ", OffsetRotation:" + part2.RotationOffset);
126 129
127 Assert.That(grp1.Children.Count, Is.EqualTo(1), "Group 1 still contained part2 after delink."); 130 Assert.That(grp1.Children.Count, Is.EqualTo(1), "Group 1 still contained part2 after delink.");
128 Assert.That(part2.AbsolutePosition == Vector3.Zero); 131 Assert.That(part2.AbsolutePosition == Vector3.Zero, "The absolute position should be zero");
129 } 132 }
130 133
131 [Test] 134 [Test]
@@ -175,10 +178,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests
175 grp3.LinkToGroup(grp4); 178 grp3.LinkToGroup(grp4);
176 179
177 // At this point we should have 4 parts total in two groups. 180 // At this point we should have 4 parts total in two groups.
178 Assert.That(grp1.Children.Count == 2); 181 Assert.That(grp1.Children.Count == 2, "Group1 children count should be 2");
179 Assert.That(grp2.IsDeleted, "Group 2 was not registered as deleted after link."); 182 Assert.That(grp2.IsDeleted, "Group 2 was not registered as deleted after link.");
180 Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained parts after delink."); 183 Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained parts after delink.");
181 Assert.That(grp3.Children.Count == 2); 184 Assert.That(grp3.Children.Count == 2, "Group3 children count should be 2");
182 Assert.That(grp4.IsDeleted, "Group 4 was not registered as deleted after link."); 185 Assert.That(grp4.IsDeleted, "Group 4 was not registered as deleted after link.");
183 Assert.That(grp4.Children.Count, Is.EqualTo(0), "Group 4 still contained parts after delink."); 186 Assert.That(grp4.Children.Count, Is.EqualTo(0), "Group 4 still contained parts after delink.");
184 187
@@ -201,10 +204,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests
201 grp3.RootPart.UpdateFlag = 0; 204 grp3.RootPart.UpdateFlag = 0;
202 205
203 // root part should have no offset position or rotation 206 // root part should have no offset position or rotation
204 Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity); 207 Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity,
208 "root part should have no offset position or rotation (again)");
205 209
206 // offset position should be root part position - part2.absolute position. 210 // offset position should be root part position - part2.absolute position.
207 Assert.That(part2.OffsetPosition == new Vector3(-10, -10, -10)); 211 Assert.That(part2.OffsetPosition == new Vector3(-10, -10, -10),
212 "offset position should be root part position - part2.absolute position (again)");
208 213
209 float roll = 0; 214 float roll = 0;
210 float pitch = 0; 215 float pitch = 0;
@@ -223,7 +228,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests
223 if (debugtest) 228 if (debugtest)
224 m_log.Debug(rotEuler2); 229 m_log.Debug(rotEuler2);
225 230
226 Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f)); 231 Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f),
232 "Not sure what this assertion is all about...");
227 233
228 // Now we're linking the first group to the third group. This will make the first group child parts of the third one. 234 // Now we're linking the first group to the third group. This will make the first group child parts of the third one.
229 grp3.LinkToGroup(grp1); 235 grp3.LinkToGroup(grp1);
@@ -246,13 +252,14 @@ namespace OpenSim.Region.Framework.Scenes.Tests
246 m_log.Debug("Group3: Prim2: OffsetPosition:" + part4.OffsetPosition + ", OffsetRotation:" + part4.RotationOffset); 252 m_log.Debug("Group3: Prim2: OffsetPosition:" + part4.OffsetPosition + ", OffsetRotation:" + part4.RotationOffset);
247 } 253 }
248 254
249 Assert.That(part2.AbsolutePosition == Vector3.Zero); 255 Assert.That(part2.AbsolutePosition == Vector3.Zero, "Badness 1");
250 Assert.That(part4.OffsetPosition == new Vector3(20, 20, 20)); 256 Assert.That(part4.OffsetPosition == new Vector3(20, 20, 20), "Badness 2");
251 Quaternion compareQuaternion = new Quaternion(0, 0.7071068f, 0, 0.7071068f); 257 Quaternion compareQuaternion = new Quaternion(0, 0.7071068f, 0, 0.7071068f);
252 Assert.That((part4.RotationOffset.X - compareQuaternion.X < 0.00003) 258 Assert.That((part4.RotationOffset.X - compareQuaternion.X < 0.00003)
253 && (part4.RotationOffset.Y - compareQuaternion.Y < 0.00003) 259 && (part4.RotationOffset.Y - compareQuaternion.Y < 0.00003)
254 && (part4.RotationOffset.Z - compareQuaternion.Z < 0.00003) 260 && (part4.RotationOffset.Z - compareQuaternion.Z < 0.00003)
255 && (part4.RotationOffset.W - compareQuaternion.W < 0.00003)); 261 && (part4.RotationOffset.W - compareQuaternion.W < 0.00003),
262 "Badness 3");
256 } 263 }
257 } 264 }
258} 265}