From 9821c4f566e11c75c8d87721777480c5b2e2bd4e Mon Sep 17 00:00:00 2001 From: Revolution Date: Sun, 14 Feb 2010 15:41:57 -0600 Subject: Revolution is on the roll again! :) Fixes: Undo, T-pose of others on login, modifiedBulletX works again, feet now stand on the ground instead of in the ground, adds checks to CombatModule. Adds: Redo, Land Undo, checks to agentUpdate (so one can not fall off of a region), more vehicle parts. Finishes almost all of LSL (1 function left, 2 events). Direct flames and kudos to Revolution, please Signed-off-by: Melanie --- .../Scenes/Animation/ScenePresenceAnimator.cs | 13 +- OpenSim/Region/Framework/Scenes/Scene.cs | 47 ++- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 9 + .../Region/Framework/Scenes/SceneObjectGroup.cs | 139 ++++++--- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 340 +++++++++++++++++++-- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 89 +++++- OpenSim/Region/Framework/Scenes/UndoState.cs | 79 ++++- 7 files changed, 612 insertions(+), 104 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index fd526eb..712dcc7 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -418,15 +418,12 @@ namespace OpenSim.Region.Framework.Scenes.Animation { if (m_scenePresence.IsChildAgent) return; - - UUID[] animIDs; - int[] sequenceNums; - UUID[] objectIDs; - m_animations.GetArrays(out animIDs, out sequenceNums, out objectIDs); - - m_scenePresence.ControllingClient.SendAnimations( - animIDs, sequenceNums, m_scenePresence.ControllingClient.AgentId, objectIDs); + m_scenePresence.Scene.ForEachScenePresence( + delegate(ScenePresence SP) + { + SP.Animator.SendAnimPack(); + }); } /// diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 2909311..c7fb32a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1976,6 +1976,23 @@ namespace OpenSim.Region.Framework.Scenes return; } + if (grp.RootPart.RETURN_AT_EDGE) + { + // We remove the object here + try + { + List objects = new List(); + objects.Add(grp); + SceneObjectGroup[] objectsArray = objects.ToArray(); + returnObjects(objectsArray, UUID.Zero); + } + catch (Exception) + { + m_log.Warn("[DATABASE]: exception when trying to return the prim that crossed the border."); + } + return; + } + int thisx = (int)RegionInfo.RegionLocX; int thisy = (int)RegionInfo.RegionLocY; Vector3 EastCross = new Vector3(0.1f,0,0); @@ -2044,19 +2061,25 @@ namespace OpenSim.Region.Framework.Scenes Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S); //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize) - if (crossedBordery.BorderLine.Z > 0) + try { - pos.Y = ((pos.Y + crossedBordery.BorderLine.Z)); - changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize); - } - else - pos.Y = ((pos.Y + Constants.RegionSize)); + if (crossedBordery.BorderLine.Z > 0) + { + pos.Y = ((pos.Y + crossedBordery.BorderLine.Z)); + changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize); + } + else + pos.Y = ((pos.Y + Constants.RegionSize)); - newRegionHandle - = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize), - (uint)((thisy + changeY) * Constants.RegionSize)); - // x - 1 - // y + 1 + newRegionHandle + = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize), + (uint)((thisy + changeY) * Constants.RegionSize)); + // x - 1 + // y + 1 + } + catch (Exception ex) + { + } } else { @@ -2684,6 +2707,7 @@ namespace OpenSim.Region.Framework.Scenes client.OnGrabUpdate += ProcessObjectGrabUpdate; client.OnDeGrabObject += ProcessObjectDeGrab; client.OnUndo += m_sceneGraph.HandleUndo; + client.OnRedo += m_sceneGraph.HandleRedo; client.OnObjectDescription += m_sceneGraph.PrimDescription; client.OnObjectDrop += m_sceneGraph.DropObject; client.OnObjectSaleInfo += ObjectSaleInfo; @@ -2838,6 +2862,7 @@ namespace OpenSim.Region.Framework.Scenes client.OnGrabObject -= ProcessObjectGrab; client.OnDeGrabObject -= ProcessObjectDeGrab; client.OnUndo -= m_sceneGraph.HandleUndo; + client.OnRedo -= m_sceneGraph.HandleRedo; client.OnObjectDescription -= m_sceneGraph.PrimDescription; client.OnObjectDrop -= m_sceneGraph.DropObject; client.OnObjectSaleInfo -= ObjectSaleInfo; diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 1ac061a..2b13181 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -452,6 +452,15 @@ namespace OpenSim.Region.Framework.Scenes part.Undo(); } } + protected internal void HandleRedo(IClientAPI remoteClient, UUID primId) + { + if (primId != UUID.Zero) + { + SceneObjectPart part = m_parentScene.GetSceneObjectPart(primId); + if (part != null) + part.Redo(); + } + } protected internal void HandleObjectGroupUpdate( IClientAPI remoteClient, UUID GroupID, uint objectLocalID, UUID Garbage) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index af46659..fe9dd9b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -298,7 +298,16 @@ namespace OpenSim.Region.Framework.Scenes { m_scene.CrossPrimGroupIntoNewRegion(val, this, true); } - + if (RootPart.GetStatusSandbox()) + { + if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10) + { + RootPart.ScriptSetPhysicsStatus(false); + Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"), + ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false); + return; + } + } lock (m_parts) { foreach (SceneObjectPart part in m_parts.Values) @@ -398,6 +407,34 @@ namespace OpenSim.Region.Framework.Scenes } } + private SceneObjectPart m_PlaySoundMasterPrim = null; + public SceneObjectPart PlaySoundMasterPrim + { + get { return m_PlaySoundMasterPrim; } + set { m_PlaySoundMasterPrim = value; } + } + + private List m_PlaySoundSlavePrims = new List(); + public List PlaySoundSlavePrims + { + get { return m_LoopSoundSlavePrims; } + set { m_LoopSoundSlavePrims = value; } + } + + private SceneObjectPart m_LoopSoundMasterPrim = null; + public SceneObjectPart LoopSoundMasterPrim + { + get { return m_LoopSoundMasterPrim; } + set { m_LoopSoundMasterPrim = value; } + } + + private List m_LoopSoundSlavePrims = new List(); + public List LoopSoundSlavePrims + { + get { return m_LoopSoundSlavePrims; } + set { m_LoopSoundSlavePrims = value; } + } + // The UUID for the Region this Object is in. public UUID RegionUUID { @@ -1779,32 +1816,6 @@ namespace OpenSim.Region.Framework.Scenes } } - public void rotLookAt(Quaternion target, float strength, float damping) - { - SceneObjectPart rootpart = m_rootPart; - if (rootpart != null) - { - if (IsAttachment) - { - /* - ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar); - if (avatar != null) - { - Rotate the Av? - } */ - } - else - { - if (rootpart.PhysActor != null) - { - rootpart.PhysActor.APIDTarget = new Quaternion(target.X, target.Y, target.Z, target.W); - rootpart.PhysActor.APIDStrength = strength; - rootpart.PhysActor.APIDDamping = damping; - rootpart.PhysActor.APIDActive = true; - } - } - } - } public void stopLookAt() { SceneObjectPart rootpart = m_rootPart; @@ -1963,6 +1974,8 @@ namespace OpenSim.Region.Framework.Scenes foreach (SceneObjectPart part in m_parts.Values) { + if (!IsSelected) + part.UpdateLookAt(); part.SendScheduledUpdates(); } } @@ -2452,11 +2465,14 @@ namespace OpenSim.Region.Framework.Scenes { if (m_rootPart.PhysActor.IsPhysical) { - Vector3 llmoveforce = pos - AbsolutePosition; - Vector3 grabforce = llmoveforce; - grabforce = (grabforce / 10) * m_rootPart.PhysActor.Mass; - m_rootPart.PhysActor.AddForce(grabforce,true); - m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); + if (!m_rootPart.BlockGrab) + { + Vector3 llmoveforce = pos - AbsolutePosition; + Vector3 grabforce = llmoveforce; + grabforce = (grabforce / 10) * m_rootPart.PhysActor.Mass; + m_rootPart.PhysActor.AddForce(grabforce, true); + m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); + } } else { @@ -2812,6 +2828,7 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectPart part = GetChildPart(localID); if (part != null) { + part.IgnoreUndoUpdate = true; if (scale.X > m_scene.m_maxNonphys) scale.X = m_scene.m_maxNonphys; if (scale.Y > m_scene.m_maxNonphys) @@ -2839,6 +2856,7 @@ namespace OpenSim.Region.Framework.Scenes { if (obPart.UUID != m_rootPart.UUID) { + obPart.IgnoreUndoUpdate = true; Vector3 oldSize = new Vector3(obPart.Scale); float f = 1.0f; @@ -2898,6 +2916,8 @@ namespace OpenSim.Region.Framework.Scenes z *= a; } } + obPart.IgnoreUndoUpdate = false; + obPart.StoreUndoState(); } } } @@ -2913,6 +2933,7 @@ namespace OpenSim.Region.Framework.Scenes { foreach (SceneObjectPart obPart in m_parts.Values) { + obPart.IgnoreUndoUpdate = true; if (obPart.UUID != m_rootPart.UUID) { Vector3 currentpos = new Vector3(obPart.OffsetPosition); @@ -2926,6 +2947,8 @@ namespace OpenSim.Region.Framework.Scenes obPart.Resize(newSize); obPart.UpdateOffSet(currentpos); } + obPart.IgnoreUndoUpdate = false; + obPart.StoreUndoState(); } } @@ -2935,6 +2958,8 @@ namespace OpenSim.Region.Framework.Scenes m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor); } + part.IgnoreUndoUpdate = false; + part.StoreUndoState(); HasGroupChanged = true; ScheduleGroupForTerseUpdate(); } @@ -2950,13 +2975,26 @@ namespace OpenSim.Region.Framework.Scenes /// public void UpdateGroupPosition(Vector3 pos) { + foreach (SceneObjectPart part in Children.Values) + { + part.StoreUndoState(); + } if (m_scene.EventManager.TriggerGroupMove(UUID, pos)) { if (IsAttachment) { m_rootPart.AttachedPos = pos; } - + if (RootPart.GetStatusSandbox()) + { + if (Util.GetDistanceTo(RootPart.StatusSandboxPos, pos) > 10) + { + RootPart.ScriptSetPhysicsStatus(false); + pos = AbsolutePosition; + Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"), + ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false); + } + } AbsolutePosition = pos; HasGroupChanged = true; @@ -2975,7 +3013,10 @@ namespace OpenSim.Region.Framework.Scenes public void UpdateSinglePosition(Vector3 pos, uint localID) { SceneObjectPart part = GetChildPart(localID); - + foreach (SceneObjectPart parts in Children.Values) + { + parts.StoreUndoState(); + } if (part != null) { if (part.UUID == m_rootPart.UUID) @@ -2997,6 +3038,10 @@ namespace OpenSim.Region.Framework.Scenes /// private void UpdateRootPosition(Vector3 pos) { + foreach (SceneObjectPart part in Children.Values) + { + part.StoreUndoState(); + } Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z); Vector3 oldPos = new Vector3(AbsolutePosition.X + m_rootPart.OffsetPosition.X, @@ -3040,6 +3085,10 @@ namespace OpenSim.Region.Framework.Scenes /// public void UpdateGroupRotationR(Quaternion rot) { + foreach (SceneObjectPart parts in Children.Values) + { + parts.StoreUndoState(); + } m_rootPart.UpdateRotation(rot); PhysicsActor actor = m_rootPart.PhysActor; @@ -3060,6 +3109,10 @@ namespace OpenSim.Region.Framework.Scenes /// public void UpdateGroupRotationPR(Vector3 pos, Quaternion rot) { + foreach (SceneObjectPart parts in Children.Values) + { + parts.StoreUndoState(); + } m_rootPart.UpdateRotation(rot); PhysicsActor actor = m_rootPart.PhysActor; @@ -3083,6 +3136,10 @@ namespace OpenSim.Region.Framework.Scenes public void UpdateSingleRotation(Quaternion rot, uint localID) { SceneObjectPart part = GetChildPart(localID); + foreach (SceneObjectPart parts in Children.Values) + { + parts.StoreUndoState(); + } if (part != null) { if (part.UUID == m_rootPart.UUID) @@ -3113,8 +3170,11 @@ namespace OpenSim.Region.Framework.Scenes } else { + part.IgnoreUndoUpdate = true; part.UpdateRotation(rot); part.OffsetPosition = pos; + part.IgnoreUndoUpdate = false; + part.StoreUndoState(); } } } @@ -3128,6 +3188,7 @@ namespace OpenSim.Region.Framework.Scenes Quaternion axRot = rot; Quaternion oldParentRot = m_rootPart.RotationOffset; + m_rootPart.StoreUndoState(); m_rootPart.UpdateRotation(rot); if (m_rootPart.PhysActor != null) { @@ -3141,6 +3202,7 @@ namespace OpenSim.Region.Framework.Scenes { if (prim.UUID != m_rootPart.UUID) { + prim.IgnoreUndoUpdate = true; Vector3 axPos = prim.OffsetPosition; axPos *= oldParentRot; axPos *= Quaternion.Inverse(axRot); @@ -3153,7 +3215,14 @@ namespace OpenSim.Region.Framework.Scenes } } } - + foreach (SceneObjectPart childpart in Children.Values) + { + if (childpart != m_rootPart) + { + childpart.IgnoreUndoUpdate = false; + childpart.StoreUndoState(); + } + } m_rootPart.ScheduleTerseUpdate(); } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index dd797fc..d339208 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -133,6 +133,18 @@ namespace OpenSim.Region.Framework.Scenes [XmlIgnore] public bool DIE_AT_EDGE; + [XmlIgnore] + public bool RETURN_AT_EDGE; + + [XmlIgnore] + public bool BlockGrab; + + [XmlIgnore] + public bool StatusSandbox; + + [XmlIgnore] + public Vector3 StatusSandboxPos; + // TODO: This needs to be persisted in next XML version update! [XmlIgnore] public readonly int[] PayPrice = {-2,-2,-2,-2,-2}; @@ -219,6 +231,15 @@ namespace OpenSim.Region.Framework.Scenes [XmlIgnore] public Quaternion SpinOldOrientation = Quaternion.Identity; + [XmlIgnore] + public Quaternion m_APIDTarget = Quaternion.Identity; + + [XmlIgnore] + public float m_APIDDamp = 0; + + [XmlIgnore] + public float m_APIDStrength = 0; + /// /// This part's inventory /// @@ -233,6 +254,9 @@ namespace OpenSim.Region.Framework.Scenes public bool Undoing; [XmlIgnore] + public bool IgnoreUndoUpdate = false; + + [XmlIgnore] private PrimFlags LocalFlags; [XmlIgnore] private float m_damage = -1.0f; @@ -253,6 +277,7 @@ namespace OpenSim.Region.Framework.Scenes private string m_text = String.Empty; private string m_touchName = String.Empty; private readonly UndoStack m_undo = new UndoStack(5); + private readonly UndoStack m_redo = new UndoStack(5); private UUID _creatorID; private bool m_passTouches; @@ -501,6 +526,27 @@ namespace OpenSim.Region.Framework.Scenes } } + [XmlIgnore] + public Quaternion APIDTarget + { + get { return m_APIDTarget; } + set { m_APIDTarget = value; } + } + + [XmlIgnore] + public float APIDDamp + { + get { return m_APIDDamp; } + set { m_APIDDamp = value; } + } + + [XmlIgnore] + public float APIDStrength + { + get { return m_APIDStrength; } + set { m_APIDStrength = value; } + } + public ulong RegionHandle { get { return m_regionHandle; } @@ -512,6 +558,33 @@ namespace OpenSim.Region.Framework.Scenes get { return m_scriptAccessPin; } set { m_scriptAccessPin = (int)value; } } + private SceneObjectPart m_PlaySoundMasterPrim = null; + public SceneObjectPart PlaySoundMasterPrim + { + get { return m_PlaySoundMasterPrim; } + set { m_PlaySoundMasterPrim = value; } + } + + private List m_PlaySoundSlavePrims = new List(); + public List PlaySoundSlavePrims + { + get { return m_LoopSoundSlavePrims; } + set { m_LoopSoundSlavePrims = value; } + } + + private SceneObjectPart m_LoopSoundMasterPrim = null; + public SceneObjectPart LoopSoundMasterPrim + { + get { return m_LoopSoundMasterPrim; } + set { m_LoopSoundMasterPrim = value; } + } + + private List m_LoopSoundSlavePrims = new List(); + public List LoopSoundSlavePrims + { + get { return m_LoopSoundSlavePrims; } + set { m_LoopSoundSlavePrims = value; } + } [XmlIgnore] public Byte[] TextureAnimation @@ -573,8 +646,6 @@ namespace OpenSim.Region.Framework.Scenes } set { - StoreUndoState(); - m_groupPosition = value; PhysicsActor actor = PhysActor; @@ -1401,6 +1472,10 @@ namespace OpenSim.Region.Framework.Scenes { m_undo.Clear(); } + lock (m_redo) + { + m_redo.Clear(); + } StoreUndoState(); } @@ -1711,6 +1786,66 @@ namespace OpenSim.Region.Framework.Scenes return m_parentGroup.RootPart.DIE_AT_EDGE; } + public bool GetReturnAtEdge() + { + if (m_parentGroup == null) + return false; + if (m_parentGroup.IsDeleted) + return false; + + return m_parentGroup.RootPart.RETURN_AT_EDGE; + } + + public void SetReturnAtEdge(bool p) + { + if (m_parentGroup == null) + return; + if (m_parentGroup.IsDeleted) + return; + + m_parentGroup.RootPart.RETURN_AT_EDGE = p; + } + + public bool GetBlockGrab() + { + if (m_parentGroup == null) + return false; + if (m_parentGroup.IsDeleted) + return false; + + return m_parentGroup.RootPart.BlockGrab; + } + + public void SetBlockGrab(bool p) + { + if (m_parentGroup == null) + return; + if (m_parentGroup.IsDeleted) + return; + + m_parentGroup.RootPart.BlockGrab = p; + } + + public void SetStatusSandbox(bool p) + { + if (m_parentGroup == null) + return; + if (m_parentGroup.IsDeleted) + return; + StatusSandboxPos = m_parentGroup.RootPart.AbsolutePosition; + m_parentGroup.RootPart.StatusSandbox = p; + } + + public bool GetStatusSandbox() + { + if (m_parentGroup == null) + return false; + if (m_parentGroup.IsDeleted) + return false; + + return m_parentGroup.RootPart.StatusSandbox; + } + public int GetAxisRotation(int axis) { //Cannot use ScriptBaseClass constants as no referance to it currently. @@ -1917,7 +2052,7 @@ namespace OpenSim.Region.Framework.Scenes // play the sound. if (startedColliders.Count > 0 && CollisionSound != UUID.Zero && CollisionSoundVolume > 0.0f) { - SendSound(CollisionSound.ToString(), CollisionSoundVolume, true, (byte)0); + SendSound(CollisionSound.ToString(), CollisionSoundVolume, true, (byte)0, 0, false, false); } if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_start) != 0) @@ -2491,9 +2626,8 @@ namespace OpenSim.Region.Framework.Scenes List avatarts = m_parentGroup.Scene.GetAvatars(); foreach (ScenePresence p in avatarts) { - // TODO: some filtering by distance of avatar - - p.ControllingClient.SendPreLoadSound(objectID, objectID, soundID); + if (!(Util.GetDistanceTo(p.AbsolutePosition, AbsolutePosition) >= 100)) + p.ControllingClient.SendPreLoadSound(objectID, objectID, soundID); } } @@ -2554,7 +2688,38 @@ namespace OpenSim.Region.Framework.Scenes public void RotLookAt(Quaternion target, float strength, float damping) { - m_parentGroup.rotLookAt(target, strength, damping); + rotLookAt(target, strength, damping); + } + + public void rotLookAt(Quaternion target, float strength, float damping) + { + if (IsAttachment) + { + /* + ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar); + if (avatar != null) + { + Rotate the Av? + } */ + } + else + { + APIDDamp = damping; + APIDStrength = strength; + APIDTarget = target; + } + } + + public void startLookAt(Quaternion rot, float damp, float strength) + { + APIDDamp = damp; + APIDStrength = strength; + APIDTarget = rot; + } + + public void stopLookAt() + { + APIDTarget = Quaternion.Identity; } /// @@ -2814,7 +2979,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// - public void SendSound(string sound, double volume, bool triggered, byte flags) + public void SendSound(string sound, double volume, bool triggered, byte flags, float radius, bool useMaster, bool isMaster) { if (volume > 1) volume = 1; @@ -2850,10 +3015,51 @@ namespace OpenSim.Region.Framework.Scenes ISoundModule soundModule = m_parentGroup.Scene.RequestModuleInterface(); if (soundModule != null) { - if (triggered) - soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle); + if (useMaster) + { + if (isMaster) + { + if (triggered) + soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius); + else + soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius); + ParentGroup.PlaySoundMasterPrim = this; + ownerID = this._ownerID; + objectID = this.UUID; + parentID = this.GetRootPartUUID(); + position = this.AbsolutePosition; // region local + regionHandle = this.ParentGroup.Scene.RegionInfo.RegionHandle; + if (triggered) + soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius); + else + soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius); + foreach (SceneObjectPart prim in ParentGroup.PlaySoundSlavePrims) + { + ownerID = prim._ownerID; + objectID = prim.UUID; + parentID = prim.GetRootPartUUID(); + position = prim.AbsolutePosition; // region local + regionHandle = prim.ParentGroup.Scene.RegionInfo.RegionHandle; + if (triggered) + soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius); + else + soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius); + } + ParentGroup.PlaySoundSlavePrims.Clear(); + ParentGroup.PlaySoundMasterPrim = null; + } + else + { + ParentGroup.PlaySoundSlavePrims.Add(this); + } + } else - soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags); + { + if (triggered) + soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius); + else + soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius); + } } } @@ -3156,6 +3362,14 @@ namespace OpenSim.Region.Framework.Scenes hasProfileCut = hasDimple; // is it the same thing? } + public void SetVehicleFlags(int param, bool remove) + { + if (PhysActor != null) + { + PhysActor.VehicleFlags(param, remove); + } + } + public void SetGroup(UUID groupID, IClientAPI client) { _groupID = groupID; @@ -3260,27 +3474,30 @@ namespace OpenSim.Region.Framework.Scenes { if (!Undoing) { - if (m_parentGroup != null) + if (!IgnoreUndoUpdate) { - lock (m_undo) + if (m_parentGroup != null) { - if (m_undo.Count > 0) + lock (m_undo) { - UndoState last = m_undo.Peek(); - if (last != null) + if (m_undo.Count > 0) { - if (last.Compare(this)) - return; + UndoState last = m_undo.Peek(); + if (last != null) + { + if (last.Compare(this)) + return; + } } - } - if (m_parentGroup.GetSceneMaxUndo() > 0) - { - UndoState nUndo = new UndoState(this); + if (m_parentGroup.GetSceneMaxUndo() > 0) + { + UndoState nUndo = new UndoState(this); - m_undo.Push(nUndo); - } + m_undo.Push(nUndo); + } + } } } } @@ -3751,11 +3968,36 @@ namespace OpenSim.Region.Framework.Scenes lock (m_undo) { if (m_undo.Count > 0) + { + UndoState nUndo = null; + if (m_parentGroup.GetSceneMaxUndo() > 0) { - UndoState goback = m_undo.Pop(); - if (goback != null) - goback.PlaybackState(this); + nUndo = new UndoState(this); + } + UndoState goback = m_undo.Pop(); + if (goback != null) + { + goback.PlaybackState(this); + if (nUndo != null) + m_redo.Push(nUndo); + } + } + } + } + + public void Redo() + { + lock (m_redo) + { + if (m_parentGroup.GetSceneMaxUndo() > 0) + { + UndoState nUndo = new UndoState(this); + + m_undo.Push(nUndo); } + UndoState gofwd = m_redo.Pop(); + if (gofwd != null) + gofwd.PlayfwdState(this); } } @@ -3802,6 +4044,18 @@ namespace OpenSim.Region.Framework.Scenes (pos.Z != OffsetPosition.Z)) { Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z); + + if (ParentGroup.RootPart.GetStatusSandbox()) + { + if (Util.GetDistanceTo(ParentGroup.RootPart.StatusSandboxPos, newPos) > 10) + { + ParentGroup.RootPart.ScriptSetPhysicsStatus(false); + newPos = OffsetPosition; + ParentGroup.Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"), + ChatTypeEnum.DebugChannel, 0x7FFFFFFF, ParentGroup.RootPart.AbsolutePosition, Name, UUID, false); + } + } + OffsetPosition = newPos; ScheduleTerseUpdate(); } @@ -4094,7 +4348,6 @@ namespace OpenSim.Region.Framework.Scenes (rot.Z != RotationOffset.Z) || (rot.W != RotationOffset.W)) { - //StoreUndoState(); RotationOffset = rot; ParentGroup.HasGroupChanged = true; ScheduleTerseUpdate(); @@ -4396,5 +4649,36 @@ namespace OpenSim.Region.Framework.Scenes Inventory.ApplyNextOwnerPermissions(); } + public void UpdateLookAt() + { + try + { + if (APIDTarget != Quaternion.Identity) + { + if (Single.IsNaN(APIDTarget.W) == true) + { + APIDTarget = Quaternion.Identity; + return; + } + Quaternion rot = RotationOffset; + Quaternion dir = (rot - APIDTarget); + float speed = ((APIDStrength / APIDDamp) * (float)(Math.PI / 180.0f)); + if (dir.Z > speed) + { + rot.Z -= speed; + } + if (dir.Z < -speed) + { + rot.Z += speed; + } + rot.Normalize(); + UpdateRotation(rot); + } + } + catch (Exception ex) + { + m_log.Error("[Physics] " + ex); + } + } } } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 9c7559b..675fb69 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -164,6 +164,8 @@ namespace OpenSim.Region.Framework.Scenes private Quaternion m_bodyRot= Quaternion.Identity; + private Quaternion m_bodyRotPrevious = Quaternion.Identity; + private const int LAND_VELOCITYMAG_MAX = 12; public bool IsRestrictedToRegion; @@ -508,6 +510,12 @@ namespace OpenSim.Region.Framework.Scenes set { m_bodyRot = value; } } + public Quaternion PreviousRotation + { + get { return m_bodyRotPrevious; } + set { m_bodyRotPrevious = value; } + } + /// /// If this is true, agent doesn't have a representation in this scene. /// this is an agent 'looking into' this scene from a nearby scene(region) @@ -824,6 +832,31 @@ namespace OpenSim.Region.Framework.Scenes if (pos.X < 0 || pos.Y < 0 || pos.Z < 0) { Vector3 emergencyPos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 128); + + if (pos.X < 0) + { + emergencyPos.X = (int)Constants.RegionSize + pos.X; + if (!(pos.Y < 0)) + emergencyPos.Y = pos.Y; + if (!(pos.Z < 0)) + emergencyPos.X = pos.X; + } + if (pos.Y < 0) + { + emergencyPos.Y = (int)Constants.RegionSize + pos.Y; + if (!(pos.X < 0)) + emergencyPos.X = pos.X; + if (!(pos.Z < 0)) + emergencyPos.Z = pos.Z; + } + if (pos.Z < 0) + { + if (!(pos.X < 0)) + emergencyPos.X = pos.X; + if (!(pos.Y < 0)) + emergencyPos.Y = pos.Y; + //Leave as 128 + } m_log.WarnFormat( "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", @@ -1193,6 +1226,14 @@ namespace OpenSim.Region.Framework.Scenes } else { + if (m_pos.X < 0) + m_pos.X = 128; + if (m_pos.Y < 0) + m_pos.Y = 128; + if (m_pos.X > Scene.WestBorders[0].BorderLine.X) + m_pos.X = 128; + if (m_pos.Y > Scene.NorthBorders[0].BorderLine.Y) + m_pos.Y = 128; m_LastFinitePos = m_pos; } @@ -2704,36 +2745,72 @@ namespace OpenSim.Region.Framework.Scenes { // Checks if where it's headed exists a region + bool needsTransit = false; if (m_scene.TestBorderCross(pos2, Cardinals.W)) { if (m_scene.TestBorderCross(pos2, Cardinals.S)) + { + needsTransit = true; neighbor = HaveNeighbor(Cardinals.SW, ref fix); + } else if (m_scene.TestBorderCross(pos2, Cardinals.N)) + { + needsTransit = true; neighbor = HaveNeighbor(Cardinals.NW, ref fix); + } else + { + needsTransit = true; neighbor = HaveNeighbor(Cardinals.W, ref fix); + } } else if (m_scene.TestBorderCross(pos2, Cardinals.E)) { if (m_scene.TestBorderCross(pos2, Cardinals.S)) + { + needsTransit = true; neighbor = HaveNeighbor(Cardinals.SE, ref fix); + } else if (m_scene.TestBorderCross(pos2, Cardinals.N)) + { + needsTransit = true; neighbor = HaveNeighbor(Cardinals.NE, ref fix); + } else + { + needsTransit = true; neighbor = HaveNeighbor(Cardinals.E, ref fix); + } } else if (m_scene.TestBorderCross(pos2, Cardinals.S)) + { + needsTransit = true; neighbor = HaveNeighbor(Cardinals.S, ref fix); + } else if (m_scene.TestBorderCross(pos2, Cardinals.N)) + { + needsTransit = true; neighbor = HaveNeighbor(Cardinals.N, ref fix); + } + - // Makes sure avatar does not end up outside region - if (neighbor < 0) - AbsolutePosition = new Vector3( - AbsolutePosition.X + 3*fix[0], - AbsolutePosition.Y + 3*fix[1], - AbsolutePosition.Z); + if (neighbor <= 0) + { + if (!needsTransit) + { + Vector3 pos = AbsolutePosition; + if (AbsolutePosition.X < 0) + pos.X += Velocity.Y; + else if (AbsolutePosition.X > Constants.RegionSize) + pos.X -= Velocity.Y; + if (AbsolutePosition.Y < 0) + pos.Y += Velocity.Y; + else if (AbsolutePosition.Y > Constants.RegionSize) + pos.Y -= Velocity.Y; + AbsolutePosition = pos; + } + } else if (neighbor > 0) CrossToNewRegion(); } diff --git a/OpenSim/Region/Framework/Scenes/UndoState.cs b/OpenSim/Region/Framework/Scenes/UndoState.cs index 713ff69..55e407e 100644 --- a/OpenSim/Region/Framework/Scenes/UndoState.cs +++ b/OpenSim/Region/Framework/Scenes/UndoState.cs @@ -26,6 +26,7 @@ */ using OpenMetaverse; +using OpenSim.Region.Framework.Interfaces; namespace OpenSim.Region.Framework.Scenes { @@ -35,29 +36,21 @@ namespace OpenSim.Region.Framework.Scenes public Vector3 Scale = Vector3.Zero; public Quaternion Rotation = Quaternion.Identity; - public UndoState(Vector3 pos, Quaternion rot, Vector3 scale) - { - Position = pos; - Rotation = rot; - Scale = scale; - } - public UndoState(SceneObjectPart part) { if (part != null) { if (part.ParentID == 0) { - Position = part.AbsolutePosition; + Position = part.ParentGroup.AbsolutePosition; Rotation = part.RotationOffset; - + Scale = part.Shape.Scale; } else { Position = part.OffsetPosition; Rotation = part.RotationOffset; Scale = part.Shape.Scale; - } } } @@ -68,7 +61,7 @@ namespace OpenSim.Region.Framework.Scenes { if (part.ParentID == 0) { - if (Position == part.AbsolutePosition && Rotation == part.RotationOffset) + if (Position == part.ParentGroup.AbsolutePosition && Rotation == part.ParentGroup.Rotation) return true; else return false; @@ -93,24 +86,78 @@ namespace OpenSim.Region.Framework.Scenes if (part.ParentID == 0) { - part.ParentGroup.AbsolutePosition = Position; - part.UpdateRotation(Rotation); + if (Position != Vector3.Zero) + part.ParentGroup.AbsolutePosition = Position; + part.RotationOffset = Rotation; + if (Scale != Vector3.Zero) + part.Resize(Scale); part.ParentGroup.ScheduleGroupForTerseUpdate(); } else { - part.OffsetPosition = Position; + if (Position != Vector3.Zero) + part.OffsetPosition = Position; part.UpdateRotation(Rotation); - part.Resize(Scale); + if (Scale != Vector3.Zero) + part.Resize(Scale); part.ScheduleTerseUpdate(); + } + part.Undoing = false; + + } + } + public void PlayfwdState(SceneObjectPart part) + { + if (part != null) + { + part.Undoing = true; + + if (part.ParentID == 0) + { + if (Position != Vector3.Zero) + part.ParentGroup.AbsolutePosition = Position; + if (Rotation != Quaternion.Identity) + part.UpdateRotation(Rotation); + if (Scale != Vector3.Zero) + part.Resize(Scale); + part.ParentGroup.ScheduleGroupForTerseUpdate(); + } + else + { + if (Position != Vector3.Zero) + part.OffsetPosition = Position; + if (Rotation != Quaternion.Identity) + part.UpdateRotation(Rotation); + if (Scale != Vector3.Zero) + part.Resize(Scale); part.ScheduleTerseUpdate(); } part.Undoing = false; } } + } + public class LandUndoState + { + public ITerrainModule m_terrainModule; + public ITerrainChannel m_terrainChannel; + + public LandUndoState(ITerrainModule terrainModule, ITerrainChannel terrainChannel) + { + m_terrainModule = terrainModule; + m_terrainChannel = terrainChannel; + } + + public bool Compare(ITerrainChannel terrainChannel) + { + if (m_terrainChannel != terrainChannel) + return false; + else + return false; + } - public UndoState() + public void PlaybackState() { + m_terrainModule.UndoTerrain(m_terrainChannel); } } } -- cgit v1.1 From 2c0c21d0a5fd89120d8be47cd959acd96b286fe3 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 14 Feb 2010 23:58:54 +0000 Subject: Plug a small hole --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 7df3e50..c6cee75 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -585,6 +585,9 @@ namespace OpenSim.Region.Framework.Scenes m_log.Error("[AGENT INVENTORY]: Failed to find item " + oldItemID.ToString()); return; } + + if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) + return; } AssetBase asset = AssetService.Get(item.AssetID.ToString()); -- cgit v1.1 From 5c7acd0d4d4d4cf1eceb27dadabc051611a9be33 Mon Sep 17 00:00:00 2001 From: Revolution Date: Sun, 14 Feb 2010 19:32:08 -0600 Subject: Fixes a bug in the previous patch. Signed-off-by: Melanie --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 31 ++++++++++-------------- 1 file changed, 13 insertions(+), 18 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 675fb69..7cdea05 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1226,14 +1226,6 @@ namespace OpenSim.Region.Framework.Scenes } else { - if (m_pos.X < 0) - m_pos.X = 128; - if (m_pos.Y < 0) - m_pos.Y = 128; - if (m_pos.X > Scene.WestBorders[0].BorderLine.X) - m_pos.X = 128; - if (m_pos.Y > Scene.NorthBorders[0].BorderLine.Y) - m_pos.Y = 128; m_LastFinitePos = m_pos; } @@ -2799,16 +2791,19 @@ namespace OpenSim.Region.Framework.Scenes { if (!needsTransit) { - Vector3 pos = AbsolutePosition; - if (AbsolutePosition.X < 0) - pos.X += Velocity.Y; - else if (AbsolutePosition.X > Constants.RegionSize) - pos.X -= Velocity.Y; - if (AbsolutePosition.Y < 0) - pos.Y += Velocity.Y; - else if (AbsolutePosition.Y > Constants.RegionSize) - pos.Y -= Velocity.Y; - AbsolutePosition = pos; + if (m_requestedSitTargetUUID == UUID.Zero) + { + Vector3 pos = AbsolutePosition; + if (AbsolutePosition.X < 0) + pos.X += Velocity.X; + else if (AbsolutePosition.X > Constants.RegionSize) + pos.X -= Velocity.X; + if (AbsolutePosition.Y < 0) + pos.Y += Velocity.Y; + else if (AbsolutePosition.Y > Constants.RegionSize) + pos.Y -= Velocity.Y; + AbsolutePosition = pos; + } } } else if (neighbor > 0) -- cgit v1.1 From af265e001d3bf043590e480cd6574a14193f6de0 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 15 Feb 2010 19:15:03 +0900 Subject: Formatting cleanup. --- OpenSim/Region/Framework/Scenes/EventManager.cs | 172 ++++++++++----------- OpenSim/Region/Framework/Scenes/Scene.cs | 2 +- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 2 +- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 +- .../Framework/Scenes/SceneObjectPartInventory.cs | 6 +- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 8 +- 6 files changed, 96 insertions(+), 96 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 9f74b2a..57e1c37 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -209,7 +209,7 @@ namespace OpenSim.Region.Framework.Scenes /// Triggered when an object or attachment enters a scene /// public event OnIncomingSceneObjectDelegate OnIncomingSceneObject; - public delegate void OnIncomingSceneObjectDelegate(SceneObjectGroup so); + public delegate void OnIncomingSceneObjectDelegate(SceneObjectGroup so); public delegate void NewInventoryItemUploadComplete(UUID avatarID, UUID assetID, string name, int userlevel); @@ -413,7 +413,7 @@ namespace OpenSim.Region.Framework.Scenes } } } - } + } public void TriggerGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) { @@ -433,7 +433,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerOnScriptChangedEvent(uint localID, uint change) @@ -454,7 +454,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerOnClientMovement(ScenePresence avatar) @@ -475,7 +475,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerPermissionError(UUID user, string reason) @@ -496,7 +496,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerOnPluginConsole(string[] args) @@ -517,7 +517,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerOnFrame() @@ -538,11 +538,11 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerOnNewClient(IClientAPI client) - { + { OnNewClientDelegate handlerNewClient = OnNewClient; if (handlerNewClient != null) { @@ -559,10 +559,10 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } if (client is IClientCore) - { + { OnClientConnectCoreDelegate handlerClientConnect = OnClientConnect; if (handlerClientConnect != null) { @@ -579,7 +579,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } } @@ -601,11 +601,11 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerOnRemovePresence(UUID agentId) - { + { OnRemovePresenceDelegate handlerRemovePresence = OnRemovePresence; if (handlerRemovePresence != null) { @@ -622,11 +622,11 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerOnBackup(IRegionDataStore dstore) - { + { OnBackupDelegate handlerOnAttach = OnBackup; if (handlerOnAttach != null) { @@ -643,7 +643,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerParcelPrimCountUpdate() @@ -664,7 +664,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs args) @@ -685,7 +685,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerTerrainTick() @@ -706,7 +706,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerParcelPrimCountAdd(SceneObjectGroup obj) @@ -727,7 +727,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj) @@ -748,11 +748,11 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerShutdown() - { + { OnShutdownDelegate handlerShutdown = OnShutdown; if (handlerShutdown != null) { @@ -769,11 +769,11 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) - { + { ObjectGrabDelegate handlerObjectGrab = OnObjectGrab; if (handlerObjectGrab != null) { @@ -790,11 +790,11 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerObjectGrabbing(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) - { + { ObjectGrabDelegate handlerObjectGrabbing = OnObjectGrabbing; if (handlerObjectGrabbing != null) { @@ -811,11 +811,11 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) - { + { ObjectDeGrabDelegate handlerObjectDeGrab = OnObjectDeGrab; if (handlerObjectDeGrab != null) { @@ -832,11 +832,11 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerScriptReset(uint localID, UUID itemID) - { + { ScriptResetDelegate handlerScriptReset = OnScriptReset; if (handlerScriptReset != null) { @@ -853,11 +853,11 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource) - { + { NewRezScript handlerRezScript = OnRezScript; if (handlerRezScript != null) { @@ -874,7 +874,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerStartScript(uint localID, UUID itemID) @@ -895,7 +895,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerStopScript(uint localID, UUID itemID) @@ -916,11 +916,11 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerRemoveScript(uint localID, UUID itemID) - { + { RemoveScript handlerRemoveScript = OnRemoveScript; if (handlerRemoveScript != null) { @@ -937,7 +937,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public bool TriggerGroupMove(UUID groupID, Vector3 delta) @@ -1036,7 +1036,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerLandObjectAdded(ILandObject newParcel) @@ -1057,7 +1057,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerLandObjectRemoved(UUID globalID) @@ -1078,7 +1078,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerLandObjectUpdated(uint localParcelID, ILandObject newParcel) @@ -1104,7 +1104,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerIncomingInstantMessage(GridInstantMessage message) @@ -1125,7 +1125,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerUnhandledInstantMessage(GridInstantMessage message) @@ -1146,7 +1146,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerClientClosed(UUID ClientID, Scene scene) @@ -1167,7 +1167,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerOnMakeChildAgent(ScenePresence presence) @@ -1188,7 +1188,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerOnMakeRootAgent(ScenePresence presence) @@ -1209,7 +1209,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerOnIncomingSceneObject(SceneObjectGroup so) @@ -1229,12 +1229,12 @@ namespace OpenSim.Region.Framework.Scenes "[EVENT MANAGER]: Delegate for TriggerOnIncomingSceneObject failed - continuing. {0} {1}", e.Message, e.StackTrace); } - } + } } } public void TriggerOnRegisterCaps(UUID agentID, Caps caps) - { + { RegisterCapsEvent handlerRegisterCaps = OnRegisterCaps; if (handlerRegisterCaps != null) { @@ -1251,7 +1251,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerOnDeregisterCaps(UUID agentID, Caps caps) @@ -1272,7 +1272,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerOnNewInventoryItemUploadComplete(UUID agentID, UUID AssetID, String AssetName, int userlevel) @@ -1293,7 +1293,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerLandBuy(Object sender, LandBuyArgs args) @@ -1314,7 +1314,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerValidateLandBuy(Object sender, LandBuyArgs args) @@ -1335,11 +1335,11 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 currentpos) - { + { ScriptAtTargetEvent handlerScriptAtTargetEvent = OnScriptAtTargetEvent; if (handlerScriptAtTargetEvent != null) { @@ -1356,7 +1356,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerNotAtTargetEvent(uint localID) @@ -1377,11 +1377,11 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion currentrot) - { + { ScriptAtRotTargetEvent handlerScriptAtRotTargetEvent = OnScriptAtRotTargetEvent; if (handlerScriptAtRotTargetEvent != null) { @@ -1398,7 +1398,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerNotAtRotTargetEvent(uint localID) @@ -1419,7 +1419,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerRequestChangeWaterHeight(float height) @@ -1440,7 +1440,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar) @@ -1461,7 +1461,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerSignificantClientMovement(IClientAPI client) @@ -1482,7 +1482,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerOnChatFromWorld(Object sender, OSChatMessage chat) @@ -1503,7 +1503,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerOnChatFromClient(Object sender, OSChatMessage chat) @@ -1524,7 +1524,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat) @@ -1545,7 +1545,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } internal void TriggerControlEvent(uint p, UUID scriptUUID, UUID avatarID, uint held, uint _changed) @@ -1566,7 +1566,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerNoticeNoLandDataFromStorage() @@ -1587,7 +1587,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerIncomingLandDataFromStorage(List landData) @@ -1608,7 +1608,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerSetAllowForcefulBan(bool allow) @@ -1629,7 +1629,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerRequestParcelPrimCountUpdate() @@ -1650,7 +1650,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerParcelPrimCountTainted() @@ -1671,7 +1671,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } // this lets us keep track of nasty script events like timer, etc. @@ -1710,7 +1710,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public float GetCurrentTimeAsSunLindenHour() @@ -1737,7 +1737,7 @@ namespace OpenSim.Region.Framework.Scenes } public void TriggerOarFileLoaded(Guid requestId, string message) - { + { OarFileLoaded handlerOarFileLoaded = OnOarFileLoaded; if (handlerOarFileLoaded != null) { @@ -1754,7 +1754,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerOarFileSaved(Guid requestId, string message) @@ -1775,7 +1775,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerEmptyScriptCompileQueue(int numScriptsFailed, string message) @@ -1796,7 +1796,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerScriptCollidingStart(uint localId, ColliderArgs colliders) @@ -1817,7 +1817,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerScriptColliding(uint localId, ColliderArgs colliders) @@ -1838,7 +1838,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders) @@ -1859,7 +1859,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerScriptLandCollidingStart(uint localId, ColliderArgs colliders) @@ -1880,7 +1880,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerScriptLandColliding(uint localId, ColliderArgs colliders) @@ -1901,7 +1901,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerScriptLandCollidingEnd(uint localId, ColliderArgs colliders) @@ -1922,11 +1922,11 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerSetRootAgentScene(UUID agentID, Scene scene) - { + { OnSetRootAgentSceneDelegate handlerSetRootAgentScene = OnSetRootAgentScene; if (handlerSetRootAgentScene != null) { @@ -1943,7 +1943,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } public void TriggerOnRegionUp(GridRegion otherRegion) @@ -1964,7 +1964,7 @@ namespace OpenSim.Region.Framework.Scenes e.Message, e.StackTrace); } } - } + } } } } \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index c7fb32a..41fd1e1 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2541,7 +2541,7 @@ namespace OpenSim.Region.Framework.Scenes AttachObject( sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); RootPrim.RemFlag(PrimFlags.TemporaryOnRez); - grp.SendGroupFullUpdate(); + grp.SendGroupFullUpdate(); } else { diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 2b13181..321cc45 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -642,7 +642,7 @@ namespace OpenSim.Region.Framework.Scenes // it get cleaned up // group.RootPart.RemFlag(PrimFlags.TemporaryOnRez); - group.HasGroupChanged = false; + group.HasGroupChanged = false; } else { diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index d339208..5c283bc 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -4531,7 +4531,7 @@ namespace OpenSim.Region.Framework.Scenes else { // m_log.DebugFormat( -// "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents()", Name, LocalId); +// "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents()", Name, LocalId); ScheduleFullUpdate(); } } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 298ede9..a555eae 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -314,7 +314,7 @@ namespace OpenSim.Region.Framework.Scenes } ); } - } + } private void RestoreSavedScriptState(UUID oldID, UUID newID) { @@ -579,7 +579,7 @@ namespace OpenSim.Region.Framework.Scenes m_items.TryGetValue(itemId, out item); return item; - } + } /// /// Get inventory items by name. @@ -588,7 +588,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// A list of inventory items with that name. /// If no inventory item has that name then an empty list is returned. - /// + /// public IList GetInventoryItems(string name) { IList items = new List(); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 7cdea05..4973663 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -227,7 +227,7 @@ namespace OpenSim.Region.Framework.Scenes // Agent's Draw distance. protected float m_DrawDistance; - protected AvatarAppearance m_appearance; + protected AvatarAppearance m_appearance; // neighbouring regions we have enabled a child agent in // holds the seed cap for the child agent in that region @@ -648,7 +648,7 @@ namespace OpenSim.Region.Framework.Scenes #region Constructor(s) public ScenePresence() - { + { m_sendCourseLocationsMethod = SendCoarseLocationsDefault; CreateSceneViewer(); m_animator = new ScenePresenceAnimator(this); @@ -3265,7 +3265,7 @@ namespace OpenSim.Region.Framework.Scenes m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; m_physicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong m_physicsActor.SubscribeEvents(500); - m_physicsActor.LocalID = LocalId; + m_physicsActor.LocalID = LocalId; } private void OutOfBoundsCall(Vector3 pos) @@ -3357,7 +3357,7 @@ namespace OpenSim.Region.Framework.Scenes } if (m_health <= 0) m_scene.EventManager.TriggerAvatarKill(killerObj, this); - } + } } public void setHealthWithUpdate(float health) -- cgit v1.1