diff options
author | Justin Clarke Casey | 2008-03-25 18:47:14 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-03-25 18:47:14 +0000 |
commit | 8c74cf775895276e485f82b04c23099db09dc682 (patch) | |
tree | 7f11eafe072b32a0f9b949844e9150c8167d9bb6 /OpenSim/Region | |
parent | * Use Face normal to offset new prim instead of the hard coded pos.Z += 0.25f... (diff) | |
download | opensim-SC_OLD-8c74cf775895276e485f82b04c23099db09dc682.zip opensim-SC_OLD-8c74cf775895276e485f82b04c23099db09dc682.tar.gz opensim-SC_OLD-8c74cf775895276e485f82b04c23099db09dc682.tar.bz2 opensim-SC_OLD-8c74cf775895276e485f82b04c23099db09dc682.tar.xz |
* Tear down CAPS and http handlers when an agent leaves a region (via crossing, teleport or logout)
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 33 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs | 11 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 15 |
3 files changed, 48 insertions, 11 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 951e467..f02f038 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -1498,11 +1498,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1498 | } | 1498 | } |
1499 | m_sceneGridService.SendCloseChildAgentConnections(agentID, childknownRegions); | 1499 | m_sceneGridService.SendCloseChildAgentConnections(agentID, childknownRegions); |
1500 | 1500 | ||
1501 | if (m_capsHandlers.ContainsKey(agentID)) | 1501 | RemoveCapsHandler(agentID); |
1502 | { | ||
1503 | m_capsHandlers[agentID].DeregisterHandlers(); | ||
1504 | m_capsHandlers.Remove(agentID); | ||
1505 | } | ||
1506 | } | 1502 | } |
1507 | 1503 | ||
1508 | m_eventManager.TriggerClientClosed(agentID); | 1504 | m_eventManager.TriggerClientClosed(agentID); |
@@ -1717,8 +1713,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1717 | String capsObjectPath = GetCapsPath(agentId); | 1713 | String capsObjectPath = GetCapsPath(agentId); |
1718 | 1714 | ||
1719 | m_log.DebugFormat( | 1715 | m_log.DebugFormat( |
1720 | "[CONNECTION DEBUGGING]: Setting up CAPS handler for avatar {0} at {1} in {2}", | 1716 | "[CONNECTION DEBUGGING]: Setting up CAPS handler for avatar {0} in {1}", |
1721 | agentId, capsObjectPath, RegionInfo.RegionName); | 1717 | agentId, RegionInfo.RegionName); |
1722 | 1718 | ||
1723 | Caps cap = | 1719 | Caps cap = |
1724 | new Caps(AssetCache, m_httpListener, m_regInfo.ExternalHostName, m_httpListener.Port, | 1720 | new Caps(AssetCache, m_httpListener, m_regInfo.ExternalHostName, m_httpListener.Port, |
@@ -1735,6 +1731,29 @@ namespace OpenSim.Region.Environment.Scenes | |||
1735 | } | 1731 | } |
1736 | 1732 | ||
1737 | /// <summary> | 1733 | /// <summary> |
1734 | /// Remove the caps handler for a given agent. | ||
1735 | /// </summary> | ||
1736 | /// <param name="agentId"></param> | ||
1737 | public void RemoveCapsHandler(LLUUID agentId) | ||
1738 | { | ||
1739 | if (m_capsHandlers.ContainsKey(agentId)) | ||
1740 | { | ||
1741 | m_log.DebugFormat( | ||
1742 | "[CONNECTION DEBUGGING]: Removing CAPS handler for root agent {0} in {1}", | ||
1743 | agentId, RegionInfo.RegionName); | ||
1744 | |||
1745 | m_capsHandlers[agentId].DeregisterHandlers(); | ||
1746 | m_capsHandlers.Remove(agentId); | ||
1747 | } | ||
1748 | else | ||
1749 | { | ||
1750 | m_log.WarnFormat( | ||
1751 | "[CONNECTION DEBUGGING]: Received request to remove CAPS handler for root agent {0} in {1}, but no such CAPS handler found!", | ||
1752 | agentId, RegionInfo.RegionName); | ||
1753 | } | ||
1754 | } | ||
1755 | |||
1756 | /// <summary> | ||
1738 | /// | 1757 | /// |
1739 | /// </summary> | 1758 | /// </summary> |
1740 | /// <param name="regionHandle"></param> | 1759 | /// <param name="regionHandle"></param> |
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index f2b2f20..318b04a 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs | |||
@@ -547,6 +547,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
547 | if(destRegionUp) | 547 | if(destRegionUp) |
548 | { | 548 | { |
549 | avatar.Close(); | 549 | avatar.Close(); |
550 | |||
551 | // Compared to ScenePresence.CrossToNewRegion(), there's no obvious code to handle a teleport | ||
552 | // failure at this point (unlike a border crossing failure). So perhaps this can never fail | ||
553 | // once we reach here... | ||
554 | avatar.Scene.RemoveCapsHandler(avatar.UUID); | ||
555 | |||
550 | m_commsProvider.InterRegion.InformRegionOfChildAgent(regionHandle, agent); | 556 | m_commsProvider.InterRegion.InformRegionOfChildAgent(regionHandle, agent); |
551 | m_commsProvider.InterRegion.ExpectAvatarCrossing(regionHandle, avatar.ControllingClient.AgentId, | 557 | m_commsProvider.InterRegion.ExpectAvatarCrossing(regionHandle, avatar.ControllingClient.AgentId, |
552 | position, false); | 558 | position, false); |
@@ -555,7 +561,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
555 | // TODO Should construct this behind a method | 561 | // TODO Should construct this behind a method |
556 | string capsPath = | 562 | string capsPath = |
557 | "http://" + reg.ExternalHostName + ":" + reg.HttpPort | 563 | "http://" + reg.ExternalHostName + ":" + reg.HttpPort |
558 | + "/CAPS/" + circuitdata.CapsPath + "0000/"; | 564 | + "/CAPS/" + circuitdata.CapsPath + "0000/"; |
565 | |||
566 | m_log.DebugFormat( | ||
567 | "[CONNECTION DEBUGGING]: Sending new CAPS seed url {0} to avatar {1}", capsPath, avatar.UUID); | ||
559 | 568 | ||
560 | avatar.ControllingClient.SendRegionTeleport(regionHandle, 13, reg.ExternalEndPoint, 4, (1 << 4), | 569 | avatar.ControllingClient.SendRegionTeleport(regionHandle, 13, reg.ExternalEndPoint, 4, (1 << 4), |
561 | capsPath); | 570 | capsPath); |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index df43490..8f9cbbf 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -1618,12 +1618,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
1618 | ulong neighbourHandle = Helpers.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize)); | 1618 | ulong neighbourHandle = Helpers.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize)); |
1619 | SimpleRegionInfo neighbourRegion = m_scene.RequestNeighbouringRegionInfo(neighbourHandle); | 1619 | SimpleRegionInfo neighbourRegion = m_scene.RequestNeighbouringRegionInfo(neighbourHandle); |
1620 | if (neighbourRegion != null) | 1620 | if (neighbourRegion != null) |
1621 | { | 1621 | { |
1622 | // When the neighbour is informed of the border crossing, it will set up CAPS handlers for the avatar | ||
1623 | // This means we need to remove the current caps handler here and possibly compensate later, | ||
1624 | // in case both scenes are being hosted on the same region server. Messy | ||
1625 | m_scene.RemoveCapsHandler(UUID); | ||
1626 | |||
1622 | bool res = | 1627 | bool res = |
1623 | m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos, | 1628 | m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos, |
1624 | m_physicsActor.Flying); | 1629 | m_physicsActor.Flying); |
1625 | if (res) | 1630 | if (res) |
1626 | { | 1631 | { |
1627 | AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); | 1632 | AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); |
1628 | 1633 | ||
1629 | // TODO Should construct this behind a method | 1634 | // TODO Should construct this behind a method |
@@ -1632,7 +1637,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1632 | + "/CAPS/" + circuitdata.CapsPath + "0000/"; | 1637 | + "/CAPS/" + circuitdata.CapsPath + "0000/"; |
1633 | 1638 | ||
1634 | m_log.DebugFormat( | 1639 | m_log.DebugFormat( |
1635 | "[CONNECTION DEBUGGING]: Sending new CAPS seed url {0} to avatar {1}", capsPath, m_uuid); | 1640 | "[CONNECTION DEBUGGING]: Sending new CAPS seed url {0} to avatar {1}", capsPath, m_uuid); |
1636 | 1641 | ||
1637 | m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, | 1642 | m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, |
1638 | capsPath); | 1643 | capsPath); |
@@ -1640,6 +1645,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
1640 | m_scene.SendKillObject(m_localId); | 1645 | m_scene.SendKillObject(m_localId); |
1641 | m_scene.NotifyMyCoarseLocationChange(); | 1646 | m_scene.NotifyMyCoarseLocationChange(); |
1642 | } | 1647 | } |
1648 | else | ||
1649 | { | ||
1650 | m_scene.AddCapsHandler(UUID); | ||
1651 | } | ||
1643 | } | 1652 | } |
1644 | } | 1653 | } |
1645 | 1654 | ||