aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorDiva Canto2010-02-28 12:07:38 -0800
committerDiva Canto2010-02-28 12:07:38 -0800
commit5c5966545d14de43500b95109e8ce81058ebe2c3 (patch)
tree732f9f47668141b177a8f6e9e6e6d64aa0ee722d /OpenSim/Region/Framework
parentFriends connectors finished. Status notification working across the board. On... (diff)
downloadopensim-SC_OLD-5c5966545d14de43500b95109e8ce81058ebe2c3.zip
opensim-SC_OLD-5c5966545d14de43500b95109e8ce81058ebe2c3.tar.gz
opensim-SC_OLD-5c5966545d14de43500b95109e8ce81058ebe2c3.tar.bz2
opensim-SC_OLD-5c5966545d14de43500b95109e8ce81058ebe2c3.tar.xz
Initial Online friends notification seems to be working reliably now. All this needs more testing, but everything is there.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IFriendsModule.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs27
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs6
4 files changed, 37 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs b/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs
index 239a2ba..a0a1e3a 100644
--- a/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs
@@ -47,5 +47,6 @@ namespace OpenSim.Region.Framework.Interfaces
47 /// <param name="offerMessage"></param> 47 /// <param name="offerMessage"></param>
48 void OfferFriendship(UUID fromUserId, IClientAPI toUserClient, string offerMessage); 48 void OfferFriendship(UUID fromUserId, IClientAPI toUserClient, string offerMessage);
49 uint GetFriendPerms(UUID PrincipalID, UUID FriendID); 49 uint GetFriendPerms(UUID PrincipalID, UUID FriendID);
50 void SendFriendsOnlineIfNeeded(IClientAPI client);
50 } 51 }
51} 52}
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 57e1c37..ac04462 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -66,13 +66,16 @@ namespace OpenSim.Region.Framework.Scenes
66 public event OnClientConnectCoreDelegate OnClientConnect; 66 public event OnClientConnectCoreDelegate OnClientConnect;
67 67
68 public delegate void OnNewClientDelegate(IClientAPI client); 68 public delegate void OnNewClientDelegate(IClientAPI client);
69 69
70 /// <summary> 70 /// <summary>
71 /// Deprecated in favour of OnClientConnect. 71 /// Deprecated in favour of OnClientConnect.
72 /// Will be marked Obsolete after IClientCore has 100% of IClientAPI interfaces. 72 /// Will be marked Obsolete after IClientCore has 100% of IClientAPI interfaces.
73 /// </summary> 73 /// </summary>
74 public event OnNewClientDelegate OnNewClient; 74 public event OnNewClientDelegate OnNewClient;
75 75
76 public delegate void OnClientLoginDelegate(IClientAPI client);
77 public event OnClientLoginDelegate OnClientLogin;
78
76 public delegate void OnNewPresenceDelegate(ScenePresence presence); 79 public delegate void OnNewPresenceDelegate(ScenePresence presence);
77 80
78 public event OnNewPresenceDelegate OnNewPresence; 81 public event OnNewPresenceDelegate OnNewPresence;
@@ -583,6 +586,28 @@ namespace OpenSim.Region.Framework.Scenes
583 } 586 }
584 } 587 }
585 588
589 public void TriggerOnClientLogin(IClientAPI client)
590 {
591 OnClientLoginDelegate handlerClientLogin = OnClientLogin;
592 if (handlerClientLogin != null)
593 {
594 foreach (OnClientLoginDelegate d in handlerClientLogin.GetInvocationList())
595 {
596 try
597 {
598 d(client);
599 }
600 catch (Exception e)
601 {
602 m_log.ErrorFormat(
603 "[EVENT MANAGER]: Delegate for TriggerOnClientLogin failed - continuing. {0} {1}",
604 e.Message, e.StackTrace);
605 }
606 }
607 }
608
609 }
610
586 public void TriggerOnNewPresence(ScenePresence presence) 611 public void TriggerOnNewPresence(ScenePresence presence)
587 { 612 {
588 OnNewPresenceDelegate handlerNewPresence = OnNewPresence; 613 OnNewPresenceDelegate handlerNewPresence = OnNewPresence;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index b9b16ad..d00c990 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2422,6 +2422,8 @@ namespace OpenSim.Region.Framework.Scenes
2422 /// <param name="client"></param> 2422 /// <param name="client"></param>
2423 public override void AddNewClient(IClientAPI client) 2423 public override void AddNewClient(IClientAPI client)
2424 { 2424 {
2425 bool vialogin = false;
2426
2425 m_clientManager.Add(client); 2427 m_clientManager.Add(client);
2426 2428
2427 CheckHeartbeat(); 2429 CheckHeartbeat();
@@ -2463,6 +2465,7 @@ namespace OpenSim.Region.Framework.Scenes
2463 if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0) 2465 if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0)
2464 { 2466 {
2465 m_log.DebugFormat("[Scene]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); 2467 m_log.DebugFormat("[Scene]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
2468 vialogin = true;
2466 IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>(); 2469 IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>();
2467 if (userVerification != null) 2470 if (userVerification != null)
2468 { 2471 {
@@ -2512,7 +2515,8 @@ namespace OpenSim.Region.Framework.Scenes
2512 2515
2513 m_LastLogin = Util.EnvironmentTickCount(); 2516 m_LastLogin = Util.EnvironmentTickCount();
2514 EventManager.TriggerOnNewClient(client); 2517 EventManager.TriggerOnNewClient(client);
2515 2518 if (vialogin)
2519 EventManager.TriggerOnClientLogin(client);
2516 } 2520 }
2517 2521
2518 2522
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index af9afa6..f83a4d2 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1114,7 +1114,7 @@ namespace OpenSim.Region.Framework.Scenes
1114 /// This is called upon a very important packet sent from the client, 1114 /// This is called upon a very important packet sent from the client,
1115 /// so it's client-controlled. Never call this method directly. 1115 /// so it's client-controlled. Never call this method directly.
1116 /// </summary> 1116 /// </summary>
1117 public void CompleteMovement() 1117 public void CompleteMovement(IClientAPI client)
1118 { 1118 {
1119 //m_log.Debug("[SCENE PRESENCE]: CompleteMovement"); 1119 //m_log.Debug("[SCENE PRESENCE]: CompleteMovement");
1120 1120
@@ -1159,6 +1159,10 @@ namespace OpenSim.Region.Framework.Scenes
1159 m_agentTransfer.EnableChildAgents(this); 1159 m_agentTransfer.EnableChildAgents(this);
1160 else 1160 else
1161 m_log.DebugFormat("[SCENE PRESENCE]: Unable to create child agents in neighbours, because AgentTransferModule is not active"); 1161 m_log.DebugFormat("[SCENE PRESENCE]: Unable to create child agents in neighbours, because AgentTransferModule is not active");
1162
1163 IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>();
1164 if (friendsModule != null)
1165 friendsModule.SendFriendsOnlineIfNeeded(ControllingClient);
1162 } 1166 }
1163 1167
1164 } 1168 }