Initial Online friends notification seems to be working reliably now. All this needs more testing, but everything is there.

This commit is contained in:
Diva Canto
2010-02-28 12:07:38 -08:00
parent db24e57cab
commit 5c5966545d
14 changed files with 97 additions and 39 deletions

View File

@@ -66,13 +66,16 @@ namespace OpenSim.Region.Framework.Scenes
public event OnClientConnectCoreDelegate OnClientConnect;
public delegate void OnNewClientDelegate(IClientAPI client);
/// <summary>
/// Deprecated in favour of OnClientConnect.
/// Will be marked Obsolete after IClientCore has 100% of IClientAPI interfaces.
/// </summary>
public event OnNewClientDelegate OnNewClient;
public delegate void OnClientLoginDelegate(IClientAPI client);
public event OnClientLoginDelegate OnClientLogin;
public delegate void OnNewPresenceDelegate(ScenePresence presence);
public event OnNewPresenceDelegate OnNewPresence;
@@ -583,6 +586,28 @@ namespace OpenSim.Region.Framework.Scenes
}
}
public void TriggerOnClientLogin(IClientAPI client)
{
OnClientLoginDelegate handlerClientLogin = OnClientLogin;
if (handlerClientLogin != null)
{
foreach (OnClientLoginDelegate d in handlerClientLogin.GetInvocationList())
{
try
{
d(client);
}
catch (Exception e)
{
m_log.ErrorFormat(
"[EVENT MANAGER]: Delegate for TriggerOnClientLogin failed - continuing. {0} {1}",
e.Message, e.StackTrace);
}
}
}
}
public void TriggerOnNewPresence(ScenePresence presence)
{
OnNewPresenceDelegate handlerNewPresence = OnNewPresence;