aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorTeravus Ovares (Dan Olivares)2010-10-14 09:24:15 -0400
committerTeravus Ovares (Dan Olivares)2010-10-14 09:24:15 -0400
commit7e363b79c7894b8c393ec38ae60ea19f8cb65d5e (patch)
treeabd4fc965bc45736f364667d6376f16eef67a60c /OpenSim
parentMerge branch 'master' of ssh://MyConnection/var/git/opensim (diff)
downloadopensim-SC-7e363b79c7894b8c393ec38ae60ea19f8cb65d5e.zip
opensim-SC-7e363b79c7894b8c393ec38ae60ea19f8cb65d5e.tar.gz
opensim-SC-7e363b79c7894b8c393ec38ae60ea19f8cb65d5e.tar.bz2
opensim-SC-7e363b79c7894b8c393ec38ae60ea19f8cb65d5e.tar.xz
* Tweaked the upload response and now at least uploading the mesh works.
* Binary error on downloading the mesh though.. so still not yet working.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Capabilities/LLSDAssetUploadResponse.cs14
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs33
3 files changed, 35 insertions, 16 deletions
diff --git a/OpenSim/Framework/Capabilities/LLSDAssetUploadResponse.cs b/OpenSim/Framework/Capabilities/LLSDAssetUploadResponse.cs
index 08f14e3..0d6f7f9 100644
--- a/OpenSim/Framework/Capabilities/LLSDAssetUploadResponse.cs
+++ b/OpenSim/Framework/Capabilities/LLSDAssetUploadResponse.cs
@@ -39,4 +39,18 @@ namespace OpenSim.Framework.Capabilities
39 { 39 {
40 } 40 }
41 } 41 }
42
43 [OSDMap]
44 public class LLSDNewFileAngentInventoryVariablePriceReplyResponse
45 {
46 public int resource_cost;
47 public string state;
48 public int upload_price;
49 public string rsvp;
50
51 public LLSDNewFileAngentInventoryVariablePriceReplyResponse()
52 {
53 state = "confirm_upload";
54 }
55 }
42} \ No newline at end of file 56} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs
index c1e9891..bae108c 100644
--- a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs
@@ -145,7 +145,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
145 mesh = m_assetService.GetCached(meshID.ToString()); 145 mesh = m_assetService.GetCached(meshID.ToString());
146 if (mesh != null) 146 if (mesh != null)
147 { 147 {
148 if (mesh.Type == (sbyte)45) //TODO: Change to AssetType.Mesh when libomv gets updated! 148 if (mesh.Type == (sbyte)49) //TODO: Change to AssetType.Mesh when libomv gets updated!
149 { 149 {
150 responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data); 150 responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data);
151 responsedata["content_type"] = "application/vnd.ll.mesh"; 151 responsedata["content_type"] = "application/vnd.ll.mesh";
@@ -166,7 +166,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
166 mesh = m_assetService.Get(meshID.ToString()); 166 mesh = m_assetService.Get(meshID.ToString());
167 if (mesh != null) 167 if (mesh != null)
168 { 168 {
169 if (mesh.Type == (sbyte)45) //TODO: Change to AssetType.Mesh when libomv gets updated! 169 if (mesh.Type == (sbyte)49) //TODO: Change to AssetType.Mesh when libomv gets updated!
170 { 170 {
171 responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data); 171 responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data);
172 responsedata["content_type"] = "application/vnd.ll.mesh"; 172 responsedata["content_type"] = "application/vnd.ll.mesh";
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs
index 0bba7d4..9029f58 100644
--- a/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs
@@ -107,7 +107,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
107 m_log.Info("[GETMESH]: /CAPS/" + capID); 107 m_log.Info("[GETMESH]: /CAPS/" + capID);
108 caps.RegisterHandler("NewFileAgentInventoryVariablePrice", 108 caps.RegisterHandler("NewFileAgentInventoryVariablePrice",
109 109
110 new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDAssetUploadResponse>("POST", 110 new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDNewFileAngentInventoryVariablePriceReplyResponse>("POST",
111 "/CAPS/" + capID.ToString(), 111 "/CAPS/" + capID.ToString(),
112 delegate(LLSDAssetUploadRequest req) 112 delegate(LLSDAssetUploadRequest req)
113 { 113 {
@@ -117,8 +117,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
117 } 117 }
118 118
119 #endregion 119 #endregion
120 120
121 public LLSDAssetUploadResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest, UUID agentID) 121 public LLSDNewFileAngentInventoryVariablePriceReplyResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest, UUID agentID)
122 { 122 {
123 //if (llsdRequest.asset_type == "texture" || 123 //if (llsdRequest.asset_type == "texture" ||
124 // llsdRequest.asset_type == "animation" || 124 // llsdRequest.asset_type == "animation" ||
@@ -138,8 +138,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
138 if (client != null) 138 if (client != null)
139 client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); 139 client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);
140 140
141 LLSDAssetUploadResponse errorResponse = new LLSDAssetUploadResponse(); 141 LLSDNewFileAngentInventoryVariablePriceReplyResponse errorResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse();
142 errorResponse.uploader = ""; 142 errorResponse.rsvp = "";
143 errorResponse.state = "error"; 143 errorResponse.state = "error";
144 return errorResponse; 144 return errorResponse;
145 } 145 }
@@ -170,14 +170,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
170 170
171 string uploaderURL = protocol + m_scene.RegionInfo.ExternalHostName + ":" + MainServer.Instance.Port.ToString() + capsBase + 171 string uploaderURL = protocol + m_scene.RegionInfo.ExternalHostName + ":" + MainServer.Instance.Port.ToString() + capsBase +
172 uploaderPath; 172 uploaderPath;
173
173 174
174 LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); 175 LLSDNewFileAngentInventoryVariablePriceReplyResponse uploadResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse();
175 uploadResponse.uploader = uploaderURL; 176
177
178 uploadResponse.rsvp = uploaderURL;
176 uploadResponse.state = "upload"; 179 uploadResponse.state = "upload";
180 uploadResponse.resource_cost = 0;
181 uploadResponse.upload_price = 0;
177 182
178 uploader.OnUpLoad += UploadCompleteHandler; 183 uploader.OnUpLoad += //UploadCompleteHandler;
179 184
180 /*delegate( 185 delegate(
181 string passetName, string passetDescription, UUID passetID, 186 string passetName, string passetDescription, UUID passetID,
182 UUID pinventoryItem, UUID pparentFolder, byte[] pdata, string pinventoryType, 187 UUID pinventoryItem, UUID pparentFolder, byte[] pdata, string pinventoryType,
183 string passetType) 188 string passetType)
@@ -185,16 +190,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
185 UploadCompleteHandler(passetName, passetDescription, passetID, 190 UploadCompleteHandler(passetName, passetDescription, passetID,
186 pinventoryItem, pparentFolder, pdata, pinventoryType, 191 pinventoryItem, pparentFolder, pdata, pinventoryType,
187 passetType,agentID); 192 passetType,agentID);
188 };*/ 193 };
189 return uploadResponse; 194 return uploadResponse;
190 } 195 }
191 196
192 197
193 public void UploadCompleteHandler(string assetName, string assetDescription, UUID assetID, 198 public void UploadCompleteHandler(string assetName, string assetDescription, UUID assetID,
194 UUID inventoryItem, UUID parentFolder, byte[] data, string inventoryType, 199 UUID inventoryItem, UUID parentFolder, byte[] data, string inventoryType,
195 string assetType) 200 string assetType,UUID AgentID)
196 { 201 {
197 UUID AgentID = UUID.Zero; 202
198 sbyte assType = 0; 203 sbyte assType = 0;
199 sbyte inType = 0; 204 sbyte inType = 0;
200 205
@@ -223,8 +228,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
223 } 228 }
224 else if (inventoryType == "mesh") 229 else if (inventoryType == "mesh")
225 { 230 {
226 inType = 45; // TODO: Replace with appropriate type 231 inType = 22; // TODO: Replace with appropriate type
227 assType = 45;// TODO: Replace with appropriate type 232 assType = 49;// TODO: Replace with appropriate type
228 } 233 }
229 234
230 AssetBase asset; 235 AssetBase asset;