From 90a6891a7d5af39013efc49f12dc69a8d7b240de Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sat, 27 Apr 2013 10:34:23 -0700
Subject: Better error reporting

---
 OpenSim/Server/Base/ServerUtils.cs | 1 +
 1 file changed, 1 insertion(+)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs
index 210a314..25957d3 100644
--- a/OpenSim/Server/Base/ServerUtils.cs
+++ b/OpenSim/Server/Base/ServerUtils.cs
@@ -286,6 +286,7 @@ namespace OpenSim.Server.Base
                                         e.InnerException == null ? e.Message : e.InnerException.Message, 
                                         e.StackTrace);
                                 }
+                                m_log.ErrorFormat("[SERVER UTILS]: Error loading plugin {0}: {1}", dllName, e.Message);
                                 return null;
                             }
 
-- 
cgit v1.1


From 3ce198165c3533d416148a9f4ffa056bf22c602d Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 29 Apr 2013 22:21:57 +0100
Subject: minor: remove some mono compiler warnings in ServicesServerBase

---
 OpenSim/Server/Base/ServicesServerBase.cs | 5 -----
 1 file changed, 5 deletions(-)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs
index 7c8e6b7..b13c87d 100644
--- a/OpenSim/Server/Base/ServicesServerBase.cs
+++ b/OpenSim/Server/Base/ServicesServerBase.cs
@@ -171,11 +171,6 @@ namespace OpenSim.Server.Base
 
             m_console = MainConsole.Instance;
 
-            // Configure the appenders for log4net
-            //
-            OpenSimAppender consoleAppender = null;
-            FileAppender fileAppender = null;
-
             if (logConfig != null)
             {
                 FileInfo cfg = new FileInfo(logConfig);
-- 
cgit v1.1


From 4194d935ecd21a922859a640cb28acec7e5bae45 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Mon, 13 May 2013 13:07:39 -0700
Subject: Fixed mantis #6609 -- LoadPlugin error messages on Robust.

---
 OpenSim/Server/Base/ServerUtils.cs                               | 2 +-
 OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs   | 8 ++++++--
 .../Server/Handlers/Hypergrid/InstantMessageServerConnector.cs   | 7 ++++++-
 OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs    | 7 ++++++-
 OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs       | 9 +++++++--
 5 files changed, 26 insertions(+), 7 deletions(-)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs
index 25957d3..08ba50d 100644
--- a/OpenSim/Server/Base/ServerUtils.cs
+++ b/OpenSim/Server/Base/ServerUtils.cs
@@ -286,7 +286,7 @@ namespace OpenSim.Server.Base
                                         e.InnerException == null ? e.Message : e.InnerException.Message, 
                                         e.StackTrace);
                                 }
-                                m_log.ErrorFormat("[SERVER UTILS]: Error loading plugin {0}: {1}", dllName, e.Message);
+                                m_log.ErrorFormat("[SERVER UTILS]: Error loading plugin {0}: {1} args.Length {2}", dllName, e.Message, args.Length);
                                 return null;
                             }
 
diff --git a/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs
index 0d4990a..ffe2f36 100644
--- a/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs
@@ -76,10 +76,14 @@ namespace OpenSim.Server.Handlers.Hypergrid
             server.AddStreamHandler(new GatekeeperAgentHandler(m_GatekeeperService, m_Proxy));
         }
 
-        public GatekeeperServiceInConnector(IConfigSource config, IHttpServer server)
-            : this(config, server, null)
+        public GatekeeperServiceInConnector(IConfigSource config, IHttpServer server, string configName)
+            : this(config, server, (ISimulationService)null)
         {
         }
 
+        public GatekeeperServiceInConnector(IConfigSource config, IHttpServer server)
+            : this(config, server, String.Empty)
+        {
+        }
     }
 }
diff --git a/OpenSim/Server/Handlers/Hypergrid/InstantMessageServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/InstantMessageServerConnector.cs
index 80eb5d2..8145a21 100644
--- a/OpenSim/Server/Handlers/Hypergrid/InstantMessageServerConnector.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/InstantMessageServerConnector.cs
@@ -54,10 +54,15 @@ namespace OpenSim.Server.Handlers.Hypergrid
         private IInstantMessage m_IMService;
 
         public InstantMessageServerConnector(IConfigSource config, IHttpServer server) :
-                this(config, server, null)
+            this(config, server, (IInstantMessageSimConnector)null)
         {            
         }
 
