diff options
author | Teravus Ovares | 2008-01-16 05:48:40 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-01-16 05:48:40 +0000 |
commit | 5dd741267eae5c7dfcd20372ba1b43904dd4503a (patch) | |
tree | 15bc97bf2552a6fb45aec9eea401aa9a80190efc /OpenSim/Region/Environment/Scenes/ScenePresence.cs | |
parent | * Added Packets In/s, Packets Out/s and Current un_acked Packets to the SimSt... (diff) | |
download | opensim-SC_OLD-5dd741267eae5c7dfcd20372ba1b43904dd4503a.zip opensim-SC_OLD-5dd741267eae5c7dfcd20372ba1b43904dd4503a.tar.gz opensim-SC_OLD-5dd741267eae5c7dfcd20372ba1b43904dd4503a.tar.bz2 opensim-SC_OLD-5dd741267eae5c7dfcd20372ba1b43904dd4503a.tar.xz |
* Added Agent Time, Pending Downloads, and made Agent Updates/Sec actually accurate.
* We're only missing, the script related sim stats counters and the Images time counter and the Pending Uploads counter. The rest of them are actually implemented now.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 2e2bb62..30ad4a5 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -56,6 +56,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
56 | private float m_sitAvatarHeight = 2.0f; | 56 | private float m_sitAvatarHeight = 2.0f; |
57 | private float m_godlevel = 0; | 57 | private float m_godlevel = 0; |
58 | 58 | ||
59 | private int m_perfMonMS = 0; | ||
60 | |||
59 | private bool m_setAlwaysRun = false; | 61 | private bool m_setAlwaysRun = false; |
60 | 62 | ||
61 | private Quaternion m_bodyRot; | 63 | private Quaternion m_bodyRot; |
@@ -402,12 +404,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
402 | // this.UpdateQuadTreeNode(); | 404 | // this.UpdateQuadTreeNode(); |
403 | //this.RefreshQuadObject(); | 405 | //this.RefreshQuadObject(); |
404 | //} | 406 | //} |
407 | m_perfMonMS = System.Environment.TickCount; | ||
408 | |||
405 | if (!m_gotAllObjectsInScene) | 409 | if (!m_gotAllObjectsInScene) |
406 | { | 410 | { |
407 | if (!m_isChildAgent || m_scene.m_sendTasksToChild) | 411 | if (!m_isChildAgent || m_scene.m_sendTasksToChild) |
408 | { | 412 | { |
413 | |||
409 | m_scene.SendAllSceneObjectsToClient(this); | 414 | m_scene.SendAllSceneObjectsToClient(this); |
410 | m_gotAllObjectsInScene = true; | 415 | m_gotAllObjectsInScene = true; |
416 | |||
411 | } | 417 | } |
412 | } | 418 | } |
413 | if (m_partsUpdateQueue.Count > 0) | 419 | if (m_partsUpdateQueue.Count > 0) |
@@ -464,6 +470,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
464 | } | 470 | } |
465 | } | 471 | } |
466 | } | 472 | } |
473 | |||
474 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); | ||
467 | } | 475 | } |
468 | 476 | ||
469 | public void forceAvatarMovement(Vector3 position, Quaternion rotation) | 477 | public void forceAvatarMovement(Vector3 position, Quaternion rotation) |
@@ -634,6 +642,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
634 | // Must check for standing up even when PhysicsActor is null, | 642 | // Must check for standing up even when PhysicsActor is null, |
635 | // since sitting currently removes avatar from physical scene | 643 | // since sitting currently removes avatar from physical scene |
636 | 644 | ||
645 | m_perfMonMS = System.Environment.TickCount; | ||
646 | |||
637 | uint flags = agentData.AgentData.ControlFlags; | 647 | uint flags = agentData.AgentData.ControlFlags; |
638 | LLQuaternion bodyRotation = agentData.AgentData.BodyRotation; | 648 | LLQuaternion bodyRotation = agentData.AgentData.BodyRotation; |
639 | 649 | ||
@@ -760,8 +770,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
760 | UpdateMovementAnimations(update_movementflag); | 770 | UpdateMovementAnimations(update_movementflag); |
761 | } | 771 | } |
762 | } | 772 | } |
763 | 773 | ||
764 | m_scene.EventManager.TriggerOnClientMovement(this); | 774 | m_scene.EventManager.TriggerOnClientMovement(this); |
775 | |||
776 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); | ||
765 | } | 777 | } |
766 | 778 | ||
767 | /// <summary> | 779 | /// <summary> |
@@ -1008,6 +1020,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1008 | /// </summary> | 1020 | /// </summary> |
1009 | protected void UpdateMovementAnimations(bool update_movementflag) | 1021 | protected void UpdateMovementAnimations(bool update_movementflag) |
1010 | { | 1022 | { |
1023 | |||
1024 | |||
1011 | if (update_movementflag) | 1025 | if (update_movementflag) |
1012 | { | 1026 | { |
1013 | // Are we moving? | 1027 | // Are we moving? |
@@ -1081,6 +1095,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1081 | } | 1095 | } |
1082 | } | 1096 | } |
1083 | } | 1097 | } |
1098 | |||
1084 | } | 1099 | } |
1085 | 1100 | ||
1086 | /// <summary> | 1101 | /// <summary> |
@@ -1093,6 +1108,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
1093 | Console.WriteLine("DEBUG: AddNewMovement: child agent"); | 1108 | Console.WriteLine("DEBUG: AddNewMovement: child agent"); |
1094 | return; | 1109 | return; |
1095 | } | 1110 | } |
1111 | |||
1112 | m_perfMonMS = System.Environment.TickCount; | ||
1113 | |||
1096 | m_rotation = rotation; | 1114 | m_rotation = rotation; |
1097 | NewForce newVelocity = new NewForce(); | 1115 | NewForce newVelocity = new NewForce(); |
1098 | Vector3 direc = rotation*vec; | 1116 | Vector3 direc = rotation*vec; |
@@ -1134,6 +1152,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1134 | newVelocity.Y = direc.y; | 1152 | newVelocity.Y = direc.y; |
1135 | newVelocity.Z = direc.z; | 1153 | newVelocity.Z = direc.z; |
1136 | m_forcesList.Add(newVelocity); | 1154 | m_forcesList.Add(newVelocity); |
1155 | |||
1156 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); | ||
1137 | } | 1157 | } |
1138 | 1158 | ||
1139 | #endregion | 1159 | #endregion |
@@ -1190,11 +1210,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
1190 | /// <param name="remoteClient"></param> | 1210 | /// <param name="remoteClient"></param> |
1191 | public void SendTerseUpdateToClient(IClientAPI remoteClient) | 1211 | public void SendTerseUpdateToClient(IClientAPI remoteClient) |
1192 | { | 1212 | { |
1213 | m_perfMonMS = System.Environment.TickCount; | ||
1214 | |||
1193 | LLVector3 pos = m_pos; | 1215 | LLVector3 pos = m_pos; |
1194 | LLVector3 vel = Velocity; | 1216 | LLVector3 vel = Velocity; |
1195 | LLQuaternion rot = new LLQuaternion(m_bodyRot.x, m_bodyRot.y, m_bodyRot.z, m_bodyRot.w); | 1217 | LLQuaternion rot = new LLQuaternion(m_bodyRot.x, m_bodyRot.y, m_bodyRot.z, m_bodyRot.w); |
1196 | remoteClient.SendAvatarTerseUpdate(m_regionHandle, 64096, LocalId, new LLVector3(pos.X, pos.Y, pos.Z), | 1218 | remoteClient.SendAvatarTerseUpdate(m_regionHandle, 64096, LocalId, new LLVector3(pos.X, pos.Y, pos.Z), |
1197 | new LLVector3(vel.X, vel.Y, vel.Z), rot); | 1219 | new LLVector3(vel.X, vel.Y, vel.Z), rot); |
1220 | |||
1221 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); | ||
1222 | m_scene.AddAgentUpdates(1); | ||
1198 | } | 1223 | } |
1199 | 1224 | ||
1200 | /// <summary> | 1225 | /// <summary> |
@@ -1202,11 +1227,18 @@ namespace OpenSim.Region.Environment.Scenes | |||
1202 | /// </summary> | 1227 | /// </summary> |
1203 | public void SendTerseUpdateToAllClients() | 1228 | public void SendTerseUpdateToAllClients() |
1204 | { | 1229 | { |
1230 | m_perfMonMS = System.Environment.TickCount; | ||
1231 | |||
1205 | m_scene.Broadcast(SendTerseUpdateToClient); | 1232 | m_scene.Broadcast(SendTerseUpdateToClient); |
1233 | |||
1234 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); | ||
1235 | |||
1206 | } | 1236 | } |
1207 | 1237 | ||
1208 | public void SendCoarseLocations() | 1238 | public void SendCoarseLocations() |
1209 | { | 1239 | { |
1240 | m_perfMonMS = System.Environment.TickCount; | ||
1241 | |||
1210 | List<LLVector3> CoarseLocations = new List<LLVector3>(); | 1242 | List<LLVector3> CoarseLocations = new List<LLVector3>(); |
1211 | List<ScenePresence> avatars = m_scene.GetAvatars(); | 1243 | List<ScenePresence> avatars = m_scene.GetAvatars(); |
1212 | for (int i = 0; i < avatars.Count; i++) | 1244 | for (int i = 0; i < avatars.Count; i++) |
@@ -1218,6 +1250,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1218 | } | 1250 | } |
1219 | 1251 | ||
1220 | m_controllingClient.SendCoarseLocationUpdate(CoarseLocations); | 1252 | m_controllingClient.SendCoarseLocationUpdate(CoarseLocations); |
1253 | |||
1254 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); | ||
1221 | } | 1255 | } |
1222 | 1256 | ||
1223 | public void CoarseLocationChange() | 1257 | public void CoarseLocationChange() |
@@ -1234,6 +1268,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1234 | remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, | 1268 | remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, |
1235 | LocalId, m_pos, m_appearance.TextureEntry.ToBytes(), | 1269 | LocalId, m_pos, m_appearance.TextureEntry.ToBytes(), |
1236 | m_parentID); | 1270 | m_parentID); |
1271 | m_scene.AddAgentUpdates(1); | ||
1237 | } | 1272 | } |
1238 | 1273 | ||
1239 | /// <summary> | 1274 | /// <summary> |
@@ -1241,6 +1276,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1241 | /// </summary> | 1276 | /// </summary> |
1242 | public void SendFullUpdateToAllClients() | 1277 | public void SendFullUpdateToAllClients() |
1243 | { | 1278 | { |
1279 | m_perfMonMS = System.Environment.TickCount; | ||
1280 | |||
1244 | List<ScenePresence> avatars = m_scene.GetScenePresences(); | 1281 | List<ScenePresence> avatars = m_scene.GetScenePresences(); |
1245 | foreach (ScenePresence avatar in avatars) | 1282 | foreach (ScenePresence avatar in avatars) |
1246 | { | 1283 | { |
@@ -1254,6 +1291,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1254 | } | 1291 | } |
1255 | } | 1292 | } |
1256 | } | 1293 | } |
1294 | m_scene.AddAgentUpdates(avatars.Count); | ||
1295 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); | ||
1257 | } | 1296 | } |
1258 | 1297 | ||
1259 | /// <summary> | 1298 | /// <summary> |
@@ -1289,6 +1328,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1289 | /// </summary> | 1328 | /// </summary> |
1290 | public void SendAppearanceToAllOtherAgents() | 1329 | public void SendAppearanceToAllOtherAgents() |
1291 | { | 1330 | { |
1331 | m_perfMonMS=System.Environment.TickCount; | ||
1332 | |||
1292 | m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) | 1333 | m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) |
1293 | { | 1334 | { |
1294 | if (scenePresence.UUID != UUID) | 1335 | if (scenePresence.UUID != UUID) |
@@ -1296,6 +1337,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1296 | m_appearance.SendAppearanceToOtherAgent(scenePresence); | 1337 | m_appearance.SendAppearanceToOtherAgent(scenePresence); |
1297 | } | 1338 | } |
1298 | }); | 1339 | }); |
1340 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); | ||
1299 | } | 1341 | } |
1300 | 1342 | ||
1301 | public void SendAppearanceToOtherAgent(ScenePresence avatar) | 1343 | public void SendAppearanceToOtherAgent(ScenePresence avatar) |