aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie Thielker2008-08-19 15:09:35 +0000
committerMelanie Thielker2008-08-19 15:09:35 +0000
commite5cdba1cb49346308fb0e9699c3a6386b487d97b (patch)
treecc299b3bae3d221887522294bfe031985db93740 /OpenSim/Region
parentUpdate svn properties, minor formatting cleanup. (diff)
downloadopensim-SC-e5cdba1cb49346308fb0e9699c3a6386b487d97b.zip
opensim-SC-e5cdba1cb49346308fb0e9699c3a6386b487d97b.tar.gz
opensim-SC-e5cdba1cb49346308fb0e9699c3a6386b487d97b.tar.bz2
opensim-SC-e5cdba1cb49346308fb0e9699c3a6386b487d97b.tar.xz
Fix region crossings and access to inventory after changing regions within
the same simulator
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs28
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs17
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs5
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs7
4 files changed, 50 insertions, 7 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs
index 03bbaf3..5f0d83d 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs
@@ -49,6 +49,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory
49 private IDictionary<LLUUID, LLUUID> m_pendingOffers = new Dictionary<LLUUID, LLUUID>(); 49 private IDictionary<LLUUID, LLUUID> m_pendingOffers = new Dictionary<LLUUID, LLUUID>();
50 50
51 private List<Scene> m_Scenelist = new List<Scene>(); 51 private List<Scene> m_Scenelist = new List<Scene>();
52 private Dictionary<LLUUID, Scene> m_AgentRegions = new Dictionary<LLUUID, Scene>();
52 53
53 #region IRegionModule Members 54 #region IRegionModule Members
54 55
@@ -61,6 +62,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory
61 scene.RegisterModuleInterface<IInventoryModule>(this); 62 scene.RegisterModuleInterface<IInventoryModule>(this);
62 63
63 scene.EventManager.OnNewClient += OnNewClient; 64 scene.EventManager.OnNewClient += OnNewClient;
65 scene.EventManager.OnClientClosed += ClientLoggedOut;
64 } 66 }
65 } 67 }
66 68
@@ -223,8 +225,28 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory
223 } 225 }
224 } 226 }
225 227
226// public void TestFunction() 228 public void SetRootAgentScene(LLUUID agentID, Scene scene)
227// { 229 {
228// } 230 m_AgentRegions[agentID] = scene;
231 }
232
233 public bool NeedSceneCacheClear(LLUUID agentID, Scene scene)
234 {
235 if (!m_AgentRegions.ContainsKey(agentID))
236 return true;
237
238 if(m_AgentRegions[agentID] == scene)
239 {
240 m_AgentRegions.Remove(agentID);
241 return true;
242 }
243 return false;
244 }
245
246 public void ClientLoggedOut(LLUUID agentID)
247 {
248 if (m_AgentRegions.ContainsKey(agentID))
249 m_AgentRegions.Remove(agentID);
250 }
229 } 251 }
230} 252}
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 4564cf1..7d55f7e 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -3860,5 +3860,22 @@ namespace OpenSim.Region.Environment.Scenes
3860 client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised()); 3860 client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised());
3861 } 3861 }
3862 3862
3863 public void SetRootAgentScene(LLUUID agentID)
3864 {
3865 IInventoryModule inv = RequestModuleInterface<IInventoryModule>();
3866 if(inv == null)
3867 return;
3868
3869 inv.SetRootAgentScene(agentID, this);
3870 }
3871
3872 public bool NeedSceneCacheClear(LLUUID agentID)
3873 {
3874 IInventoryModule inv = RequestModuleInterface<IInventoryModule>();
3875 if(inv == null)
3876 return true;
3877
3878 return inv.NeedSceneCacheClear(agentID, this);
3879 }
3863 } 3880 }
3864} 3881}
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
index adad7d3..f1af15f 100644
--- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
@@ -653,9 +653,10 @@ namespace OpenSim.Region.Environment.Scenes
653 SendCloseChildAgentConnections(avatar.UUID,avatar.GetKnownRegionList()); 653 SendCloseChildAgentConnections(avatar.UUID,avatar.GetKnownRegionList());
654 } 654 }
655 // if (teleport success) // seems to be always success here 655 // if (teleport success) // seems to be always success here
656 // the user may change thier profile information in other region, 656 // the user may change their profile information in other region,
657 // so the userinfo in UserProfileCache is not reliable any more, delete it 657 // so the userinfo in UserProfileCache is not reliable any more, delete it
658 m_commsProvider.UserProfileCacheService.RemoveUser(avatar.UUID); 658 if (avatar.Scene.NeedSceneCacheClear(avatar.UUID))
659 m_commsProvider.UserProfileCacheService.RemoveUser(avatar.UUID);
659 m_log.InfoFormat("User {0} is going to another region, profile cache removed", avatar.UUID); 660 m_log.InfoFormat("User {0} is going to another region, profile cache removed", avatar.UUID);
660 } 661 }
661 else 662 else
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 8059a78..706fd61 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -606,6 +606,8 @@ namespace OpenSim.Region.Environment.Scenes
606 /// </summary> 606 /// </summary>
607 public void MakeRootAgent(LLVector3 pos, bool isFlying) 607 public void MakeRootAgent(LLVector3 pos, bool isFlying)
608 { 608 {
609 m_scene.SetRootAgentScene(m_uuid);
610
609 IAvatarFactory ava = m_scene.RequestModuleInterface<IAvatarFactory>(); 611 IAvatarFactory ava = m_scene.RequestModuleInterface<IAvatarFactory>();
610 if (ava != null) 612 if (ava != null)
611 { 613 {
@@ -2010,9 +2012,10 @@ namespace OpenSim.Region.Environment.Scenes
2010 2012
2011 m_scene.SendKillObject(m_localId); 2013 m_scene.SendKillObject(m_localId);
2012 m_scene.NotifyMyCoarseLocationChange(); 2014 m_scene.NotifyMyCoarseLocationChange();
2013 // the user may change thier profile information in other region, 2015 // the user may change their profile information in other region,
2014 // so the userinfo in UserProfileCache is not reliable any more, delete it 2016 // so the userinfo in UserProfileCache is not reliable any more, delete it
2015 m_scene.CommsManager.UserProfileCacheService.RemoveUser(UUID); 2017 if(m_scene.NeedSceneCacheClear(UUID))
2018 m_scene.CommsManager.UserProfileCacheService.RemoveUser(UUID);
2016 m_log.InfoFormat("User {0} is going to another region, profile cache removed", UUID); 2019 m_log.InfoFormat("User {0} is going to another region, profile cache removed", UUID);
2017 } 2020 }
2018 else 2021 else