diff options
author | Justin Clark-Casey (justincc) | 2011-11-15 20:26:42 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-11-15 20:26:42 +0000 |
commit | 828e4a5b093c6a67302776137fc0bdbcfded4c9b (patch) | |
tree | 2e23acc14ca786cb9f5484004222e03829bdfc60 /OpenSim/Region | |
parent | Instead of having scene add/remove collision events directly to the OdeScene ... (diff) | |
download | opensim-SC-828e4a5b093c6a67302776137fc0bdbcfded4c9b.zip opensim-SC-828e4a5b093c6a67302776137fc0bdbcfded4c9b.tar.gz opensim-SC-828e4a5b093c6a67302776137fc0bdbcfded4c9b.tar.bz2 opensim-SC-828e4a5b093c6a67302776137fc0bdbcfded4c9b.tar.xz |
Add comments about trying to avoid synchronous work off the EventManager.OnMakeRootAgent event since this is on the critical path for transfer of avatars from one region to another.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 13 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 3 |
3 files changed, 16 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 21640cf..c266fe5 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using System.Threading; | ||
32 | using log4net; | 33 | using log4net; |
33 | using Nini.Config; | 34 | using Nini.Config; |
34 | using Nwc.XmlRpc; | 35 | using Nwc.XmlRpc; |
@@ -856,7 +857,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
856 | IClientAPI friendClient = LocateClientObject(friendID); | 857 | IClientAPI friendClient = LocateClientObject(friendID); |
857 | if (friendClient != null) | 858 | if (friendClient != null) |
858 | { | 859 | { |
859 | // the friend in this sim as root agent | 860 | // the friend in this sim as root agent |
860 | if (online) | 861 | if (online) |
861 | friendClient.SendAgentOnline(new UUID[] { userID }); | 862 | friendClient.SendAgentOnline(new UUID[] { userID }); |
862 | else | 863 | else |
@@ -913,6 +914,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
913 | 914 | ||
914 | private void RecacheFriends(IClientAPI client) | 915 | private void RecacheFriends(IClientAPI client) |
915 | { | 916 | { |
917 | // FIXME: Ideally, we want to avoid doing this here since it sits the EventManager.OnMakeRootAgent event | ||
918 | // is on the critical path for transferring an avatar from one region to another. | ||
916 | UUID agentID = client.AgentId; | 919 | UUID agentID = client.AgentId; |
917 | lock (m_Friends) | 920 | lock (m_Friends) |
918 | { | 921 | { |
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index bf9ad65..4906665 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -212,10 +212,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
212 | public delegate void OnMakeChildAgentDelegate(ScenePresence presence); | 212 | public delegate void OnMakeChildAgentDelegate(ScenePresence presence); |
213 | public event OnMakeChildAgentDelegate OnMakeChildAgent; | 213 | public event OnMakeChildAgentDelegate OnMakeChildAgent; |
214 | 214 | ||
215 | public delegate void OnMakeRootAgentDelegate(ScenePresence presence); | ||
216 | public delegate void OnSaveNewWindlightProfileDelegate(); | 215 | public delegate void OnSaveNewWindlightProfileDelegate(); |
217 | public delegate void OnSendNewWindlightProfileTargetedDelegate(RegionLightShareData wl, UUID user); | 216 | public delegate void OnSendNewWindlightProfileTargetedDelegate(RegionLightShareData wl, UUID user); |
218 | public event OnMakeRootAgentDelegate OnMakeRootAgent; | 217 | |
218 | /// <summary> | ||
219 | /// This event is on the critical path for transferring an avatar from one region to another. Try and do | ||
220 | /// as little work on this event as possible, or do work asynchronously. | ||
221 | /// </summary> | ||
222 | public event Action<ScenePresence> OnMakeRootAgent; | ||
223 | |||
219 | public event OnSendNewWindlightProfileTargetedDelegate OnSendNewWindlightProfileTargeted; | 224 | public event OnSendNewWindlightProfileTargetedDelegate OnSendNewWindlightProfileTargeted; |
220 | public event OnSaveNewWindlightProfileDelegate OnSaveNewWindlightProfile; | 225 | public event OnSaveNewWindlightProfileDelegate OnSaveNewWindlightProfile; |
221 | 226 | ||
@@ -1322,10 +1327,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1322 | 1327 | ||
1323 | public void TriggerOnMakeRootAgent(ScenePresence presence) | 1328 | public void TriggerOnMakeRootAgent(ScenePresence presence) |
1324 | { | 1329 | { |
1325 | OnMakeRootAgentDelegate handlerMakeRootAgent = OnMakeRootAgent; | 1330 | Action<ScenePresence> handlerMakeRootAgent = OnMakeRootAgent; |
1326 | if (handlerMakeRootAgent != null) | 1331 | if (handlerMakeRootAgent != null) |
1327 | { | 1332 | { |
1328 | foreach (OnMakeRootAgentDelegate d in handlerMakeRootAgent.GetInvocationList()) | 1333 | foreach (Action<ScenePresence> d in handlerMakeRootAgent.GetInvocationList()) |
1329 | { | 1334 | { |
1330 | try | 1335 | try |
1331 | { | 1336 | { |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 189394e..5587073 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -865,6 +865,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
865 | /// avatar is actual in the sim. They can perform all actions. | 865 | /// avatar is actual in the sim. They can perform all actions. |
866 | /// This change is made whenever an avatar enters a region, whether by crossing over from a neighbouring sim, | 866 | /// This change is made whenever an avatar enters a region, whether by crossing over from a neighbouring sim, |
867 | /// teleporting in or on initial login. | 867 | /// teleporting in or on initial login. |
868 | /// | ||
869 | /// This method is on the critical path for transferring an avatar from one region to another. Delay here | ||
870 | /// delays that crossing. | ||
868 | /// </summary> | 871 | /// </summary> |
869 | public void MakeRootAgent(Vector3 pos, bool isFlying) | 872 | public void MakeRootAgent(Vector3 pos, bool isFlying) |
870 | { | 873 | { |