From 50803dfe2ca8818f438d740e788762e1faf1078c Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 15 Nov 2011 15:57:53 +0000
Subject: For clients that are entering a simulator from initial login, stop
executing FriendsModule.FetchFriendslist() asychronously.
Executing this asynchronously allows a race condition where subsequent friends fetches hit a cache that FetchFriendsList() had not yet populated.
Changing this to synchronous may improve issues where a user does not see friends as online even though they are.
I don't believe synchronous is a problem here, but if it is, then a more complicated signalling mechanism is required. Locking the cache isn't sufficient.
---
OpenSim/Region/Framework/Scenes/EventManager.cs | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 96da2c3..bf9ad65 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -73,8 +73,10 @@ namespace OpenSim.Region.Framework.Scenes
///
public event OnNewClientDelegate OnNewClient;
- public delegate void OnClientLoginDelegate(IClientAPI client);
- public event OnClientLoginDelegate OnClientLogin;
+ ///
+ /// Fired if the client entering this sim is doing so as a new login
+ ///
+ public event Action OnClientLogin;
public delegate void OnNewPresenceDelegate(ScenePresence presence);
@@ -651,10 +653,10 @@ namespace OpenSim.Region.Framework.Scenes
public void TriggerOnClientLogin(IClientAPI client)
{
- OnClientLoginDelegate handlerClientLogin = OnClientLogin;
+ Action handlerClientLogin = OnClientLogin;
if (handlerClientLogin != null)
{
- foreach (OnClientLoginDelegate d in handlerClientLogin.GetInvocationList())
+ foreach (Action d in handlerClientLogin.GetInvocationList())
{
try
{
--
cgit v1.1