+        public InstantMessageServerConnector(IConfigSource config, IHttpServer server, string configName) :
+            this(config, server)
+        {
+        }
+
         public InstantMessageServerConnector(IConfigSource config, IHttpServer server, IInstantMessageSimConnector simConnector) :
                 base(config, server, String.Empty)
         {
diff --git a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
index db62aaa..b20f467 100644
--- a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
@@ -62,10 +62,15 @@ namespace OpenSim.Server.Handlers.Hypergrid
         private bool m_VerifyCallers = false;
 
         public UserAgentServerConnector(IConfigSource config, IHttpServer server) :
-                this(config, server, null)
+            this(config, server, (IFriendsSimConnector)null)
         {            
         }
 
+        public UserAgentServerConnector(IConfigSource config, IHttpServer server, string configName) :
+            this(config, server)
+        {
+        }
+        
         public UserAgentServerConnector(IConfigSource config, IHttpServer server, IFriendsSimConnector friendsConnector) :
                 base(config, server, String.Empty)
         {
diff --git a/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs b/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs
index 9a7ad34..1fb0dbc 100644
--- a/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs
+++ b/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs
@@ -60,8 +60,8 @@ namespace OpenSim.Server.Handlers.Login
             InitializeHandlers(server);
         }
 
-        public LLLoginServiceInConnector(IConfigSource config, IHttpServer server) :
-            base(config, server, String.Empty)
+        public LLLoginServiceInConnector(IConfigSource config, IHttpServer server, string configName) :
+            base(config, server, configName)
         {
             string loginService = ReadLocalServiceFromConfig(config);
 
@@ -72,6 +72,11 @@ namespace OpenSim.Server.Handlers.Login
             InitializeHandlers(server);
         }
 
+        public LLLoginServiceInConnector(IConfigSource config, IHttpServer server) :
+            this(config, server, String.Empty)
+        {
+        }
+
         private string ReadLocalServiceFromConfig(IConfigSource config)
         {
             IConfig serverConfig = config.Configs["LoginService"];
-- 
cgit v1.1


From 3bc8cf65a4e933cfdd0597affc1685c74fb29dba Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 16 May 2013 17:30:30 +0100
Subject: Where this is not already happening, trigger asychoronous calls to
 CloseChildAgent() above the LocalSimulationConnector level.

This is so that other callers (such as SceneCommunicationService.SendCloseChildAgentConnections() can perform all closes asynchronously without pointlessly firing another thread for local closes).
No functional change apart from elimination of unnecessary chaining of new threads.
---
 OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index 012b14e..ae37ca7 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -218,7 +218,7 @@ namespace OpenSim.Server.Handlers.Simulation
             if (action.Equals("release"))
                 ReleaseAgent(regionID, id);
             else
-                m_SimulationService.CloseAgent(destination, id);
+                Util.FireAndForget(delegate { m_SimulationService.CloseAgent(destination, id); });
 
             responsedata["int_response_code"] = HttpStatusCode.OK;
             responsedata["str_response_string"] = "OpenSim agent " + id.ToString();
-- 
cgit v1.1


From 328883700a15e4216bf7b251ac099d38f413375e Mon Sep 17 00:00:00 2001
From: BlueWall
Date: Mon, 13 May 2013 22:11:28 -0400
Subject: UserProfiles

  UserProfiles for Robust and Standalone. Includes service and connectors for Robust and standalone opensim plus matching region module.
---
 .../Handlers/Profiles/UserProfilesConnector.cs     |  92 +++++
 .../Handlers/Profiles/UserProfilesHandlers.cs      | 434 +++++++++++++++++++++
 2 files changed, 526 insertions(+)
 create mode 100644 OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
 create mode 100644 OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs b/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
new file mode 100644
index 0000000..4ad7297
--- /dev/null
+++ b/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
@@ -0,0 +1,92 @@
+using System;
+using System.Reflection;
+using Nini.Config;
+using OpenSim.Server.Base;
+using OpenSim.Services.Interfaces;
+using OpenSim.Framework.Servers.HttpServer;
+using OpenSim.Framework;
+using OpenSim.Server.Handlers.Base;
+using log4net;
+
+namespace OpenSim.Server.Handlers.Profiles
+{
+    public class UserProfilesConnector: ServiceConnector
+    {
+        static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+        
+        
+        // Our Local Module
+        public IUserProfilesService ServiceModule
+        {
+            get; private set;
+        }
+
+        // The HTTP server.
+        public IHttpServer Server
+        {
+            get; private set;
+        }
+
+        public string ConfigName
+        {
+            get; private set;
+        }
+
+        public bool Enabled
+        {
+            get; private set;
+        }
+
+        public UserProfilesConnector(IConfigSource config, IHttpServer server, string configName) :
+            base(config, server, configName)
+        {
+            ConfigName = "UserProfilesService";
+            if(!string.IsNullOrEmpty(configName))
+                ConfigName = configName;
+
+            IConfig serverConfig = config.Configs[ConfigName];
+            if (serverConfig == null)
+                throw new Exception(String.Format("No section {0} in config file", ConfigName));
+
+            if(!serverConfig.GetBoolean("Enabled",false))
+            {
+                Enabled = false;
+                return;
+            }
+
+            Enabled = true;
+
+            Server = server;
+
+            string service = serverConfig.GetString("LocalServiceModule", String.Empty);
+
+            Object[] args = new Object[] { config, ConfigName };
+            ServiceModule = ServerUtils.LoadPlugin<IUserProfilesService>(service, args);
+            
+            JsonRpcProfileHandlers handler = new JsonRpcProfileHandlers(ServiceModule);
+
+            Server.AddJsonRPCHandler("avatarclassifiedsrequest", handler.AvatarClassifiedsRequest);
+            Server.AddJsonRPCHandler("classified_update", handler.ClassifiedUpdate);
+            Server.AddJsonRPCHandler("classifieds_info_query", handler.ClassifiedInfoRequest);
+            Server.AddJsonRPCHandler("classified_delete", handler.ClassifiedDelete);
+            Server.AddJsonRPCHandler("avatarpicksrequest", handler.AvatarPicksRequest);
+            Server.AddJsonRPCHandler("pickinforequest", handler.PickInfoRequest);
+            Server.AddJsonRPCHandler("picks_update", handler.PicksUpdate);
+            Server.AddJsonRPCHandler("picks_delete", handler.PicksDelete);
+            Server.AddJsonRPCHandler("avatarnotesrequest", handler.AvatarNotesRequest);
+            Server.AddJsonRPCHandler("avatar_notes_update", handler.NotesUpdate);
+            Server.AddJsonRPCHandler("avatar_properties_request", handler.AvatarPropertiesRequest);
+            Server.AddJsonRPCHandler("avatar_properties_update", handler.AvatarPropertiesUpdate);
+            Server.AddJsonRPCHandler("avatar_interests_update", handler.AvatarInterestsUpdate);
+            Server.AddJsonRPCHandler("image_assets_request", handler.AvatarImageAssetsRequest);
+//            Server.AddJsonRPCHandler("user_preferences_request", handler.UserPreferencesRequest);
+//            Server.AddJsonRPCHandler("user_preferences_update", handler.UserPreferencesUpdate);
+//            Server.AddJsonRPCHandler("user_account_create", handler.UserAccountCreate);
+//            Server.AddJsonRPCHandler("user_account_auth", handler.UserAccountAuth);
+//            Server.AddJsonRPCHandler("user_account_test", handler.UserAccountTest);
+            Server.AddJsonRPCHandler("user_data_request", handler.RequestUserAppData);
+            Server.AddJsonRPCHandler("user_data_update", handler.UpdateUserAppData);
+        }
+    }
+}
+
diff --git a/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs b/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs
new file mode 100644
index 0000000..93da102
--- /dev/null
+++ b/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs
@@ -0,0 +1,434 @@
+using System;
+using System.Reflection;
+using OpenMetaverse;
+using OpenMetaverse.StructuredData;
+using log4net;
+using OpenSim.Services.Interfaces;
+using OpenSim.Framework.Servers.HttpServer;
+using OpenSim.Framework;
+
+namespace OpenSim.Server.Handlers
+{
+    public class UserProfilesHandlers
+    {
+        public UserProfilesHandlers ()
+        {
+        }
+    }
+
+    public class JsonRpcProfileHandlers
+    {
+        static readonly ILog m_log =
+            LogManager.GetLogger(
+                MethodBase.GetCurrentMethod().DeclaringType);
+        
+        public IUserProfilesService Service
+        {
+            get; private set;
+        }
+        
+        public JsonRpcProfileHandlers(IUserProfilesService service)
+        {
+            Service = service;
+        }
+        
+        #region Classifieds
+        /// <summary>
+        /// Request avatar's classified ads.
+        /// </summary>
+        /// <returns>
+        /// An array containing all the calassified uuid and it's name created by the creator id
+        /// </returns>
+        /// <param name='json'>
+        /// Our parameters are in the OSDMap json["params"]
+        /// </param>
+        /// <param name='response'>
+        /// If set to <c>true</c> response.
+        /// </param>
+        public bool AvatarClassifiedsRequest(OSDMap json, ref JsonRpcResponse response)
+        {
+            if(!json.ContainsKey("params"))
+            {
+                response.Error.Code = ErrorCode.ParseError;
+                m_log.DebugFormat ("Classified Request");
+                return false;
+            }
+            
+            OSDMap request = (OSDMap)json["params"];
+            UUID creatorId = new UUID(request["creatorId"].AsString());
+            
+            
+            OSDArray data = (OSDArray) Service.AvatarClassifiedsRequest(creatorId);
+            response.Result = data;
+            
+            return true;
+        }
+        
+        public bool ClassifiedUpdate(OSDMap json, ref JsonRpcResponse response)
+        {
+            if(!json.ContainsKey("params"))
+            {
+                response.Error.Code = ErrorCode.ParseError;
+                response.Error.Message = "Error parsing classified update request";
+                m_log.DebugFormat ("Classified Update Request");
+                return false;
+            }
+            
+            string result = string.Empty;
+            UserClassifiedAdd ad = new UserClassifiedAdd();
+            object Ad = (object)ad;
+            OSD.DeserializeMembers(ref Ad, (OSDMap)json["params"]);
+            if(Service.ClassifiedUpdate(ad, ref result))
+            {
+                response.Result = OSD.SerializeMembers(ad);
+                return true;
+            }
+            
+            response.Error.Code = ErrorCode.InternalError;
+            response.Error.Message = string.Format("{0}", result);
+            return false;
+        }
+        
+        public bool ClassifiedDelete(OSDMap json, ref JsonRpcResponse response)
+        {
+            if(!json.ContainsKey("params"))
+            {
+                response.Error.Code = ErrorCode.ParseError;
+                m_log.DebugFormat ("Classified Delete Request");
+                return false;
+            }
+            
+            OSDMap request = (OSDMap)json["params"];
+            UUID classifiedId = new UUID(request["classifiedID"].AsString());
+            
+            OSDMap res = new OSDMap();
+            res["result"] = OSD.FromString("success");
+            response.Result = res;
+            
+            return true;
+            
+        }
+        
+        public bool ClassifiedInfoRequest(OSDMap json, ref JsonRpcResponse response)
+        {
+            if(!json.ContainsKey("params"))
+            {
+                response.Error.Code = ErrorCode.ParseError;
+                response.Error.Message = "no parameters supplied";
+                m_log.DebugFormat ("Classified Info Request");
+                return false;
+            }
+            
+            string result = string.Empty;
+            UserClassifiedAdd ad = new UserClassifiedAdd();
+            object Ad = (object)ad;
+            OSD.DeserializeMembers(ref Ad, (OSDMap)json["params"]);
+            if(Service.ClassifiedInfoRequest(ref ad, ref result))
+            {
+                response.Result = OSD.SerializeMembers(ad);
+                return true;
+            }
+            
+            response.Error.Code = ErrorCode.InternalError;
+            response.Error.Message = string.Format("{0}", result);
+            return false;
+        }
+        #endregion Classifieds
+        
+        #region Picks
+        public bool AvatarPicksRequest(OSDMap json, ref JsonRpcResponse response)
+        {
+            if(!json.ContainsKey("params"))
+            {
+                response.Error.Code = ErrorCode.ParseError;
+                m_log.DebugFormat ("Avatar Picks Request");
+                return false;
+            }
+            
+            OSDMap request = (OSDMap)json["params"];
+            UUID creatorId = new UUID(request["creatorId"].AsString());
+            
+            
+            OSDArray data = (OSDArray) Service.AvatarPicksRequest(creatorId);
+            response.Result = data;
+            
+            return true;
+        }
+        
+        public bool PickInfoRequest(OSDMap json, ref JsonRpcResponse response)
+        {
+            if(!json.ContainsKey("params"))
+            {
+                response.Error.Code = ErrorCode.ParseError;
+                response.Error.Message = "no parameters supplied";
+                m_log.DebugFormat ("Avatar Picks Info Request");
+                return false;
+            }
+            
+            string result = string.Empty;
+            UserProfilePick pick = new UserProfilePick();
+            object Pick = (object)pick;
+            OSD.DeserializeMembers(ref Pick, (OSDMap)json["params"]);
+            if(Service.PickInfoRequest(ref pick, ref result))
+            {
+                response.Result = OSD.SerializeMembers(pick);
+                return true;
+            }
+            
+            response.Error.Code = ErrorCode.InternalError;
+            response.Error.Message = string.Format("{0}", result);
+            return false;
+        }
+        
+        public bool PicksUpdate(OSDMap json, ref JsonRpcResponse response)
+        {
+            if(!json.ContainsKey("params"))
+            {
+                response.Error.Code = ErrorCode.ParseError;
+                response.Error.Message = "no parameters supplied";
+                m_log.DebugFormat ("Avatar Picks Update Request");
+                return false;
+            }
+            
+            string result = string.Empty;
+            UserProfilePick pick = new UserProfilePick();
+            object Pick = (object)pick;
+            OSD.DeserializeMembers(ref Pick, (OSDMap)json["params"]);
+            if(Service.PicksUpdate(ref pick, ref result))
+            {
+                response.Result = OSD.SerializeMembers(pick);
+                return true;
+            }
+            
+            response.Error.Code = ErrorCode.InternalError;
+            response.Error.Message = "unable to update pick";
+            
+            return false;
+        }
+        
+        public bool PicksDelete(OSDMap json, ref JsonRpcResponse response)
+        {
+            if(!json.ContainsKey("params"))
+            {
+                response.Error.Code = ErrorCode.ParseError;
+                m_log.DebugFormat ("Avatar Picks Delete Request");
+                return false;
+            }
+            
+            OSDMap request = (OSDMap)json["params"];
+            UUID pickId = new UUID(request["pickId"].AsString());
+            if(Service.PicksDelete(pickId))
+                return true;
+            
+            response.Error.Code = ErrorCode.InternalError;
+            response.Error.Message = "data error removing record";
+            return false;
+        }
+        #endregion Picks
+        
+        #region Notes
+        public bool AvatarNotesRequest(OSDMap json, ref JsonRpcResponse response)
+        {
+            if(!json.ContainsKey("params"))
+            {
+                response.Error.Code = ErrorCode.ParseError;
+                response.Error.Message = "Params missing";
+                m_log.DebugFormat ("Avatar Notes Request");
+                return false;
+            }
+            
+            string result = string.Empty;
+            UserProfileNotes note = new UserProfileNotes();
+            object Note = (object)note;
+            OSD.DeserializeMembers(ref Note, (OSDMap)json["params"]);
+            if(Service.AvatarNotesRequest(ref note))
+            {
+                response.Result = OSD.SerializeMembers(note);
+                return true;
+            }
+            
+            object Notes = (object) note;
+            OSD.DeserializeMembers(ref Notes, (OSDMap)json["params"]);
+            return true;
+        }
+        
+        public bool NotesUpdate(OSDMap json, ref JsonRpcResponse response)
+        {
+            if(!json.ContainsKey("params"))
+            {
+                response.Error.Code = ErrorCode.ParseError;
+                response.Error.Message = "No parameters";
+                m_log.DebugFormat ("Avatar Notes Update Request");
+                return false;
+            }
+            
+            string result = string.Empty;
+            UserProfileNotes note = new UserProfileNotes();
+            object Notes = (object) note;
+            OSD.DeserializeMembers(ref Notes, (OSDMap)json["params"]);
+            if(Service.NotesUpdate(ref note, ref result))
+            {
+                response.Result = OSD.SerializeMembers(note);
+                return true;
+            }
+            return true;
+        }
+        #endregion Notes
+        
+        #region Profile Properties
+        public bool AvatarPropertiesRequest(OSDMap json, ref JsonRpcResponse response)
+        {
+            if(!json.ContainsKey("params"))
+            {
+                response.Error.Code = ErrorCode.ParseError;
+                response.Error.Message = "no parameters supplied";
+                m_log.DebugFormat ("Avatar Properties Request");
+                return false;
+            }
+            
+            string result = string.Empty;
+            UserProfileProperties props = new UserProfileProperties();
+            object Props = (object)props;
+            OSD.DeserializeMembers(ref Props, (OSDMap)json["params"]);
+            if(Service.AvatarPropertiesRequest(ref props, ref result))
+            {
+                response.Result = OSD.SerializeMembers(props);
+                return true;
+            }
+            
+            response.Error.Code = ErrorCode.InternalError;
+            response.Error.Message = string.Format("{0}", result);
+            return false;
+        }
+        
+        public bool AvatarPropertiesUpdate(OSDMap json, ref JsonRpcResponse response)
+        {
+            if(!json.ContainsKey("params"))
+            {
+                response.Error.Code = ErrorCode.ParseError;
+                response.Error.Message = "no parameters supplied";
+                m_log.DebugFormat ("Avatar Properties Update Request");
+                return false;
+            }
+            
+            string result = string.Empty;
+            UserProfileProperties props = new UserProfileProperties();
+            object Props = (object)props;
+            OSD.DeserializeMembers(ref Props, (OSDMap)json["params"]);
+            if(Service.AvatarPropertiesUpdate(ref props, ref result))
+            {
+                response.Result = OSD.SerializeMembers(props);
+                return true;
+            }
+            
+            response.Error.Code = ErrorCode.InternalError;
+            response.Error.Message = string.Format("{0}", result);
+            return false;
+        }
+        #endregion Profile Properties
+        
+        #region Interests
+        public bool AvatarInterestsUpdate(OSDMap json, ref JsonRpcResponse response)
+        {
+            if(!json.ContainsKey("params"))
+            {
+                response.Error.Code = ErrorCode.ParseError;
+                response.Error.Message = "no parameters supplied";
+                m_log.DebugFormat ("Avatar Interests Update Request");
+                return false;
+            }
+            
+            string result = string.Empty;
+            UserProfileProperties props = new UserProfileProperties();
+            object Props = (object)props;
+            OSD.DeserializeMembers(ref Props, (OSDMap)json["params"]);
+            if(Service.AvatarInterestsUpdate(props, ref result))
+            {
+                response.Result = OSD.SerializeMembers(props);
+                return true;
+            }
+            
+            response.Error.Code = ErrorCode.InternalError;
+            response.Error.Message = string.Format("{0}", result);
+            return false;
+        }
+        #endregion Interests
+
+        #region Utility
+        public bool AvatarImageAssetsRequest(OSDMap json, ref JsonRpcResponse response)
+        {
+            if(!json.ContainsKey("params"))
+            {
+                response.Error.Code = ErrorCode.ParseError;
+                m_log.DebugFormat ("Avatar Image Assets Request");
+                return false;
+            }
+            
+            OSDMap request = (OSDMap)json["params"];
+            UUID avatarId = new UUID(request["avatarId"].AsString());
+
+            OSDArray data = (OSDArray) Service.AvatarImageAssetsRequest(avatarId);
+            response.Result = data;
+            
+            return true;
+        }
+        #endregion Utiltiy
+
+        #region UserData
+        public bool RequestUserAppData(OSDMap json, ref JsonRpcResponse response)
+        {
+            if(!json.ContainsKey("params"))
+            {
+                response.Error.Code = ErrorCode.ParseError;
+                response.Error.Message = "no parameters supplied";
+                m_log.DebugFormat ("User Application Service URL Request: No Parameters!");
+                return false;
+            }
+            
+            string result = string.Empty;
+            UserAppData props = new UserAppData();
+            object Props = (object)props;
+            OSD.DeserializeMembers(ref Props, (OSDMap)json["params"]);
+            if(Service.RequestUserAppData(ref props, ref result))
+            {
+                OSDMap res = new OSDMap();
+                res["result"] = OSD.FromString("success");
+                res["token"] = OSD.FromString (result);
+                response.Result = res;
+                
+                return true;
+            }
+            
+            response.Error.Code = ErrorCode.InternalError;
+            response.Error.Message = string.Format("{0}", result);
+            return false;
+        }
+        
+        public bool UpdateUserAppData(OSDMap json, ref JsonRpcResponse response)
+        {
+            if(!json.ContainsKey("params"))
+            {
+                response.Error.Code = ErrorCode.ParseError;
+                response.Error.Message = "no parameters supplied";
+                m_log.DebugFormat ("User App Data Update Request");
+                return false;
+            }
+            
+            string result = string.Empty;
+            UserAppData props = new UserAppData();
+            object Props = (object)props;
+            OSD.DeserializeMembers(ref Props, (OSDMap)json["params"]);
+            if(Service.SetUserAppData(props, ref result))
+            {
+                response.Result = OSD.SerializeMembers(props);
+                return true;
+            }
+            
+            response.Error.Code = ErrorCode.InternalError;
+            response.Error.Message = string.Format("{0}", result);
+            return false;
+        }
+        #endregion UserData
+    }
+}
+
-- 
cgit v1.1


From d7fa9f671eefebd49c0e8f56e56088b0c0b3d93c Mon Sep 17 00:00:00 2001
From: BlueWall
Date: Fri, 31 May 2013 22:03:27 -0400
Subject: Adding standard OpenSim header to source files

---
 .../Handlers/Profiles/UserProfilesConnector.cs     | 27 ++++++++++++++++++++++
 .../Handlers/Profiles/UserProfilesHandlers.cs      | 27 ++++++++++++++++++++++
 2 files changed, 54 insertions(+)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs b/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
index 4ad7297..5a24ee3 100644
--- a/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
+++ b/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.org/
+ * See CONTRIBUTORS.TXT for a full list of copyright holders.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of the OpenSimulator Project nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 using System;
 using System.Reflection;
 using Nini.Config;
diff --git a/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs b/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs
index 93da102..f5f0794 100644
--- a/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs
+++ b/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) Contributors, http://opensimulator.org/
+ * See CONTRIBUTORS.TXT for a full list of copyright holders.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of the OpenSimulator Project nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 using System;
 using System.Reflection;
 using OpenMetaverse;
-- 
cgit v1.1


From cd64da87461937b2a46ff6f5e8250ee9a8d15889 Mon Sep 17 00:00:00 2001
From: BlueWall
Date: Wed, 5 Jun 2013 18:41:55 -0400
Subject: Cleanup

---
 OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs | 5 -----
 1 file changed, 5 deletions(-)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs b/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
index 5a24ee3..f9a520a 100644
--- a/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
+++ b/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
@@ -106,11 +106,6 @@ namespace OpenSim.Server.Handlers.Profiles
             Server.AddJsonRPCHandler("avatar_properties_update", handler.AvatarPropertiesUpdate);
             Server.AddJsonRPCHandler("avatar_interests_update", handler.AvatarInterestsUpdate);
             Server.AddJsonRPCHandler("image_assets_request", handler.AvatarImageAssetsRequest);
-//            Server.AddJsonRPCHandler("user_preferences_request", handler.UserPreferencesRequest);
-//            Server.AddJsonRPCHandler("user_preferences_update", handler.UserPreferencesUpdate);
-//            Server.AddJsonRPCHandler("user_account_create", handler.UserAccountCreate);
-//            Server.AddJsonRPCHandler("user_account_auth", handler.UserAccountAuth);
-//            Server.AddJsonRPCHandler("user_account_test", handler.UserAccountTest);
             Server.AddJsonRPCHandler("user_data_request", handler.RequestUserAppData);
             Server.AddJsonRPCHandler("user_data_update", handler.UpdateUserAppData);
         }
