diff options
author | Brian McBee | 2007-12-15 04:57:14 +0000 |
---|---|---|
committer | Brian McBee | 2007-12-15 04:57:14 +0000 |
commit | 8a8c89a0f32b528bd588715bdbfc875c852e7187 (patch) | |
tree | b46cb20d03dfdb21a5cbdfa514a8e745070a3713 /OpenSim/Region/ClientStack/ClientView.cs | |
parent | Set svn:eol-style. Cleaned up set-eol-style.sh a bit. (diff) | |
download | opensim-SC_OLD-8a8c89a0f32b528bd588715bdbfc875c852e7187.zip opensim-SC_OLD-8a8c89a0f32b528bd588715bdbfc875c852e7187.tar.gz opensim-SC_OLD-8a8c89a0f32b528bd588715bdbfc875c852e7187.tar.bz2 opensim-SC_OLD-8a8c89a0f32b528bd588715bdbfc875c852e7187.tar.xz |
Grid Inventory feature upgrade: renaming folders should now be correct, subfolders work, moving folders works.
Tested only in MYSQL, but may work in MSSQL and sqlite.
Probably not working in standalone mode.
Diffstat (limited to 'OpenSim/Region/ClientStack/ClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.cs | 63 |
1 files changed, 60 insertions, 3 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 0514df5..1746db8 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs | |||
@@ -502,6 +502,7 @@ namespace OpenSim.Region.ClientStack | |||
502 | public event CreateNewInventoryItem OnCreateNewInventoryItem; | 502 | public event CreateNewInventoryItem OnCreateNewInventoryItem; |
503 | public event CreateInventoryFolder OnCreateNewInventoryFolder; | 503 | public event CreateInventoryFolder OnCreateNewInventoryFolder; |
504 | public event UpdateInventoryFolder OnUpdateInventoryFolder; | 504 | public event UpdateInventoryFolder OnUpdateInventoryFolder; |
505 | public event MoveInventoryFolder OnMoveInventoryFolder; | ||
505 | public event FetchInventoryDescendents OnFetchInventoryDescendents; | 506 | public event FetchInventoryDescendents OnFetchInventoryDescendents; |
506 | public event PurgeInventoryDescendents OnPurgeInventoryDescendents; | 507 | public event PurgeInventoryDescendents OnPurgeInventoryDescendents; |
507 | public event FetchInventory OnFetchInventory; | 508 | public event FetchInventory OnFetchInventory; |
@@ -892,7 +893,7 @@ namespace OpenSim.Region.ClientStack | |||
892 | /// <param name="subFoldersCount">The number of subfolders contained in the given folder. This is necessary since | 893 | /// <param name="subFoldersCount">The number of subfolders contained in the given folder. This is necessary since |
893 | /// the client is expecting inventory packets which incorporate this number into the descendents field, even though | 894 | /// the client is expecting inventory packets which incorporate this number into the descendents field, even though |
894 | /// we send back no details of the folders themselves (only the items).</param> | 895 | /// we send back no details of the folders themselves (only the items).</param> |
895 | public void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items, int subFoldersCount) | 896 | public void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items, List<InventoryFolderBase> folders, int subFoldersCount) |
896 | { | 897 | { |
897 | Encoding enc = Encoding.ASCII; | 898 | Encoding enc = Encoding.ASCII; |
898 | uint FULL_MASK_PERMISSIONS = 2147483647; | 899 | uint FULL_MASK_PERMISSIONS = 2147483647; |
@@ -931,14 +932,14 @@ namespace OpenSim.Region.ClientStack | |||
931 | descend.ItemData[i].FolderID = item.parentFolderID; | 932 | descend.ItemData[i].FolderID = item.parentFolderID; |
932 | descend.ItemData[i].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); | 933 | descend.ItemData[i].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); |
933 | descend.ItemData[i].GroupMask = 0; | 934 | descend.ItemData[i].GroupMask = 0; |
934 | descend.ItemData[i].InvType = (sbyte) item.invType; | 935 | descend.ItemData[i].InvType = (sbyte)item.invType; |
935 | descend.ItemData[i].Name = Helpers.StringToField(item.inventoryName); | 936 | descend.ItemData[i].Name = Helpers.StringToField(item.inventoryName); |
936 | descend.ItemData[i].NextOwnerMask = item.inventoryNextPermissions; | 937 | descend.ItemData[i].NextOwnerMask = item.inventoryNextPermissions; |
937 | descend.ItemData[i].OwnerID = item.avatarID; | 938 | descend.ItemData[i].OwnerID = item.avatarID; |
938 | descend.ItemData[i].OwnerMask = item.inventoryCurrentPermissions; | 939 | descend.ItemData[i].OwnerMask = item.inventoryCurrentPermissions; |
939 | descend.ItemData[i].SalePrice = 0; | 940 | descend.ItemData[i].SalePrice = 0; |
940 | descend.ItemData[i].SaleType = 0; | 941 | descend.ItemData[i].SaleType = 0; |
941 | descend.ItemData[i].Type = (sbyte) item.assetType; | 942 | descend.ItemData[i].Type = (sbyte)item.assetType; |
942 | descend.ItemData[i].CRC = | 943 | descend.ItemData[i].CRC = |
943 | 944 | ||
944 | Helpers.InventoryCRC(descend.ItemData[i].CreationDate, descend.ItemData[i].SaleType, | 945 | Helpers.InventoryCRC(descend.ItemData[i].CreationDate, descend.ItemData[i].SaleType, |
@@ -976,6 +977,47 @@ namespace OpenSim.Region.ClientStack | |||
976 | { | 977 | { |
977 | OutPacket(descend, ThrottleOutPacketType.Asset); | 978 | OutPacket(descend, ThrottleOutPacketType.Asset); |
978 | } | 979 | } |
980 | |||
981 | //send subfolders | ||
982 | descend = CreateInventoryDescendentsPacket(ownerID, folderID); | ||
983 | descend.FolderData = new InventoryDescendentsPacket.FolderDataBlock[folders.Count]; | ||
984 | i = 0; | ||
985 | count = 0; | ||
986 | foreach (InventoryFolderBase folder in folders) | ||
987 | { | ||
988 | descend.FolderData[i] = new InventoryDescendentsPacket.FolderDataBlock(); | ||
989 | descend.FolderData[i].FolderID = folder.folderID; | ||
990 | descend.FolderData[i].Name = Helpers.StringToField(folder.name); | ||
991 | descend.FolderData[i].ParentID = folder.parentID; | ||
992 | descend.FolderData[i].Type = (sbyte)folder.type; | ||
993 | i++; | ||
994 | count++; | ||
995 | if (i == 40) | ||
996 | { | ||
997 | OutPacket(descend, ThrottleOutPacketType.Asset); | ||
998 | |||
999 | if ((folders.Count - count) > 0) | ||
1000 | { | ||
1001 | descend = CreateInventoryDescendentsPacket(ownerID, folderID); | ||
1002 | if ((folders.Count - count) < 40) | ||
1003 | { | ||
1004 | descend.FolderData = new InventoryDescendentsPacket.FolderDataBlock[items.Count - count]; | ||
1005 | descend.AgentData.Descendents = folders.Count - count; | ||
1006 | } | ||
1007 | else | ||
1008 | { | ||
1009 | descend.FolderData = new InventoryDescendentsPacket.FolderDataBlock[40]; | ||
1010 | descend.AgentData.Descendents = 40; | ||
1011 | } | ||
1012 | i = 0; | ||
1013 | } | ||
1014 | } | ||
1015 | } | ||
1016 | |||
1017 | if (i < 40) | ||
1018 | { | ||
1019 | OutPacket(descend, ThrottleOutPacketType.Asset); | ||
1020 | } | ||
979 | } | 1021 | } |
980 | 1022 | ||
981 | private InventoryDescendentsPacket CreateInventoryDescendentsPacket(LLUUID ownerID, LLUUID folderID) | 1023 | private InventoryDescendentsPacket CreateInventoryDescendentsPacket(LLUUID ownerID, LLUUID folderID) |
@@ -2821,6 +2863,17 @@ namespace OpenSim.Region.ClientStack | |||
2821 | } | 2863 | } |
2822 | } | 2864 | } |
2823 | break; | 2865 | break; |
2866 | case PacketType.MoveInventoryFolder: | ||
2867 | if (OnMoveInventoryFolder != null) | ||
2868 | { | ||
2869 | MoveInventoryFolderPacket invFolder = (MoveInventoryFolderPacket)Pack; | ||
2870 | for (int i = 0; i < invFolder.InventoryData.Length; i++) | ||
2871 | { | ||
2872 | OnMoveInventoryFolder(this, invFolder.InventoryData[i].FolderID, | ||
2873 | invFolder.InventoryData[i].ParentID); | ||
2874 | } | ||
2875 | } | ||
2876 | break; | ||
2824 | case PacketType.CreateInventoryItem: | 2877 | case PacketType.CreateInventoryItem: |
2825 | CreateInventoryItemPacket createItem = (CreateInventoryItemPacket) Pack; | 2878 | CreateInventoryItemPacket createItem = (CreateInventoryItemPacket) Pack; |
2826 | if (OnCreateNewInventoryItem != null) | 2879 | if (OnCreateNewInventoryItem != null) |
@@ -3267,6 +3320,10 @@ namespace OpenSim.Region.ClientStack | |||
3267 | // TODO: handle this packet | 3320 | // TODO: handle this packet |
3268 | MainLog.Instance.Warn("CLIENT", "unhandled RequestRegionInfo packet"); | 3321 | MainLog.Instance.Warn("CLIENT", "unhandled RequestRegionInfo packet"); |
3269 | break; | 3322 | break; |
3323 | case PacketType.InventoryDescendents: | ||
3324 | // TODO: handle this packet | ||
3325 | MainLog.Instance.Warn("CLIENT", "unhandled InventoryDescent packet"); | ||
3326 | break; | ||
3270 | default: | 3327 | default: |
3271 | MainLog.Instance.Warn("CLIENT", "unhandled packet " + Pack.ToString()); | 3328 | MainLog.Instance.Warn("CLIENT", "unhandled packet " + Pack.ToString()); |
3272 | break; | 3329 | break; |