diff options
author | Melanie Thielker | 2009-06-19 20:46:17 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-06-19 20:46:17 +0000 |
commit | e4d26d7bfa4b4d4e775531a7dd400f41fc61f45f (patch) | |
tree | a15fb5f00eb11a26a49b287c76209fb3e80833d4 /OpenSim | |
parent | Thanks cmickeyb for a patch that checks for null assets in Cenome asset cache... (diff) | |
download | opensim-SC-e4d26d7bfa4b4d4e775531a7dd400f41fc61f45f.zip opensim-SC-e4d26d7bfa4b4d4e775531a7dd400f41fc61f45f.tar.gz opensim-SC-e4d26d7bfa4b4d4e775531a7dd400f41fc61f45f.tar.bz2 opensim-SC-e4d26d7bfa4b4d4e775531a7dd400f41fc61f45f.tar.xz |
When a shared module hooks OnClientClosed, it has no way of finding
out which client connection has closed. So, in multi-region sims, things
can get messy fast.
This introduces a second parameters, which is a Scene object ref. Minor
adjustments to custom modules may be required due to this change.
Diffstat (limited to 'OpenSim')
9 files changed, 13 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 8afb8fe..b98bfaf 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -382,7 +382,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
382 | client.OnLogout += OnLogout; | 382 | client.OnLogout += OnLogout; |
383 | } | 383 | } |
384 | 384 | ||
385 | private void ClientClosed(UUID AgentId) | 385 | private void ClientClosed(UUID AgentId, Scene scene) |
386 | { | 386 | { |
387 | // agent's client was closed. As we handle logout in OnLogout, this here has only to handle | 387 | // agent's client was closed. As we handle logout in OnLogout, this here has only to handle |
388 | // TPing away (root agent is closed) or TPing/crossing in a region far enough away (client | 388 | // TPing away (root agent is closed) or TPing/crossing in a region far enough away (client |
diff --git a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs index a733585..31363e5 100644 --- a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs | |||
@@ -198,7 +198,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups | |||
198 | remote_client.SendGroupNameReply(groupUUID, groupnamereply); | 198 | remote_client.SendGroupNameReply(groupUUID, groupnamereply); |
199 | } | 199 | } |
200 | 200 | ||
201 | private void OnClientClosed(UUID agentID) | 201 | private void OnClientClosed(UUID agentID, Scene scene) |
202 | { | 202 | { |
203 | lock (m_ClientMap) | 203 | lock (m_ClientMap) |
204 | { | 204 | { |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 12f5d19..d862c06 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -368,7 +368,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
368 | return false; | 368 | return false; |
369 | } | 369 | } |
370 | 370 | ||
371 | public void ClientLoggedOut(UUID agentID) | 371 | public void ClientLoggedOut(UUID agentID, Scene scene) |
372 | { | 372 | { |
373 | if (m_AgentRegions.ContainsKey(agentID)) | 373 | if (m_AgentRegions.ContainsKey(agentID)) |
374 | m_AgentRegions.Remove(agentID); | 374 | m_AgentRegions.Remove(agentID); |
diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs index a94f23f..3dcf342 100644 --- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs | |||
@@ -198,7 +198,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue | |||
198 | // ClientClosed(client.AgentId); | 198 | // ClientClosed(client.AgentId); |
199 | // } | 199 | // } |
200 | 200 | ||
201 | private void ClientClosed(UUID AgentID) | 201 | private void ClientClosed(UUID AgentID, Scene scene) |
202 | { | 202 | { |
203 | m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", AgentID, m_scene.RegionInfo.RegionName); | 203 | m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", AgentID, m_scene.RegionInfo.RegionName); |
204 | 204 | ||
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 6fe0b57..16c02a3 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -287,7 +287,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
287 | /// Event handler | 287 | /// Event handler |
288 | /// </summary> | 288 | /// </summary> |
289 | /// <param name="AgentId">AgentID that logged out</param> | 289 | /// <param name="AgentId">AgentID that logged out</param> |
290 | private void ClientLoggedOut(UUID AgentId) | 290 | private void ClientLoggedOut(UUID AgentId, Scene scene) |
291 | { | 291 | { |
292 | List<ScenePresence> presences = m_scene.GetAvatars(); | 292 | List<ScenePresence> presences = m_scene.GetAvatars(); |
293 | int rootcount = 0; | 293 | int rootcount = 0; |
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 08ec1aa..4b3e45f 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -162,7 +162,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
162 | 162 | ||
163 | public event IncomingInstantMessage OnUnhandledInstantMessage; | 163 | public event IncomingInstantMessage OnUnhandledInstantMessage; |
164 | 164 | ||
165 | public delegate void ClientClosed(UUID clientID); | 165 | public delegate void ClientClosed(UUID clientID, Scene scene); |
166 | 166 | ||
167 | public event ClientClosed OnClientClosed; | 167 | public event ClientClosed OnClientClosed; |
168 | 168 | ||
@@ -733,12 +733,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
733 | } | 733 | } |
734 | } | 734 | } |
735 | 735 | ||
736 | public void TriggerClientClosed(UUID ClientID) | 736 | public void TriggerClientClosed(UUID ClientID, Scene scene) |
737 | { | 737 | { |
738 | handlerClientClosed = OnClientClosed; | 738 | handlerClientClosed = OnClientClosed; |
739 | if (handlerClientClosed != null) | 739 | if (handlerClientClosed != null) |
740 | { | 740 | { |
741 | handlerClientClosed(ClientID); | 741 | handlerClientClosed(ClientID, scene); |
742 | } | 742 | } |
743 | } | 743 | } |
744 | 744 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index d3437b9..8f6e920 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2246,7 +2246,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2246 | m_sceneGridService.SendCloseChildAgentConnections(agentID, regions); | 2246 | m_sceneGridService.SendCloseChildAgentConnections(agentID, regions); |
2247 | 2247 | ||
2248 | } | 2248 | } |
2249 | m_eventManager.TriggerClientClosed(agentID); | 2249 | m_eventManager.TriggerClientClosed(agentID, this); |
2250 | } | 2250 | } |
2251 | catch (NullReferenceException) | 2251 | catch (NullReferenceException) |
2252 | { | 2252 | { |
diff --git a/OpenSim/Region/ReplaceableModules/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/ReplaceableModules/MoneyModule/SampleMoneyModule.cs index 5a5ba6d..6251293 100644 --- a/OpenSim/Region/ReplaceableModules/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/ReplaceableModules/MoneyModule/SampleMoneyModule.cs | |||
@@ -698,7 +698,7 @@ namespace OpenSim.Region.ReplaceableModules.MoneyModule | |||
698 | /// When the client closes the connection we remove their accounting info from memory to free up resources. | 698 | /// When the client closes the connection we remove their accounting info from memory to free up resources. |
699 | /// </summary> | 699 | /// </summary> |
700 | /// <param name="AgentID"></param> | 700 | /// <param name="AgentID"></param> |
701 | public void ClientClosed(UUID AgentID) | 701 | public void ClientClosed(UUID AgentID, Scene scene) |
702 | { | 702 | { |
703 | 703 | ||
704 | } | 704 | } |
@@ -760,7 +760,7 @@ namespace OpenSim.Region.ReplaceableModules.MoneyModule | |||
760 | /// Event Handler for when the client logs out. | 760 | /// Event Handler for when the client logs out. |
761 | /// </summary> | 761 | /// </summary> |
762 | /// <param name="AgentId"></param> | 762 | /// <param name="AgentId"></param> |
763 | private void ClientLoggedOut(UUID AgentId) | 763 | private void ClientLoggedOut(UUID AgentId, Scene scene) |
764 | { | 764 | { |
765 | 765 | ||
766 | } | 766 | } |
@@ -771,7 +771,7 @@ namespace OpenSim.Region.ReplaceableModules.MoneyModule | |||
771 | /// <param name="client"></param> | 771 | /// <param name="client"></param> |
772 | public void ClientClosed(IClientAPI client) | 772 | public void ClientClosed(IClientAPI client) |
773 | { | 773 | { |
774 | ClientClosed(client.AgentId); | 774 | ClientClosed(client.AgentId, null); |
775 | } | 775 | } |
776 | 776 | ||
777 | /// <summary> | 777 | /// <summary> |
diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs index 756a5d0..4f6fcce 100644 --- a/OpenSim/Region/UserStatistics/WebStatsModule.cs +++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs | |||
@@ -386,7 +386,7 @@ namespace OpenSim.Region.UserStatistics | |||
386 | } | 386 | } |
387 | 387 | ||
388 | 388 | ||
389 | public void OnClientClosed(UUID agentID) | 389 | public void OnClientClosed(UUID agentID, Scene scene) |
390 | { | 390 | { |
391 | lock (m_sessions) | 391 | lock (m_sessions) |
392 | { | 392 | { |