-- 
cgit v1.1


From 824a4b480873721a4a10598299b185b602e1931d Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 12 Jun 2013 23:47:47 +0100
Subject: After calls to GetSuitcaseXFolder() in HGSuitcaseInventoryService,
 consistently check for null return and log warning rather than throw
 exception.

This was being done already in some places.
If an exception is thrown it is now an error rather than debug
---
 OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
index 64127c2..9d28dc3 100644
--- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
+++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
@@ -155,7 +155,7 @@ namespace OpenSim.Server.Handlers.Asset
             }
             catch (Exception e)
             {
-                m_log.DebugFormat("[XINVENTORY HANDLER]: Exception {0}", e.StackTrace);
+                m_log.ErrorFormat("[XINVENTORY HANDLER]: Exception {0}", e.StackTrace);
             }
 
             return FailureResult();
-- 
cgit v1.1


From 0d2fd0d914581f755661455b8db2b9e399154632 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 17 Jun 2013 22:39:00 +0100
Subject: Make general server stats available on the robust console as well as
 the simulator console

This means the "show stats" command is now active on the robust console.
---
 OpenSim/Server/Base/ServicesServerBase.cs | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs
index b13c87d..8243900 100644
--- a/OpenSim/Server/Base/ServicesServerBase.cs
+++ b/OpenSim/Server/Base/ServicesServerBase.cs
@@ -190,16 +190,7 @@ namespace OpenSim.Server.Base
             }
 
             RegisterCommonCommands();
-
-            // Register the quit command
-            //
-            MainConsole.Instance.Commands.AddCommand("General", false, "quit",
-                    "quit",
-                    "Quit the application", HandleQuit);
-
-            MainConsole.Instance.Commands.AddCommand("General", false, "shutdown",
-                    "shutdown",
-                    "Quit the application", HandleQuit);
+            RegisterCommonComponents(Config);
 
             // Allow derived classes to perform initialization that
             // needs to be done after the console has opened
@@ -231,11 +222,12 @@ namespace OpenSim.Server.Base
             return 0;
         }
 
-        protected virtual void HandleQuit(string module, string[] args)
+        protected override void ShutdownSpecific()
         {
             m_Running = false;
             m_log.Info("[CONSOLE] Quitting");
 
+            base.ShutdownSpecific();
         }
 
         protected virtual void ReadConfig()
@@ -246,4 +238,4 @@ namespace OpenSim.Server.Base
         {
         }
     }
-}
+}
\ No newline at end of file
-- 
cgit v1.1


From 9501a583cbc8fd819d2b13db4f9ad76958520ce7 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 18 Jun 2013 23:07:18 +0100
Subject: Make number of inbound http requests handled available as a
 httpserver.<port>.IncomingHTTPRequestsProcessed stat

---
 OpenSim/Server/Base/ServicesServerBase.cs | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs
index 8243900..667cef8 100644
--- a/OpenSim/Server/Base/ServicesServerBase.cs
+++ b/OpenSim/Server/Base/ServicesServerBase.cs
@@ -34,6 +34,7 @@ using System.Text;
 using System.Xml;
 using OpenSim.Framework;
 using OpenSim.Framework.Console;
+using OpenSim.Framework.Monitoring;
 using OpenSim.Framework.Servers;
 using log4net;
 using log4net.Config;
@@ -205,6 +206,9 @@ namespace OpenSim.Server.Base
 
         public virtual int Run()
         {
+            Watchdog.Enabled = true;
+            MemoryWatchdog.Enabled = true;
+
             while (m_Running)
             {
                 try
-- 
cgit v1.1


From 4778d67005c3364ee3f75bdd6640f03ff945d885 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Fri, 21 Jun 2013 20:52:46 -0700
Subject: Finally moved HG agent transfers to use agent fatpacks.

---
 OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs |   2 +-
 .../Server/Handlers/Hypergrid/HomeAgentHandlers.cs | 200 +++++----------------
 .../Handlers/Hypergrid/UserAgentServerConnector.cs |   2 +-
 .../Server/Handlers/Simulation/AgentHandlers.cs    |  76 +++++---
 4 files changed, 100 insertions(+), 180 deletions(-)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs
index cf1af15..adc2fbc 100644
--- a/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs
@@ -61,7 +61,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
             m_Proxy = proxy;
         }
 
-        protected override bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, out string reason)
+        protected override bool CreateAgent(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, out string reason)
         {
             return m_GatekeeperService.LoginAgent(aCircuit, destination, out reason);
         }
diff --git a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
index 968c1e6..df875af 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
@@ -49,191 +49,87 @@ using log4net;
 
 namespace OpenSim.Server.Handlers.Hypergrid
 {
-    public class HomeAgentHandler 
+    public class HomeAgentHandler : AgentPostHandler
     {
         private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
         private IUserAgentService m_UserAgentService;
 
         private string m_LoginServerIP;
-        private bool m_Proxy = false;
 
-        public HomeAgentHandler(IUserAgentService userAgentService, string loginServerIP, bool proxy)
+        public HomeAgentHandler(IUserAgentService userAgentService, string loginServerIP, bool proxy) :
+            base("/homeagent")
         {
             m_UserAgentService = userAgentService;
             m_LoginServerIP = loginServerIP;
             m_Proxy = proxy;
         }
 
-        public Hashtable Handler(Hashtable request)
+        protected override AgentDestinationData CreateAgentDestinationData()
         {
-//            m_log.Debug("[CONNECTION DEBUGGING]: HomeAgentHandler Called");
-//
-//            m_log.Debug("---------------------------");
-//            m_log.Debug(" >> uri=" + request["uri"]);
-//            m_log.Debug(" >> content-type=" + request["content-type"]);
-//            m_log.Debug(" >> http-method=" + request["http-method"]);
-//            m_log.Debug("---------------------------\n");
-
-            Hashtable responsedata = new Hashtable();
-            responsedata["content_type"] = "text/html";
-            responsedata["keepalive"] = false;
-
-
-            UUID agentID;
-            UUID regionID;
-            string action;
-            if (!Utils.GetParams((string)request["uri"], out agentID, out regionID, out action))
+            return new ExtendedAgentDestinationData();
+        }
+        protected override void UnpackData(OSDMap args, AgentDestinationData d, Hashtable request)
+        {
+            base.UnpackData(args, d, request);
+            ExtendedAgentDestinationData data = (ExtendedAgentDestinationData)d;
+            try
             {
-                m_log.InfoFormat("[HOME AGENT HANDLER]: Invalid parameters for agent message {0}", request["uri"]);
-                responsedata["int_response_code"] = 404;
-                responsedata["str_response_string"] = "false";
+                if (args.ContainsKey("gatekeeper_host") && args["gatekeeper_host"] != null)
+                    data.host = args["gatekeeper_host"].AsString();
+                if (args.ContainsKey("gatekeeper_port") && args["gatekeeper_port"] != null)
+                    Int32.TryParse(args["gatekeeper_port"].AsString(), out data.port);
+                if (args.ContainsKey("gatekeeper_serveruri") && args["gatekeeper_serveruri"] != null)
+                    data.gatekeeperServerURI = args["gatekeeper_serveruri"];
+                if (args.ContainsKey("destination_serveruri") && args["destination_serveruri"] != null)
+                    data.destinationServerURI = args["destination_serveruri"];
 
-                return responsedata;
             }
-
-            // Next, let's parse the verb
-            string method = (string)request["http-method"];
-            if (method.Equals("POST"))
+            catch (InvalidCastException e)
             {
-                DoAgentPost(request, responsedata, agentID);
-                return responsedata;
+                m_log.ErrorFormat("[HOME AGENT HANDLER]: Bad cast in UnpackData");
             }
-            else
-            {
-                m_log.InfoFormat("[HOME AGENT HANDLER]: method {0} not supported in agent message", method);
-                responsedata["int_response_code"] = HttpStatusCode.MethodNotAllowed;
-                responsedata["str_response_string"] = "Method not allowed";
 
-                return responsedata;
-            }
+            string callerIP = GetCallerIP(request);
+            // Verify if this call came from the login server
+            if (callerIP == m_LoginServerIP)
+                data.fromLogin = true;
 
         }
 
-        protected void DoAgentPost(Hashtable request, Hashtable responsedata, UUID id)
+        protected override GridRegion ExtractGatekeeper(AgentDestinationData d)
         {
-            OSDMap args = Utils.GetOSDMap((string)request["body"]);
-            if (args == null)
+            if (d is ExtendedAgentDestinationData)
             {
-                responsedata["int_response_code"] = HttpStatusCode.BadRequest;
-                responsedata["str_response_string"] = "Bad request";
-                return;
+                ExtendedAgentDestinationData data = (ExtendedAgentDestinationData)d;
+                GridRegion gatekeeper = new GridRegion();
+                gatekeeper.ServerURI = data.gatekeeperServerURI;
+                gatekeeper.ExternalHostName = data.host;
+                gatekeeper.HttpPort = (uint)data.port;
+                gatekeeper.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0);
+
+                return gatekeeper;
             }
-
-            // retrieve the input arguments
-            int x = 0, y = 0;
-            UUID uuid = UUID.Zero;
-            string regionname = string.Empty;
-            string gatekeeper_host = string.Empty;
-            string gatekeeper_serveruri = string.Empty;
-            string destination_serveruri = string.Empty;
-            int gatekeeper_port = 0;
-            IPEndPoint client_ipaddress = null;
-
-            if (args.ContainsKey("gatekeeper_host") && args["gatekeeper_host"] != null)
-                gatekeeper_host = args["gatekeeper_host"].AsString();
-            if (args.ContainsKey("gatekeeper_port") && args["gatekeeper_port"] != null)
-                Int32.TryParse(args["gatekeeper_port"].AsString(), out gatekeeper_port);
-            if (args.ContainsKey("gatekeeper_serveruri") && args["gatekeeper_serveruri"] !=null)
-                gatekeeper_serveruri = args["gatekeeper_serveruri"];
-            if (args.ContainsKey("destination_serveruri") && args["destination_serveruri"] !=null)
-                destination_serveruri = args["destination_serveruri"];
-
-            GridRegion gatekeeper = new GridRegion();
-            gatekeeper.ServerURI = gatekeeper_serveruri;
-            gatekeeper.ExternalHostName = gatekeeper_host;
-            gatekeeper.HttpPort = (uint)gatekeeper_port;
-            gatekeeper.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0);
-
-            if (args.ContainsKey("destination_x") && args["destination_x"] != null)
-                Int32.TryParse(args["destination_x"].AsString(), out x);
             else
-                m_log.WarnFormat("  -- request didn't have destination_x");
-            if (args.ContainsKey("destination_y") && args["destination_y"] != null)
-                Int32.TryParse(args["destination_y"].AsString(), out y);
-            else
-                m_log.WarnFormat("  -- request didn't have destination_y");
-            if (args.ContainsKey("destination_uuid") && args["destination_uuid"] != null)
-                UUID.TryParse(args["destination_uuid"].AsString(), out uuid);
-            if (args.ContainsKey("destination_name") && args["destination_name"] != null)
-                regionname = args["destination_name"].ToString();
-
-            if (args.ContainsKey("client_ip") && args["client_ip"] != null)
-            {
-                string ip_str = args["client_ip"].ToString();
-                try
-                {
-                    string callerIP = GetCallerIP(request);
-                    // Verify if this caller has authority to send the client IP
-                    if (callerIP == m_LoginServerIP)
-                        client_ipaddress = new IPEndPoint(IPAddress.Parse(ip_str), 0);
-                    else // leaving this for now, but this warning should be removed
-                        m_log.WarnFormat("[HOME AGENT HANDLER]: Unauthorized machine {0} tried to set client ip to {1}", callerIP, ip_str);
-                }
-                catch
-                {
-                    m_log.DebugFormat("[HOME AGENT HANDLER]: Exception parsing client ip address from {0}", ip_str);
-                }
-            }
-
-            GridRegion destination = new GridRegion();
-            destination.RegionID = uuid;
-            destination.RegionLocX = x;
-            destination.RegionLocY = y;
-            destination.RegionName = regionname;
-            destination.ServerURI = destination_serveruri;
-            
-            AgentCircuitData aCircuit = new AgentCircuitData();
-            try
-            {
-                aCircuit.UnpackAgentCircuitData(args);
-            }
-            catch (Exception ex)
-            {
-                m_log.InfoFormat("[HOME AGENT HANDLER]: exception on unpacking ChildCreate message {0}", ex.Message);
-                responsedata["int_response_code"] = HttpStatusCode.BadRequest;
-                responsedata["str_response_string"] = "Bad request";
-                return;
-            }
-
-            OSDMap resp = new OSDMap(2);
-            string reason = String.Empty;
+                m_log.WarnFormat("[HOME AGENT HANDLER]: Wrong data type");
 
-            bool result = m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, client_ipaddress, out reason);
-
-            resp["reason"] = OSD.FromString(reason);
-            resp["success"] = OSD.FromBoolean(result);
-
-            // TODO: add reason if not String.Empty?
-            responsedata["int_response_code"] = HttpStatusCode.OK;
-            responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp);
+            return null;
         }
 
