diff options
author | Justin Clarke Casey | 2008-08-01 18:49:48 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-08-01 18:49:48 +0000 |
commit | 43b2ff1d112174c36bb18caf353945afc6390840 (patch) | |
tree | 2da70a8856c417dcfb66f75fb38a4bde2b73c57f /OpenSim/Region | |
parent | * minor: eliminate some unused variables in InventoryFolderImpl (diff) | |
download | opensim-SC-43b2ff1d112174c36bb18caf353945afc6390840.zip opensim-SC-43b2ff1d112174c36bb18caf353945afc6390840.tar.gz opensim-SC-43b2ff1d112174c36bb18caf353945afc6390840.tar.bz2 opensim-SC-43b2ff1d112174c36bb18caf353945afc6390840.tar.xz |
* Drop cached inventory from the local region when a user crosses out into a remote region
* May resolves inventory problems that occur when the user moves between two regions`
* e.g. if the user moves to a second region, adds an inventory item, moves back to the original region then tries to manipulate that item
* Not yet implemented for teleport
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 7 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 39 |
3 files changed, 39 insertions, 9 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index c4078c9..f81248b 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -1976,7 +1976,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1976 | #region Add/Remove Avatar Methods | 1976 | #region Add/Remove Avatar Methods |
1977 | 1977 | ||
1978 | /// <summary> | 1978 | /// <summary> |
1979 | /// | 1979 | /// Register the new client with the scene |
1980 | /// </summary> | 1980 | /// </summary> |
1981 | /// <param name="client"></param | 1981 | /// <param name="client"></param |
1982 | /// <param name="child"></param> | 1982 | /// <param name="child"></param> |
@@ -1991,7 +1991,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1991 | 1991 | ||
1992 | if (m_restorePresences.ContainsKey(client.AgentId)) | 1992 | if (m_restorePresences.ContainsKey(client.AgentId)) |
1993 | { | 1993 | { |
1994 | m_log.Info("[REGION]: Restore Scene Presence"); | 1994 | m_log.Info("[REGION]: Restoring Scene Presence"); |
1995 | 1995 | ||
1996 | presence = m_restorePresences[client.AgentId]; | 1996 | presence = m_restorePresences[client.AgentId]; |
1997 | m_restorePresences.Remove(client.AgentId); | 1997 | m_restorePresences.Remove(client.AgentId); |
@@ -2015,9 +2015,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
2015 | } | 2015 | } |
2016 | else | 2016 | else |
2017 | { | 2017 | { |
2018 | m_log.Info("[REGION]: Add New Scene Presence"); | 2018 | m_log.Info("[REGION]: Adding New Scene Presence"); |
2019 | 2019 | ||
2020 | //CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); | ||
2021 | CommsManager.UserProfileCacheService.AddNewUser(client); | 2020 | CommsManager.UserProfileCacheService.AddNewUser(client); |
2022 | 2021 | ||
2023 | CreateAndAddScenePresence(client, child); | 2022 | CreateAndAddScenePresence(client, child); |
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index b9bf42b..b35e60f 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs | |||
@@ -557,8 +557,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
557 | LLVector3 lookAt, uint flags) | 557 | LLVector3 lookAt, uint flags) |
558 | { | 558 | { |
559 | bool destRegionUp = false; | 559 | bool destRegionUp = false; |
560 | |||
560 | if (regionHandle == m_regionInfo.RegionHandle) | 561 | if (regionHandle == m_regionInfo.RegionHandle) |
561 | { | 562 | { |
563 | // Teleport within the same region | ||
562 | avatar.ControllingClient.SendTeleportLocationStart(); | 564 | avatar.ControllingClient.SendTeleportLocationStart(); |
563 | avatar.ControllingClient.SendLocalTeleport(position, lookAt, flags); | 565 | avatar.ControllingClient.SendLocalTeleport(position, lookAt, flags); |
564 | avatar.Teleport(position); | 566 | avatar.Teleport(position); |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 221da0e..bb3d953 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -35,6 +35,7 @@ using libsecondlife; | |||
35 | using libsecondlife.Packets; | 35 | using libsecondlife.Packets; |
36 | using log4net; | 36 | using log4net; |
37 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
38 | using OpenSim.Framework.Communications.Cache; | ||
38 | using OpenSim.Region.Environment.Types; | 39 | using OpenSim.Region.Environment.Types; |
39 | using OpenSim.Region.Physics.Manager; | 40 | using OpenSim.Region.Physics.Manager; |
40 | 41 | ||
@@ -646,7 +647,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
646 | /// when an agent departs this region for a neighbor, this gets called. | 647 | /// when an agent departs this region for a neighbor, this gets called. |
647 | /// | 648 | /// |
648 | /// It doesn't get called for a teleport. Reason being, an agent that | 649 | /// It doesn't get called for a teleport. Reason being, an agent that |
649 | /// teleports out may not be anywhere near this region | 650 | /// teleports out may not end up anywhere near this region |
650 | /// </summary> | 651 | /// </summary> |
651 | public void MakeChildAgent() | 652 | public void MakeChildAgent() |
652 | { | 653 | { |
@@ -1877,6 +1878,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1877 | { | 1878 | { |
1878 | if (IsChildAgent) | 1879 | if (IsChildAgent) |
1879 | return; | 1880 | return; |
1881 | |||
1880 | LLVector3 pos2 = AbsolutePosition; | 1882 | LLVector3 pos2 = AbsolutePosition; |
1881 | LLVector3 vel = Velocity; | 1883 | LLVector3 vel = Velocity; |
1882 | 1884 | ||
@@ -1947,10 +1949,30 @@ namespace OpenSim.Region.Environment.Scenes | |||
1947 | // in case both scenes are being hosted on the same region server. Messy | 1949 | // in case both scenes are being hosted on the same region server. Messy |
1948 | m_scene.RemoveCapsHandler(UUID); | 1950 | m_scene.RemoveCapsHandler(UUID); |
1949 | newpos = newpos + (vel); | 1951 | newpos = newpos + (vel); |
1950 | bool res = | 1952 | |
1953 | bool crossingToRemoteRegion = neighbourRegion.ExternalHostName != m_scene.RegionInfo.ExternalHostName; | ||
1954 | if (crossingToRemoteRegion) | ||
1955 | { | ||
1956 | m_scene.CommsManager.UserProfileCacheService.RemoveUser(UUID); | ||
1957 | } | ||
1958 | else | ||
1959 | { | ||
1960 | CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(UUID); | ||
1961 | |||
1962 | if (userInfo != null) | ||
1963 | { | ||
1964 | userInfo.DropInventory(); | ||
1965 | } | ||
1966 | else | ||
1967 | { | ||
1968 | m_log.WarnFormat("[SCENE PRESENCE]: No cached user info found for {0} {1} on leaving region", Name, UUID); | ||
1969 | } | ||
1970 | } | ||
1971 | |||
1972 | bool crossingSuccessful = | ||
1951 | m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos, | 1973 | m_scene.InformNeighbourOfCrossing(neighbourHandle, m_controllingClient.AgentId, newpos, |
1952 | m_physicsActor.Flying); | 1974 | m_physicsActor.Flying); |
1953 | if (res) | 1975 | if (crossingSuccessful) |
1954 | { | 1976 | { |
1955 | AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); | 1977 | AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); |
1956 | 1978 | ||
@@ -1965,12 +1987,19 @@ namespace OpenSim.Region.Environment.Scenes | |||
1965 | m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, | 1987 | m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, |
1966 | capsPath); | 1988 | capsPath); |
1967 | MakeChildAgent(); | 1989 | MakeChildAgent(); |
1968 | CrossAttachmentsIntoNewRegion(neighbourHandle); | 1990 | CrossAttachmentsIntoNewRegion(neighbourHandle); |
1991 | |||
1969 | m_scene.SendKillObject(m_localId); | 1992 | m_scene.SendKillObject(m_localId); |
1970 | m_scene.NotifyMyCoarseLocationChange(); | 1993 | m_scene.NotifyMyCoarseLocationChange(); |
1971 | } | 1994 | } |
1972 | else | 1995 | else |
1973 | { | 1996 | { |
1997 | // Restore the user structures that we needed to delete before asking the receiving region to complete the crossing | ||
1998 | if (crossingToRemoteRegion) | ||
1999 | m_scene.CommsManager.UserProfileCacheService.AddNewUser(m_controllingClient); | ||
2000 | |||
2001 | m_scene.CommsManager.UserProfileCacheService.RequestInventoryForUser(UUID); | ||
2002 | |||
1974 | m_scene.AddCapsHandler(UUID); | 2003 | m_scene.AddCapsHandler(UUID); |
1975 | } | 2004 | } |
1976 | } | 2005 | } |