From f6c8c10d3fce8eb279608cdeb9d8154fbca3852c Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Mon, 5 Nov 2007 14:38:58 +0000 Subject: * Substituted som 'GenericCall' with Action<> * OnRequestWearables does no longer accept 'Client' as param, since it's always on the current client * Fixed SendOwnWearables to always operate on self, as that's what it does --- OpenSim/Region/ClientStack/ClientView.API.cs | 8 ++-- .../ClientStack/ClientView.ProcessPackets.cs | 2 +- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 44 ++++++++++++---------- 3 files changed, 29 insertions(+), 25 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index b02fcf6..1ffcd5e 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs @@ -48,15 +48,15 @@ namespace OpenSim.Region.ClientStack public event RezObject OnRezObject; public event GenericCall4 OnDeRezObject; public event ModifyTerrain OnModifyTerrain; - public event GenericCall OnRegionHandShakeReply; - public event GenericCall OnRequestWearables; + public event Action OnRegionHandShakeReply; + public event GenericCall2 OnRequestWearables; public event SetAppearance OnSetAppearance; public event GenericCall2 OnCompleteMovementToRegion; public event UpdateAgent OnAgentUpdate; public event AgentRequestSit OnAgentRequestSit; public event AgentSit OnAgentSit; public event StartAnim OnStartAnim; - public event GenericCall OnRequestAvatarsData; + public event Action OnRequestAvatarsData; public event LinkObjects OnLinkObjects; public event UpdateVector OnGrabObject; public event ObjectSelect OnDeGrabObject; @@ -79,7 +79,7 @@ namespace OpenSim.Region.ClientStack public event UpdateVector OnUpdatePrimScale; public event StatusChange OnChildAgentStatus; public event GenericCall2 OnStopMovement; - public event GenericCall6 OnRemoveAvatar; + public event Action OnRemoveAvatar; public event RequestMapBlocks OnRequestMapBlocks; public event TeleportLocationRequest OnTeleportLocationRequest; public event DisconnectUser OnDisconnectUser; diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs index 7c1a663..7a778e8 100644 --- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs +++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs @@ -158,7 +158,7 @@ namespace OpenSim.Region.ClientStack case PacketType.AgentWearablesRequest: if (OnRequestWearables != null) { - OnRequestWearables(this); + OnRequestWearables( ); } if (OnRequestAvatarsData != null) { diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 49e3c39..b08f39f 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -53,7 +53,7 @@ namespace OpenSim.Region.Environment.Scenes private LLVector3 m_requestedSitOffset = new LLVector3(); private float m_sitAvatarHeight = 2.0f; - private Quaternion bodyRot; + private Quaternion m_bodyRot; private byte[] m_visualParams; private AvatarWearable[] m_wearables; private LLObject.TextureEntry m_textureEntry; @@ -71,7 +71,7 @@ namespace OpenSim.Region.Environment.Scenes private LLVector3 lastPhysPos = new LLVector3(); private int m_wearablesSerial = 1; - private List m_KnownChildRegions = new List(); //neighbouring regions we have enabled a child agent in + private readonly List m_knownChildRegions = new List(); //neighbouring regions we have enabled a child agent in private enum Dir_ControlFlags { @@ -234,7 +234,7 @@ namespace OpenSim.Region.Environment.Scenes public List KnownChildRegions { - get { return m_KnownChildRegions; } + get { return m_knownChildRegions; } } #endregion @@ -261,8 +261,8 @@ namespace OpenSim.Region.Environment.Scenes Animations.LoadAnims(); //register for events - m_controllingClient.OnRequestWearables += SendOurAppearance; - m_controllingClient.OnSetAppearance += new SetAppearance(SetAppearance); + m_controllingClient.OnRequestWearables += SendOwnAppearance; + m_controllingClient.OnSetAppearance += SetAppearance; m_controllingClient.OnCompleteMovementToRegion += CompleteMovement; m_controllingClient.OnCompleteMovementToRegion += SendInitialData; m_controllingClient.OnAgentUpdate += HandleAgentUpdate; @@ -409,17 +409,17 @@ namespace OpenSim.Region.Environment.Scenes public void AddNeighbourRegion(ulong regionHandle) { - if (!m_KnownChildRegions.Contains(regionHandle)) + if (!m_knownChildRegions.Contains(regionHandle)) { - m_KnownChildRegions.Add(regionHandle); + m_knownChildRegions.Add(regionHandle); } } public void RemoveNeighbourRegion(ulong regionHandle) { - if (!m_KnownChildRegions.Contains(regionHandle)) + if (!m_knownChildRegions.Contains(regionHandle)) { - m_KnownChildRegions.Remove(regionHandle); + m_knownChildRegions.Remove(regionHandle); } } #endregion @@ -501,9 +501,9 @@ namespace OpenSim.Region.Environment.Scenes update_movementflag = true; } - if (q != bodyRot) + if (q != m_bodyRot) { - bodyRot = q; + m_bodyRot = q; update_rotation = true; } @@ -765,10 +765,10 @@ namespace OpenSim.Region.Environment.Scenes LLVector3 pos = AbsolutePosition; LLVector3 vel = Velocity; LLQuaternion rot; - rot.X = bodyRot.x; - rot.Y = bodyRot.y; - rot.Z = bodyRot.z; - rot.W = bodyRot.w; + rot.X = m_bodyRot.x; + rot.Y = m_bodyRot.y; + rot.Z = m_bodyRot.z; + rot.W = m_bodyRot.w; RemoteClient.SendAvatarTerseUpdate(m_regionHandle, 64096, LocalId, new LLVector3(pos.X, pos.Y, pos.Z), new LLVector3(vel.X, vel.Y, vel.Z), rot); } @@ -851,9 +851,9 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void SendOurAppearance(IClientAPI client) + public void SendOwnAppearance( ) { - client.SendWearables(m_wearables, m_wearablesSerial++); + SendOwnWearables( ); m_scene.SendAllSceneObjectsToClient(this); m_controllingClient.SendViewerTime(m_scene.TimePhase); } @@ -1101,8 +1101,12 @@ namespace OpenSim.Region.Environment.Scenes public void SetWearable(int wearableId, AvatarWearable wearable) { m_wearables[wearableId] = wearable; - m_controllingClient.SendWearables(m_wearables, ++m_wearablesSerial); - //m_controllingClient.SendWearables(m_wearables, m_wearablesSerial++); + SendOwnWearables(); + } + + private void SendOwnWearables() + { + m_controllingClient.SendWearables(m_wearables, m_wearablesSerial++); } } -} \ No newline at end of file +} -- cgit v1.1