-        private string GetCallerIP(Hashtable request)
-        {
-            if (!m_Proxy)
-                return Util.GetCallerIP(request);
-
-            // We're behind a proxy
-            Hashtable headers = (Hashtable)request["headers"];
-            string xff = "X-Forwarded-For";
-            if (headers.ContainsKey(xff.ToLower()))
-                xff = xff.ToLower();
 
-            if (!headers.ContainsKey(xff) || headers[xff] == null)
-            {
-                m_log.WarnFormat("[AGENT HANDLER]: No XFF header");
-                return Util.GetCallerIP(request);
-            }
+        protected override bool CreateAgent(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, out string reason)
+        {
+            return m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, fromLogin, out reason);
+        }
 
-            m_log.DebugFormat("[AGENT HANDLER]: XFF is {0}", headers[xff]);
+    }
 
-            IPEndPoint ep = Util.GetClientIPFromXFF((string)headers[xff]);
-            if (ep != null)
-                return ep.Address.ToString();
+    public class ExtendedAgentDestinationData : AgentDestinationData
+    {
+        public string host;
+        public int port;
+        public string gatekeeperServerURI;
+        public string destinationServerURI;
 
-            // Oops
-            return Util.GetCallerIP(request);
-        }
     }
 
 }
diff --git a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
index b20f467..d9c1bd3 100644
--- a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
@@ -108,7 +108,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
             server.AddXmlRPCHandler("get_uui", GetUUI, false);
             server.AddXmlRPCHandler("get_uuid", GetUUID, false);
 
-            server.AddHTTPHandler("/homeagent/", new HomeAgentHandler(m_HomeUsersService, loginServerIP, proxy).Handler);
+            server.AddStreamHandler(new HomeAgentHandler(m_HomeUsersService, loginServerIP, proxy));
         }
 
         public XmlRpcResponse GetHomeRegion(XmlRpcRequest request, IPEndPoint remoteClient)
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index ae37ca7..334d313 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -328,31 +328,16 @@ namespace OpenSim.Server.Handlers.Simulation
                 return;
             }
 
-            // retrieve the input arguments
-            int x = 0, y = 0;
-            UUID uuid = UUID.Zero;
-            string regionname = string.Empty;
-            uint teleportFlags = 0;
-            if (args.ContainsKey("destination_x") && args["destination_x"] != null)
-                Int32.TryParse(args["destination_x"].AsString(), out x);
-            else
-                m_log.WarnFormat("  -- request didn't have destination_x");
-            if (args.ContainsKey("destination_y") && args["destination_y"] != null)
-                Int32.TryParse(args["destination_y"].AsString(), out y);
-            else
-                m_log.WarnFormat("  -- request didn't have destination_y");
-            if (args.ContainsKey("destination_uuid") && args["destination_uuid"] != null)
-                UUID.TryParse(args["destination_uuid"].AsString(), out uuid);
-            if (args.ContainsKey("destination_name") && args["destination_name"] != null)
-                regionname = args["destination_name"].ToString();
-            if (args.ContainsKey("teleport_flags") && args["teleport_flags"] != null)
-                teleportFlags = args["teleport_flags"].AsUInteger();
+            AgentDestinationData data = CreateAgentDestinationData();
+            UnpackData(args, data, request);
 
             GridRegion destination = new GridRegion();
-            destination.RegionID = uuid;
-            destination.RegionLocX = x;
-            destination.RegionLocY = y;
-            destination.RegionName = regionname;
+            destination.RegionID = data.uuid;
+            destination.RegionLocX = data.x;
+            destination.RegionLocY = data.y;
+            destination.RegionName = data.name;
+
+            GridRegion gatekeeper = ExtractGatekeeper(data);
 
             AgentCircuitData aCircuit = new AgentCircuitData();
             try
@@ -373,7 +358,7 @@ namespace OpenSim.Server.Handlers.Simulation
             // This is the meaning of POST agent
             //m_regionClient.AdjustUserInformation(aCircuit);
             //bool result = m_SimulationService.CreateAgent(destination, aCircuit, teleportFlags, out reason);
-            bool result = CreateAgent(destination, aCircuit, teleportFlags, out reason);
+            bool result = CreateAgent(gatekeeper, destination, aCircuit, data.flags, data.fromLogin, out reason);
 
             resp["reason"] = OSD.FromString(reason);
             resp["success"] = OSD.FromBoolean(result);
@@ -385,7 +370,36 @@ namespace OpenSim.Server.Handlers.Simulation
             responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp);
         }
 
-        private string GetCallerIP(Hashtable request)
+        protected virtual AgentDestinationData CreateAgentDestinationData()
+        {
+            return new AgentDestinationData();
+        }
+
+        protected virtual void UnpackData(OSDMap args, AgentDestinationData data, Hashtable request)
+        {
+            // retrieve the input arguments
+            if (args.ContainsKey("destination_x") && args["destination_x"] != null)
+                Int32.TryParse(args["destination_x"].AsString(), out data.x);
+            else
+                m_log.WarnFormat("  -- request didn't have destination_x");
+            if (args.ContainsKey("destination_y") && args["destination_y"] != null)
+                Int32.TryParse(args["destination_y"].AsString(), out data.y);
+            else
+                m_log.WarnFormat("  -- request didn't have destination_y");
+            if (args.ContainsKey("destination_uuid") && args["destination_uuid"] != null)
+                UUID.TryParse(args["destination_uuid"].AsString(), out data.uuid);
+            if (args.ContainsKey("destination_name") && args["destination_name"] != null)
+                data.name = args["destination_name"].ToString();
+            if (args.ContainsKey("teleport_flags") && args["teleport_flags"] != null)
+                data.flags = args["teleport_flags"].AsUInteger();
+        }
+
+        protected virtual GridRegion ExtractGatekeeper(AgentDestinationData data)
+        {
+            return null;
+        }
+
+        protected string GetCallerIP(Hashtable request)
         {
             if (!m_Proxy)
                 return Util.GetCallerIP(request);
@@ -418,7 +432,7 @@ namespace OpenSim.Server.Handlers.Simulation
         }
 
         // subclasses can override this
-        protected virtual bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, out string reason)
+        protected virtual bool CreateAgent(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, out string reason)
         {
             return m_SimulationService.CreateAgent(destination, aCircuit, teleportFlags, out reason);
         }
@@ -593,4 +607,14 @@ namespace OpenSim.Server.Handlers.Simulation
             return m_SimulationService.UpdateAgent(destination, agent);
         }
     }
+
+    public class AgentDestinationData
+    {
+        public int x;
+        public int y;
+        public string name;
+        public UUID uuid;
+        public uint flags;
+        public bool fromLogin;
+    }
 }
-- 
cgit v1.1


From 6c7e33fe472014688837b993118fc48878f134ff Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sat, 22 Jun 2013 08:29:06 -0700
Subject: Change IsLocalRegion from using region handle to using regionID. This
 was affecting UpdateAgent and CloseAgent in cases where the foreign region is
 on the same coordinates as *some* local region.

---
 OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 1 -
 1 file changed, 1 deletion(-)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index 334d313..71a9e6f 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -576,7 +576,6 @@ namespace OpenSim.Server.Handlers.Simulation
                 //agent.Dump();
                 // This is one of the meanings of PUT agent
                 result = UpdateAgent(destination, agent);
-
             }
             else if ("AgentPosition".Equals(messageType))
             {
-- 
cgit v1.1


From e26e8b882965430f66c6459987a8b219d68e5da1 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 28 Jun 2013 19:19:38 +0100
Subject: Remove "Asset deletion not supported by database" message from
 "delete asset" robust/standalone console command since it actually was
 implemented and performed.

Improve other associated messages.
---
 OpenSim/Server/Handlers/Asset/AssetServerConnector.cs | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs b/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
index ff45d94..cc4325a 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
@@ -119,16 +119,14 @@ namespace OpenSim.Server.Handlers.Asset
 
             if (asset == null || asset.Data.Length == 0)
             {
-                MainConsole.Instance.Output("Asset not found");
+                MainConsole.Instance.OutputFormat("Could not find asset with ID {0}", args[2]);
                 return;
             }
 
-            m_AssetService.Delete(args[2]);
-
-            //MainConsole.Instance.Output("Asset deleted");
-            // TODO: Implement this
-
-            MainConsole.Instance.Output("Asset deletion not supported by database");
+            if (!m_AssetService.Delete(asset.ID))
+                MainConsole.Instance.OutputFormat("ERROR: Could not delete asset {0} {1}", asset.ID, asset.Name);
+            else
+                MainConsole.Instance.OutputFormat("Deleted asset {0} {1}", asset.ID, asset.Name);
         }
 
         void HandleDumpAsset(string module, string[] args)
