Exemple #1
0
        byte[] AddAbuseReport(Dictionary <string, object> request)
        {
            AbuseReport ar = new AbuseReport(request);

            m_AbuseReportsService.AddAbuseReport(ar);
            //m_log.DebugFormat("[ABUSEREPORTS HANDLER]: neighbours for region {0}: {1}", regionID, rinfos.Count);

            return(SuccessResult());
        }
        private byte[] AddAbuseReport(Dictionary <string, object> request)
        {
            AbuseReport ar = new AbuseReport();

            ar.FromKVP(request);
            m_AbuseReportsService.AddAbuseReport(ar);
            //MainConsole.Instance.DebugFormat("[ABUSEREPORTS HANDLER]: neighbours for region {0}: {1}", regionID, rinfos.Count);

            return(SuccessResult());
        }
Exemple #3
0
        /// <summary>
        ///     This deals with saving the report into the database.
        /// </summary>
        /// <param name="client"></param>
        /// <param name="regionName"></param>
        /// <param name="abuserID"></param>
        /// <param name="catagory"></param>
        /// <param name="checkflags"></param>
        /// <param name="details"></param>
        /// <param name="objectID"></param>
        /// <param name="position"></param>
        /// <param name="reportType"></param>
        /// <param name="screenshotID"></param>
        /// <param name="summery"></param>
        /// <param name="reporter"></param>
        void UserReport(IClientAPI client, string regionName, UUID abuserID, byte catagory, byte checkflags,
                        string details, UUID objectID, Vector3 position, byte reportType, UUID screenshotID,
                        string summery, UUID reporter)
        {
            AbuseReport report = new AbuseReport
            {
                ObjectUUID     = objectID,
                ObjectPosition = position.ToString(),
                Active         = true,
                Checked        = false,
                Notes          = "",
                AssignedTo     = "No One",
                ScreenshotID   = screenshotID
            };

            if (objectID != UUID.Zero)
            {
                ISceneChildEntity Object = client.Scene.GetSceneObjectPart(objectID);
                report.ObjectName = Object.Name;
            }
            else
            {
                report.ObjectName = "";
            }

            string[] detailssplit = details.Split('\n');

            string AbuseDetails = detailssplit[detailssplit.Length - 1];

            report.AbuseDetails = AbuseDetails;

            report.ReporterName = client.Name;

            string[] findRegion = summery.Split('|');
            report.RegionName = findRegion[1];

            string[] findLocation    = summery.Split('(');
            string[] findLocationend = findLocation[1].Split(')');
            report.AbuseLocation = findLocationend[0];

            string[] findCategory    = summery.Split('[');
            string[] findCategoryend = findCategory[1].Split(']');
            report.Category = findCategoryend[0];

            string[] findAbuserName    = summery.Split('{');
            string[] findAbuserNameend = findAbuserName[1].Split('}');
            report.AbuserName = findAbuserNameend[0];

            string[] findSummary = summery.Split('\"');

            string abuseSummary = findSummary[1];

            if (findSummary.Length != 0)
            {
                abuseSummary = findSummary[1];
            }

            report.AbuseSummary = abuseSummary;


            report.Number = (-1);

            EstateSettings ES = client.Scene.RegionInfo.EstateSettings;

            //If the abuse email is set up and the email module is available, send the email
            if (ES.AbuseEmailToEstateOwner && ES.AbuseEmail != "")
            {
                IEmailModule Email = m_Scene.RequestModuleInterface <IEmailModule>();
                if (Email != null)
                {
                    string msg = "This abuse report was submitted by " +
                                 report.ReporterName + " against " +
                                 report.AbuserName + " at " +
                                 report.AbuseLocation + " in your region " +
                                 report.RegionName +
                                 ". Summary: " + report.AbuseSummary +
                                 ". Details: " + report.AbuseDetails + ".";

                    Email.SendEmail(
                        UUID.Zero,
                        ES.AbuseEmail,
                        "Abuse Report",
                        msg,
                        client.Scene
                        );
                }
            }
            //Tell the DB about it
            IAbuseReports conn = m_Scene.RequestModuleInterface <IAbuseReports>();

            if (conn != null)
            {
                conn.AddAbuseReport(report);
            }
        }