diff options
author | Melanie Thielker | 2009-05-01 17:10:42 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-05-01 17:10:42 +0000 |
commit | 8020af61845eaf408d9db0ee5d3958b60809d67b (patch) | |
tree | 900f2bcc630619a9ce4e67d6aa1fe0f1bcd8d413 | |
parent | Send the animations of all already present avatar to an avatar entering a sim (diff) | |
download | opensim-SC_OLD-8020af61845eaf408d9db0ee5d3958b60809d67b.zip opensim-SC_OLD-8020af61845eaf408d9db0ee5d3958b60809d67b.tar.gz opensim-SC_OLD-8020af61845eaf408d9db0ee5d3958b60809d67b.tar.bz2 opensim-SC_OLD-8020af61845eaf408d9db0ee5d3958b60809d67b.tar.xz |
Add methods to block and queue agent updates during region crossing and TP
This is to ensure integrity of animations and script states with regard
to controls pressed or released. No user functionality yet.
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 72c6630..f01a1cd 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -116,6 +116,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
116 | 116 | ||
117 | private bool m_setAlwaysRun; | 117 | private bool m_setAlwaysRun; |
118 | 118 | ||
119 | private bool m_updatesAllowed = true; | ||
120 | private List<AgentUpdateArgs> m_agentUpdates = new List<AgentUpdateArgs>(); | ||
119 | private string m_movementAnimation = "DEFAULT"; | 121 | private string m_movementAnimation = "DEFAULT"; |
120 | private long m_animPersistUntil = 0; | 122 | private long m_animPersistUntil = 0; |
121 | private bool m_allowFalling = false; | 123 | private bool m_allowFalling = false; |
@@ -1127,11 +1129,52 @@ namespace OpenSim.Region.Framework.Scenes | |||
1127 | 1129 | ||
1128 | } | 1130 | } |
1129 | 1131 | ||
1132 | // These methods allow to queue up agent updates (like key presses) | ||
1133 | // until all attachment scripts are running and the animations from | ||
1134 | // AgentDataUpdate have been started. It is essential for combat | ||
1135 | // devices, weapons and AOs that keypresses are not processed | ||
1136 | // until scripts that are potentially interested in them are | ||
1137 | // up and running and that animations a script knows to be running | ||
1138 | // from before a crossing are running again | ||
1139 | // | ||
1140 | public void LockAgentUpdates() | ||
1141 | { | ||
1142 | m_updatesAllowed = false; | ||
1143 | } | ||
1144 | |||
1145 | public void UnlockAgentUpdates() | ||
1146 | { | ||
1147 | lock (m_agentUpdates) | ||
1148 | { | ||
1149 | if (m_updatesAllowed == false) | ||
1150 | { | ||
1151 | foreach (AgentUpdateArgs a in m_agentUpdates) | ||
1152 | RealHandleAgentUpdate(ControllingClient, a); | ||
1153 | m_agentUpdates.Clear(); | ||
1154 | m_updatesAllowed = true; | ||
1155 | } | ||
1156 | } | ||
1157 | } | ||
1158 | |||
1130 | /// <summary> | 1159 | /// <summary> |
1131 | /// This is the event handler for client movement. If a client is moving, this event is triggering. | 1160 | /// This is the event handler for client movement. If a client is moving, this event is triggering. |
1132 | /// </summary> | 1161 | /// </summary> |
1133 | public void HandleAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) | 1162 | public void HandleAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) |
1134 | { | 1163 | { |
1164 | lock (m_agentUpdates) | ||
1165 | { | ||
1166 | if (m_updatesAllowed) | ||
1167 | { | ||
1168 | RealHandleAgentUpdate(remoteClient, agentData); | ||
1169 | return; | ||
1170 | } | ||
1171 | |||
1172 | m_agentUpdates.Add(agentData); | ||
1173 | } | ||
1174 | } | ||
1175 | |||
1176 | private void RealHandleAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) | ||
1177 | { | ||
1135 | //if (m_isChildAgent) | 1178 | //if (m_isChildAgent) |
1136 | //{ | 1179 | //{ |
1137 | // // m_log.Debug("DEBUG: HandleAgentUpdate: child agent"); | 1180 | // // m_log.Debug("DEBUG: HandleAgentUpdate: child agent"); |