aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2011-05-13 12:05:46 +0100
committerMelanie2011-05-13 12:05:46 +0100
commit75d4956ee58340adca06d2ad602e2cd87b2e5943 (patch)
tree8203a626b75a7926bcffe8044847724fd53dae40 /OpenSim/Region
parentMerge branch 'master' into careminster-presence-refactor (diff)
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC-75d4956ee58340adca06d2ad602e2cd87b2e5943.zip
opensim-SC-75d4956ee58340adca06d2ad602e2cd87b2e5943.tar.gz
opensim-SC-75d4956ee58340adca06d2ad602e2cd87b2e5943.tar.bz2
opensim-SC-75d4956ee58340adca06d2ad602e2cd87b2e5943.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs7
-rw-r--r--OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs8
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs56
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs4
5 files changed, 68 insertions, 11 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index de40abd..7564907 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -1630,14 +1630,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1630 currentPacket.ItemData[itemsSent % MAX_ITEMS_PER_PACKET] = CreateItemDataBlock(items[itemsSent++]); 1630 currentPacket.ItemData[itemsSent % MAX_ITEMS_PER_PACKET] = CreateItemDataBlock(items[itemsSent++]);
1631 else 1631 else
1632 { 1632 {
1633// m_log.DebugFormat(
1634// "[LLCLIENTVIEW]: Sending inventory folder details packet to {0} for folder {1}", Name, folderID);
1633 OutPacket(currentPacket, ThrottleOutPacketType.Asset, false); 1635 OutPacket(currentPacket, ThrottleOutPacketType.Asset, false);
1634 currentPacket = null; 1636 currentPacket = null;
1635 } 1637 }
1636
1637 } 1638 }
1638 1639
1639 if (currentPacket != null) 1640 if (currentPacket != null)
1641 {
1642// m_log.DebugFormat(
1643// "[LLCLIENTVIEW]: Sending inventory folder details packet to {0} for folder {1}", Name, folderID);
1640 OutPacket(currentPacket, ThrottleOutPacketType.Asset, false); 1644 OutPacket(currentPacket, ThrottleOutPacketType.Asset, false);
1645 }
1641 } 1646 }
1642 1647
1643 private InventoryDescendentsPacket.FolderDataBlock CreateFolderDataBlock(InventoryFolderBase folder) 1648 private InventoryDescendentsPacket.FolderDataBlock CreateFolderDataBlock(InventoryFolderBase folder)
diff --git a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs
index a0ccdc7..5ab334f 100644
--- a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs
@@ -62,8 +62,8 @@ namespace OpenSim.Region.CoreModules.Hypergrid
62 { 62 {
63 List<MapBlockData> mapBlocks = new List<MapBlockData>(); 63 List<MapBlockData> mapBlocks = new List<MapBlockData>();
64 List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, 64 List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID,
65 (minX - 4) * (int)Constants.RegionSize, (maxX + 4) * (int)Constants.RegionSize, 65 minX * (int)Constants.RegionSize, maxX * (int)Constants.RegionSize,
66 (minY - 4) * (int)Constants.RegionSize, (maxY + 4) * (int)Constants.RegionSize); 66 minY * (int)Constants.RegionSize, maxY * (int)Constants.RegionSize);
67 67
68 foreach (GridRegion r in regions) 68 foreach (GridRegion r in regions)
69 { 69 {
@@ -76,7 +76,7 @@ namespace OpenSim.Region.CoreModules.Hypergrid
76 FillInMap(mapBlocks, minX, minY, maxX, maxY); 76 FillInMap(mapBlocks, minX, minY, maxX, maxY);
77 // 77 //
78 78
79 remoteClient.SendMapBlock(mapBlocks, flag); 79 remoteClient.SendMapBlock(mapBlocks, 0);
80 } 80 }
81 81
82 82
@@ -93,7 +93,7 @@ namespace OpenSim.Region.CoreModules.Hypergrid
93 mblock.X = (ushort)x; 93 mblock.X = (ushort)x;
94 mblock.Y = (ushort)y; 94 mblock.Y = (ushort)y;
95 mblock.Name = ""; 95 mblock.Name = "";
96 mblock.Access = 254; // not here??? 96 mblock.Access = 254; // means 'simulator is offline'. We need this because the viewer ignores 255's
97 mblock.MapImageId = UUID.Zero; 97 mblock.MapImageId = UUID.Zero;
98 mapBlocks.Add(mblock); 98 mapBlocks.Add(mblock);
99 } 99 }
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index fe919b7..cd40c5d 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -820,7 +820,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
820 MapBlockData block = new MapBlockData(); 820 MapBlockData block = new MapBlockData();
821 block.X = (ushort)minX; 821 block.X = (ushort)minX;
822 block.Y = (ushort)minY; 822 block.Y = (ushort)minY;
823 block.Access = 254; // == not there 823 block.Access = 254; // means 'simulator is offline'
824 response.Add(block); 824 response.Add(block);
825 } 825 }
826 remoteClient.SendMapBlock(response, 0); 826 remoteClient.SendMapBlock(response, 0);
@@ -846,7 +846,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
846 MapBlockFromGridRegion(block, r); 846 MapBlockFromGridRegion(block, r);
847 mapBlocks.Add(block); 847 mapBlocks.Add(block);
848 } 848 }
849 remoteClient.SendMapBlock(mapBlocks, flag); 849 remoteClient.SendMapBlock(mapBlocks, 0);
850 } 850 }
851 851
852 protected void MapBlockFromGridRegion(MapBlockData block, GridRegion r) 852 protected void MapBlockFromGridRegion(MapBlockData block, GridRegion r)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index dfb5846..1c30a35 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -907,11 +907,29 @@ namespace OpenSim.Region.Framework.Scenes
907 } 907 }
908 } 908 }
909 909
910 /// <summary>
911 /// Link an inventory item to an existing item.
912 /// </summary>
913 /// <remarks>
914 /// The linkee item id is placed in the asset id slot. This appears to be what the viewer expects when
915 /// it receives inventory information.
916 /// </remarks>
917 /// <param name="remoteClient"></param>
918 /// <param name="transActionID"></param>
919 /// <param name="folderID"></param>
920 /// <param name="callbackID"></param>
921 /// <param name="description"></param>
922 /// <param name="name"></param>
923 /// <param name="invType"></param>
924 /// <param name="type">/param>
925 /// <param name="olditemID"></param>
910 private void HandleLinkInventoryItem(IClientAPI remoteClient, UUID transActionID, UUID folderID, 926 private void HandleLinkInventoryItem(IClientAPI remoteClient, UUID transActionID, UUID folderID,
911 uint callbackID, string description, string name, 927 uint callbackID, string description, string name,
912 sbyte invType, sbyte type, UUID olditemID) 928 sbyte invType, sbyte type, UUID olditemID)
913 { 929 {
914 m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item link {0} in folder {1} pointing to {2}", name, folderID, olditemID); 930 m_log.DebugFormat(
931 "[AGENT INVENTORY]: Received request from {0} to create inventory item link {1} in folder {2} pointing to {3}",
932 remoteClient.Name, name, folderID, olditemID);
915 933
916 if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId)) 934 if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId))
917 return; 935 return;
@@ -919,7 +937,20 @@ namespace OpenSim.Region.Framework.Scenes
919 ScenePresence presence; 937 ScenePresence presence;
920 if (TryGetScenePresence(remoteClient.AgentId, out presence)) 938 if (TryGetScenePresence(remoteClient.AgentId, out presence))
921 { 939 {
922// byte[] data = null; 940 bool linkAlreadyExists = false;
941 List<InventoryItemBase> existingItems = InventoryService.GetFolderItems(remoteClient.AgentId, folderID);
942 foreach (InventoryItemBase item in existingItems)
943 if (item.AssetID == olditemID)
944 linkAlreadyExists = true;
945
946 if (linkAlreadyExists)
947 {
948 m_log.WarnFormat(
949 "[AGENT INVENTORY]: Ignoring request from {0} to create item link {1} in folder {2} pointing to {3} since a link already exists",
950 remoteClient.Name, name, folderID, olditemID);
951
952 return;
953 }
923 954
924 AssetBase asset = new AssetBase(); 955 AssetBase asset = new AssetBase();
925 asset.FullID = olditemID; 956 asset.FullID = olditemID;
@@ -1370,11 +1401,28 @@ namespace OpenSim.Region.Framework.Scenes
1370 InventoryFolderBase containingFolder = new InventoryFolderBase(folder.ID, client.AgentId); 1401 InventoryFolderBase containingFolder = new InventoryFolderBase(folder.ID, client.AgentId);
1371 containingFolder = InventoryService.GetFolder(containingFolder); 1402 containingFolder = InventoryService.GetFolder(containingFolder);
1372 1403
1373 //m_log.DebugFormat("[AGENT INVENTORY]: Sending inventory folder contents ({0} nodes) for \"{1}\" to {2} {3}", 1404// m_log.DebugFormat("[AGENT INVENTORY]: Sending inventory folder contents ({0} nodes) for \"{1}\" to {2} {3}",
1374 // contents.Folders.Count + contents.Items.Count, containingFolder.Name, client.FirstName, client.LastName); 1405// contents.Folders.Count + contents.Items.Count, containingFolder.Name, client.FirstName, client.LastName);
1375 1406
1376 if (containingFolder != null && containingFolder != null) 1407 if (containingFolder != null && containingFolder != null)
1408 {
1409 // If the folder requested contains links, then we need to send those folders first, otherwise the links
1410 // will be broken in the viewer.
1411 HashSet<UUID> linkedItemFolderIdsToSend = new HashSet<UUID>();
1412 foreach (InventoryItemBase item in contents.Items)
1413 {
1414 if (item.AssetType == (int)AssetType.Link)
1415 {
1416 InventoryItemBase linkedItem = InventoryService.GetItem(new InventoryItemBase(item.AssetID));
1417 linkedItemFolderIdsToSend.Add(linkedItem.Folder);
1418 }
1419 }
1420
1421 foreach (UUID linkedItemFolderId in linkedItemFolderIdsToSend)
1422 SendInventoryUpdate(client, new InventoryFolderBase(linkedItemFolderId), false, true);
1423
1377 client.SendInventoryFolderDetails(client.AgentId, folder.ID, contents.Items, contents.Folders, containingFolder.Version, fetchFolders, fetchItems); 1424 client.SendInventoryFolderDetails(client.AgentId, folder.ID, contents.Items, contents.Folders, containingFolder.Version, fetchFolders, fetchItems);
1425 }
1378 } 1426 }
1379 1427
1380 /// <summary> 1428 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index ab567fb..e2d7208 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -499,6 +499,10 @@ namespace OpenSim.Region.Framework.Scenes
499 public void HandleFetchInventoryDescendents(IClientAPI remoteClient, UUID folderID, UUID ownerID, 499 public void HandleFetchInventoryDescendents(IClientAPI remoteClient, UUID folderID, UUID ownerID,
500 bool fetchFolders, bool fetchItems, int sortOrder) 500 bool fetchFolders, bool fetchItems, int sortOrder)
501 { 501 {
502// m_log.DebugFormat(
503// "[USER INVENTORY]: HandleFetchInventoryDescendents() for {0}, folder={1}, fetchFolders={2}, fetchItems={3}, sortOrder={4}",
504// remoteClient.Name, folderID, fetchFolders, fetchItems, sortOrder);
505
502 if (folderID == UUID.Zero) 506 if (folderID == UUID.Zero)
503 return; 507 return;
504 508