Beispiel #1
0
        byte[] ProcessSendUserReportWithScreenshot(UUID AgentID, string path, Stream request, OSHttpRequest httpRequest,
                                                   OSHttpResponse httpResponse)
        {
            IScenePresence SP  = findScenePresence(AgentID);
            OSDMap         map = (OSDMap)OSDParser.DeserializeLLSDXml(HttpServerHandlerHelpers.ReadFully(request));
            //string RegionName = map["abuse-region-name"];

            UUID    AbuserID     = map["abuser-id"];
            uint    Category     = map["category"];
            uint    CheckFlags   = map["check-flags"];
            string  details      = map["details"];
            UUID    objectID     = map["object-id"];
            Vector3 position     = map["position"];
            uint    ReportType   = map["report-type"];
            UUID    ScreenShotID = map["screenshot-id"];
            string  summary      = map["summary"];

            UserReport(
                SP.ControllingClient,
                SP.Scene.RegionInfo.RegionName,
                AbuserID,
                (byte)Category,
                (byte)CheckFlags,
                details,
                objectID,
                position,
                (byte)ReportType,
                ScreenShotID,
                summary,
                SP.UUID
                );

            if (ScreenShotID != UUID.Zero)
            {
                string uploadpath             = "/CAPS/Upload/" + UUID.Random() + "/";
                AbuseTextureUploader uploader = new AbuseTextureUploader(uploadpath, SP.UUID, ScreenShotID);
                uploader.OnUpLoad += AbuseTextureUploaded;

                MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uploadpath, uploader.uploaderCaps));

                string uploaderURL = MainServer.Instance.ServerURI + uploadpath;
                OSDMap resp        = new OSDMap();
                resp["uploader"] = uploaderURL;
                resp["state"]    = "upload";

                return(OSDParser.SerializeLLSDXmlBytes(resp));
            }

            return(MainServer.BlankResponse);
        }
        private byte[] ProcessSendUserReportWithScreenshot(UUID AgentID, string path, Stream request, OSHttpRequest httpRequest,
            OSHttpResponse httpResponse)
        {
            IScenePresence SP = findScenePresence(AgentID);
            OSDMap map = (OSDMap)OSDParser.DeserializeLLSDXml(HttpServerHandlerHelpers.ReadFully(request));
            UUID AbuserID = map["abuser-id"];
            uint Category = map["category"];
            uint CheckFlags = map["check-flags"];
            string details = map["details"];
            UUID objectID = map["object-id"];
            Vector3 position = map["position"];
            uint ReportType = map["report-type"];
            UUID ScreenShotID = map["screenshot-id"];
            string summary = map["summary"];
            UserReport(SP.ControllingClient, SP.Scene.RegionInfo.RegionName, AbuserID, (byte)Category, (byte)CheckFlags,
                       details, objectID, position, (byte)ReportType, ScreenShotID, summary, SP.UUID);

            if (ScreenShotID != UUID.Zero)
            {
                string uploadpath = "/CAPS/Upload/" + UUID.Random() + "/";
                AbuseTextureUploader uploader = new AbuseTextureUploader(uploadpath, SP.UUID, ScreenShotID);
                uploader.OnUpLoad += AbuseTextureUploaded;

                MainServer.Instance.AddStreamHandler(new GenericStreamHandler("POST", uploadpath,
                                                                    uploader.uploaderCaps));

                string uploaderURL = MainServer.Instance.ServerURI + uploadpath;
                OSDMap resp = new OSDMap();
                resp["uploader"] = uploaderURL;
                resp["state"] = "upload";
                return OSDParser.SerializeLLSDXmlBytes(resp);
            }
            else
                return MainServer.BlankResponse;
        }