From bf5c81d77e492cd6df5517ecab32cd64168b01c2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 May 2010 15:59:48 -0700 Subject: * Initial commit of the slimupdates2 rewrite. This pass maintains the original behavior of avatar update sending and has a simplified set of IClientAPI methods for sending avatar/prim updates --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 29 ++++++++++++------------ 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 30eafd7..ee0eb07 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -67,7 +67,7 @@ namespace OpenSim.Region.Framework.Scenes public delegate void SendCourseLocationsMethod(UUID scene, ScenePresence presence); - public class ScenePresence : EntityBase + public class ScenePresence : EntityBase, ISceneEntity { // ~ScenePresence() // { @@ -478,6 +478,12 @@ namespace OpenSim.Region.Framework.Scenes } } + public Vector3 OffsetPosition + { + get { return m_pos; } + set { m_pos = value; } + } + /// /// Current velocity of the avatar. /// @@ -1036,8 +1042,9 @@ namespace OpenSim.Region.Framework.Scenes AbsolutePosition = AbsolutePosition + new Vector3(0f, 0f, (1.56f / 6f)); } - ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, - AbsolutePosition, Velocity, Vector3.Zero, m_bodyRot, new Vector4(0,0,1,AbsolutePosition.Z - 0.5f), m_uuid, null, GetUpdatePriority(ControllingClient))); + ControllingClient.SendPrimUpdate(this, PrimUpdateFlags.Position); + //ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, + // AbsolutePosition, Velocity, Vector3.Zero, m_bodyRot, new Vector4(0,0,1,AbsolutePosition.Z - 0.5f), m_uuid, null, GetUpdatePriority(ControllingClient))); } public void AddNeighbourRegion(ulong regionHandle, string cap) @@ -2360,8 +2367,7 @@ namespace OpenSim.Region.Framework.Scenes //m_log.DebugFormat("[SCENEPRESENCE]: TerseUpdate: Pos={0} Rot={1} Vel={2}", m_pos, m_bodyRot, m_velocity); - remoteClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, - pos, velocity, Vector3.Zero, m_bodyRot, CollisionPlane, m_uuid, null, GetUpdatePriority(remoteClient))); + remoteClient.SendPrimUpdate(this, PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity); m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); m_scene.StatsReporter.AddAgentUpdates(1); @@ -2457,9 +2463,7 @@ namespace OpenSim.Region.Framework.Scenes Vector3 pos = m_pos; pos.Z += m_appearance.HipOffset; - remoteAvatar.m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, - LocalId, pos, m_appearance.Texture.GetBytes(), - m_parentID, m_bodyRot)); + remoteAvatar.m_controllingClient.SendAvatarDataImmediate(this); m_scene.StatsReporter.AddAgentUpdates(1); } @@ -2527,8 +2531,7 @@ namespace OpenSim.Region.Framework.Scenes Vector3 pos = m_pos; pos.Z += m_appearance.HipOffset; - m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId, - pos, m_appearance.Texture.GetBytes(), m_parentID, m_bodyRot)); + m_controllingClient.SendAvatarDataImmediate(this); SendInitialFullUpdateToAllClients(); SendAppearanceToAllOtherAgents(); @@ -2638,9 +2641,7 @@ namespace OpenSim.Region.Framework.Scenes Vector3 pos = m_pos; pos.Z += m_appearance.HipOffset; - m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId, - pos, m_appearance.Texture.GetBytes(), m_parentID, m_bodyRot)); - + m_controllingClient.SendAvatarDataImmediate(this); } public void SetWearable(int wearableId, AvatarWearable wearable) @@ -3906,7 +3907,7 @@ namespace OpenSim.Region.Framework.Scenes private void Reprioritize(object sender, ElapsedEventArgs e) { - m_controllingClient.ReprioritizeUpdates(StateUpdateTypes.All, UpdatePriority); + m_controllingClient.ReprioritizeUpdates(UpdatePriority); lock (m_reprioritization_timer) { -- cgit v1.1