public void AddAbuseReport(AbuseReport abuse_report)
        {
            try
            {
                List<string> m_ServerURIs = m_registry.RequestModuleInterface<IConfigurationService>().FindValueOf("RemoteServerURI");
                foreach (string m_ServerURI in m_ServerURIs)
                {
                    Dictionary<string, object> ar = abuse_report.ToKeyValuePairs();
                    ar.Add("METHOD", "AddAbuseReport");

                    SynchronousRestFormsRequester.MakeRequest("POST",
                        m_ServerURI,
                        WebUtils.BuildQueryString(ar));
                }
            }
            catch (Exception e)
            {
                m_log.DebugFormat("[ABUSEREPORT CONNECTOR]: Exception when contacting friends server: {0}", e.Message);
            }
        }
        private byte[] UpdateAbuseReport(Dictionary<string, object> request)
        {
            AbuseReport ar = new AbuseReport(request);
            m_AbuseReportsService.UpdateAbuseReport(ar, request["Password"].ToString());
            //MainConsole.Instance.DebugFormat("[ABUSEREPORTS HANDLER]: neighbours for region {0}: {1}", regionID, rinfos.Count);

            return SuccessResult();
        }
        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();
        }
 public void UpdateAbuseReport(AbuseReport report, string Password)
 {
     try
     {
         Dictionary<string, object> send = report.ToKeyValuePairs();
         send.Add("Password", Password);
         send.Add("METHOD", "AddAbuseReport");
         List<string> m_ServerURIs = m_registry.RequestModuleInterface<IConfigurationService>().FindValueOf("RemoteServerURI");
         SynchronousRestFormsRequester.MakeRequest("POST",
             m_ServerURIs[0],
             WebUtils.BuildQueryString(send));
     }
     catch (Exception e)
     {
         m_log.DebugFormat("[ABUSEREPORT CONNECTOR]: Exception when contacting friends server: {0}", e.Message);
     }
 }
        /// <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>
        private 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_SceneList[0].RequestModuleInterface<IEmailModule>();
                if (Email != null)
                    Email.SendEmail(UUID.Zero, ES.AbuseEmail, "Abuse Report", "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 + ".");
            }
            //Tell the DB about it
            IAbuseReports conn = m_SceneList[0].RequestModuleInterface<IAbuseReports>();
            if (conn != null)
                conn.AddAbuseReport(report);
        }