diff options
author | Justin Clark-Casey (justincc) | 2012-03-28 23:36:30 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-03-28 23:36:30 +0100 |
commit | 33df0c2efd27950ce46c6d00268041af1af591b3 (patch) | |
tree | 46d0d5eabf57069a6d4f32873fbe0925758367a5 /OpenSim/Region/CoreModules | |
parent | Enable voice by default on parcels to weaken effects of viewer 2/3 ParcelVoic... (diff) | |
parent | HG 2.0 Suitcase inventory: proof of concept now working properly with the hea... (diff) | |
download | opensim-SC_OLD-33df0c2efd27950ce46c6d00268041af1af591b3.zip opensim-SC_OLD-33df0c2efd27950ce46c6d00268041af1af591b3.tar.gz opensim-SC_OLD-33df0c2efd27950ce46c6d00268041af1af591b3.tar.bz2 opensim-SC_OLD-33df0c2efd27950ce46c6d00268041af1af591b3.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | 69 |
1 files changed, 62 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 4cdf303..ec260b4 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -71,7 +71,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
71 | if (name == Name) | 71 | if (name == Name) |
72 | { | 72 | { |
73 | InitialiseCommon(source); | 73 | InitialiseCommon(source); |
74 | IConfig transferConfig = source.Configs["HGEntityTransfer"]; | 74 | IConfig transferConfig = source.Configs["HGEntityTransferModule"]; |
75 | if (transferConfig != null) | 75 | if (transferConfig != null) |
76 | m_RestrictInventoryAccessAbroad = transferConfig.GetBoolean("RestrictInventoryAccessAbroad", false); | 76 | m_RestrictInventoryAccessAbroad = transferConfig.GetBoolean("RestrictInventoryAccessAbroad", false); |
77 | 77 | ||
@@ -94,6 +94,31 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
94 | client.OnTeleportHomeRequest += TeleportHome; | 94 | client.OnTeleportHomeRequest += TeleportHome; |
95 | client.OnTeleportLandmarkRequest += RequestTeleportLandmark; | 95 | client.OnTeleportLandmarkRequest += RequestTeleportLandmark; |
96 | client.OnConnectionClosed += new Action<IClientAPI>(OnConnectionClosed); | 96 | client.OnConnectionClosed += new Action<IClientAPI>(OnConnectionClosed); |
97 | client.OnCompleteMovementToRegion += new Action<IClientAPI, bool>(OnCompleteMovementToRegion); | ||
98 | } | ||
99 | |||
100 | protected void OnCompleteMovementToRegion(IClientAPI client, bool arg2) | ||
101 | { | ||
102 | // HACK HACK -- just seeing how the viewer responds | ||
103 | // Let's send the Suitcase or the real root folder folder for incoming HG agents | ||
104 | // Visiting agents get their suitcase contents; incoming local users get their real root folder's content | ||
105 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: OnCompleteMovementToRegion of user {0}", client.AgentId); | ||
106 | object sp = null; | ||
107 | if (client.Scene.TryGetScenePresence(client.AgentId, out sp)) | ||
108 | { | ||
109 | if (sp is ScenePresence) | ||
110 | { | ||
111 | AgentCircuitData aCircuit = ((ScenePresence)sp).Scene.AuthenticateHandler.GetAgentCircuitData(client.AgentId); | ||
112 | if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0) | ||
113 | { | ||
114 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: ViaHGLogin"); | ||
115 | if (m_RestrictInventoryAccessAbroad) | ||
116 | { | ||
117 | RestoreRootFolderContents(client); | ||
118 | } | ||
119 | } | ||
120 | } | ||
121 | } | ||
97 | } | 122 | } |
98 | 123 | ||
99 | 124 | ||
@@ -105,6 +130,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
105 | { | 130 | { |
106 | m_GatekeeperConnector = new GatekeeperServiceConnector(scene.AssetService); | 131 | m_GatekeeperConnector = new GatekeeperServiceConnector(scene.AssetService); |
107 | m_Initialized = true; | 132 | m_Initialized = true; |
133 | |||
134 | scene.AddCommand( | ||
135 | "HG", this, "send inventory", | ||
136 | "send inventory", | ||
137 | "Don't use this", | ||
138 | HandleSendInventory); | ||
139 | |||
108 | } | 140 | } |
109 | 141 | ||
110 | } | 142 | } |
@@ -369,7 +401,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
369 | InventoryFolderBase root = m_Scenes[0].InventoryService.GetRootFolder(client.AgentId); | 401 | InventoryFolderBase root = m_Scenes[0].InventoryService.GetRootFolder(client.AgentId); |
370 | if (root != null) | 402 | if (root != null) |
371 | { | 403 | { |
372 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Removing root inventory"); | 404 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Removing root inventory for user {0}", client.AgentId); |
373 | InventoryCollection content = m_Scenes[0].InventoryService.GetFolderContent(client.AgentId, root.ID); | 405 | InventoryCollection content = m_Scenes[0].InventoryService.GetFolderContent(client.AgentId, root.ID); |
374 | UUID[] ids = new UUID[content.Folders.Count]; | 406 | UUID[] ids = new UUID[content.Folders.Count]; |
375 | int i = 0; | 407 | int i = 0; |
@@ -388,12 +420,26 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
388 | 420 | ||
389 | private void RestoreRootFolderContents(IClientAPI client) | 421 | private void RestoreRootFolderContents(IClientAPI client) |
390 | { | 422 | { |
391 | // Restore the user's inventory, because we removed it earlier on | 423 | if (client is IClientCore) |
392 | InventoryFolderBase root = m_Scenes[0].InventoryService.GetRootFolder(client.AgentId); | ||
393 | if (root != null) | ||
394 | { | 424 | { |
395 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Restoring root inventory"); | 425 | IClientCore core = (IClientCore)client; |
396 | client.SendBulkUpdateInventory(root); | 426 | IClientInventory inv; |
427 | |||
428 | if (core.TryGet<IClientInventory>(out inv)) | ||
429 | { | ||
430 | InventoryFolderBase root = m_Scenes[0].InventoryService.GetRootFolder(client.AgentId); | ||
431 | client.SendBulkUpdateInventory(root); | ||
432 | //if (root != null) | ||
433 | //{ | ||
434 | // m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Restoring root inventory for user {0}", client.AgentId); | ||
435 | // InventoryCollection content = m_Scenes[0].InventoryService.GetFolderContent(client.AgentId, root.ID); | ||
436 | // m_log.DebugFormat("[XXX]: Folder name {0}, id {1}, parent {2}", root.Name, root.ID, root.ParentID); | ||
437 | // foreach (InventoryItemBase i in content.Items) | ||
438 | // m_log.DebugFormat("[XXX]: Name={0}, folderID={1}", i.Name, i.Folder); | ||
439 | |||
440 | // inv.SendBulkUpdateInventory(content.Folders.ToArray(), content.Items.ToArray()); | ||
441 | //} | ||
442 | } | ||
397 | } | 443 | } |
398 | } | 444 | } |
399 | 445 | ||
@@ -413,5 +459,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
413 | region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), (int)0); | 459 | region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), (int)0); |
414 | return region; | 460 | return region; |
415 | } | 461 | } |
462 | |||
463 | protected void HandleSendInventory(string module, string[] cmd) | ||
464 | { | ||
465 | m_Scenes[0].ForEachClient(delegate(IClientAPI client) | ||
466 | { | ||
467 | RestoreRootFolderContents(client); | ||
468 | }); | ||
469 | } | ||
470 | |||
416 | } | 471 | } |
417 | } | 472 | } |