diff options
author | Justin Clark-Casey (justincc) | 2013-04-29 20:50:49 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-05-03 22:41:14 +0100 |
commit | 6b0615712650ea72ab63cb9b6c107cccca47d400 (patch) | |
tree | 2a881a26e6b3a68d01e4aefa8d81add110386a11 /OpenSim/Region/CoreModules/Avatar | |
parent | Fix bug where an agent that declined an inventory offer and subsequently empt... (diff) | |
download | opensim-SC_OLD-6b0615712650ea72ab63cb9b6c107cccca47d400.zip opensim-SC_OLD-6b0615712650ea72ab63cb9b6c107cccca47d400.tar.gz opensim-SC_OLD-6b0615712650ea72ab63cb9b6c107cccca47d400.tar.bz2 opensim-SC_OLD-6b0615712650ea72ab63cb9b6c107cccca47d400.tar.xz |
Add regression test for offer, accept and subsequent receiver delete of an item offered via instant message.
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | 83 |
1 files changed, 3 insertions, 80 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index e1ada97..c292700 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -47,10 +47,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
47 | 47 | ||
48 | /// <summary> | 48 | /// <summary> |
49 | private List<Scene> m_Scenelist = new List<Scene>(); | 49 | private List<Scene> m_Scenelist = new List<Scene>(); |
50 | // private Dictionary<UUID, Scene> m_AgentRegions = | ||
51 | // new Dictionary<UUID, Scene>(); | ||
52 | 50 | ||
53 | private IMessageTransferModule m_TransferModule = null; | 51 | private IMessageTransferModule m_TransferModule; |
54 | private bool m_Enabled = true; | 52 | private bool m_Enabled = true; |
55 | 53 | ||
56 | #region Region Module interface | 54 | #region Region Module interface |
@@ -81,9 +79,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
81 | // scene.RegisterModuleInterface<IInventoryTransferModule>(this); | 79 | // scene.RegisterModuleInterface<IInventoryTransferModule>(this); |
82 | 80 | ||
83 | scene.EventManager.OnNewClient += OnNewClient; | 81 | scene.EventManager.OnNewClient += OnNewClient; |
84 | // scene.EventManager.OnClientClosed += ClientLoggedOut; | ||
85 | scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; | 82 | scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; |
86 | // scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene; | ||
87 | } | 83 | } |
88 | 84 | ||
89 | public void RegionLoaded(Scene scene) | 85 | public void RegionLoaded(Scene scene) |
@@ -96,11 +92,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
96 | m_log.Error("[INVENTORY TRANSFER]: No Message transfer module found, transfers will be local only"); | 92 | m_log.Error("[INVENTORY TRANSFER]: No Message transfer module found, transfers will be local only"); |
97 | m_Enabled = false; | 93 | m_Enabled = false; |
98 | 94 | ||
99 | m_Scenelist.Clear(); | 95 | // m_Scenelist.Clear(); |
100 | scene.EventManager.OnNewClient -= OnNewClient; | 96 | // scene.EventManager.OnNewClient -= OnNewClient; |
101 | // scene.EventManager.OnClientClosed -= ClientLoggedOut; | ||
102 | scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; | 97 | scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; |
103 | // scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene; | ||
104 | } | 98 | } |
105 | } | 99 | } |
106 | } | 100 | } |
@@ -108,9 +102,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
108 | public void RemoveRegion(Scene scene) | 102 | public void RemoveRegion(Scene scene) |
109 | { | 103 | { |
110 | scene.EventManager.OnNewClient -= OnNewClient; | 104 | scene.EventManager.OnNewClient -= OnNewClient; |
111 | // scene.EventManager.OnClientClosed -= ClientLoggedOut; | ||
112 | scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; | 105 | scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; |
113 | // scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene; | ||
114 | m_Scenelist.Remove(scene); | 106 | m_Scenelist.Remove(scene); |
115 | } | 107 | } |
116 | 108 | ||
@@ -139,11 +131,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
139 | // Inventory giving is conducted via instant message | 131 | // Inventory giving is conducted via instant message |
140 | client.OnInstantMessage += OnInstantMessage; | 132 | client.OnInstantMessage += OnInstantMessage; |
141 | } | 133 | } |
142 | |||
143 | // protected void OnSetRootAgentScene(UUID id, Scene scene) | ||
144 | // { | ||
145 | // m_AgentRegions[id] = scene; | ||
146 | // } | ||
147 | 134 | ||
148 | private Scene FindClientScene(UUID agentId) | 135 | private Scene FindClientScene(UUID agentId) |
149 | { | 136 | { |
@@ -460,70 +447,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
460 | } | 447 | } |
461 | } | 448 | } |
462 | 449 | ||
463 | // public bool NeedSceneCacheClear(UUID agentID, Scene scene) | ||
464 | // { | ||
465 | // if (!m_AgentRegions.ContainsKey(agentID)) | ||
466 | // { | ||
467 | // // Since we can get here two ways, we need to scan | ||
468 | // // the scenes here. This is somewhat more expensive | ||
469 | // // but helps avoid a nasty bug | ||
470 | // // | ||
471 | // | ||
472 | // foreach (Scene s in m_Scenelist) | ||
473 | // { | ||
474 | // ScenePresence presence; | ||
475 | // | ||
476 | // if (s.TryGetScenePresence(agentID, out presence)) | ||
477 | // { | ||
478 | // // If the agent is in this scene, then we | ||
479 | // // are being called twice in a single | ||
480 | // // teleport. This is wasteful of cycles | ||
481 | // // but harmless due to this 2nd level check | ||
482 | // // | ||
483 | // // If the agent is found in another scene | ||
484 | // // then the list wasn't current | ||
485 | // // | ||
486 | // // If the agent is totally unknown, then what | ||
487 | // // are we even doing here?? | ||
488 | // // | ||
489 | // if (s == scene) | ||
490 | // { | ||
491 | // //m_log.Debug("[INVTRANSFERMOD]: s == scene. Returning true in " + scene.RegionInfo.RegionName); | ||
492 | // return true; | ||
493 | // } | ||
494 | // else | ||
495 | // { | ||
496 | // //m_log.Debug("[INVTRANSFERMOD]: s != scene. Returning false in " + scene.RegionInfo.RegionName); | ||
497 | // return false; | ||
498 | // } | ||
499 | // } | ||
500 | // } | ||
501 | // //m_log.Debug("[INVTRANSFERMOD]: agent not in scene. Returning true in " + scene.RegionInfo.RegionName); | ||
502 | // return true; | ||
503 | // } | ||
504 | // | ||
505 | // // The agent is left in current Scene, so we must be | ||
506 | // // going to another instance | ||
507 | // // | ||
508 | // if (m_AgentRegions[agentID] == scene) | ||
509 | // { | ||
510 | // //m_log.Debug("[INVTRANSFERMOD]: m_AgentRegions[agentID] == scene. Returning true in " + scene.RegionInfo.RegionName); | ||
511 | // m_AgentRegions.Remove(agentID); | ||
512 | // return true; | ||
513 | // } | ||
514 | // | ||
515 | // // Another region has claimed the agent | ||
516 | // // | ||
517 | // //m_log.Debug("[INVTRANSFERMOD]: last resort. Returning false in " + scene.RegionInfo.RegionName); | ||
518 | // return false; | ||
519 | // } | ||
520 | // | ||
521 | // public void ClientLoggedOut(UUID agentID, Scene scene) | ||
522 | // { | ||
523 | // if (m_AgentRegions.ContainsKey(agentID)) | ||
524 | // m_AgentRegions.Remove(agentID); | ||
525 | // } | ||
526 | |||
527 | /// <summary> | 450 | /// <summary> |
528 | /// | 451 | /// |
529 | /// </summary> | 452 | /// </summary> |