diff options
author | Justin Clark-Casey (justincc) | 2012-10-06 02:34:49 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-10-06 02:34:49 +0100 |
commit | 16c9c1dff7bbf299efddd44e4f9aeeb7db38fff6 (patch) | |
tree | affb51dd09432b08673ec0201f24f87e9f61797e /OpenSim/Region/CoreModules | |
parent | Fix bug in implementation of "show part pos" that would not filter probably. (diff) | |
download | opensim-SC-16c9c1dff7bbf299efddd44e4f9aeeb7db38fff6.zip opensim-SC-16c9c1dff7bbf299efddd44e4f9aeeb7db38fff6.tar.gz opensim-SC-16c9c1dff7bbf299efddd44e4f9aeeb7db38fff6.tar.bz2 opensim-SC-16c9c1dff7bbf299efddd44e4f9aeeb7db38fff6.tar.xz |
On receiving TaskInventoryAccepted with a destination folder in the binary bucket slot for RLV, notify the viewer about inventory folder updates.
The viewer would not see the folder move without this, either on accept or decline.
This commit also updates the TaskInventoryOffered message to better conform with the data LL uses
Changes are, agentID is prim owner rather than prim id, agent name is now simply object name rather than name with owner detail,
message is just folder name in single quotes, message is not timestamped.
However, folder is not renamed "still #RLV/~<name>". Long term solution is probably not to do these operations server-side.
Notes will be added to http://opensimulator.org/mantis/view.php?id=6311
Diffstat (limited to 'OpenSim/Region/CoreModules')
5 files changed, 62 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs index d942e87..5ec0ea9 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs | |||
@@ -141,7 +141,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
141 | client.FirstName+" "+client.LastName, | 141 | client.FirstName+" "+client.LastName, |
142 | destID, (byte)211, false, | 142 | destID, (byte)211, false, |
143 | String.Empty, | 143 | String.Empty, |
144 | transactionID, false, new Vector3(), new byte[0]), | 144 | transactionID, false, new Vector3(), new byte[0], true), |
145 | delegate(bool success) {} ); | 145 | delegate(bool success) {} ); |
146 | } | 146 | } |
147 | } | 147 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 91eda19..33b4839 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -297,6 +297,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
297 | }); | 297 | }); |
298 | } | 298 | } |
299 | } | 299 | } |
300 | |||
301 | // XXX: This code was placed here to try and accomdate RLV which moves given folders named #RLV/~<name> | ||
302 | // to a folder called name in #RLV. However, this approach may not be ultimately correct - from analysis | ||
303 | // of Firestorm 4.2.2 on sending an InventoryOffered instead of TaskInventoryOffered (as was previously | ||
304 | // done), the viewer itself would appear to move and rename the folder, rather than the simulator doing it here. | ||
300 | else if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) | 305 | else if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) |
301 | { | 306 | { |
302 | UUID destinationFolderID = UUID.Zero; | 307 | UUID destinationFolderID = UUID.Zero; |
@@ -308,6 +313,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
308 | 313 | ||
309 | if (destinationFolderID != UUID.Zero) | 314 | if (destinationFolderID != UUID.Zero) |
310 | { | 315 | { |
316 | InventoryFolderBase destinationFolder = new InventoryFolderBase(destinationFolderID, client.AgentId); | ||
317 | if (destinationFolder == null) | ||
318 | { | ||
319 | m_log.WarnFormat( | ||
320 | "[INVENTORY TRANSFER]: TaskInventoryAccepted message from {0} in {1} specified folder {2} which does not exist", | ||
321 | client.Name, scene.Name, destinationFolderID); | ||
322 | |||
323 | return; | ||
324 | } | ||
325 | |||
311 | IInventoryService invService = scene.InventoryService; | 326 | IInventoryService invService = scene.InventoryService; |
312 | 327 | ||
313 | UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip | 328 | UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip |
@@ -315,9 +330,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
315 | InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId); | 330 | InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId); |
316 | item = invService.GetItem(item); | 331 | item = invService.GetItem(item); |
317 | InventoryFolderBase folder = null; | 332 | InventoryFolderBase folder = null; |
333 | UUID? previousParentFolderID = null; | ||
318 | 334 | ||
319 | if (item != null) // It's an item | 335 | if (item != null) // It's an item |
320 | { | 336 | { |
337 | previousParentFolderID = item.Folder; | ||
321 | item.Folder = destinationFolderID; | 338 | item.Folder = destinationFolderID; |
322 | 339 | ||
323 | invService.DeleteItems(item.Owner, new List<UUID>() { item.ID }); | 340 | invService.DeleteItems(item.Owner, new List<UUID>() { item.ID }); |
@@ -330,10 +347,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
330 | 347 | ||
331 | if (folder != null) // It's a folder | 348 | if (folder != null) // It's a folder |
332 | { | 349 | { |
350 | previousParentFolderID = folder.ParentID; | ||
333 | folder.ParentID = destinationFolderID; | 351 | folder.ParentID = destinationFolderID; |
334 | invService.MoveFolder(folder); | 352 | invService.MoveFolder(folder); |
335 | } | 353 | } |
336 | } | 354 | } |
355 | |||
356 | // Tell client about updates to original parent and new parent (this should probably be factored with existing move item/folder code). | ||
357 | if (previousParentFolderID != null) | ||
358 | { | ||
359 | InventoryFolderBase previousParentFolder | ||
360 | = new InventoryFolderBase((UUID)previousParentFolderID, client.AgentId); | ||
361 | previousParentFolder = invService.GetFolder(previousParentFolder); | ||
362 | scene.SendInventoryUpdate(client, previousParentFolder, true, true); | ||
363 | |||
364 | scene.SendInventoryUpdate(client, destinationFolder, true, true); | ||
365 | } | ||
337 | } | 366 | } |
338 | } | 367 | } |
339 | else if ( | 368 | else if ( |
@@ -354,9 +383,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
354 | InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId); | 383 | InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId); |
355 | item = invService.GetItem(item); | 384 | item = invService.GetItem(item); |
356 | InventoryFolderBase folder = null; | 385 | InventoryFolderBase folder = null; |
386 | UUID? previousParentFolderID = null; | ||
357 | 387 | ||
358 | if (item != null && trashFolder != null) | 388 | if (item != null && trashFolder != null) |
359 | { | 389 | { |
390 | previousParentFolderID = item.Folder; | ||
360 | item.Folder = trashFolder.ID; | 391 | item.Folder = trashFolder.ID; |
361 | 392 | ||
362 | // Diva comment: can't we just update this item??? | 393 | // Diva comment: can't we just update this item??? |
@@ -372,6 +403,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
372 | 403 | ||
373 | if (folder != null & trashFolder != null) | 404 | if (folder != null & trashFolder != null) |
374 | { | 405 | { |
406 | previousParentFolderID = folder.ParentID; | ||
375 | folder.ParentID = trashFolder.ID; | 407 | folder.ParentID = trashFolder.ID; |
376 | invService.MoveFolder(folder); | 408 | invService.MoveFolder(folder); |
377 | } | 409 | } |
@@ -391,6 +423,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
391 | client.SendAgentAlertMessage("Unable to delete "+ | 423 | client.SendAgentAlertMessage("Unable to delete "+ |
392 | "received inventory" + reason, false); | 424 | "received inventory" + reason, false); |
393 | } | 425 | } |
426 | // Tell client about updates to original parent and new parent (this should probably be factored with existing move item/folder code). | ||
427 | else if (previousParentFolderID != null) | ||
428 | { | ||
429 | InventoryFolderBase previousParentFolder | ||
430 | = new InventoryFolderBase((UUID)previousParentFolderID, client.AgentId); | ||
431 | previousParentFolder = invService.GetFolder(previousParentFolder); | ||
432 | scene.SendInventoryUpdate(client, previousParentFolder, true, true); | ||
433 | |||
434 | scene.SendInventoryUpdate(client, trashFolder, true, true); | ||
435 | } | ||
394 | 436 | ||
395 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); | 437 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); |
396 | 438 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs index 92cf9d1..9c369f6 100644 --- a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs | |||
@@ -186,7 +186,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure | |||
186 | client.FirstName+" "+client.LastName, targetid, | 186 | client.FirstName+" "+client.LastName, targetid, |
187 | (byte)InstantMessageDialog.RequestTeleport, false, | 187 | (byte)InstantMessageDialog.RequestTeleport, false, |
188 | message, sessionID, false, presence.AbsolutePosition, | 188 | message, sessionID, false, presence.AbsolutePosition, |
189 | new Byte[0]); | 189 | new Byte[0], true); |
190 | m.RegionID = client.Scene.RegionInfo.RegionID.Guid; | 190 | m.RegionID = client.Scene.RegionInfo.RegionID.Guid; |
191 | 191 | ||
192 | m_log.DebugFormat("[HG LURE MODULE]: RequestTeleport sessionID={0}, regionID={1}, message={2}", m.imSessionID, m.RegionID, m.message); | 192 | m_log.DebugFormat("[HG LURE MODULE]: RequestTeleport sessionID={0}, regionID={1}, message={2}", m.imSessionID, m.RegionID, m.message); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs index 2d4cffd..6ce9556 100644 --- a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs | |||
@@ -169,7 +169,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure | |||
169 | client.FirstName+" "+client.LastName, targetid, | 169 | client.FirstName+" "+client.LastName, targetid, |
170 | (byte)InstantMessageDialog.RequestTeleport, false, | 170 | (byte)InstantMessageDialog.RequestTeleport, false, |
171 | message, dest, false, presence.AbsolutePosition, | 171 | message, dest, false, presence.AbsolutePosition, |
172 | new Byte[0]); | 172 | new Byte[0], true); |
173 | 173 | ||
174 | if (m_TransferModule != null) | 174 | if (m_TransferModule != null) |
175 | { | 175 | { |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index b51570f..617a350 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -1068,6 +1068,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1068 | Scene initiatingScene) | 1068 | Scene initiatingScene) |
1069 | { | 1069 | { |
1070 | Thread.Sleep(10000); | 1070 | Thread.Sleep(10000); |
1071 | |||
1071 | IMessageTransferModule im = initiatingScene.RequestModuleInterface<IMessageTransferModule>(); | 1072 | IMessageTransferModule im = initiatingScene.RequestModuleInterface<IMessageTransferModule>(); |
1072 | if (im != null) | 1073 | if (im != null) |
1073 | { | 1074 | { |
@@ -1080,11 +1081,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1080 | (uint)(int)position.X, | 1081 | (uint)(int)position.X, |
1081 | (uint)(int)position.Y, | 1082 | (uint)(int)position.Y, |
1082 | (uint)(int)position.Z); | 1083 | (uint)(int)position.Z); |
1083 | GridInstantMessage m = new GridInstantMessage(initiatingScene, UUID.Zero, | 1084 | |
1084 | "Region", agent.UUID, | 1085 | GridInstantMessage m |
1085 | (byte)InstantMessageDialog.GodLikeRequestTeleport, false, | 1086 | = new GridInstantMessage( |
1086 | "", gotoLocation, false, new Vector3(127, 0, 0), | 1087 | initiatingScene, |
1087 | new Byte[0]); | 1088 | UUID.Zero, |
1089 | "Region", | ||
1090 | agent.UUID, | ||
1091 | (byte)InstantMessageDialog.GodLikeRequestTeleport, | ||
1092 | false, | ||
1093 | "", | ||
1094 | gotoLocation, | ||
1095 | false, | ||
1096 | new Vector3(127, 0, 0), | ||
1097 | new Byte[0], | ||
1098 | false); | ||
1099 | |||
1088 | im.SendInstantMessage(m, delegate(bool success) | 1100 | im.SendInstantMessage(m, delegate(bool success) |
1089 | { | 1101 | { |
1090 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Client Initiating Teleport sending IM success = {0}", success); | 1102 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Client Initiating Teleport sending IM success = {0}", success); |