aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-08-01 18:49:48 +0000
committerJustin Clarke Casey2008-08-01 18:49:48 +0000
commit43b2ff1d112174c36bb18caf353945afc6390840 (patch)
tree2da70a8856c417dcfb66f75fb38a4bde2b73c57f /OpenSim/Region/Environment/Scenes/ScenePresence.cs
parent* minor: eliminate some unused variables in InventoryFolderImpl (diff)
downloadopensim-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/Environment/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs39
1 files changed, 34 insertions, 5 deletions
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;
35using libsecondlife.Packets; 35using libsecondlife.Packets;
36using log4net; 36using log4net;
37using OpenSim.Framework; 37using OpenSim.Framework;
38using OpenSim.Framework.Communications.Cache;
38using OpenSim.Region.Environment.Types; 39using OpenSim.Region.Environment.Types;
39using OpenSim.Region.Physics.Manager; 40using 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 }