diff options
author | Teravus Ovares (Dan Olivares) | 2010-10-14 03:22:14 -0400 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2010-10-14 03:22:44 -0400 |
commit | b4a5ce148cf209b1bc0a1ca302275f44abf1040f (patch) | |
tree | 1f342a3cbff3be457520dd9f879cf372f0683609 /OpenSim/Region | |
parent | * Partially complete stuff for Mesh support that Melanie wanted to see before... (diff) | |
download | opensim-SC-b4a5ce148cf209b1bc0a1ca302275f44abf1040f.zip opensim-SC-b4a5ce148cf209b1bc0a1ca302275f44abf1040f.tar.gz opensim-SC-b4a5ce148cf209b1bc0a1ca302275f44abf1040f.tar.bz2 opensim-SC-b4a5ce148cf209b1bc0a1ca302275f44abf1040f.tar.xz |
Rename file + more testing and tweaking
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs (renamed from OpenSim/Region/CoreModules/Avatar/Assets/UploadObjectAssetModule.cs) | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/UploadObjectAssetModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs index 2600506..0bba7d4 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/UploadObjectAssetModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs | |||
@@ -48,7 +48,7 @@ using OpenSim.Framework.Capabilities; | |||
48 | namespace OpenSim.Region.CoreModules.Avatar.Assets | 48 | namespace OpenSim.Region.CoreModules.Avatar.Assets |
49 | { | 49 | { |
50 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 50 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] |
51 | public class UploadObjectAssetModule : INonSharedRegionModule | 51 | public class NewFileAgentInventoryVariablePriceModule : INonSharedRegionModule |
52 | { | 52 | { |
53 | private static readonly ILog m_log = | 53 | private static readonly ILog m_log = |
54 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 54 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -97,7 +97,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets | |||
97 | 97 | ||
98 | public void Close() { } | 98 | public void Close() { } |
99 | 99 | ||
100 | public string Name { get { return "UploadObjectAssetModule"; } } | 100 | public string Name { get { return "NewFileAgentInventoryVariablePriceModule"; } } |
101 | 101 | ||
102 | 102 | ||
103 | public void RegisterCaps(UUID agentID, Caps caps) | 103 | public void RegisterCaps(UUID agentID, Caps caps) |
@@ -105,7 +105,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets | |||
105 | UUID capID = UUID.Random(); | 105 | UUID capID = UUID.Random(); |
106 | 106 | ||
107 | m_log.Info("[GETMESH]: /CAPS/" + capID); | 107 | m_log.Info("[GETMESH]: /CAPS/" + capID); |
108 | caps.RegisterHandler("UploadObjectAsset", | 108 | caps.RegisterHandler("NewFileAgentInventoryVariablePrice", |
109 | 109 | ||
110 | new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDAssetUploadResponse>("POST", | 110 | new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDAssetUploadResponse>("POST", |
111 | "/CAPS/" + capID.ToString(), | 111 | "/CAPS/" + capID.ToString(), |
@@ -151,11 +151,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets | |||
151 | 151 | ||
152 | string assetName = llsdRequest.name; | 152 | string assetName = llsdRequest.name; |
153 | string assetDes = llsdRequest.description; | 153 | string assetDes = llsdRequest.description; |
154 | string capsBase = "/CAPS/UploadObjectAsset/"; | 154 | string capsBase = "/CAPS/NewFileAgentInventoryVariablePrice/"; |
155 | UUID newAsset = UUID.Random(); | 155 | UUID newAsset = UUID.Random(); |
156 | UUID newInvItem = UUID.Random(); | 156 | UUID newInvItem = UUID.Random(); |
157 | UUID parentFolder = llsdRequest.folder_id; | 157 | UUID parentFolder = llsdRequest.folder_id; |
158 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); | 158 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000") + "/"; |
159 | 159 | ||
160 | Caps.AssetUploader uploader = | 160 | Caps.AssetUploader uploader = |
161 | new Caps.AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type, | 161 | new Caps.AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type, |
@@ -174,8 +174,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets | |||
174 | LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); | 174 | LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); |
175 | uploadResponse.uploader = uploaderURL; | 175 | uploadResponse.uploader = uploaderURL; |
176 | uploadResponse.state = "upload"; | 176 | uploadResponse.state = "upload"; |
177 | 177 | ||
178 | uploader.OnUpLoad += delegate( | 178 | uploader.OnUpLoad += UploadCompleteHandler; |
179 | |||
180 | /*delegate( | ||
179 | string passetName, string passetDescription, UUID passetID, | 181 | string passetName, string passetDescription, UUID passetID, |
180 | UUID pinventoryItem, UUID pparentFolder, byte[] pdata, string pinventoryType, | 182 | UUID pinventoryItem, UUID pparentFolder, byte[] pdata, string pinventoryType, |
181 | string passetType) | 183 | string passetType) |
@@ -183,15 +185,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets | |||
183 | UploadCompleteHandler(passetName, passetDescription, passetID, | 185 | UploadCompleteHandler(passetName, passetDescription, passetID, |
184 | pinventoryItem, pparentFolder, pdata, pinventoryType, | 186 | pinventoryItem, pparentFolder, pdata, pinventoryType, |
185 | passetType,agentID); | 187 | passetType,agentID); |
186 | }; | 188 | };*/ |
187 | return uploadResponse; | 189 | return uploadResponse; |
188 | } | 190 | } |
189 | 191 | ||
190 | 192 | ||
191 | public void UploadCompleteHandler(string assetName, string assetDescription, UUID assetID, | 193 | public void UploadCompleteHandler(string assetName, string assetDescription, UUID assetID, |
192 | UUID inventoryItem, UUID parentFolder, byte[] data, string inventoryType, | 194 | UUID inventoryItem, UUID parentFolder, byte[] data, string inventoryType, |
193 | string assetType,UUID AgentID) | 195 | string assetType) |
194 | { | 196 | { |
197 | UUID AgentID = UUID.Zero; | ||
195 | sbyte assType = 0; | 198 | sbyte assType = 0; |
196 | sbyte inType = 0; | 199 | sbyte inType = 0; |
197 | 200 | ||
@@ -218,6 +221,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets | |||
218 | break; | 221 | break; |
219 | } | 222 | } |
220 | } | 223 | } |
224 | else if (inventoryType == "mesh") | ||
225 | { | ||
226 | inType = 45; // TODO: Replace with appropriate type | ||
227 | assType = 45;// TODO: Replace with appropriate type | ||
228 | } | ||
221 | 229 | ||
222 | AssetBase asset; | 230 | AssetBase asset; |
223 | asset = new AssetBase(assetID, assetName, assType, AgentID.ToString()); | 231 | asset = new AssetBase(assetID, assetName, assType, AgentID.ToString()); |