aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Framework/SLUtil.cs33
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs12
2 files changed, 45 insertions, 0 deletions
diff --git a/OpenSim/Framework/SLUtil.cs b/OpenSim/Framework/SLUtil.cs
index f6d6a7c..a489806 100644
--- a/OpenSim/Framework/SLUtil.cs
+++ b/OpenSim/Framework/SLUtil.cs
@@ -106,6 +106,39 @@ namespace OpenSim.Framework
106 } 106 }
107 } 107 }
108 108
109 public static string SLInvTypeToContentType(int invType)
110 {
111 switch ((InventoryType)invType)
112 {
113 case InventoryType.Animation:
114 return "application/vnd.ll.animation";
115 case InventoryType.CallingCard:
116 return "application/vnd.ll.callingcard";
117 case InventoryType.Folder:
118 return "application/vnd.ll.folder";
119 case InventoryType.Gesture:
120 return "application/vnd.ll.gesture";
121 case InventoryType.Landmark:
122 return "application/vnd.ll.landmark";
123 case InventoryType.LSL:
124 return "application/vnd.ll.lsltext";
125 case InventoryType.Notecard:
126 return "application/vnd.ll.notecard";
127 case InventoryType.Attachment:
128 case InventoryType.Object:
129 return "application/vnd.ll.primitive";
130 case InventoryType.Sound:
131 return "application/ogg";
132 case InventoryType.Snapshot:
133 case InventoryType.Texture:
134 return "image/x-j2c";
135 case InventoryType.Wearable:
136 return "application/vnd.ll.clothing";
137 default:
138 return "application/octet-stream";
139 }
140 }
141
109 public static sbyte ContentTypeToSLAssetType(string contentType) 142 public static sbyte ContentTypeToSLAssetType(string contentType)
110 { 143 {
111 switch (contentType) 144 switch (contentType)
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
index 56e7475..9005e94 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
@@ -583,6 +583,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
583 { "Permissions", permissions } 583 { "Permissions", permissions }
584 }; 584 };
585 585
586 // Add different asset type only if it differs from inventory type
587 // (needed for links)
588 string invContentType = SLUtil.SLInvTypeToContentType(item.InvType);
589 string assetContentType = SLUtil.SLAssetTypeToContentType(item.AssetType);
590
591 if (invContentType != assetContentType)
592 extraData["LinkedItemType"] = OSD.FromString(assetContentType);
593
586 NameValueCollection requestArgs = new NameValueCollection 594 NameValueCollection requestArgs = new NameValueCollection
587 { 595 {
588 { "RequestMethod", "AddInventoryItem" }, 596 { "RequestMethod", "AddInventoryItem" },
@@ -593,6 +601,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
593 { "Name", item.Name }, 601 { "Name", item.Name },
594 { "Description", item.Description }, 602 { "Description", item.Description },
595 { "CreatorID", item.CreatorId }, 603 { "CreatorID", item.CreatorId },
604 { "ContentType", invContentType },
596 { "ExtraData", OSDParser.SerializeJsonString(extraData) } 605 { "ExtraData", OSDParser.SerializeJsonString(extraData) }
597 }; 606 };
598 607
@@ -781,6 +790,9 @@ namespace OpenSim.Services.Connectors.SimianGrid
781 invItem.GroupPermissions = perms["GroupMask"].AsUInteger(); 790 invItem.GroupPermissions = perms["GroupMask"].AsUInteger();
782 invItem.NextPermissions = perms["NextOwnerMask"].AsUInteger(); 791 invItem.NextPermissions = perms["NextOwnerMask"].AsUInteger();
783 } 792 }
793
794 if (extraData.ContainsKey("LinkedItemType"))
795 invItem.AssetType = extraData["LinkedItemType"].AsInteger();
784 } 796 }
785 797
786 if (invItem.BasePermissions == 0) 798 if (invItem.BasePermissions == 0)