-- 
cgit v1.1


From 4d24bf75fd695a12683987d9803018c2ec4cae60 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Tue, 2 Jul 2013 16:46:35 -0700
Subject: Deleted debug messages. Fixed a null ref exception on the POST
 handler of GridUserServerPostHandler.cs

---
 OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs
index 687cf8d..7483395 100644
--- a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs
@@ -185,10 +185,12 @@ namespace OpenSim.Server.Handlers.GridUser
             GridUserInfo guinfo = m_GridUserService.GetGridUserInfo(user);
 
             Dictionary<string, object> result = new Dictionary<string, object>();
-            result["result"] = guinfo.ToKeyValuePairs();
+            if (guinfo != null)
+                result["result"] = guinfo.ToKeyValuePairs();
+            else
+                result["result"] = "null";
 
             string xmlString = ServerUtils.BuildXmlResponse(result);
-
             //m_log.DebugFormat("[GRID USER HANDLER]: resp string: {0}", xmlString);
             return Util.UTF8NoBomEncoding.GetBytes(xmlString);
         }
-- 
cgit v1.1


From bbb9af363de5cabf44dec2b5aba6fb386a1e7fad Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sun, 7 Jul 2013 20:43:42 -0700
Subject: Print out caller IP when unusual requests are received.

---
 OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index 71a9e6f..b01de7a 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -107,7 +107,7 @@ namespace OpenSim.Server.Handlers.Simulation
             }
             else
             {
-                m_log.InfoFormat("[AGENT HANDLER]: method {0} not supported in agent message", method);
+                m_log.InfoFormat("[AGENT HANDLER]: method {0} not supported in agent message (caller is {1})", method, Util.GetCallerIP(request));
                 responsedata["int_response_code"] = HttpStatusCode.MethodNotAllowed;
                 responsedata["str_response_string"] = "Method not allowed";
 
-- 
cgit v1.1


From e19defde36ddbd5ff90d8304c6fe3b57110f8078 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 8 Jul 2013 22:03:07 +0100
Subject: Add "show caps stats by user" and "show caps stats by cap" console
 commands to print various counts of capability invocation by user and by cap

This currently prints caps requests received and handled, so that overload of received compared to handled or deadlock can be detected.
This involves making BaseStreamHandler and BaseOutputStream record the ints, which means inheritors should subclass ProcessRequest() instead of Handle()
However, existing inheriting classes overriding Handle() will still work, albeit without stats recording.
"show caps" becomes "show caps list" to disambiguate between show caps commands
---
 .../Handlers/Asset/AssetServerDeleteHandler.cs     |  2 +-
 .../Server/Handlers/Asset/AssetServerGetHandler.cs |  2 +-
 .../Handlers/Asset/AssetServerPostHandler.cs       |  2 +-
 .../AuthenticationServerPostHandler.cs             |  2 +-
 .../Handlers/Authentication/OpenIdServerHandler.cs | 30 ++++++++--------------
 .../AuthorizationServerPostHandler.cs              |  2 +-
 .../Handlers/Avatar/AvatarServerPostHandler.cs     |  2 +-
 .../Handlers/Friends/FriendsServerPostHandler.cs   |  2 +-
 .../Server/Handlers/Grid/GridServerPostHandler.cs  |  2 +-
 .../Handlers/GridUser/GridUserServerPostHandler.cs |  2 +-
 .../Hypergrid/HGFriendsServerPostHandler.cs        |  2 +-
 .../Handlers/Hypergrid/HeloServerConnector.cs      |  2 +-
 .../Server/Handlers/Hypergrid/HomeAgentHandlers.cs |  1 +
 .../Inventory/InventoryServerMoveItemsHandler.cs   |  2 +-
 .../Handlers/Inventory/XInventoryInConnector.cs    |  2 +-
 .../Server/Handlers/Map/MapAddServerConnector.cs   |  2 +-
 .../Server/Handlers/Map/MapGetServerConnector.cs   |  2 +-
 .../Server/Handlers/Neighbour/NeighbourHandlers.cs |  8 +++---
 .../Handlers/Presence/PresenceServerPostHandler.cs |  2 +-
 .../Server/Handlers/Simulation/AgentHandlers.cs    |  4 +--
 .../UserAccounts/UserAccountServerPostHandler.cs   |  2 +-
 21 files changed, 35 insertions(+), 42 deletions(-)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs
index 986394b..941b97d 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs
@@ -70,7 +70,7 @@ namespace OpenSim.Server.Handlers.Asset
             m_allowedTypes = allowedTypes;
         }
 
