private void UploadBakedTextureHandler(Capability cap, IHttpClientContext context, IHttpRequest request, IHttpResponse response) { UploadBakedTextureMessage reply = new UploadBakedTextureMessage(); UploaderRequestUpload replyBlock = new UploaderRequestUpload(); // Create a temporary uploader capability replyBlock.Url = m_scene.Capabilities.AddCapability(cap.OwnerID, true, m_scene.ID, "UploadBakedTextureData"); reply.Request = replyBlock; m_log.Debug("Created baked texture upload capability " + replyBlock.Url + " for " + cap.OwnerID); LLUtil.SendLLSDXMLResponse(response, reply.Serialize()); }
private void UploadBakedTextureDataHandler(Capability cap, IHttpClientContext context, IHttpRequest request, IHttpResponse response) { byte[] textureData = request.GetBody(); UUID assetID = UUID.Zero; m_log.Debug("Received baked texture upload from " + cap.OwnerID + " (" + textureData.Length + " bytes)"); if (textureData != null && textureData.Length > 0) { if (!m_assetClient.StoreAsset("image/x-j2c", true, true, textureData, cap.OwnerID, out assetID)) m_log.WarnFormat("Failed to store uploaded texture bake ({0} bytes)", textureData.Length); } else { m_log.Warn("Texture bake upload contained no data"); } UploadBakedTextureMessage reply = new UploadBakedTextureMessage(); UploaderRequestComplete replyBlock = new UploaderRequestComplete(); replyBlock.AssetID = assetID; reply.Request = replyBlock; LLUtil.SendLLSDXMLResponse(response, reply.Serialize()); }