A message sent from the simulator that will inform the agent the upload is complete, and the UUID of the uploaded asset
Inheritance: AssetUploaderBlock
Ejemplo n.º 1
0
        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());
        }