-        public override byte[] Handle(string path, Stream request,
+        protected override byte[] ProcessRequest(string path, Stream request,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
             bool result = false;
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
index 8f7412b..8b23a83 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
@@ -54,7 +54,7 @@ namespace OpenSim.Server.Handlers.Asset
             m_AssetService = service;
         }
 
-        public override byte[] Handle(string path, Stream request,
+        protected override byte[] ProcessRequest(string path, Stream request,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
             byte[] result = new byte[0];
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs
index a006fa8..8eebc61 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs
@@ -54,7 +54,7 @@ namespace OpenSim.Server.Handlers.Asset
             m_AssetService = service;
         }
 
-        public override byte[] Handle(string path, Stream request,
+        protected override byte[] ProcessRequest(string path, Stream request,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
             AssetBase asset;
diff --git a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs
index 6b93cd9..16e011a 100644
--- a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs
@@ -70,7 +70,7 @@ namespace OpenSim.Server.Handlers.Authentication
             }
         }
 
-        public override byte[] Handle(string path, Stream request,
+        protected override byte[] ProcessRequest(string path, Stream request,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
             string[] p = SplitParams(path);
diff --git a/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs b/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs
index 18cef15..66a26fc 100644
--- a/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs
+++ b/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs
@@ -147,7 +147,7 @@ namespace OpenSim.Server.Handlers.Authentication
         #endregion
     }
 
-    public class OpenIdStreamHandler : IStreamHandler
+    public class OpenIdStreamHandler : BaseOutputStreamHandler
     {
         #region HTML
 
@@ -191,42 +191,34 @@ For more information, see <a href='http://openid.net/'>http://openid.net/</a>.
 
         #endregion HTML
 
-        public string Name { get { return "OpenId"; } }
-        public string Description { get { return null; } }
-        public string ContentType { get { return m_contentType; } }
-        public string HttpMethod { get { return m_httpMethod; } }
-        public string Path { get { return m_path; } }
-
-        string m_contentType;
-        string m_httpMethod;
-        string m_path;
         IAuthenticationService m_authenticationService;
         IUserAccountService m_userAccountService;
         ProviderMemoryStore m_openidStore = new ProviderMemoryStore();
 
+        public override string ContentType { get { return "text/html"; } }
+
         /// <summary>
         /// Constructor
         /// </summary>
-        public OpenIdStreamHandler(string httpMethod, string path, IUserAccountService userService, IAuthenticationService authService)
+        public OpenIdStreamHandler(
+            string httpMethod, string path, IUserAccountService userService, IAuthenticationService authService)
+            : base(httpMethod, path, "OpenId", "OpenID stream handler")
         {
             m_authenticationService = authService;
             m_userAccountService = userService;
-            m_httpMethod = httpMethod;
-            m_path = path;
-
-            m_contentType = "text/html";
         }
 
         /// <summary>
         /// Handles all GET and POST requests for OpenID identifier pages and endpoint
         /// server communication
         /// </summary>
-        public void Handle(string path, Stream request, Stream response, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
+        protected override void ProcessRequest(
+            string path, Stream request, Stream response, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
             Uri providerEndpoint = new Uri(String.Format("{0}://{1}{2}", httpRequest.Url.Scheme, httpRequest.Url.Authority, httpRequest.Url.AbsolutePath));
 
             // Defult to returning HTML content
-            m_contentType = "text/html";
+            httpResponse.ContentType = ContentType;
 
             try
             {
@@ -276,7 +268,7 @@ For more information, see <a href='http://openid.net/'>http://openid.net/</a>.
 
                     string[] contentTypeValues = provider.Request.Response.Headers.GetValues("Content-Type");
                     if (contentTypeValues != null && contentTypeValues.Length == 1)
-                        m_contentType = contentTypeValues[0];
+                        httpResponse.ContentType = contentTypeValues[0];
 
                     // Set the response code and document body based on the OpenID result
                     httpResponse.StatusCode = (int)provider.Request.Response.Code;
@@ -344,4 +336,4 @@ For more information, see <a href='http://openid.net/'>http://openid.net/</a>.
             return false;
         }
     }
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs b/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs
index bcf9d47..c9b4e9b 100644
--- a/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs
@@ -54,7 +54,7 @@ namespace OpenSim.Server.Handlers.Authorization
             m_AuthorizationService = service;
         }
 
-        public override byte[] Handle(string path, Stream request,
+        protected override byte[] ProcessRequest(string path, Stream request,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
             XmlSerializer xs = new XmlSerializer(typeof (AuthorizationRequest));
diff --git a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs
index 8cd747e..d6bbb8f 100644
--- a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs
@@ -56,7 +56,7 @@ namespace OpenSim.Server.Handlers.Avatar
             m_AvatarService = service;
         }
 
-        public override byte[] Handle(string path, Stream requestData,
+        protected override byte[] ProcessRequest(string path, Stream requestData,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
             StreamReader sr = new StreamReader(requestData);
diff --git a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs
index 47a8558..ca0a24c 100644
--- a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs
@@ -57,7 +57,7 @@ namespace OpenSim.Server.Handlers.Friends
             m_FriendsService = service;
         }
 
-        public override byte[] Handle(string path, Stream requestData,
+        protected override byte[] ProcessRequest(string path, Stream requestData,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
             StreamReader sr = new StreamReader(requestData);
diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
index ef5f33e..89cba8a 100644
--- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
@@ -57,7 +57,7 @@ namespace OpenSim.Server.Handlers.Grid
             m_GridService = service;
         }
 
-        public override byte[] Handle(string path, Stream requestData,
+        protected override byte[] ProcessRequest(string path, Stream requestData,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
             StreamReader sr = new StreamReader(requestData);
diff --git a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs
index 7483395..0b98e9a 100644
--- a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs
@@ -56,7 +56,7 @@ namespace OpenSim.Server.Handlers.GridUser
             m_GridUserService = service;
         }
 
-        public override byte[] Handle(string path, Stream requestData,
+        protected override byte[] ProcessRequest(string path, Stream requestData,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
             StreamReader sr = new StreamReader(requestData);
diff --git a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs
index 0aa2729..a2bdadb 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs
@@ -68,7 +68,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
                 m_log.ErrorFormat("[HGFRIENDS HANDLER]: TheService is null!");
         }
 
-        public override byte[] Handle(string path, Stream requestData,
+        protected override byte[] ProcessRequest(string path, Stream requestData,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
             StreamReader sr = new StreamReader(requestData);
diff --git a/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs
index f306b1c..06eaf2e 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs
@@ -91,7 +91,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
             m_HandlersType = handlersType;
         }
 
-        public override byte[] Handle(string path, Stream requestData,
+        protected override byte[] ProcessRequest(string path, Stream requestData,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
             return OKResponse(httpResponse);
diff --git a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
index df875af..f37f2f1 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
@@ -68,6 +68,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
         {
             return new ExtendedAgentDestinationData();
         }
+
         protected override void UnpackData(OSDMap args, AgentDestinationData d, Hashtable request)
         {
             base.UnpackData(args, d, request);
diff --git a/OpenSim/Server/Handlers/Inventory/InventoryServerMoveItemsHandler.cs b/OpenSim/Server/Handlers/Inventory/InventoryServerMoveItemsHandler.cs
index 231e32f..e2c50fe 100644
--- a/OpenSim/Server/Handlers/Inventory/InventoryServerMoveItemsHandler.cs
+++ b/OpenSim/Server/Handlers/Inventory/InventoryServerMoveItemsHandler.cs
@@ -56,7 +56,7 @@ namespace OpenSim.Server.Handlers.Inventory
             m_InventoryService = service;
         }
 
-        public override byte[] Handle(string path, Stream request,
+        protected override byte[] ProcessRequest(string path, Stream request,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
             XmlSerializer xs = new XmlSerializer(typeof (List<InventoryItemBase>));
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
index 9d28dc3..0d7c136 100644
--- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
+++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs
@@ -87,7 +87,7 @@ namespace OpenSim.Server.Handlers.Asset
             m_InventoryService = service;
         }
 
-        public override byte[] Handle(string path, Stream requestData,
+        protected override byte[] ProcessRequest(string path, Stream requestData,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
             StreamReader sr = new StreamReader(requestData);
diff --git a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs
index 4a61969..d438fc7 100644
--- a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs
+++ b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs
@@ -99,7 +99,7 @@ namespace OpenSim.Server.Handlers.MapImage
             m_Proxy = proxy;
         }
 
-        public override byte[] Handle(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
+        protected override byte[] ProcessRequest(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
 //            m_log.DebugFormat("[MAP SERVICE IMAGE HANDLER]: Received {0}", path);
             StreamReader sr = new StreamReader(requestData);
diff --git a/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs b/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs
index fb85d1c..7bb2f39 100644
--- a/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs
+++ b/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs
@@ -80,7 +80,7 @@ namespace OpenSim.Server.Handlers.MapImage
             m_MapService = service;
         }
 
-        public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
+        protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
             byte[] result = new byte[0];
 
diff --git a/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs b/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs
index 8a1f824..3525a01 100644
--- a/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs
+++ b/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Server.Handlers.Neighbour
             // TODO: unused: m_AuthenticationService = authentication;
         }
 
-        public override byte[] Handle(string path, Stream request,
+        protected override byte[] ProcessRequest(string path, Stream request,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
             // Not implemented yet
@@ -83,7 +83,7 @@ namespace OpenSim.Server.Handlers.Neighbour
             // TODO: unused: m_AllowForeignGuests = foreignGuests;
         }
 
-        public override byte[] Handle(string path, Stream request,
+        protected override byte[] ProcessRequest(string path, Stream request,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
             byte[] result = new byte[0];
@@ -176,7 +176,7 @@ namespace OpenSim.Server.Handlers.Neighbour
             // TODO: unused: m_AuthenticationService = authentication;
         }
 
-        public override byte[] Handle(string path, Stream request,
+        protected override byte[] ProcessRequest(string path, Stream request,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
             // Not implemented yet
@@ -197,7 +197,7 @@ namespace OpenSim.Server.Handlers.Neighbour
             // TODO: unused: m_AuthenticationService = authentication;
         }
 
-        public override byte[] Handle(string path, Stream request,
+        protected override byte[] ProcessRequest(string path, Stream request,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
             // Not implemented yet
diff --git a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
index 2d67c6d..abb4b19 100644
--- a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
@@ -56,7 +56,7 @@ namespace OpenSim.Server.Handlers.Presence
             m_PresenceService = service;
         }
 
-        public override byte[] Handle(string path, Stream requestData,
+        protected override byte[] ProcessRequest(string path, Stream requestData,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
             StreamReader sr = new StreamReader(requestData);
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index 71a9e6f..a9fd4ed 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -251,7 +251,7 @@ namespace OpenSim.Server.Handlers.Simulation
             m_SimulationService = null;
         }
 
-        public override byte[] Handle(string path, Stream request,
+        protected override byte[] ProcessRequest(string path, Stream request,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
 //            m_log.DebugFormat("[SIMULATION]: Stream handler called");
@@ -457,7 +457,7 @@ namespace OpenSim.Server.Handlers.Simulation
             m_SimulationService = null;
         }
 
-        public override byte[] Handle(string path, Stream request,
+        protected override byte[] ProcessRequest(string path, Stream request,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
 //            m_log.DebugFormat("[SIMULATION]: Stream handler called");
diff --git a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs
index 72551ef..24c9de6 100644
--- a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs
@@ -68,7 +68,7 @@ namespace OpenSim.Server.Handlers.UserAccounts
             }
         }
 
-        public override byte[] Handle(string path, Stream requestData,
+        protected override byte[] ProcessRequest(string path, Stream requestData,
                 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
         {
             StreamReader sr = new StreamReader(requestData);
-- 
cgit v1.1


From 931eb892d92bcd61194655ec02def6264d8b182e Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sat, 13 Jul 2013 17:56:42 -0700
Subject: Deleted GET agent all around. Not used.

---
 .../Server/Handlers/Simulation/AgentHandlers.cs    | 61 +---------------------
 1 file changed, 2 insertions(+), 59 deletions(-)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index 40a34c6..17a8ef4 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -90,12 +90,7 @@ namespace OpenSim.Server.Handlers.Simulation
 
             // Next, let's parse the verb
             string method = (string)request["http-method"];
-            if (method.Equals("GET"))
-            {
-                DoAgentGet(request, responsedata, agentID, regionID);
-                return responsedata;
-            }
-            else if (method.Equals("DELETE"))
+            if (method.Equals("DELETE"))
             {
                 DoAgentDelete(request, responsedata, agentID, action, regionID);
                 return responsedata;
@@ -107,7 +102,7 @@ namespace OpenSim.Server.Handlers.Simulation
             }
             else
             {
-                m_log.InfoFormat("[AGENT HANDLER]: method {0} not supported in agent message (caller is {1})", method, Util.GetCallerIP(request));
+                m_log.ErrorFormat("[AGENT HANDLER]: method {0} not supported in agent message {1} (caller is {2})", method, (string)request["uri"], Util.GetCallerIP(request));
                 responsedata["int_response_code"] = HttpStatusCode.MethodNotAllowed;
                 responsedata["str_response_string"] = "Method not allowed";
 
@@ -156,58 +151,6 @@ namespace OpenSim.Server.Handlers.Simulation
 //            Console.WriteLine("str_response_string [{0}]", responsedata["str_response_string"]);
         }
 
-        protected virtual void DoAgentGet(Hashtable request, Hashtable responsedata, UUID id, UUID regionID)
-        {
-            if (m_SimulationService == null)
-            {
-                m_log.Debug("[AGENT HANDLER]: Agent GET called. Harmless but useless.");
-                responsedata["content_type"] = "application/json";
-                responsedata["int_response_code"] = HttpStatusCode.NotImplemented;
-                responsedata["str_response_string"] = string.Empty;
-
-                return;
-            }
-
-            GridRegion destination = new GridRegion();
-            destination.RegionID = regionID;
-
-            IAgentData agent = null;
-            bool result = m_SimulationService.RetrieveAgent(destination, id, out agent);
-            OSDMap map = null;
-            if (result)
-            {
-                if (agent != null) // just to make sure
-                {
-                    map = agent.Pack();
-                    string strBuffer = "";
-                    try
-                    {
-                        strBuffer = OSDParser.SerializeJsonString(map);
-                    }
-                    catch (Exception e)
-                    {
-                        m_log.WarnFormat("[AGENT HANDLER]: Exception thrown on serialization of DoAgentGet: {0}", e.Message);
-                        responsedata["int_response_code"] = HttpStatusCode.InternalServerError;
-                        // ignore. buffer will be empty, caller should check.
-                    }
-
-                    responsedata["content_type"] = "application/json";
-                    responsedata["int_response_code"] = HttpStatusCode.OK;
-                    responsedata["str_response_string"] = strBuffer;
-                }
-                else
-                {
-                    responsedata["int_response_code"] = HttpStatusCode.InternalServerError;
-                    responsedata["str_response_string"] = "Internal error";
-                }
-            }
-            else
-            {
-                responsedata["int_response_code"] = HttpStatusCode.NotFound;
-                responsedata["str_response_string"] = "Not Found";
-            }
-        }
-
         protected void DoAgentDelete(Hashtable request, Hashtable responsedata, UUID id, string action, UUID regionID)
         {
             m_log.Debug(" >>> DoDelete action:" + action + "; RegionID:" + regionID);
-- 
cgit v1.1


From b4f1b9acf65f9e782d56602e60c58be6145c5cca Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sat, 13 Jul 2013 21:28:46 -0700
Subject: Guard against unauthorized agent deletes.

---
 OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index 17a8ef4..cd172e4 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -27,11 +27,13 @@
 
 using System;
 using System.Collections;
+using System.Collections.Specialized;
 using System.IO;
 using System.IO.Compression;
 using System.Reflection;
 using System.Net;
 using System.Text;
+using System.Web;
 
 using OpenSim.Server.Base;
 using OpenSim.Server.Handlers.Base;
@@ -92,7 +94,11 @@ namespace OpenSim.Server.Handlers.Simulation
             string method = (string)request["http-method"];
             if (method.Equals("DELETE"))
             {
-                DoAgentDelete(request, responsedata, agentID, action, regionID);
+                string auth_token = string.Empty;
+                if (request.ContainsKey("auth"))
+                    auth_token = request["auth"].ToString();
+
+                DoAgentDelete(request, responsedata, agentID, action, regionID, auth_token);
                 return responsedata;
             }
             else if (method.Equals("QUERYACCESS"))
@@ -151,9 +157,9 @@ namespace OpenSim.Server.Handlers.Simulation
 //            Console.WriteLine("str_response_string [{0}]", responsedata["str_response_string"]);
         }
 
-        protected void DoAgentDelete(Hashtable request, Hashtable responsedata, UUID id, string action, UUID regionID)
+        protected void DoAgentDelete(Hashtable request, Hashtable responsedata, UUID id, string action, UUID regionID, string auth_token)
         {
-            m_log.Debug(" >>> DoDelete action:" + action + "; RegionID:" + regionID);
+            m_log.DebugFormat("[AGENT HANDLER]: >>> DELETE action: {0}; RegionID: {1}; from: {2}; auth_code: {3}", action, regionID, Util.GetCallerIP(request), auth_token);
 
             GridRegion destination = new GridRegion();
             destination.RegionID = regionID;
@@ -161,12 +167,12 @@ namespace OpenSim.Server.Handlers.Simulation
             if (action.Equals("release"))
                 ReleaseAgent(regionID, id);
             else
-                Util.FireAndForget(delegate { m_SimulationService.CloseAgent(destination, id); });
+                Util.FireAndForget(delegate { m_SimulationService.CloseAgent(destination, id, auth_token); });
 
             responsedata["int_response_code"] = HttpStatusCode.OK;
             responsedata["str_response_string"] = "OpenSim agent " + id.ToString();
 
-            m_log.DebugFormat("[AGENT HANDLER]: Agent {0} Released/Deleted from region {1}", id, regionID);
+            //m_log.DebugFormat("[AGENT HANDLER]: Agent {0} Released/Deleted from region {1}", id, regionID);
         }
 
         protected virtual void ReleaseAgent(UUID regionID, UUID id)
-- 
cgit v1.1


From f3b3e21dea98b4ea974ae7649a63d00b69e6dfed Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sun, 14 Jul 2013 07:28:40 -0700
Subject: Change the auth token to be the user's sessionid.

---
 OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index cd172e4..4ac477f 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -159,7 +159,10 @@ namespace OpenSim.Server.Handlers.Simulation
 
         protected void DoAgentDelete(Hashtable request, Hashtable responsedata, UUID id, string action, UUID regionID, string auth_token)
         {
-            m_log.DebugFormat("[AGENT HANDLER]: >>> DELETE action: {0}; RegionID: {1}; from: {2}; auth_code: {3}", action, regionID, Util.GetCallerIP(request), auth_token);
+            if (string.IsNullOrEmpty(action))
+                m_log.DebugFormat("[AGENT HANDLER]: >>> DELETE <<< RegionID: {0}; from: {1}; auth_code: {2}", regionID, Util.GetCallerIP(request), auth_token);
+            else
+                m_log.DebugFormat("[AGENT HANDLER]: Release {0} to RegionID: {1}", id, regionID);
 
             GridRegion destination = new GridRegion();
             destination.RegionID = regionID;
-- 
cgit v1.1


From b3052c425effe7eed6f4a8ab8e25fd4de907bc86 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 17 Aug 2013 01:08:19 +0100
Subject: Remove some mono compiler warnings from OpenSim/Server/Handlers

---
 OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs        | 2 +-
 OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs | 6 +-----
 OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs     | 6 ++----
 3 files changed, 4 insertions(+), 10 deletions(-)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
index f37f2f1..04bb9e8 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
@@ -85,7 +85,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
                     data.destinationServerURI = args["destination_serveruri"];
 
             }
-            catch (InvalidCastException e)
+            catch (InvalidCastException)
             {
                 m_log.ErrorFormat("[HOME AGENT HANDLER]: Bad cast in UnpackData");
             }
diff --git a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
index d9c1bd3..7137836 100644
--- a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
@@ -453,7 +453,6 @@ namespace OpenSim.Server.Handlers.Hypergrid
             XmlRpcResponse response = new XmlRpcResponse();
             response.Value = hash;
             return response;
-
         }
 
         /// <summary>
@@ -471,9 +470,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
             //string portstr = (string)requestData["port"];
             if (requestData.ContainsKey("first") && requestData.ContainsKey("last"))
             {
-                UUID userID = UUID.Zero;
                 string first = (string)requestData["first"];
-
                 string last = (string)requestData["last"];
                 UUID uuid = m_HomeUsersService.GetUUID(first, last);
                 hash["UUID"] = uuid.ToString();
@@ -482,7 +479,6 @@ namespace OpenSim.Server.Handlers.Hypergrid
             XmlRpcResponse response = new XmlRpcResponse();
             response.Value = hash;
             return response;
-
         }
     }
-}
+}
\ No newline at end of file
diff --git a/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs b/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
index f9a520a..28dbbc2 100644
--- a/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
+++ b/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
@@ -39,8 +39,7 @@ namespace OpenSim.Server.Handlers.Profiles
 {
     public class UserProfilesConnector: ServiceConnector
     {
-        static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-        
+//        static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);        
         
         // Our Local Module
         public IUserProfilesService ServiceModule
@@ -110,5 +109,4 @@ namespace OpenSim.Server.Handlers.Profiles
             Server.AddJsonRPCHandler("user_data_update", handler.UpdateUserAppData);
         }
     }
-}
-
+}
\ No newline at end of file
-- 
cgit v1.1


From 4cbadc3c4984b8bebc7098a720846309f645ad7b Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Mon, 2 Sep 2013 17:27:45 +0100
Subject: Allow one to specify a DefaultHGRegion flag in [GridService] in order
 to allow different default regions for HG and direct grid logins.

This requires a new GridService.GetDefaultHypergridRegions() so ROBUST services require updating but not simulators.
This method still returns regions flagged with just DefaultRegion after any DefaultHGRegions, so if no DefaultHGRegions are specified
then existing configured defaults will still work.
Immediate use is for conference where we need to be able to specify different defaults
However, this is also generally useful to send experienced HG users to one default location and local users whose specified region fails (e.g. no "home" or "last") to another.
---
 .../Server/Handlers/Grid/GridServerPostHandler.cs  | 33 ++++++++++++++++++++++
 1 file changed, 33 insertions(+)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
index 89cba8a..c63b409 100644
--- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
@@ -106,6 +106,9 @@ namespace OpenSim.Server.Handlers.Grid
                     case "get_default_regions":
                         return GetDefaultRegions(request);
 
+                    case "get_default_hypergrid_regions":
+                        return GetDefaultHypergridRegions(request);
+
                     case "get_fallback_regions":
                         return GetFallbackRegions(request);
 
@@ -444,6 +447,36 @@ namespace OpenSim.Server.Handlers.Grid
             return Util.UTF8NoBomEncoding.GetBytes(xmlString);
         }
 
+        byte[] GetDefaultHypergridRegions(Dictionary<string, object> request)
+        {
+            //m_log.DebugFormat("[GRID HANDLER]: GetDefaultRegions");
+            UUID scopeID = UUID.Zero;
+            if (request.ContainsKey("SCOPEID"))
+                UUID.TryParse(request["SCOPEID"].ToString(), out scopeID);
+            else
+                m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region range");
+
+            List<GridRegion> rinfos = m_GridService.GetDefaultHypergridRegions(scopeID);
+
+            Dictionary<string, object> result = new Dictionary<string, object>();
+            if ((rinfos == null) || ((rinfos != null) && (rinfos.Count == 0)))
+                result["result"] = "null";
+            else
+            {
+                int i = 0;
+                foreach (GridRegion rinfo in rinfos)
+                {
+                    Dictionary<string, object> rinfoDict = rinfo.ToKeyValuePairs();
+                    result["region" + i] = rinfoDict;
+                    i++;
+                }
+            }
+            string xmlString = ServerUtils.BuildXmlResponse(result);
+
+            //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString);
+            return Util.UTF8NoBomEncoding.GetBytes(xmlString);
+        }
+
         byte[] GetFallbackRegions(Dictionary<string, object> request)
         {
             //m_log.DebugFormat("[GRID HANDLER]: GetRegionRange");
-- 
cgit v1.1


From 42bdf446585007029faf4cd21abd289487f0f797 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 4 Oct 2013 23:33:47 +0100
Subject: Bump OPenSimulator version and assembly versions up to 0.8.0 Dev

---
 OpenSim/Server/Base/Properties/AssemblyInfo.cs     | 2 +-
 OpenSim/Server/Handlers/Properties/AssemblyInfo.cs | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Base/Properties/AssemblyInfo.cs b/OpenSim/Server/Base/Properties/AssemblyInfo.cs
index b4732b8..67340c7 100644
--- a/OpenSim/Server/Base/Properties/AssemblyInfo.cs
+++ b/OpenSim/Server/Base/Properties/AssemblyInfo.cs
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
 //      Build Number
 //      Revision
 //
-[assembly: AssemblyVersion("0.7.6.*")]
+[assembly: AssemblyVersion("0.8.0.*")]
 
diff --git a/OpenSim/Server/Handlers/Properties/AssemblyInfo.cs b/OpenSim/Server/Handlers/Properties/AssemblyInfo.cs
index 3295ffd..04cd798 100644
--- a/OpenSim/Server/Handlers/Properties/AssemblyInfo.cs
+++ b/OpenSim/Server/Handlers/Properties/AssemblyInfo.cs
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
 //      Build Number
 //      Revision
 //
-[assembly: AssemblyVersion("0.7.6.*")]
+[assembly: AssemblyVersion("0.8.0.*")]
 
-- 
cgit v1.1


From 31246ecd04c0f57631587e25ae0245d086098ddc Mon Sep 17 00:00:00 2001
From: teravus
Date: Fri, 4 Oct 2013 20:53:01 -0500
Subject: * Added a unique and interesting WebSocket grid login processor by
 hijacking the LLSD login code.    This sends the data through the normal
 login channels and spits out a JSON object back that mimics the login
 response.    Feel free to comment on the best way to set this up as a config
 option.

---
 OpenSim/Server/Handlers/Login/LLLoginHandlers.cs   | 56 ++++++++++++++++++++++
 .../Handlers/Login/LLLoginServiceInConnector.cs    |  1 +
 2 files changed, 57 insertions(+)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs
index f83a239..e4a0ffa 100644
--- a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs
+++ b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs
@@ -53,6 +53,7 @@ namespace OpenSim.Server.Handlers.Login
 
         private ILoginService m_LocalService;
         private bool m_Proxy;
+        
 
         public LLLoginHandlers(ILoginService service, bool hasProxy)
         {
@@ -213,6 +214,61 @@ namespace OpenSim.Server.Handlers.Login
             return FailedOSDResponse();
         }
 
+        public void HandleWebSocketLoginEvents(string path, WebSocketHttpServerHandler sock)
+        {
+            sock.MaxPayloadSize = 16384; //16 kb payload
+            sock.InitialMsgTimeout = 5000; //5 second first message to trigger at least one of these events
+            sock.NoDelay_TCP_Nagle = true;
+            sock.OnData += delegate(object sender, WebsocketDataEventArgs data) { sock.Close("fail"); };
+            sock.OnPing += delegate(object sender, PingEventArgs pingdata) { sock.Close("fail"); };
+            sock.OnPong += delegate(object sender, PongEventArgs pongdata) { sock.Close("fail"); };
+            sock.OnText += delegate(object sender, WebsocketTextEventArgs text)
+                               {
+                                   OSD request = null;
+                                   try
+                                   {
+                                       request = OSDParser.DeserializeJson(text.Data);
+                                       if (!(request is OSDMap))
+                                       {
+                                           sock.SendMessage(OSDParser.SerializeJsonString(FailedOSDResponse()));
+                                       }
+                                       else
+                                       {
+                                           OSDMap req = request as OSDMap;
+                                           string first = req["firstname"].AsString();
+                                           string last = req["lastname"].AsString();
+                                           string passwd = req["passwd"].AsString();
+                                           string start = req["startlocation"].AsString();
+                                           string version = req["version"].AsString();
+                                           string channel = req["channel"].AsString();
+                                           string mac = req["mac"].AsString();
+                                           string id0 = req["id0"].AsString();
+                                           UUID scope = UUID.Zero;
+                                           IPEndPoint endPoint =
+                                               (sender as WebSocketHttpServerHandler).GetRemoteIPEndpoint();
+                                           LoginResponse reply = null;
+                                           reply = m_LocalService.Login(first, last, passwd, start, scope, version,
+                                                                        channel, mac, id0, endPoint);
+                                           sock.SendMessage(OSDParser.SerializeJsonString(reply.ToOSDMap()));
+
+                                       }
+
+                                   }
+                                   catch (Exception)
+                                   {
+                                       sock.SendMessage(OSDParser.SerializeJsonString(FailedOSDResponse()));
+                                   }
+                                   finally
+                                   {
+                                       sock.Close("success");
+                                   }
+                               };
+            
+            sock.HandshakeAndUpgrade();
+
+        }
+        
+
         private XmlRpcResponse FailedXMLRPCResponse()
         {
             Hashtable hash = new Hashtable();
diff --git a/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs b/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs
index 1fb0dbc..97e8295 100644
--- a/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs
+++ b/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs
@@ -98,6 +98,7 @@ namespace OpenSim.Server.Handlers.Login
             server.AddXmlRPCHandler("login_to_simulator", loginHandlers.HandleXMLRPCLogin, false);
             server.AddXmlRPCHandler("set_login_level", loginHandlers.HandleXMLRPCSetLoginLevel, false);
             server.SetDefaultLLSDHandler(loginHandlers.HandleLLSDLogin);
+            server.AddWebSocketHandler("/WebSocket/GridLogin", loginHandlers.HandleWebSocketLoginEvents);
         }
     }
 }
-- 
cgit v1.1


From f76cc6036ebf446553ee5201321879538dafe3b2 Mon Sep 17 00:00:00 2001
From: teravus
Date: Mon, 7 Oct 2013 21:35:55 -0500
Subject: * Added a Basic DOS protection container/base object for the most
 common HTTP Server handlers. XMLRPC Handler, GenericHttpHandler and
 <Various>StreamHandler * Applied the XmlRpcBasicDOSProtector.cs to the login
 service as both an example, and good practice. * Applied the
 BaseStreamHandlerBasicDOSProtector.cs to the friends service as an example of
 the DOS Protector on StreamHandlers * Added CircularBuffer, used for CPU and
 Memory friendly rate monitoring. * DosProtector has 2 states, 1. Just Check
 for blocked users and check general velocity, 2. Track velocity per user,    
 It only jumps to 2 if it's getting a lot of requests, and state 1 is about as
 resource friendly as if it wasn't even there.

---
 OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs    | 12 ++++++++++--
 OpenSim/Server/Handlers/Login/LLLoginHandlers.cs          | 11 +++++++++++
 .../Server/Handlers/Login/LLLoginServiceInConnector.cs    | 15 ++++++++++++++-
 3 files changed, 35 insertions(+), 3 deletions(-)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
index 8b23a83..0bd0235 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
@@ -42,14 +42,22 @@ using OpenSim.Framework.Servers.HttpServer;
 
 namespace OpenSim.Server.Handlers.Asset
 {
-    public class AssetServerGetHandler : BaseStreamHandler
+    public class AssetServerGetHandler : BaseStreamHandlerBasicDOSProtector
     {
         // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
 
         private IAssetService m_AssetService;
 
         public AssetServerGetHandler(IAssetService service) :
-                base("GET", "/assets")
+                base("GET", "/assets",new BasicDosProtectorOptions()
+                                          {
+                                              AllowXForwardedFor = true,
+                                              ForgetTimeSpan = TimeSpan.FromSeconds(2),
+                                              MaxRequestsInTimeframe = 5,
+                                              ReportingName = "ASSETGETDOSPROTECTOR",
+                                              RequestTimeSpan = TimeSpan.FromSeconds(5),
+                                              ThrottledAction = ThrottleAction.DoThrottledMethod
+                                          })
         {
             m_AssetService = service;
         }
diff --git a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs
index e4a0ffa..f2a5678 100644
--- a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs
+++ b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs
@@ -145,6 +145,17 @@ namespace OpenSim.Server.Handlers.Login
             return FailedXMLRPCResponse();
 
         }
+        public XmlRpcResponse HandleXMLRPCLoginBlocked(XmlRpcRequest request, IPEndPoint client)
+        {
+            XmlRpcResponse response = new XmlRpcResponse();
+            Hashtable resp = new Hashtable();
+
+            resp["reason"] = "presence";
+            resp["message"] = "Logins are currently restricted. Please try again later.";
+            resp["login"] = "false";
+            response.Value = resp;
+            return response;
+        }
 
         public XmlRpcResponse HandleXMLRPCSetLoginLevel(XmlRpcRequest request, IPEndPoint remoteClient)
         {
diff --git a/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs b/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs
index 97e8295..f60e892 100644
--- a/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs
+++ b/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs
@@ -44,6 +44,7 @@ namespace OpenSim.Server.Handlers.Login
 
         private ILoginService m_LoginService;
         private bool m_Proxy;
+        private BasicDosProtectorOptions m_DosProtectionOptions;
 
         public LLLoginServiceInConnector(IConfigSource config, IHttpServer server, IScene scene) :
                 base(config, server, String.Empty)
@@ -88,6 +89,16 @@ namespace OpenSim.Server.Handlers.Login
                 throw new Exception(String.Format("No LocalServiceModule for LoginService in config file"));
 
             m_Proxy = serverConfig.GetBoolean("HasProxy", false);
+            m_DosProtectionOptions = new BasicDosProtectorOptions();
+            // Dos Protection Options
+            m_DosProtectionOptions.AllowXForwardedFor = serverConfig.GetBoolean("DOSAllowXForwardedForHeader", false);
+            m_DosProtectionOptions.RequestTimeSpan =
+                TimeSpan.FromMilliseconds(serverConfig.GetInt("DOSRequestTimeFrameMS", 10000));
+            m_DosProtectionOptions.MaxRequestsInTimeframe = serverConfig.GetInt("DOSMaxRequestsInTimeFrame", 5);
+            m_DosProtectionOptions.ForgetTimeSpan =
+                TimeSpan.FromMilliseconds(serverConfig.GetInt("DOSForgiveClientAfterMS", 120000));
+            m_DosProtectionOptions.ReportingName = "LOGINDOSPROTECTION";
+            
 
             return loginService;
         }
@@ -95,7 +106,9 @@ namespace OpenSim.Server.Handlers.Login
         private void InitializeHandlers(IHttpServer server)
         {
             LLLoginHandlers loginHandlers = new LLLoginHandlers(m_LoginService, m_Proxy);
-            server.AddXmlRPCHandler("login_to_simulator", loginHandlers.HandleXMLRPCLogin, false);
+            server.AddXmlRPCHandler("login_to_simulator", 
+                new XmlRpcBasicDOSProtector(loginHandlers.HandleXMLRPCLogin,loginHandlers.HandleXMLRPCLoginBlocked,
+                    m_DosProtectionOptions).Process, false);
             server.AddXmlRPCHandler("set_login_level", loginHandlers.HandleXMLRPCSetLoginLevel, false);
             server.SetDefaultLLSDHandler(loginHandlers.HandleLLSDLogin);
             server.AddWebSocketHandler("/WebSocket/GridLogin", loginHandlers.HandleWebSocketLoginEvents);
-- 
cgit v1.1


From 75fdd6054d6605877acb511b1bd794de963a15f3 Mon Sep 17 00:00:00 2001
From: teravus
Date: Mon, 7 Oct 2013 23:19:50 -0500
Subject: * Refactor * Break out common BasicDOSProtector code into separate
 class.

---
 OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
index 0bd0235..cd42e70 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
@@ -56,7 +56,7 @@ namespace OpenSim.Server.Handlers.Asset
                                               MaxRequestsInTimeframe = 5,
                                               ReportingName = "ASSETGETDOSPROTECTOR",
                                               RequestTimeSpan = TimeSpan.FromSeconds(5),
-                                              ThrottledAction = ThrottleAction.DoThrottledMethod
+                                              ThrottledAction = BasicDOSProtector.ThrottleAction.DoThrottledMethod
                                           })
         {
             m_AssetService = service;
-- 
cgit v1.1


From e7ea053c4a4945160980f5e6763ecc4dc8af2609 Mon Sep 17 00:00:00 2001
From: teravus
Date: Mon, 7 Oct 2013 23:52:44 -0500
Subject: * Remove a test *cleanup*

---
 OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
index cd42e70..8b23a83 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs
@@ -42,22 +42,14 @@ using OpenSim.Framework.Servers.HttpServer;
 
 namespace OpenSim.Server.Handlers.Asset
 {
-    public class AssetServerGetHandler : BaseStreamHandlerBasicDOSProtector
+    public class AssetServerGetHandler : BaseStreamHandler
     {
         // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
 
         private IAssetService m_AssetService;
 
         public AssetServerGetHandler(IAssetService service) :
-                base("GET", "/assets",new BasicDosProtectorOptions()
-                                          {
-                                              AllowXForwardedFor = true,
-                                              ForgetTimeSpan = TimeSpan.FromSeconds(2),
-                                              MaxRequestsInTimeframe = 5,
-                                              ReportingName = "ASSETGETDOSPROTECTOR",
-                                              RequestTimeSpan = TimeSpan.FromSeconds(5),
-                                              ThrottledAction = BasicDOSProtector.ThrottleAction.DoThrottledMethod
-                                          })
+                base("GET", "/assets")
         {
             m_AssetService = service;
         }
-- 
cgit v1.1


From 1842388bb4dcf5ecd57732ffa877b6ca1a3dec7b Mon Sep 17 00:00:00 2001
From: BlueWall
Date: Fri, 6 Dec 2013 02:52:13 -0500
Subject: Add support for user preferences (im via email)

---
 .../Handlers/Profiles/UserProfilesConnector.cs     |  2 +
 .../Handlers/Profiles/UserProfilesHandlers.cs      | 53 ++++++++++++++++++++++
 2 files changed, 55 insertions(+)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs b/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
index 28dbbc2..6403882 100644
--- a/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
+++ b/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
@@ -104,6 +104,8 @@ namespace OpenSim.Server.Handlers.Profiles
             Server.AddJsonRPCHandler("avatar_properties_request", handler.AvatarPropertiesRequest);
             Server.AddJsonRPCHandler("avatar_properties_update", handler.AvatarPropertiesUpdate);
             Server.AddJsonRPCHandler("avatar_interests_update", handler.AvatarInterestsUpdate);
+            Server.AddJsonRPCHandler("user_preferences_update", handler.UserPreferenecesUpdate);
+            Server.AddJsonRPCHandler("user_preferences_request", handler.UserPreferencesRequest);
             Server.AddJsonRPCHandler("image_assets_request", handler.AvatarImageAssetsRequest);
             Server.AddJsonRPCHandler("user_data_request", handler.RequestUserAppData);
             Server.AddJsonRPCHandler("user_data_update", handler.UpdateUserAppData);
diff --git a/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs b/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs
index f5f0794..d30cc22 100644
--- a/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs
+++ b/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs
@@ -381,6 +381,59 @@ namespace OpenSim.Server.Handlers
         }
         #endregion Interests
 
+        #region User Preferences
+        public bool UserPreferencesRequest(OSDMap json, ref JsonRpcResponse response)
+        {
+            if(!json.ContainsKey("params"))
+            {
+                response.Error.Code = ErrorCode.ParseError;
+                m_log.DebugFormat ("User Preferences Request");
+                return false;
+            }
+
+            string result = string.Empty;
+            UserPreferences prefs = new UserPreferences();
+            object Prefs = (object)prefs;
+            OSD.DeserializeMembers(ref Prefs, (OSDMap)json["params"]);
+            if(Service.UserPreferencesRequest(ref prefs, ref result))
+            {
+                response.Result = OSD.SerializeMembers(prefs);
+                return true;
+            }
+            
+            response.Error.Code = ErrorCode.InternalError;
+            response.Error.Message = string.Format("{0}", result);
+            m_log.InfoFormat("[PROFILES]: User preferences request error - {0}", response.Error.Message);
+            return false;
+        }
+
+        public bool UserPreferenecesUpdate(OSDMap json, ref JsonRpcResponse response)
+        {
+            if(!json.ContainsKey("params"))
+            {
+                response.Error.Code = ErrorCode.ParseError;
+                response.Error.Message = "no parameters supplied";
+                m_log.DebugFormat ("User Preferences Update Request");
+                return false;
+            }
+            
+            string result = string.Empty;
+            UserPreferences prefs = new UserPreferences();
+            object Prefs = (object)prefs;
+            OSD.DeserializeMembers(ref Prefs, (OSDMap)json["params"]);
+            if(Service.UserPreferencesUpdate(ref prefs, ref result))
+            {
+                response.Result = OSD.SerializeMembers(prefs);
+                return true;
+            }
+            
+            response.Error.Code = ErrorCode.InternalError;
+            response.Error.Message = string.Format("{0}", result);
+            m_log.InfoFormat("[PROFILES]: User preferences update error - {0}", response.Error.Message);
+            return false;
+        }
+        #endregion User Preferences
+
         #region Utility
         public bool AvatarImageAssetsRequest(OSDMap json, ref JsonRpcResponse response)
         {
-- 
cgit v1.1


From 958a8f274b8a25703935ab4092f190e9d54b8559 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sat, 7 Dec 2013 01:29:15 +0000
Subject: Revert "Add support for user preferences (im via email)"

This reverts commit 1842388bb4dcf5ecd57732ffa877b6ca1a3dec7b.
---
 .../Handlers/Profiles/UserProfilesConnector.cs     |  2 -
 .../Handlers/Profiles/UserProfilesHandlers.cs      | 53 ----------------------
 2 files changed, 55 deletions(-)

(limited to 'OpenSim/Server')

diff --git a/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs b/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
index 6403882..28dbbc2 100644
--- a/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
+++ b/OpenSim/Server/Handlers/Profiles/UserProfilesConnector.cs
@@ -104,8 +104,6 @@ namespace OpenSim.Server.Handlers.Profiles
             Server.AddJsonRPCHandler("avatar_properties_request", handler.AvatarPropertiesRequest);
             Server.AddJsonRPCHandler("avatar_properties_update", handler.AvatarPropertiesUpdate);
             Server.AddJsonRPCHandler("avatar_interests_update", handler.AvatarInterestsUpdate);
-            Server.AddJsonRPCHandler("user_preferences_update", handler.UserPreferenecesUpdate);
-            Server.AddJsonRPCHandler("user_preferences_request", handler.UserPreferencesRequest);
             Server.AddJsonRPCHandler("image_assets_request", handler.AvatarImageAssetsRequest);
             Server.AddJsonRPCHandler("user_data_request", handler.RequestUserAppData);
             Server.AddJsonRPCHandler("user_data_update", handler.UpdateUserAppData);
diff --git a/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs b/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs
index d30cc22..f5f0794 100644
--- a/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs
+++ b/OpenSim/Server/Handlers/Profiles/UserProfilesHandlers.cs
@@ -381,59 +381,6 @@ namespace OpenSim.Server.Handlers
         }
         #endregion Interests
 
-        #region User Preferences
-        public bool UserPreferencesRequest(OSDMap json, ref JsonRpcResponse response)
-        {
-            if(!json.ContainsKey("params"))
-            {
-                response.Error.Code = ErrorCode.ParseError;
-                m_log.DebugFormat ("User Preferences Request");
-                return false;
-            }
-
-            string result = string.Empty;
-            UserPreferences prefs = new UserPreferences();
-            object Prefs = (object)prefs;
-            OSD.DeserializeMembers(ref Prefs, (OSDMap)json["params"]);
-            if(Service.UserPreferencesRequest(ref prefs, ref result))
-            {
-                response.Result = OSD.SerializeMembers(prefs);
-                return true;
-            }
-            
-            response.Error.Code = ErrorCode.InternalError;
-            response.Error.Message = string.Format("{0}", result);
-            m_log.InfoFormat("[PROFILES]: User preferences request error - {0}", response.Error.Message);
-            return false;
-        }
-
-        public bool UserPreferenecesUpdate(OSDMap json, ref JsonRpcResponse response)
-        {
-            if(!json.ContainsKey("params"))
-            {
-                response.Error.Code = ErrorCode.ParseError;
-                response.Error.Message = "no parameters supplied";
-                m_log.DebugFormat ("User Preferences Update Request");
-                return false;
-            }
-            
-            string result = string.Empty;
-            UserPreferences prefs = new UserPreferences();
-            object Prefs = (object)prefs;
-            OSD.DeserializeMembers(ref Prefs, (OSDMap)json["params"]);
-            if(Service.UserPreferencesUpdate(ref prefs, ref result))
-            {
-                response.Result = OSD.SerializeMembers(prefs);
-                return true;
-            }
-            
-            response.Error.Code = ErrorCode.InternalError;
-            response.Error.Message = string.Format("{0}", result);
-            m_log.InfoFormat("[PROFILES]: User preferences update error - {0}", response.Error.Message);
-            return false;
-        }
-        #endregion User Preferences
-
         #region Utility
         public bool AvatarImageAssetsRequest(OSDMap json, ref JsonRpcResponse response)
         {
-- 
cgit v1.1