diff options
author | Teravus Ovares | 2009-03-28 02:41:51 +0000 |
---|---|---|
committer | Teravus Ovares | 2009-03-28 02:41:51 +0000 |
commit | 67be0213d4dd0ccd95a297aacf739e7a546a9dde (patch) | |
tree | e11be781ba0dad6f8d8de368ea58a0ef431581e1 | |
parent | * Adds AgentUUIDs into the CourseLocationUpdate to improve compatibility with... (diff) | |
download | opensim-SC-67be0213d4dd0ccd95a297aacf739e7a546a9dde.zip opensim-SC-67be0213d4dd0ccd95a297aacf739e7a546a9dde.tar.gz opensim-SC-67be0213d4dd0ccd95a297aacf739e7a546a9dde.tar.bz2 opensim-SC-67be0213d4dd0ccd95a297aacf739e7a546a9dde.tar.xz |
* Remove redundancies in ScenePresence
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 122 |
1 files changed, 59 insertions, 63 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index b059624..f7ea357 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -28,10 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using System.Runtime.Serialization; | ||
32 | using System.Security.Permissions; | ||
33 | using OpenMetaverse; | 31 | using OpenMetaverse; |
34 | using OpenMetaverse.Packets; | ||
35 | using log4net; | 32 | using log4net; |
36 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
37 | using OpenSim.Framework.Client; | 34 | using OpenSim.Framework.Client; |
@@ -39,7 +36,6 @@ using OpenSim.Framework.Communications.Cache; | |||
39 | using OpenSim.Region.Framework.Interfaces; | 36 | using OpenSim.Region.Framework.Interfaces; |
40 | using OpenSim.Region.Framework.Scenes.Types; | 37 | using OpenSim.Region.Framework.Scenes.Types; |
41 | using OpenSim.Region.Physics.Manager; | 38 | using OpenSim.Region.Physics.Manager; |
42 | using OSD = OpenMetaverse.StructuredData.OSD; | ||
43 | 39 | ||
44 | namespace OpenSim.Region.Framework.Scenes | 40 | namespace OpenSim.Region.Framework.Scenes |
45 | { | 41 | { |
@@ -83,24 +79,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
83 | private ScriptControlled IgnoredControls = ScriptControlled.CONTROL_ZERO; | 79 | private ScriptControlled IgnoredControls = ScriptControlled.CONTROL_ZERO; |
84 | private ScriptControlled LastCommands = ScriptControlled.CONTROL_ZERO; | 80 | private ScriptControlled LastCommands = ScriptControlled.CONTROL_ZERO; |
85 | private bool MouseDown = false; | 81 | private bool MouseDown = false; |
86 | private SceneObjectGroup proxyObjectGroup = null; | 82 | private SceneObjectGroup proxyObjectGroup; |
87 | //private SceneObjectPart proxyObjectPart = null; | 83 | //private SceneObjectPart proxyObjectPart = null; |
88 | 84 | ||
89 | public Vector3 lastKnownAllowedPosition = new Vector3(); | 85 | public Vector3 lastKnownAllowedPosition; |
90 | public bool sentMessageAboutRestrictedParcelFlyingDown = false; | 86 | public bool sentMessageAboutRestrictedParcelFlyingDown; |
91 | 87 | ||
92 | private bool m_updateflag = false; | 88 | private bool m_updateflag; |
93 | private byte m_movementflag = 0; | 89 | private byte m_movementflag; |
94 | private readonly List<NewForce> m_forcesList = new List<NewForce>(); | 90 | private readonly List<NewForce> m_forcesList = new List<NewForce>(); |
95 | private short m_updateCount = 0; | 91 | private short m_updateCount; |
96 | private uint m_requestedSitTargetID = 0; | 92 | private uint m_requestedSitTargetID; |
97 | private UUID m_requestedSitTargetUUID = UUID.Zero; | 93 | private UUID m_requestedSitTargetUUID = UUID.Zero; |
98 | 94 | ||
99 | private bool m_startAnimationSet = false; | 95 | private bool m_startAnimationSet; |
100 | 96 | ||
101 | //private Vector3 m_requestedSitOffset = new Vector3(); | 97 | //private Vector3 m_requestedSitOffset = new Vector3(); |
102 | 98 | ||
103 | private Vector3 m_LastFinitePos = new Vector3(); | 99 | private Vector3 m_LastFinitePos; |
104 | 100 | ||
105 | private float m_sitAvatarHeight = 2.0f; | 101 | private float m_sitAvatarHeight = 2.0f; |
106 | 102 | ||
@@ -111,26 +107,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
111 | // rotation, prim cut, prim twist, prim taper, and prim shear. See mantis | 107 | // rotation, prim cut, prim twist, prim taper, and prim shear. See mantis |
112 | // issue #1716 | 108 | // issue #1716 |
113 | private static readonly Vector3 m_sitTargetCorrectionOffset = new Vector3(0.1f, 0.0f, 0.3f); | 109 | private static readonly Vector3 m_sitTargetCorrectionOffset = new Vector3(0.1f, 0.0f, 0.3f); |
114 | private float m_godlevel = 0; | 110 | private float m_godlevel; |
115 | 111 | ||
116 | private bool m_invulnerable = true; | 112 | private bool m_invulnerable = true; |
117 | 113 | ||
118 | private Vector3 m_LastChildAgentUpdatePosition = new Vector3(); | 114 | private Vector3 m_LastChildAgentUpdatePosition; |
119 | 115 | ||
120 | private int m_perfMonMS = 0; | 116 | private int m_perfMonMS; |
121 | 117 | ||
122 | private bool m_sitStatus = false; | 118 | private bool m_sitStatus; |
123 | 119 | ||
124 | private bool m_setAlwaysRun = false; | 120 | private bool m_setAlwaysRun; |
125 | 121 | ||
126 | private Quaternion m_bodyRot= Quaternion.Identity; | 122 | private Quaternion m_bodyRot= Quaternion.Identity; |
127 | 123 | ||
128 | public bool IsRestrictedToRegion = false; | 124 | public bool IsRestrictedToRegion; |
129 | 125 | ||
130 | public string JID = string.Empty; | 126 | public string JID = string.Empty; |
131 | 127 | ||
132 | // Agent moves with a PID controller causing a force to be exerted. | 128 | // Agent moves with a PID controller causing a force to be exerted. |
133 | private bool m_newForce = false; | 129 | private bool m_newForce; |
134 | private bool m_newCoarseLocations = true; | 130 | private bool m_newCoarseLocations = true; |
135 | private float m_health = 100f; | 131 | private float m_health = 100f; |
136 | 132 | ||
@@ -140,7 +136,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
140 | private float m_avHeight = 127.0f; | 136 | private float m_avHeight = 127.0f; |
141 | 137 | ||
142 | protected RegionInfo m_regionInfo; | 138 | protected RegionInfo m_regionInfo; |
143 | protected ulong crossingFromRegion = 0; | 139 | protected ulong crossingFromRegion; |
144 | 140 | ||
145 | private readonly Vector3[] Dir_Vectors = new Vector3[6]; | 141 | private readonly Vector3[] Dir_Vectors = new Vector3[6]; |
146 | 142 | ||
@@ -162,27 +158,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
162 | protected Vector3 m_CameraAtAxis = Vector3.Zero; | 158 | protected Vector3 m_CameraAtAxis = Vector3.Zero; |
163 | protected Vector3 m_CameraLeftAxis = Vector3.Zero; | 159 | protected Vector3 m_CameraLeftAxis = Vector3.Zero; |
164 | protected Vector3 m_CameraUpAxis = Vector3.Zero; | 160 | protected Vector3 m_CameraUpAxis = Vector3.Zero; |
165 | private uint m_AgentControlFlags = 0; | 161 | private uint m_AgentControlFlags; |
166 | private Quaternion m_headrotation = Quaternion.Identity; | 162 | private Quaternion m_headrotation = Quaternion.Identity; |
167 | private byte m_state = 0; | 163 | private byte m_state; |
168 | 164 | ||
169 | //Reuse the Vector3 instead of creating a new one on the UpdateMovement method | 165 | //Reuse the Vector3 instead of creating a new one on the UpdateMovement method |
170 | private Vector3 movementvector = Vector3.Zero; | 166 | private Vector3 movementvector = Vector3.Zero; |
171 | 167 | ||
172 | private bool m_autopilotMoving = false; | 168 | private bool m_autopilotMoving; |
173 | private Vector3 m_autoPilotTarget = Vector3.Zero; | 169 | private Vector3 m_autoPilotTarget = Vector3.Zero; |
174 | private bool m_sitAtAutoTarget = false; | 170 | private bool m_sitAtAutoTarget; |
175 | 171 | ||
176 | private string m_nextSitAnimation = String.Empty; | 172 | private string m_nextSitAnimation = String.Empty; |
177 | 173 | ||
178 | //PauPaw:Proper PID Controler for autopilot************ | 174 | //PauPaw:Proper PID Controler for autopilot************ |
179 | private bool m_moveToPositionInProgress = false; | 175 | private bool m_moveToPositionInProgress; |
180 | private Vector3 m_moveToPositionTarget = Vector3.Zero; | 176 | private Vector3 m_moveToPositionTarget = Vector3.Zero; |
181 | //private int m_moveToPositionStateStatus = 0; | 177 | //private int m_moveToPositionStateStatus = 0; |
182 | //***************************************************** | 178 | //***************************************************** |
183 | 179 | ||
184 | // Agent's Draw distance. | 180 | // Agent's Draw distance. |
185 | protected float m_DrawDistance = 0f; | 181 | protected float m_DrawDistance; |
186 | 182 | ||
187 | protected AvatarAppearance m_appearance; | 183 | protected AvatarAppearance m_appearance; |
188 | 184 | ||
@@ -209,10 +205,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
209 | /// <summary> | 205 | /// <summary> |
210 | /// Position at which a significant movement was made | 206 | /// Position at which a significant movement was made |
211 | /// </summary> | 207 | /// </summary> |
212 | private Vector3 posLastSignificantMove = new Vector3(); | 208 | private Vector3 posLastSignificantMove; |
213 | 209 | ||
214 | private UpdateQueue m_partsUpdateQueue = new UpdateQueue(); | 210 | private UpdateQueue m_partsUpdateQueue = new UpdateQueue(); |
215 | private Queue<SceneObjectGroup> m_pendingObjects = null; | 211 | private Queue<SceneObjectGroup> m_pendingObjects; |
216 | 212 | ||
217 | private Dictionary<UUID, ScenePartUpdate> m_updateTimes = new Dictionary<UUID, ScenePartUpdate>(); | 213 | private Dictionary<UUID, ScenePartUpdate> m_updateTimes = new Dictionary<UUID, ScenePartUpdate>(); |
218 | 214 | ||
@@ -374,7 +370,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
374 | get { return (IClientCore) m_controllingClient; } | 370 | get { return (IClientCore) m_controllingClient; } |
375 | } | 371 | } |
376 | 372 | ||
377 | protected Vector3 m_parentPosition = new Vector3(); | 373 | protected Vector3 m_parentPosition; |
378 | public Vector3 ParentPosition | 374 | public Vector3 ParentPosition |
379 | { | 375 | { |
380 | get { return m_parentPosition; } | 376 | get { return m_parentPosition; } |
@@ -472,7 +468,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
472 | set { m_isChildAgent = value; } | 468 | set { m_isChildAgent = value; } |
473 | } | 469 | } |
474 | 470 | ||
475 | private uint m_parentID = 0; | 471 | private uint m_parentID; |
476 | 472 | ||
477 | public uint ParentID | 473 | public uint ParentID |
478 | { | 474 | { |
@@ -693,7 +689,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
693 | // this.UpdateQuadTreeNode(); | 689 | // this.UpdateQuadTreeNode(); |
694 | //this.RefreshQuadObject(); | 690 | //this.RefreshQuadObject(); |
695 | //} | 691 | //} |
696 | m_perfMonMS = System.Environment.TickCount; | 692 | m_perfMonMS = Environment.TickCount; |
697 | 693 | ||
698 | if (m_pendingObjects == null) | 694 | if (m_pendingObjects == null) |
699 | { | 695 | { |
@@ -811,7 +807,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
811 | break; | 807 | break; |
812 | } | 808 | } |
813 | 809 | ||
814 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); | 810 | m_scene.AddAgentTime(Environment.TickCount - m_perfMonMS); |
815 | } | 811 | } |
816 | 812 | ||
817 | #region Status Methods | 813 | #region Status Methods |
@@ -1129,7 +1125,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1129 | //} | 1125 | //} |
1130 | //} | 1126 | //} |
1131 | 1127 | ||
1132 | m_perfMonMS = System.Environment.TickCount; | 1128 | m_perfMonMS = Environment.TickCount; |
1133 | 1129 | ||
1134 | uint flags = agentData.ControlFlags; | 1130 | uint flags = agentData.ControlFlags; |
1135 | Quaternion bodyRotation = agentData.BodyRotation; | 1131 | Quaternion bodyRotation = agentData.BodyRotation; |
@@ -1167,7 +1163,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1167 | if (scriptedcontrols.Count > 0) | 1163 | if (scriptedcontrols.Count > 0) |
1168 | { | 1164 | { |
1169 | SendControlToScripts(flags); | 1165 | SendControlToScripts(flags); |
1170 | flags = this.RemoveIgnoredControls(flags, IgnoredControls); | 1166 | flags = RemoveIgnoredControls(flags, IgnoredControls); |
1171 | 1167 | ||
1172 | } | 1168 | } |
1173 | } | 1169 | } |
@@ -1394,7 +1390,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1394 | 1390 | ||
1395 | m_scene.EventManager.TriggerOnClientMovement(this); | 1391 | m_scene.EventManager.TriggerOnClientMovement(this); |
1396 | 1392 | ||
1397 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); | 1393 | m_scene.AddAgentTime(Environment.TickCount - m_perfMonMS); |
1398 | } | 1394 | } |
1399 | 1395 | ||
1400 | public void DoAutoPilot(uint not_used, Vector3 Pos, IClientAPI remote_client) | 1396 | public void DoAutoPilot(uint not_used, Vector3 Pos, IClientAPI remote_client) |
@@ -1450,7 +1446,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1450 | catch (Exception ex) | 1446 | catch (Exception ex) |
1451 | { | 1447 | { |
1452 | //Why did I get this error? | 1448 | //Why did I get this error? |
1453 | m_log.Error("[SCENEPRESENCE]: DoMoveToPosition" + ex.ToString()); | 1449 | m_log.Error("[SCENEPRESENCE]: DoMoveToPosition" + ex); |
1454 | } | 1450 | } |
1455 | } | 1451 | } |
1456 | 1452 | ||
@@ -1473,6 +1469,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1473 | //ControllingClient.SendSitResponse(m_requestedSitTargetID, m_requestedSitOffset, Quaternion.Identity, false, Vector3.Zero, Vector3.Zero, false); | 1469 | //ControllingClient.SendSitResponse(m_requestedSitTargetID, m_requestedSitOffset, Quaternion.Identity, false, Vector3.Zero, Vector3.Zero, false); |
1474 | m_requestedSitTargetUUID = UUID.Zero; | 1470 | m_requestedSitTargetUUID = UUID.Zero; |
1475 | } | 1471 | } |
1472 | /* | ||
1476 | else | 1473 | else |
1477 | { | 1474 | { |
1478 | //ControllingClient.SendAlertMessage("Autopilot cancelled"); | 1475 | //ControllingClient.SendAlertMessage("Autopilot cancelled"); |
@@ -1489,7 +1486,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1489 | //m_scene.DeleteSceneObject(proxyObjectGroup); | 1486 | //m_scene.DeleteSceneObject(proxyObjectGroup); |
1490 | //} | 1487 | //} |
1491 | } | 1488 | } |
1492 | 1489 | */ | |
1493 | m_autoPilotTarget = Vector3.Zero; | 1490 | m_autoPilotTarget = Vector3.Zero; |
1494 | m_autopilotMoving = false; | 1491 | m_autopilotMoving = false; |
1495 | } | 1492 | } |
@@ -1724,7 +1721,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1724 | } | 1721 | } |
1725 | else | 1722 | else |
1726 | { | 1723 | { |
1727 | m_log.Warn("Sit requested on unknown object: " + targetID.ToString()); | 1724 | m_log.Warn("Sit requested on unknown object: " + targetID); |
1728 | } | 1725 | } |
1729 | 1726 | ||
1730 | SendSitResponse(remoteClient, targetID, offset); | 1727 | SendSitResponse(remoteClient, targetID, offset); |
@@ -1796,12 +1793,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1796 | /// Event handler for the 'Always run' setting on the client | 1793 | /// Event handler for the 'Always run' setting on the client |
1797 | /// Tells the physics plugin to increase speed of movement. | 1794 | /// Tells the physics plugin to increase speed of movement. |
1798 | /// </summary> | 1795 | /// </summary> |
1799 | public void HandleSetAlwaysRun(IClientAPI remoteClient, bool SetAlwaysRun) | 1796 | public void HandleSetAlwaysRun(IClientAPI remoteClient, bool pSetAlwaysRun) |
1800 | { | 1797 | { |
1801 | m_setAlwaysRun = SetAlwaysRun; | 1798 | m_setAlwaysRun = pSetAlwaysRun; |
1802 | if (PhysicsActor != null) | 1799 | if (PhysicsActor != null) |
1803 | { | 1800 | { |
1804 | PhysicsActor.SetAlwaysRun = SetAlwaysRun; | 1801 | PhysicsActor.SetAlwaysRun = pSetAlwaysRun; |
1805 | } | 1802 | } |
1806 | } | 1803 | } |
1807 | public BinBVHAnimation GenerateRandomAnimation() | 1804 | public BinBVHAnimation GenerateRandomAnimation() |
@@ -2036,7 +2033,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2036 | return; | 2033 | return; |
2037 | } | 2034 | } |
2038 | 2035 | ||
2039 | m_perfMonMS = System.Environment.TickCount; | 2036 | m_perfMonMS = Environment.TickCount; |
2040 | 2037 | ||
2041 | m_rotation = rotation; | 2038 | m_rotation = rotation; |
2042 | NewForce newVelocity = new NewForce(); | 2039 | NewForce newVelocity = new NewForce(); |
@@ -2079,7 +2076,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2079 | newVelocity.Z = direc.Z; | 2076 | newVelocity.Z = direc.Z; |
2080 | m_forcesList.Add(newVelocity); | 2077 | m_forcesList.Add(newVelocity); |
2081 | 2078 | ||
2082 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); | 2079 | m_scene.AddAgentTime(Environment.TickCount - m_perfMonMS); |
2083 | } | 2080 | } |
2084 | 2081 | ||
2085 | #endregion | 2082 | #endregion |
@@ -2142,16 +2139,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
2142 | // server. | 2139 | // server. |
2143 | if (remoteClient.IsActive) | 2140 | if (remoteClient.IsActive) |
2144 | { | 2141 | { |
2145 | m_perfMonMS = System.Environment.TickCount; | 2142 | m_perfMonMS = Environment.TickCount; |
2146 | 2143 | ||
2147 | Vector3 pos = m_pos; | 2144 | Vector3 pos = m_pos; |
2148 | Vector3 vel = Velocity; | 2145 | Vector3 vel = Velocity; |
2149 | Quaternion rot = m_bodyRot; | 2146 | Quaternion rot = m_bodyRot; |
2150 | pos.Z -= m_appearance.HipOffset; | 2147 | pos.Z -= m_appearance.HipOffset; |
2151 | remoteClient.SendAvatarTerseUpdate(m_regionHandle, (ushort)(m_scene.TimeDilation * (float)ushort.MaxValue), LocalId, new Vector3(pos.X, pos.Y, pos.Z), | 2148 | remoteClient.SendAvatarTerseUpdate(m_regionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, new Vector3(pos.X, pos.Y, pos.Z), |
2152 | new Vector3(vel.X, vel.Y, vel.Z), rot); | 2149 | new Vector3(vel.X, vel.Y, vel.Z), rot); |
2153 | 2150 | ||
2154 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); | 2151 | m_scene.AddAgentTime(Environment.TickCount - m_perfMonMS); |
2155 | m_scene.AddAgentUpdates(1); | 2152 | m_scene.AddAgentUpdates(1); |
2156 | } | 2153 | } |
2157 | } | 2154 | } |
@@ -2161,7 +2158,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2161 | /// </summary> | 2158 | /// </summary> |
2162 | public void SendTerseUpdateToAllClients() | 2159 | public void SendTerseUpdateToAllClients() |
2163 | { | 2160 | { |
2164 | m_perfMonMS = System.Environment.TickCount; | 2161 | m_perfMonMS = Environment.TickCount; |
2165 | 2162 | ||
2166 | m_scene.Broadcast(SendTerseUpdateToClient); | 2163 | m_scene.Broadcast(SendTerseUpdateToClient); |
2167 | 2164 | ||
@@ -2169,13 +2166,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2169 | lastPhysPos = AbsolutePosition; | 2166 | lastPhysPos = AbsolutePosition; |
2170 | lastPhysRot = m_bodyRot; | 2167 | lastPhysRot = m_bodyRot; |
2171 | 2168 | ||
2172 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); | 2169 | m_scene.AddAgentTime(Environment.TickCount - m_perfMonMS); |
2173 | 2170 | ||
2174 | } | 2171 | } |
2175 | 2172 | ||
2176 | public void SendCoarseLocations() | 2173 | public void SendCoarseLocations() |
2177 | { | 2174 | { |
2178 | m_perfMonMS = System.Environment.TickCount; | 2175 | m_perfMonMS = Environment.TickCount; |
2179 | 2176 | ||
2180 | List<Vector3> CoarseLocations = new List<Vector3>(); | 2177 | List<Vector3> CoarseLocations = new List<Vector3>(); |
2181 | List<UUID> AvatarUUIDs = new List<UUID>(); | 2178 | List<UUID> AvatarUUIDs = new List<UUID>(); |
@@ -2210,7 +2207,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2210 | 2207 | ||
2211 | m_controllingClient.SendCoarseLocationUpdate(AvatarUUIDs, CoarseLocations); | 2208 | m_controllingClient.SendCoarseLocationUpdate(AvatarUUIDs, CoarseLocations); |
2212 | 2209 | ||
2213 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); | 2210 | m_scene.AddAgentTime(Environment.TickCount - m_perfMonMS); |
2214 | } | 2211 | } |
2215 | 2212 | ||
2216 | public void CoarseLocationChange() | 2213 | public void CoarseLocationChange() |
@@ -2252,7 +2249,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2252 | /// </summary> | 2249 | /// </summary> |
2253 | public void SendInitialFullUpdateToAllClients() | 2250 | public void SendInitialFullUpdateToAllClients() |
2254 | { | 2251 | { |
2255 | m_perfMonMS = System.Environment.TickCount; | 2252 | m_perfMonMS = Environment.TickCount; |
2256 | 2253 | ||
2257 | List<ScenePresence> avatars = m_scene.GetScenePresences(); | 2254 | List<ScenePresence> avatars = m_scene.GetScenePresences(); |
2258 | foreach (ScenePresence avatar in avatars) | 2255 | foreach (ScenePresence avatar in avatars) |
@@ -2269,24 +2266,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
2269 | { | 2266 | { |
2270 | if (!avatar.IsChildAgent) | 2267 | if (!avatar.IsChildAgent) |
2271 | { | 2268 | { |
2272 | m_log.Debug(DateTime.Now.ToString()); | ||
2273 | avatar.SendFullUpdateToOtherClient(this); | 2269 | avatar.SendFullUpdateToOtherClient(this); |
2274 | avatar.SendAppearanceToOtherAgent(this); | 2270 | avatar.SendAppearanceToOtherAgent(this); |
2275 | if (m_sitStatus) | 2271 | if (m_sitStatus) |
2276 | GenerateRandomAnimation(); | 2272 | GenerateRandomAnimation(); |
2277 | avatar.SendAnimPackToClient(this.ControllingClient); | 2273 | avatar.SendAnimPackToClient(ControllingClient); |
2278 | } | 2274 | } |
2279 | } | 2275 | } |
2280 | } | 2276 | } |
2281 | m_scene.AddAgentUpdates(avatars.Count); | 2277 | m_scene.AddAgentUpdates(avatars.Count); |
2282 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); | 2278 | m_scene.AddAgentTime(Environment.TickCount - m_perfMonMS); |
2283 | 2279 | ||
2284 | //SendAnimPack(); | 2280 | //SendAnimPack(); |
2285 | } | 2281 | } |
2286 | 2282 | ||
2287 | public void SendFullUpdateToAllClients() | 2283 | public void SendFullUpdateToAllClients() |
2288 | { | 2284 | { |
2289 | m_perfMonMS = System.Environment.TickCount; | 2285 | m_perfMonMS = Environment.TickCount; |
2290 | 2286 | ||
2291 | if (m_sitStatus) | 2287 | if (m_sitStatus) |
2292 | GenerateRandomAnimation(); | 2288 | GenerateRandomAnimation(); |
@@ -2298,7 +2294,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2298 | 2294 | ||
2299 | } | 2295 | } |
2300 | m_scene.AddAgentUpdates(avatars.Count); | 2296 | m_scene.AddAgentUpdates(avatars.Count); |
2301 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); | 2297 | m_scene.AddAgentTime(Environment.TickCount - m_perfMonMS); |
2302 | 2298 | ||
2303 | SendAnimPack(); | 2299 | SendAnimPack(); |
2304 | } | 2300 | } |
@@ -2333,7 +2329,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2333 | /// <summary> | 2329 | /// <summary> |
2334 | /// Tell the client for this scene presence what items it should be wearing now | 2330 | /// Tell the client for this scene presence what items it should be wearing now |
2335 | /// </summary> | 2331 | /// </summary> |
2336 | /// <param name="client"></param> | ||
2337 | public void SendWearables() | 2332 | public void SendWearables() |
2338 | { | 2333 | { |
2339 | ControllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++); | 2334 | ControllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++); |
@@ -2344,7 +2339,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2344 | /// </summary> | 2339 | /// </summary> |
2345 | public void SendAppearanceToAllOtherAgents() | 2340 | public void SendAppearanceToAllOtherAgents() |
2346 | { | 2341 | { |
2347 | m_perfMonMS = System.Environment.TickCount; | 2342 | m_perfMonMS = Environment.TickCount; |
2348 | 2343 | ||
2349 | m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) | 2344 | m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) |
2350 | { | 2345 | { |
@@ -2354,7 +2349,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2354 | } | 2349 | } |
2355 | }); | 2350 | }); |
2356 | 2351 | ||
2357 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); | 2352 | m_scene.AddAgentTime(Environment.TickCount - m_perfMonMS); |
2358 | } | 2353 | } |
2359 | 2354 | ||
2360 | /// <summary> | 2355 | /// <summary> |
@@ -2421,6 +2416,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2421 | /// </summary> | 2416 | /// </summary> |
2422 | /// <param name="animations"></param> | 2417 | /// <param name="animations"></param> |
2423 | /// <param name="seqs"></param> | 2418 | /// <param name="seqs"></param> |
2419 | /// <param name="objectIDs"></param> | ||
2424 | public void SendAnimPack(UUID[] animations, int[] seqs, UUID[] objectIDs) | 2420 | public void SendAnimPack(UUID[] animations, int[] seqs, UUID[] objectIDs) |
2425 | { | 2421 | { |
2426 | if (m_isChildAgent) | 2422 | if (m_isChildAgent) |
@@ -2759,7 +2755,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2759 | int innacurateNeighbors = m_scene.GetInaccurateNeighborCount(); | 2755 | int innacurateNeighbors = m_scene.GetInaccurateNeighborCount(); |
2760 | if (innacurateNeighbors != 0) | 2756 | if (innacurateNeighbors != 0) |
2761 | { | 2757 | { |
2762 | multiplier = 1f / (float)innacurateNeighbors; | 2758 | multiplier = 1f / innacurateNeighbors; |
2763 | } | 2759 | } |
2764 | if (multiplier <= 0f) | 2760 | if (multiplier <= 0f) |
2765 | { | 2761 | { |
@@ -3369,7 +3365,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3369 | LastCommands = allflags; | 3365 | LastCommands = allflags; |
3370 | } | 3366 | } |
3371 | 3367 | ||
3372 | internal uint RemoveIgnoredControls(uint flags, ScriptControlled Ignored) | 3368 | internal static uint RemoveIgnoredControls(uint flags, ScriptControlled Ignored) |
3373 | { | 3369 | { |
3374 | if (Ignored == ScriptControlled.CONTROL_ZERO) | 3370 | if (Ignored == ScriptControlled.CONTROL_ZERO) |
3375 | return flags; | 3371 | return flags; |
@@ -3460,7 +3456,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3460 | { | 3456 | { |
3461 | // Attach from world, if not already attached | 3457 | // Attach from world, if not already attached |
3462 | if (att.ParentGroup != null && !att.IsAttachment) | 3458 | if (att.ParentGroup != null && !att.IsAttachment) |
3463 | m_scene.AttachObject(ControllingClient, att.ParentGroup.LocalId, (uint)0, Quaternion.Identity, att.ParentGroup.AbsolutePosition, false); | 3459 | m_scene.AttachObject(ControllingClient, att.ParentGroup.LocalId, 0, Quaternion.Identity, att.ParentGroup.AbsolutePosition, false); |
3464 | } | 3460 | } |
3465 | catch (NullReferenceException) | 3461 | catch (NullReferenceException) |
3466 | { | 3462 | { |