From 4fad66f855544b9298ae2216c58c0f44009358a5 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Thu, 1 Nov 2007 19:19:05 +0000 Subject: * Diuerse beavtificatems --- OpenSim/Region/Environment/Modules/ChatModule.cs | 2 +- .../Region/Environment/Modules/WorldCommModule.cs | 2 +- .../Environment/Scenes/Scene.PacketHandlers.cs | 8 +- OpenSim/Region/Environment/Scenes/Scene.cs | 2 +- .../Region/Environment/Scenes/SceneObjectGroup.cs | 8 +- .../Region/Environment/Scenes/SceneObjectPart.cs | 102 +++++++++++---------- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 28 +++--- 7 files changed, 79 insertions(+), 73 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs index 99b69e1..9d4187a 100644 --- a/OpenSim/Region/Environment/Modules/ChatModule.cs +++ b/OpenSim/Region/Environment/Modules/ChatModule.cs @@ -431,4 +431,4 @@ namespace OpenSim.Region.Environment.Modules m_tcp.Close(); } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Environment/Modules/WorldCommModule.cs b/OpenSim/Region/Environment/Modules/WorldCommModule.cs index 5af2ce3..7a631d7 100644 --- a/OpenSim/Region/Environment/Modules/WorldCommModule.cs +++ b/OpenSim/Region/Environment/Modules/WorldCommModule.cs @@ -490,4 +490,4 @@ namespace OpenSim.Region.Environment.Modules return m_id; } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index 73954d0..73d317a 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs @@ -332,16 +332,14 @@ namespace OpenSim.Region.Environment.Scenes { if (ent is SceneObjectGroup) { - hasprim = ((SceneObjectGroup)ent).HasChildPrim(localID); + hasprim = ((SceneObjectGroup) ent).HasChildPrim(localID); if (hasprim != false) { - - ((SceneObjectGroup)ent).UpdatePrimFlags(localID, (ushort)packet.Type, true, packet.ToBytes()); - + ((SceneObjectGroup) ent).UpdatePrimFlags(localID, (ushort) packet.Type, true, packet.ToBytes()); } } } - + //System.Console.WriteLine("Got primupdate packet: " + packet.UsePhysics.ToString()); } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 8da22c4..d02f3e3 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -1565,4 +1565,4 @@ namespace OpenSim.Region.Environment.Scenes } } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index aaa25e7..2f746b2 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -341,8 +341,9 @@ namespace OpenSim.Region.Environment.Scenes /// /// public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, - PrimitiveBaseShape shape):this(scene, regionHandle, ownerID, localID, pos, LLQuaternion.Identity, shape) - { + PrimitiveBaseShape shape) + : this(scene, regionHandle, ownerID, localID, pos, LLQuaternion.Identity, shape) + { } #endregion @@ -927,6 +928,7 @@ namespace OpenSim.Region.Environment.Scenes part.UpdatePrimFlags(type, inUse, data); } } + public void UpdateExtraParam(uint localID, ushort type, bool inUse, byte[] data) { SceneObjectPart part = GetChildPart(localID); @@ -1394,4 +1396,4 @@ namespace OpenSim.Region.Environment.Scenes Text = text; } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index dacac4b..38eaf90 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -272,9 +272,10 @@ namespace OpenSim.Region.Environment.Scenes } public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, - PrimitiveBaseShape shape, LLVector3 groupPosition, LLVector3 offsetPosition):this(regionHandle, parent, ownerID, localID, shape, groupPosition, LLQuaternion.Identity, offsetPosition) - { - } + PrimitiveBaseShape shape, LLVector3 groupPosition, LLVector3 offsetPosition) + : this(regionHandle, parent, ownerID, localID, shape, groupPosition, LLQuaternion.Identity, offsetPosition) + { + } /// /// Create a completely new SceneObjectPart (prim) @@ -286,7 +287,8 @@ namespace OpenSim.Region.Environment.Scenes /// /// public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, - PrimitiveBaseShape shape, LLVector3 groupPosition, LLQuaternion rotationOffset, LLVector3 offsetPosition) + PrimitiveBaseShape shape, LLVector3 groupPosition, LLQuaternion rotationOffset, + LLVector3 offsetPosition) { m_name = "Primitive"; m_regionHandle = regionHandle; @@ -313,12 +315,12 @@ namespace OpenSim.Region.Environment.Scenes m_flags = 0; m_flags |= LLObject.ObjectFlags.ObjectModify | LLObject.ObjectFlags.ObjectCopy | - LLObject.ObjectFlags.ObjectYouOwner | - LLObject.ObjectFlags.Touch | - LLObject.ObjectFlags.ObjectMove | + LLObject.ObjectFlags.ObjectYouOwner | + LLObject.ObjectFlags.Touch | + LLObject.ObjectFlags.ObjectMove | LLObject.ObjectFlags.AllowInventoryDrop | LLObject.ObjectFlags.ObjectTransfer | - LLObject.ObjectFlags.CreateSelected | + LLObject.ObjectFlags.CreateSelected | LLObject.ObjectFlags.ObjectOwnerModify; ScheduleFullUpdate(); @@ -447,23 +449,25 @@ namespace OpenSim.Region.Environment.Scenes TimeStampFull = (uint) Util.UnixTimeSinceEpoch(); m_updateFlag = 2; } + public void AddFlag(LLObject.ObjectFlags flag) { - LLObject.ObjectFlags prevflag = m_flags; + LLObject.ObjectFlags prevflag = m_flags; //uint objflags = m_flags; - if ((this.ObjectFlags & (uint)flag) == 0) + if ((ObjectFlags & (uint) flag) == 0) { //Console.WriteLine("Adding flag: " + ((LLObject.ObjectFlags) flag).ToString()); m_flags |= flag; } - uint currflag = (uint)m_flags; + uint currflag = (uint) m_flags; //System.Console.WriteLine("Aprev: " + prevflag.ToString() + " curr: " + m_flags.ToString()); //ScheduleFullUpdate(); } + public void RemFlag(LLObject.ObjectFlags flag) { - LLObject.ObjectFlags prevflag = m_flags; - if ((this.ObjectFlags & (uint) flag) != 0) + LLObject.ObjectFlags prevflag = m_flags; + if ((ObjectFlags & (uint) flag) != 0) { //Console.WriteLine("Removing flag: " + ((LLObject.ObjectFlags)flag).ToString()); m_flags &= ~flag; @@ -640,6 +644,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region ExtraParams + public void UpdatePrimFlags(ushort type, bool inUse, byte[] data) { bool hasPrim = false; @@ -649,8 +654,8 @@ namespace OpenSim.Region.Environment.Scenes bool CastsShadows = false; //bool IsLocked = false; int i = 0; - - + + try { i += 46; @@ -661,40 +666,41 @@ namespace OpenSim.Region.Environment.Scenes IsPhantom = (data[i++] != 0) ? true : false; CastsShadows = (data[i++] != 0) ? true : false; } - catch (System.Exception e) + catch (Exception e) { - System.Console.WriteLine("Ignoring invalid Packet:"); + Console.WriteLine("Ignoring invalid Packet:"); //Silently ignore it - TODO: FIXME Quick } if (IsPhantom) { AddFlag(LLObject.ObjectFlags.Phantom); - if(this.PhysActor != null) { - this.m_parentGroup.m_scene.PhysScene.RemovePrim(this.PhysActor); /// that's not wholesome. Had to make m_scene public - this.PhysActor = null; + if (PhysActor != null) + { + m_parentGroup.m_scene.PhysScene.RemovePrim(PhysActor); + /// that's not wholesome. Had to make m_scene public + PhysActor = null; } } else { RemFlag(LLObject.ObjectFlags.Phantom); - if (this.PhysActor == null) + if (PhysActor == null) { - this.PhysActor = this.m_parentGroup.m_scene.PhysScene.AddPrimShape( - this.Name, - this.Shape, - new PhysicsVector(this.AbsolutePosition.X, this.AbsolutePosition.Y, - this.AbsolutePosition.Z), - new PhysicsVector(this.Scale.X, this.Scale.Y, this.Scale.Z), - new Quaternion(this.RotationOffset.W, this.RotationOffset.X, - this.RotationOffset.Y, this.RotationOffset.Z)); + PhysActor = m_parentGroup.m_scene.PhysScene.AddPrimShape( + Name, + Shape, + new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, + AbsolutePosition.Z), + new PhysicsVector(Scale.X, Scale.Y, Scale.Z), + new Quaternion(RotationOffset.W, RotationOffset.X, + RotationOffset.Y, RotationOffset.Z)); } } if (UsePhysics) { AddFlag(LLObject.ObjectFlags.Physics); - } else { @@ -710,9 +716,6 @@ namespace OpenSim.Region.Environment.Scenes } // System.Console.WriteLine("Update: PHY:" + UsePhysics.ToString() + ", T:" + IsTemporary.ToString() + ", PHA:" + IsPhantom.ToString() + " S:" + CastsShadows.ToString()); ScheduleFullUpdate(); - - - } public void UpdateExtraParam(ushort type, bool inUse, byte[] data) @@ -861,22 +864,21 @@ namespace OpenSim.Region.Environment.Scenes { LLQuaternion lRot; lRot = RotationOffset; - uint clientFlags = ObjectFlags & ~(uint)LLObject.ObjectFlags.CreateSelected; - - List avatars=m_parentGroup.GetScenePresences(); - foreach(ScenePresence s in avatars) - { - if(s.m_uuid == OwnerID) - { - if(s.ControllingClient == remoteClient) - { - clientFlags = ObjectFlags; - m_flags &= ~LLObject.ObjectFlags.CreateSelected; - - } - break; - } - } + uint clientFlags = ObjectFlags & ~(uint) LLObject.ObjectFlags.CreateSelected; + + List avatars = m_parentGroup.GetScenePresences(); + foreach (ScenePresence s in avatars) + { + if (s.m_uuid == OwnerID) + { + if (s.ControllingClient == remoteClient) + { + clientFlags = ObjectFlags; + m_flags &= ~LLObject.ObjectFlags.CreateSelected; + } + break; + } + } remoteClient.SendPrimitiveToClient(m_regionHandle, 64096, LocalID, m_shape, lPos, clientFlags, m_uuid, OwnerID, @@ -1042,4 +1044,4 @@ namespace OpenSim.Region.Environment.Scenes } } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 763be03..f2d0219 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -455,7 +455,7 @@ namespace OpenSim.Region.Environment.Scenes // Must check for standing up even when PhysicsActor is null, // since sitting currently removes avatar from physical scene - if ((flags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_STAND_UP) != 0) + if ((flags & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_STAND_UP) != 0) { StandUp(); UpdateMovementAnimations(true); @@ -526,7 +526,8 @@ namespace OpenSim.Region.Environment.Scenes SceneObjectPart part = m_scene.GetSceneObjectPart(m_parentID); LLVector3 pos = new LLVector3(); if (part != null) - pos = part.AbsolutePosition + m_requestedSitOffset + new LLVector3(0.0f, 0.0f, 2.0f * m_sitAvatarHeight); + pos = part.AbsolutePosition + m_requestedSitOffset + + new LLVector3(0.0f, 0.0f, 2.0f*m_sitAvatarHeight); MakeRootAgent(pos, false); m_parentID = 0; SendFullUpdateToAllClients(); @@ -569,7 +570,7 @@ namespace OpenSim.Region.Environment.Scenes remoteClient.OutPacket(avatarSitResponse); } - + public void HandleAgentRequestSit(IClientAPI remoteClient, LLUUID agentID, LLUUID targetID, LLVector3 offset) { SendSitResponse(remoteClient, targetID, offset); @@ -597,7 +598,8 @@ namespace OpenSim.Region.Environment.Scenes { // these magic numbers come mostly from experimenting with ODE, // and seeing what looks right - AbsolutePosition = m_requestedSitOffset + new LLVector3(m_physicsActor.Size.X / 2.7f, 0f, m_physicsActor.Size.Z / 1.45f); + AbsolutePosition = m_requestedSitOffset + + new LLVector3(m_physicsActor.Size.X/2.7f, 0f, m_physicsActor.Size.Z/1.45f); m_parentID = m_requestedSitTargetID; MakeChildAgent(); SendAnimPack(Animations.AnimsLLUUID["SIT"], 1); @@ -616,20 +618,21 @@ namespace OpenSim.Region.Environment.Scenes } else { - if (((m_movementflag & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) && PhysicsActor.IsColliding) + if (((m_movementflag & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) && + PhysicsActor.IsColliding) { SendAnimPack(Animations.AnimsLLUUID["CROUCHWALK"], 1); } else - { - SendAnimPack(Animations.AnimsLLUUID["WALK"], 1); + { + SendAnimPack(Animations.AnimsLLUUID["WALK"], 1); } - } } else { - if (((m_movementflag & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) && PhysicsActor.IsColliding) + if (((m_movementflag & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) && + PhysicsActor.IsColliding) { SendAnimPack(Animations.AnimsLLUUID["CROUCH"], 1); } @@ -656,7 +659,9 @@ namespace OpenSim.Region.Environment.Scenes direc = direc*((0.03f)*128f); if (m_physicsActor.Flying) - { direc *= 4; } + { + direc *= 4; + } else { if (!m_physicsActor.Flying && m_physicsActor.IsColliding) @@ -668,7 +673,6 @@ namespace OpenSim.Region.Environment.Scenes //System.Console.WriteLine("Jump"); SendAnimPack(Animations.AnimsLLUUID["PRE_JUMP"], 1); } - } } @@ -1093,4 +1097,4 @@ namespace OpenSim.Region.Environment.Scenes m_controllingClient.SendWearables(m_wearables, m_wearablesSerial++); } } -} +} \ No newline at end of file -- cgit v1.1