diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | 83 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Mock/TestClient.cs | 12 |
2 files changed, 15 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> |
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index d26e3f7..b7a7463 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs | |||
@@ -484,6 +484,18 @@ namespace OpenSim.Tests.Common.Mock | |||
484 | OnCompleteMovementToRegion(this, true); | 484 | OnCompleteMovementToRegion(this, true); |
485 | } | 485 | } |
486 | 486 | ||
487 | /// <summary> | ||
488 | /// Emulate sending an IM from the viewer to the simulator. | ||
489 | /// </summary> | ||
490 | /// <param name='im'></param> | ||
491 | public void HandleImprovedInstantMessage(GridInstantMessage im) | ||
492 | { | ||
493 | ImprovedInstantMessage handlerInstantMessage = OnInstantMessage; | ||
494 | |||
495 | if (handlerInstantMessage != null) | ||
496 | handlerInstantMessage(this, im); | ||
497 | } | ||
498 | |||
487 | public virtual void ActivateGesture(UUID assetId, UUID gestureId) | 499 | public virtual void ActivateGesture(UUID assetId, UUID gestureId) |
488 | { | 500 | { |
489 | } | 501 | } |