aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorjustincc2010-12-15 00:35:36 +0000
committerjustincc2010-12-15 00:35:36 +0000
commitb643661938881af6fc782d39e52040ed6d16f03f (patch)
tree162e0667718b2f68e5f4e90cd10f30e6fa374cbb /OpenSim/Region/Framework/Scenes
parentreplace ode.dll with one built without asserts turned on (diff)
parentfix mistake in last change of local.include (diff)
downloadopensim-SC_OLD-b643661938881af6fc782d39e52040ed6d16f03f.zip
opensim-SC_OLD-b643661938881af6fc782d39e52040ed6d16f03f.tar.gz
opensim-SC_OLD-b643661938881af6fc782d39e52040ed6d16f03f.tar.bz2
opensim-SC_OLD-b643661938881af6fc782d39e52040ed6d16f03f.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs20
-rw-r--r--OpenSim/Region/Framework/Scenes/Prioritizer.cs28
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Permissions.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs11
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs40
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs (renamed from OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserTests.cs)10
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs87
8 files changed, 140 insertions, 76 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
index a90e0f3..4865481 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
@@ -233,6 +233,11 @@ namespace OpenSim.Region.Framework.Scenes.Animation
233 // Falling long enough to trigger the animation 233 // Falling long enough to trigger the animation
234 return "FALLDOWN"; 234 return "FALLDOWN";
235 } 235 }
236 else if (m_animTickJump == -1)
237 {
238 m_animTickJump = 0;
239 return "STAND";
240 }
236 241
237 return m_movementAnimation; 242 return m_movementAnimation;
238 } 243 }
@@ -279,6 +284,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation
279 m_animTickJump = -1; 284 m_animTickJump = -1;
280 return "JUMP"; 285 return "JUMP";
281 } 286 }
287 else
288 return "JUMP";
282 } 289 }
283 else 290 else
284 { 291 {
@@ -307,7 +314,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
307 314
308 #endregion Ground Movement 315 #endregion Ground Movement
309 316
310 return m_movementAnimation; 317 //return m_movementAnimation;
311 } 318 }
312 319
313 /// <summary> 320 /// <summary>
@@ -316,16 +323,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
316 public void UpdateMovementAnimations() 323 public void UpdateMovementAnimations()
317 { 324 {
318 m_movementAnimation = GetMovementAnimation(); 325 m_movementAnimation = GetMovementAnimation();
319 326 TrySetMovementAnimation(m_movementAnimation);
320 if (m_movementAnimation == "PREJUMP" && !m_scenePresence.Scene.m_usePreJump)
321 {
322 // This was the previous behavior before PREJUMP
323 TrySetMovementAnimation("JUMP");
324 }
325 else
326 {
327 TrySetMovementAnimation(m_movementAnimation);
328 }
329 } 327 }
330 328
331 public UUID[] GetAnimationArray() 329 public UUID[] GetAnimationArray()
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
index 19f8180..f9599f5 100644
--- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs
+++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
@@ -218,20 +218,28 @@ namespace OpenSim.Region.Framework.Scenes
218 218
219 private double GetPriorityByBestAvatarResponsiveness(IClientAPI client, ISceneEntity entity) 219 private double GetPriorityByBestAvatarResponsiveness(IClientAPI client, ISceneEntity entity)
220 { 220 {
221 ScenePresence presence = m_scene.GetScenePresence(client.AgentId); 221 // If this is an update for our own avatar give it the highest priority
222 if (presence != null) 222 if (client.AgentId == entity.UUID)
223 { 223 return 0.0;
224 // If this is an update for our own avatar give it the highest priority 224 if (entity == null)
225 if (presence == entity) 225 return double.NaN;
226 return 0.0;
227 226
228 // Use group position for child prims 227 // Use group position for child prims
229 Vector3 entityPos = entity.AbsolutePosition; 228 Vector3 entityPos = entity.AbsolutePosition;
230 if (entity is SceneObjectPart) 229 if (entity is SceneObjectPart)
231 entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition; 230 {
231 SceneObjectGroup group = (entity as SceneObjectPart).ParentGroup;
232 if (group != null)
233 entityPos = group.AbsolutePosition;
232 else 234 else
233 entityPos = entity.AbsolutePosition; 235 entityPos = entity.AbsolutePosition;
236 }
237 else
238 entityPos = entity.AbsolutePosition;
234 239
240 ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
241 if (presence != null)
242 {
235 if (!presence.IsChildAgent) 243 if (!presence.IsChildAgent)
236 { 244 {
237 if (entity is ScenePresence) 245 if (entity is ScenePresence)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
index d67638a..1295e58 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
@@ -68,6 +68,7 @@ namespace OpenSim.Region.Framework.Scenes
68 public delegate bool IsGodHandler(UUID user, Scene requestFromScene); 68 public delegate bool IsGodHandler(UUID user, Scene requestFromScene);
69 public delegate bool IsAdministratorHandler(UUID user); 69 public delegate bool IsAdministratorHandler(UUID user);
70 public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene); 70 public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene);
71 public delegate bool EditParcelPropertiesHandler(UUID user, ILandObject parcel, GroupPowers p, Scene scene);
71 public delegate bool SellParcelHandler(UUID user, ILandObject parcel, Scene scene); 72 public delegate bool SellParcelHandler(UUID user, ILandObject parcel, Scene scene);
72 public delegate bool AbandonParcelHandler(UUID user, ILandObject parcel, Scene scene); 73 public delegate bool AbandonParcelHandler(UUID user, ILandObject parcel, Scene scene);
73 public delegate bool ReclaimParcelHandler(UUID user, ILandObject parcel, Scene scene); 74 public delegate bool ReclaimParcelHandler(UUID user, ILandObject parcel, Scene scene);
@@ -131,6 +132,7 @@ namespace OpenSim.Region.Framework.Scenes
131 public event IsGodHandler OnIsGod; 132 public event IsGodHandler OnIsGod;
132 public event IsAdministratorHandler OnIsAdministrator; 133 public event IsAdministratorHandler OnIsAdministrator;
133 public event EditParcelHandler OnEditParcel; 134 public event EditParcelHandler OnEditParcel;
135 public event EditParcelPropertiesHandler OnEditParcelProperties;
134 public event SellParcelHandler OnSellParcel; 136 public event SellParcelHandler OnSellParcel;
135 public event AbandonParcelHandler OnAbandonParcel; 137 public event AbandonParcelHandler OnAbandonParcel;
136 public event ReclaimParcelHandler OnReclaimParcel; 138 public event ReclaimParcelHandler OnReclaimParcel;
@@ -720,15 +722,16 @@ namespace OpenSim.Region.Framework.Scenes
720 #endregion 722 #endregion
721 723
722 #region EDIT PARCEL 724 #region EDIT PARCEL
723 public bool CanEditParcel(UUID user, ILandObject parcel) 725
726 public bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers p)
724 { 727 {
725 EditParcelHandler handler = OnEditParcel; 728 EditParcelPropertiesHandler handler = OnEditParcelProperties;
726 if (handler != null) 729 if (handler != null)
727 { 730 {
728 Delegate[] list = handler.GetInvocationList(); 731 Delegate[] list = handler.GetInvocationList();
729 foreach (EditParcelHandler h in list) 732 foreach (EditParcelPropertiesHandler h in list)
730 { 733 {
731 if (h(user, parcel, m_scene) == false) 734 if (h(user, parcel, p, m_scene) == false)
732 return false; 735 return false;
733 } 736 }
734 } 737 }
@@ -1043,4 +1046,4 @@ namespace OpenSim.Region.Framework.Scenes
1043 return true; 1046 return true;
1044 } 1047 }
1045 } 1048 }
1046} \ No newline at end of file 1049}
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 032c859..a2ed54f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -215,7 +215,7 @@ namespace OpenSim.Region.Framework.Scenes
215 SceneObjectPart sop = m_parentScene.GetSceneObjectPart(sp.ParentID); 215 SceneObjectPart sop = m_parentScene.GetSceneObjectPart(sp.ParentID);
216 if (sop != null) 216 if (sop != null)
217 { 217 {
218 coarseLocations.Add(sop.AbsolutePosition + sp.AbsolutePosition); 218 coarseLocations.Add(sop.AbsolutePosition + sp.OffsetPosition);
219 avatarUUIDs.Add(sp.UUID); 219 avatarUUIDs.Add(sp.UUID);
220 } 220 }
221 else 221 else
@@ -1281,13 +1281,8 @@ namespace OpenSim.Region.Framework.Scenes
1281 { 1281 {
1282 if (group.IsAttachment || (group.RootPart.Shape.PCode == 9 && group.RootPart.Shape.State != 0)) 1282 if (group.IsAttachment || (group.RootPart.Shape.PCode == 9 && group.RootPart.Shape.State != 0))
1283 { 1283 {
1284 // Set the new attachment point data in the object 1284 if (m_parentScene.AttachmentsModule != null)
1285 byte attachmentPoint = group.GetAttachmentPoint(); 1285 m_parentScene.AttachmentsModule.UpdateAttachmentPosition(group, pos);
1286 group.UpdateGroupPosition(pos);
1287 group.RootPart.IsAttachment = false;
1288 group.AbsolutePosition = group.RootPart.AttachedPos;
1289 group.SetAttachmentPoint(attachmentPoint);
1290 group.HasGroupChanged = true;
1291 } 1286 }
1292 else 1287 else
1293 { 1288 {
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index f87056e..4fcd8f5 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -3251,13 +3251,6 @@ namespace OpenSim.Region.Framework.Scenes
3251 //} 3251 //}
3252 } 3252 }
3253 3253
3254 public void SetAvatarOnSitTarget(UUID avatarID)
3255 {
3256 m_sitTargetAvatar = avatarID;
3257 if (ParentGroup != null)
3258 ParentGroup.TriggerScriptChangedEvent(Changed.LINK);
3259 }
3260
3261 public void SetAxisRotation(int axis, int rotate) 3254 public void SetAxisRotation(int axis, int rotate)
3262 { 3255 {
3263 if (m_parentGroup != null) 3256 if (m_parentGroup != null)
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index a1c80e5..62d7011 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1703,7 +1703,8 @@ namespace OpenSim.Region.Framework.Scenes
1703 } 1703 }
1704 // Reset sit target. 1704 // Reset sit target.
1705 if (part.GetAvatarOnSitTarget() == UUID) 1705 if (part.GetAvatarOnSitTarget() == UUID)
1706 part.SetAvatarOnSitTarget(UUID.Zero); 1706 part.SitTargetAvatar = UUID.Zero;
1707 part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK);
1707 1708
1708 m_parentPosition = part.GetWorldPosition(); 1709 m_parentPosition = part.GetWorldPosition();
1709 ControllingClient.SendClearFollowCamProperties(part.ParentUUID); 1710 ControllingClient.SendClearFollowCamProperties(part.ParentUUID);
@@ -1807,11 +1808,12 @@ namespace OpenSim.Region.Framework.Scenes
1807 1808
1808 if (SitTargetisSet && SitTargetUnOccupied) 1809 if (SitTargetisSet && SitTargetUnOccupied)
1809 { 1810 {
1810 part.SetAvatarOnSitTarget(UUID); 1811 part.SitTargetAvatar = UUID;
1811 offset = new Vector3(avSitOffSet.X, avSitOffSet.Y, avSitOffSet.Z); 1812 offset = new Vector3(avSitOffSet.X, avSitOffSet.Y, avSitOffSet.Z);
1812 sitOrientation = avSitOrientation; 1813 sitOrientation = avSitOrientation;
1813 autopilot = false; 1814 autopilot = false;
1814 } 1815 }
1816 part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK);
1815 1817
1816 pos = part.AbsolutePosition + offset; 1818 pos = part.AbsolutePosition + offset;
1817 //if (Math.Abs(part.AbsolutePosition.Z - AbsolutePosition.Z) > 1) 1819 //if (Math.Abs(part.AbsolutePosition.Z - AbsolutePosition.Z) > 1)
@@ -2225,33 +2227,6 @@ namespace OpenSim.Region.Framework.Scenes
2225 { 2227 {
2226 // WHAT??? 2228 // WHAT???
2227 m_log.Debug("[SCENEPRESENCE]: AddNewMovement() called on child agent, making root agent!"); 2229 m_log.Debug("[SCENEPRESENCE]: AddNewMovement() called on child agent, making root agent!");
2228
2229 // we have to reset the user's child agent connections.
2230 // Likely, here they've lost the eventqueue for other regions so border
2231 // crossings will fail at this point unless we reset them.
2232
2233 List<ulong> regions = new List<ulong>(KnownChildRegionHandles);
2234 regions.Remove(m_scene.RegionInfo.RegionHandle);
2235
2236 MakeRootAgent(new Vector3(127f, 127f, 127f), true);
2237
2238 // Async command
2239 if (m_scene.SceneGridService != null)
2240 {
2241 m_scene.SceneGridService.SendCloseChildAgentConnections(UUID, regions);
2242
2243 // Give the above command some time to try and close the connections.
2244 // this is really an emergency.. so sleep, or we'll get all discombobulated.
2245 System.Threading.Thread.Sleep(500);
2246 }
2247
2248 if (m_scene.SceneGridService != null)
2249 {
2250 IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
2251 if (m_agentTransfer != null)
2252 m_agentTransfer.EnableChildAgents(this);
2253 }
2254
2255 return; 2230 return;
2256 } 2231 }
2257 2232
@@ -3226,8 +3201,11 @@ namespace OpenSim.Region.Framework.Scenes
3226 Vector3 force = m_forceToApply.Value; 3201 Vector3 force = m_forceToApply.Value;
3227 3202
3228 m_updateflag = true; 3203 m_updateflag = true;
3229// movementvector = force; 3204
3230 Velocity = force; 3205 // The magic constant 0.855f seems to make walking feel less jerky,
3206 // probably because it hackishly accounts for the overall latency of
3207 // these Velocity updates -- Diva
3208 Velocity = force * .855F;
3231 3209
3232 m_forceToApply = null; 3210 m_forceToApply = null;
3233 } 3211 }
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
index b3b99f4..39116b6 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs
@@ -43,13 +43,14 @@ using OpenSim.Tests.Common.Setup;
43namespace OpenSim.Region.Framework.Scenes.Tests 43namespace OpenSim.Region.Framework.Scenes.Tests
44{ 44{
45 /// <summary> 45 /// <summary>
46 /// Tests manipulation of scene objects by users. 46 /// Tests derez of scene objects by users.
47 /// </summary> 47 /// </summary>
48 /// 48 /// <remarks>
49 /// This is at a level above the SceneObjectBasicTests, which act on the scene directly. 49 /// This is at a level above the SceneObjectBasicTests, which act on the scene directly.
50 /// FIXME: These tests are very incomplete - they only test for a few conditions. 50 /// TODO: These tests are very incomplete - they only test for a few conditions.
51 /// </remarks>
51 [TestFixture] 52 [TestFixture]
52 public class SceneObjectUserTests 53 public class SceneObjectDeRezTests
53 { 54 {
54 /// <summary> 55 /// <summary>
55 /// Test deleting an object from a scene. 56 /// Test deleting an object from a scene.
@@ -122,6 +123,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
122 scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); 123 scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero);
123 sogd.InventoryDeQueueAndDelete(); 124 sogd.InventoryDeQueueAndDelete();
124 125
126 // Object should still be in the scene.
125 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); 127 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
126 Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID)); 128 Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID));
127 } 129 }
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
new file mode 100644
index 0000000..c78038f
--- /dev/null
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserGroupTests.cs
@@ -0,0 +1,87 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Reflection;
31using Nini.Config;
32using NUnit.Framework;
33using NUnit.Framework.SyntaxHelpers;
34using OpenMetaverse;
35using OpenSim.Framework;
36using OpenSim.Framework.Communications;
37using OpenSim.Region.CoreModules.Avatar.InstantMessage;
38using OpenSim.Region.CoreModules.World.Permissions;
39using OpenSim.Region.Framework.Interfaces;
40using OpenSim.Region.Framework.Scenes;
41using OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups;
42using OpenSim.Tests.Common;
43using OpenSim.Tests.Common.Mock;
44using OpenSim.Tests.Common.Setup;
45
46namespace OpenSim.Region.Framework.Scenes.Tests
47{
48 [TestFixture]
49 public class SceneObjectUserGroupTests
50 {
51 /// <summary>
52 /// Test share with group object functionality
53 /// </summary>
54 /// <remarks>This test is not yet fully implemented</remarks>
55 [Test]
56 public void TestShareWithGroup()
57 {
58 TestHelper.InMethod();
59// log4net.Config.XmlConfigurator.Configure();
60
61 UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
62
63 TestScene scene = SceneSetupHelpers.SetupScene();
64 IConfigSource configSource = new IniConfigSource();
65
66 IConfig startupConfig = configSource.AddConfig("Startup");
67 startupConfig.Set("serverside_object_permissions", true);
68
69 IConfig groupsConfig = configSource.AddConfig("Groups");
70 groupsConfig.Set("Enabled", true);
71 groupsConfig.Set("Module", "GroupsModule");
72 groupsConfig.Set("DebugEnabled", true);
73
74 SceneSetupHelpers.SetupSceneModules(
75 scene, configSource, new object[]
76 { new PermissionsModule(),
77 new GroupsModule(),
78 new MockGroupsServicesConnector() });
79
80 TestClient client = SceneSetupHelpers.AddRootAgent(scene, userId);
81
82 IGroupsModule groupsModule = scene.RequestModuleInterface<IGroupsModule>();
83
84 groupsModule.CreateGroup(client, "group1", "To boldly go", true, UUID.Zero, 5, true, true, true);
85 }
86 }
87} \ No newline at end of file