diff options
author | Teravus Ovares | 2008-04-15 23:10:12 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-04-15 23:10:12 +0000 |
commit | e777f88028322c9a7042ba20669b00fd9fbd573c (patch) | |
tree | 47203f1ac640808b2523a5560485ee0ba63ed0f5 /OpenSim | |
parent | fix types on nhibernate mappings for User bits (diff) | |
download | opensim-SC_OLD-e777f88028322c9a7042ba20669b00fd9fbd573c.zip opensim-SC_OLD-e777f88028322c9a7042ba20669b00fd9fbd573c.tar.gz opensim-SC_OLD-e777f88028322c9a7042ba20669b00fd9fbd573c.tar.bz2 opensim-SC_OLD-e777f88028322c9a7042ba20669b00fd9fbd573c.tar.xz |
* A tweak of the caps system so that new caps have random paths instead of a fixed path
* This allows caps requests to be routed to regions where the agent is currently a root agent instead of the region that they logged into as it did previously.
* This fixes a wide variety of bugs related to 'can't do X once i've crossed a border'.
* The first seed cap request fails, the second one works. (this generates an error message on the console)
* Experimental.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | 13 | ||||
-rw-r--r-- | OpenSim/Framework/IScene.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 21 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneBase.cs | 12 |
4 files changed, 46 insertions, 3 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index ec5717e..9f202ff 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | |||
@@ -251,6 +251,11 @@ namespace OpenSim.Framework.Communications.Cache | |||
251 | ItemReceive(userID, itemInfo); | 251 | ItemReceive(userID, itemInfo); |
252 | m_commsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); | 252 | m_commsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); |
253 | } | 253 | } |
254 | else | ||
255 | { | ||
256 | m_log.Error("[UNABLE TO UPLOAD]: "); | ||
257 | } | ||
258 | |||
254 | } | 259 | } |
255 | 260 | ||
256 | /// <summary> | 261 | /// <summary> |
@@ -264,6 +269,10 @@ namespace OpenSim.Framework.Communications.Cache | |||
264 | { | 269 | { |
265 | m_commsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); | 270 | m_commsManager.InventoryService.AddNewInventoryItem(userID, itemInfo); |
266 | } | 271 | } |
272 | else | ||
273 | { | ||
274 | m_log.Error("[UNABLE TO UPDATE]: "); | ||
275 | } | ||
267 | } | 276 | } |
268 | 277 | ||
269 | /// <summary> | 278 | /// <summary> |
@@ -283,6 +292,10 @@ namespace OpenSim.Framework.Communications.Cache | |||
283 | m_commsManager.InventoryService.DeleteInventoryItem(userID, item); | 292 | m_commsManager.InventoryService.DeleteInventoryItem(userID, item); |
284 | } | 293 | } |
285 | } | 294 | } |
295 | else | ||
296 | { | ||
297 | m_log.Error("[UNABLE TO DELETE]: "); | ||
298 | } | ||
286 | 299 | ||
287 | return result; | 300 | return result; |
288 | } | 301 | } |
diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs index cdf6257..ad3bd91 100644 --- a/OpenSim/Framework/IScene.cs +++ b/OpenSim/Framework/IScene.cs | |||
@@ -64,6 +64,7 @@ namespace OpenSim.Framework | |||
64 | 64 | ||
65 | ClientManager ClientManager { get; } | 65 | ClientManager ClientManager { get; } |
66 | 66 | ||
67 | string GetCapsPath(LLUUID agentId); | 67 | string GetCapsPath(LLUUID agentId); |
68 | string GetNewCapsPath(LLUUID agentId); | ||
68 | } | 69 | } |
69 | } | 70 | } |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index ba8a356..957c75c 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -1867,8 +1867,25 @@ namespace OpenSim.Region.Environment.Scenes | |||
1867 | /// <param name="agentId"></param> | 1867 | /// <param name="agentId"></param> |
1868 | /// <param name="capsObjectPath"></param> | 1868 | /// <param name="capsObjectPath"></param> |
1869 | public void AddCapsHandler(LLUUID agentId) | 1869 | public void AddCapsHandler(LLUUID agentId) |
1870 | { | 1870 | { |
1871 | String capsObjectPath = GetCapsPath(agentId); | 1871 | // Here we clear out old Caps handlers for the agent |
1872 | // this is required because we potentially have multiple simulators in an instance nearby. | ||
1873 | Caps oldcap = null; | ||
1874 | lock (m_capsHandlers) | ||
1875 | { | ||
1876 | if (m_capsHandlers.ContainsKey(agentId)) | ||
1877 | oldcap = m_capsHandlers[agentId]; | ||
1878 | } | ||
1879 | if (oldcap != null) | ||
1880 | { | ||
1881 | oldcap.DeregisterHandlers(); | ||
1882 | } | ||
1883 | |||
1884 | // Generate a new base caps path LLUUID.Random().ToString() instead of agentId.ToString() | ||
1885 | // If the caps paths are not different for each region, the client and sim will do weird | ||
1886 | // things like send the request to a region the agent is no longer in. | ||
1887 | |||
1888 | String capsObjectPath = GetNewCapsPath(agentId); | ||
1872 | 1889 | ||
1873 | m_log.DebugFormat( | 1890 | m_log.DebugFormat( |
1874 | "[CAPS]: Setting up CAPS handler for root agent {0} in {1}", | 1891 | "[CAPS]: Setting up CAPS handler for root agent {0} in {1}", |
diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs index 5551173..f863bff 100644 --- a/OpenSim/Region/Environment/Scenes/SceneBase.cs +++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs | |||
@@ -214,5 +214,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
214 | 214 | ||
215 | return null; | 215 | return null; |
216 | } | 216 | } |
217 | public string GetNewCapsPath(LLUUID agentID) | ||
218 | { | ||
219 | if (capsPaths.ContainsKey(agentID)) | ||
220 | { | ||
221 | capsPaths[agentID] = LLUUID.Random().ToString(); | ||
222 | } | ||
223 | else | ||
224 | { | ||
225 | capsPaths.Add(agentID, LLUUID.Random().ToString()); | ||
226 | } | ||
227 | return GetCapsPath(agentID); | ||
228 | } | ||
217 | } | 229 | } |
218 | } | 230 | } |