From d6deebdd63d16f04a643b1bc26c4ccc4e59f68b7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 3 Sep 2010 21:34:31 +0100 Subject: Add another variant of password hash construction to SimianAuthenticationServiceConnector.CheckPassword() This might be unique to the inventory archiver password check, though at the time it was written, hash construction there should have been identical to other parts of opensim This is from patch http://opensimulator.org/mantis/view.php?id=4983. Thanks cmickeyb. --- .../Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs index 7a96a05..9c4718e 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -253,7 +253,8 @@ namespace OpenSim.Services.Connectors.SimianGrid if (password == simianGridCredential || "$1$" + password == simianGridCredential || "$1$" + Utils.MD5String(password) == simianGridCredential || - Utils.MD5String(password) == simianGridCredential) + Utils.MD5String(password) == simianGridCredential || + "$1$" + Utils.MD5String(password + ":") == simianGridCredential) { authorizeResult = Authorize(userID); return true; -- cgit v1.1 From 4f79143f3f058b0570c073b668f4ea088e541a43 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Fri, 3 Sep 2010 13:36:35 -0700 Subject: * Removed Simian.IsSimianEnabled() call, changed the SimianGrid connectors to handle initialization as graceful as possible with the current broken way region module initialization is done * Added config-include/HyperSimianGrid.ini option for connecting to SimianGrid with HyperGrid enabled (work in progress on the SimianGrid side) --- .../SimianGrid/SimianAssetServiceConnector.cs | 25 +++++------- .../SimianAuthenticationServiceConnector.cs | 24 +++++------- .../SimianGrid/SimianAvatarServiceConnector.cs | 25 +++++------- .../Services/Connectors/SimianGrid/SimianGrid.cs | 14 ------- .../SimianGrid/SimianGridServiceConnector.cs | 22 +++++------ .../SimianGrid/SimianInventoryServiceConnector.cs | 44 +++++++++------------- .../SimianGrid/SimianPresenceServiceConnector.cs | 22 +++++------ .../Connectors/SimianGrid/SimianProfiles.cs | 42 +++++---------------- .../SimianUserAccountServiceConnector.cs | 25 +++++------- 9 files changed, 83 insertions(+), 160 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs index 616b5a7..3a4f84f 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs @@ -85,27 +85,20 @@ namespace OpenSim.Services.Connectors.SimianGrid public void Initialise(IConfigSource source) { - if (Simian.IsSimianEnabled(source, "AssetServices", this.Name)) + IConfig gridConfig = source.Configs["AssetService"]; + if (gridConfig != null) { - IConfig gridConfig = source.Configs["AssetService"]; - if (gridConfig == null) - { - m_log.Error("[SIMIAN ASSET CONNECTOR]: AssetService missing from OpenSim.ini"); - throw new Exception("Asset connector init error"); - } - string serviceUrl = gridConfig.GetString("AssetServerURI"); - if (String.IsNullOrEmpty(serviceUrl)) + if (!String.IsNullOrEmpty(serviceUrl)) { - m_log.Error("[SIMIAN ASSET CONNECTOR]: No AssetServerURI in section AssetService"); - throw new Exception("Asset connector init error"); + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; } - - if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) - serviceUrl = serviceUrl + '/'; - - m_serverUrl = serviceUrl; } + + if (String.IsNullOrEmpty(m_serverUrl)) + m_log.Info("[SIMIAN ASSET CONNECTOR]: No AssetServerURI specified, disabling connector"); } #region IAssetService diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs index 7a96a05..7f48bbd 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs @@ -73,24 +73,20 @@ namespace OpenSim.Services.Connectors.SimianGrid public void Initialise(IConfigSource source) { - if (Simian.IsSimianEnabled(source, "AuthenticationServices", this.Name)) + IConfig gridConfig = source.Configs["AuthenticationService"]; + if (gridConfig != null) { - IConfig assetConfig = source.Configs["AuthenticationService"]; - if (assetConfig == null) + string serviceUrl = gridConfig.GetString("AuthenticationServerURI"); + if (!String.IsNullOrEmpty(serviceUrl)) { - m_log.Error("[SIMIAN AUTH CONNECTOR]: AuthenticationService missing from OpenSim.ini"); - throw new Exception("Authentication connector init error"); + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; } - - string serviceURI = assetConfig.GetString("AuthenticationServerURI"); - if (String.IsNullOrEmpty(serviceURI)) - { - m_log.Error("[SIMIAN AUTH CONNECTOR]: No Server URI named in section AuthenticationService"); - throw new Exception("Authentication connector init error"); - } - - m_serverUrl = serviceURI; } + + if (String.IsNullOrEmpty(m_serverUrl)) + m_log.Info("[SIMIAN AUTH CONNECTOR]: No AuthenticationServerURI specified, disabling connector"); } public string Authenticate(UUID principalID, string password, int lifetime) diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs index 734bdd2..c2e20a3 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs @@ -78,27 +78,20 @@ namespace OpenSim.Services.Connectors.SimianGrid public void Initialise(IConfigSource source) { - if (Simian.IsSimianEnabled(source, "AvatarServices", this.Name)) + IConfig gridConfig = source.Configs["AvatarService"]; + if (gridConfig != null) { - IConfig gridConfig = source.Configs["AvatarService"]; - if (gridConfig == null) - { - m_log.Error("[SIMIAN AVATAR CONNECTOR]: AvatarService missing from OpenSim.ini"); - throw new Exception("Avatar connector init error"); - } - string serviceUrl = gridConfig.GetString("AvatarServerURI"); - if (String.IsNullOrEmpty(serviceUrl)) + if (!String.IsNullOrEmpty(serviceUrl)) { - m_log.Error("[SIMIAN AVATAR CONNECTOR]: No AvatarServerURI in section AvatarService"); - throw new Exception("Avatar connector init error"); + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; } - - if (!serviceUrl.EndsWith("/")) - serviceUrl = serviceUrl + '/'; - - m_serverUrl = serviceUrl; } + + if (String.IsNullOrEmpty(m_serverUrl)) + m_log.Info("[SIMIAN AVATAR CONNECTOR]: No AvatarServerURI specified, disabling connector"); } #region IAvatarService diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGrid.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGrid.cs index 7d97aaa..847319c 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianGrid.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianGrid.cs @@ -31,17 +31,3 @@ using Nini.Config; [assembly: Addin("SimianGrid", "1.0")] [assembly: AddinDependency("OpenSim", "0.5")] - -public static class Simian -{ - public static bool IsSimianEnabled(IConfigSource config, string moduleName, string connectorName) - { - if (config.Configs["Modules"] != null) - { - string module = config.Configs["Modules"].GetString(moduleName); - return !String.IsNullOrEmpty(module) && module.EndsWith(connectorName); - } - - return false; - } -} \ No newline at end of file diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs index fefdad6..9d67ccb 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs @@ -98,24 +98,20 @@ namespace OpenSim.Services.Connectors.SimianGrid public void Initialise(IConfigSource source) { - if (Simian.IsSimianEnabled(source, "GridServices", this.Name)) + IConfig gridConfig = source.Configs["GridService"]; + if (gridConfig != null) { - IConfig gridConfig = source.Configs["GridService"]; - if (gridConfig == null) - { - m_log.Error("[SIMIAN GRID CONNECTOR]: GridService missing from OpenSim.ini"); - throw new Exception("Grid connector init error"); - } - string serviceUrl = gridConfig.GetString("GridServerURI"); - if (String.IsNullOrEmpty(serviceUrl)) + if (!String.IsNullOrEmpty(serviceUrl)) { - m_log.Error("[SIMIAN GRID CONNECTOR]: No Server URI named in section GridService"); - throw new Exception("Grid connector init error"); + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; } - - m_serverUrl = serviceUrl; } + + if (String.IsNullOrEmpty(m_serverUrl)) + m_log.Info("[SIMIAN GRID CONNECTOR]: No GridServerURI specified, disabling connector"); } #region IGridService diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs index 89c1a5a..63aaad7 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs @@ -92,38 +92,30 @@ namespace OpenSim.Services.Connectors.SimianGrid public void Initialise(IConfigSource source) { - if (Simian.IsSimianEnabled(source, "InventoryServices", this.Name)) + IConfig gridConfig = source.Configs["InventoryService"]; + if (gridConfig != null) { - IConfig gridConfig = source.Configs["InventoryService"]; - if (gridConfig == null) - { - m_log.Error("[SIMIAN INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini"); - throw new Exception("Inventory connector init error"); - } - string serviceUrl = gridConfig.GetString("InventoryServerURI"); - if (String.IsNullOrEmpty(serviceUrl)) + if (!String.IsNullOrEmpty(serviceUrl)) { - m_log.Error("[SIMIAN INVENTORY CONNECTOR]: No Server URI named in section InventoryService"); - throw new Exception("Inventory connector init error"); - } + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; - m_serverUrl = serviceUrl; - - gridConfig = source.Configs["UserAccountService"]; - if (gridConfig != null) - { - serviceUrl = gridConfig.GetString("UserAccountServerURI"); - if (!String.IsNullOrEmpty(serviceUrl)) - m_userServerUrl = serviceUrl; - else - m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No Server URI named in section UserAccountService"); - } - else - { - m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: UserAccountService missing from OpenSim.ini"); + gridConfig = source.Configs["UserAccountService"]; + if (gridConfig != null) + { + serviceUrl = gridConfig.GetString("UserAccountServerURI"); + if (!String.IsNullOrEmpty(serviceUrl)) + m_userServerUrl = serviceUrl; + } } } + + if (String.IsNullOrEmpty(m_serverUrl)) + m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No InventoryServerURI specified, disabling connector"); + else if (String.IsNullOrEmpty(m_userServerUrl)) + m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No UserAccountServerURI specified, disabling connector"); } /// diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs index ca23e27..778f3f4 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs @@ -103,24 +103,20 @@ namespace OpenSim.Services.Connectors.SimianGrid public void Initialise(IConfigSource source) { - if (Simian.IsSimianEnabled(source, "PresenceServices", this.Name)) + IConfig gridConfig = source.Configs["PresenceService"]; + if (gridConfig != null) { - IConfig gridConfig = source.Configs["PresenceService"]; - if (gridConfig == null) - { - m_log.Error("[SIMIAN PRESENCE CONNECTOR]: PresenceService missing from OpenSim.ini"); - throw new Exception("Presence connector init error"); - } - string serviceUrl = gridConfig.GetString("PresenceServerURI"); - if (String.IsNullOrEmpty(serviceUrl)) + if (!String.IsNullOrEmpty(serviceUrl)) { - m_log.Error("[SIMIAN PRESENCE CONNECTOR]: No PresenceServerURI in section PresenceService"); - throw new Exception("Presence connector init error"); + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; } - - m_serverUrl = serviceUrl; } + + if (String.IsNullOrEmpty(m_serverUrl)) + m_log.Info("[SIMIAN PRESENCE CONNECTOR]: No PresenceServerURI specified, disabling connector"); } #region IPresenceService diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs index d30d880..a817d7c 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs @@ -88,44 +88,20 @@ namespace OpenSim.Services.Connectors.SimianGrid public void Initialise(IConfigSource source) { - if (Simian.IsSimianEnabled(source, "UserAccountServices", "SimianUserAccountServiceConnector")) + IConfig gridConfig = source.Configs["UserAccountService"]; + if (gridConfig != null) { - IConfig gridConfig = source.Configs["UserAccountService"]; - if (gridConfig == null) - { - m_log.Error("[SIMIAN PROFILES]: UserAccountService missing from OpenSim.ini"); - throw new Exception("Profiles init error"); - } - string serviceUrl = gridConfig.GetString("UserAccountServerURI"); - if (String.IsNullOrEmpty(serviceUrl)) - { - m_log.Error("[SIMIAN PROFILES]: No UserAccountServerURI in section UserAccountService"); - throw new Exception("Profiles init error"); - } - - if (!serviceUrl.EndsWith("/")) - serviceUrl = serviceUrl + '/'; - - m_serverUrl = serviceUrl; - IConfig profilesConfig = source.Configs["Profiles"]; - if (profilesConfig == null) + if (!String.IsNullOrEmpty(serviceUrl)) { - // Do not run this module by default. - return; - } - else - { - // if profiles aren't enabled, we're not needed. - // if we're not specified as the connector to use, then we're not wanted - if (profilesConfig.GetString("Module", String.Empty) != Name) - { - - return; - } - m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Initializing {0}", this.Name); + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; } } + + if (String.IsNullOrEmpty(m_serverUrl)) + m_log.Info("[SIMIAN PROFILES]: No UserAccountServerURI specified, disabling connector"); } private void ClientConnectHandler(IClientCore clientCore) diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs index 56c73ec..4c8662f 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs @@ -77,25 +77,20 @@ namespace OpenSim.Services.Connectors.SimianGrid public void Initialise(IConfigSource source) { - if (Simian.IsSimianEnabled(source, "UserAccountServices", this.Name)) + IConfig gridConfig = source.Configs["UserAccountService"]; + if (gridConfig != null) { - IConfig assetConfig = source.Configs["UserAccountService"]; - if (assetConfig == null) + string serviceUrl = gridConfig.GetString("UserAccountServerURI"); + if (!String.IsNullOrEmpty(serviceUrl)) { - m_log.Error("[SIMIAN ACCOUNT CONNECTOR]: UserAccountService missing from OpenSim.ini"); - throw new Exception("User account connector init error"); + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; } - - string serviceURI = assetConfig.GetString("UserAccountServerURI"); - if (String.IsNullOrEmpty(serviceURI)) - { - m_log.Error("[SIMIAN ACCOUNT CONNECTOR]: No UserAccountServerURI in section UserAccountService, skipping SimianUserAccountServiceConnector"); - throw new Exception("User account connector init error"); - } - - m_accountCache = new ExpiringCache(); - m_serverUrl = serviceURI; } + + if (String.IsNullOrEmpty(m_serverUrl)) + m_log.Info("[SIMIAN ACCOUNT CONNECTOR]: No UserAccountServerURI specified, disabling connector"); } public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName) -- cgit v1.1 From fe63fad394b89314777f2c2713c349b3a3017256 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 3 Sep 2010 22:26:15 +0100 Subject: minor: remove mono compiler warning --- OpenSim/Services/InventoryService/HGInventoryService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/InventoryService/HGInventoryService.cs b/OpenSim/Services/InventoryService/HGInventoryService.cs index 6e6b019..d62c008 100644 --- a/OpenSim/Services/InventoryService/HGInventoryService.cs +++ b/OpenSim/Services/InventoryService/HGInventoryService.cs @@ -44,7 +44,7 @@ namespace OpenSim.Services.InventoryService LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); - protected IXInventoryData m_Database; + protected new IXInventoryData m_Database; public HGInventoryService(IConfigSource config) : base(config) -- cgit v1.1 From fc062a23afab6d5391960240da3953a5865cc12d Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Fri, 3 Sep 2010 14:50:26 -0700 Subject: Make SimianFriendsServiceConnector initialize like the other connectors and gracefully handle the case where it is loaded but disabled #monoaddinslol --- .../SimianGrid/SimianFriendsServiceConnector.cs | 41 ++++++++++------------ 1 file changed, 19 insertions(+), 22 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs index 89f3594..1afb1e1 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs @@ -76,38 +76,29 @@ namespace OpenSim.Services.Connectors.SimianGrid public void Initialise(IConfigSource source) { - bool isSimianEnabled = false; - - if (source.Configs["Friends"] != null) - { - string module = source.Configs["Friends"].GetString("Connector"); - isSimianEnabled = !String.IsNullOrEmpty(module) && module.EndsWith(this.Name); - } - - if (isSimianEnabled) + IConfig gridConfig = source.Configs["FriendsService"]; + if (gridConfig != null) { - IConfig assetConfig = source.Configs["FriendsService"]; - if (assetConfig == null) - { - m_log.Error("[SIMIAN FRIENDS CONNECTOR]: FriendsService missing from OpenSim.ini"); - throw new Exception("Friends connector init error"); - } - - string serviceURI = assetConfig.GetString("FriendsServerURI"); - if (String.IsNullOrEmpty(serviceURI)) + string serviceUrl = gridConfig.GetString("FriendsServerURI"); + if (!String.IsNullOrEmpty(serviceUrl)) { - m_log.Error("[SIMIAN FRIENDS CONNECTOR]: No Server URI named in section FriendsService"); - throw new Exception("Friends connector init error"); + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; } - - m_serverUrl = serviceURI; } + + if (String.IsNullOrEmpty(m_serverUrl)) + m_log.Info("[SIMIAN FRIENDS CONNECTOR]: No FriendsServerURI specified, disabling connector"); } #region IFriendsService public FriendInfo[] GetFriends(UUID principalID) { + if (String.IsNullOrEmpty(m_serverUrl)) + return new FriendInfo[0]; + Dictionary friends = new Dictionary(); OSDArray friendsArray = GetFriended(principalID); @@ -156,6 +147,9 @@ namespace OpenSim.Services.Connectors.SimianGrid public bool StoreFriend(UUID principalID, string friend, int flags) { + if (String.IsNullOrEmpty(m_serverUrl)) + return true; + NameValueCollection requestArgs = new NameValueCollection { { "RequestMethod", "AddGeneric" }, @@ -176,6 +170,9 @@ namespace OpenSim.Services.Connectors.SimianGrid public bool Delete(UUID principalID, string friend) { + if (String.IsNullOrEmpty(m_serverUrl)) + return true; + NameValueCollection requestArgs = new NameValueCollection { { "RequestMethod", "RemoveGeneric" }, -- cgit v1.1 From 8fc68c6d9810a0d229e94a0cefb35086c65dec36 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 3 Sep 2010 17:18:53 -0700 Subject: Added XFF header processing. Untested, for lack of proxy. --- OpenSim/Services/LLLoginService/LLLoginService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index b740297..3f9bc19 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -104,7 +104,7 @@ namespace OpenSim.Services.LLLoginService m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty); m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty); m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty); - + // These are required; the others aren't if (accountService == string.Empty || authService == string.Empty) throw new Exception("LoginService is missing service specifications"); -- cgit v1.1 From 9fd98368416ce9514e0926301a1fc20648d9ad59 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 4 Sep 2010 16:39:03 -0700 Subject: Make User Agent Service and Login Service separable. --- .../Hypergrid/UserAgentServiceConnector.cs | 42 ++++++++++++++++------ 1 file changed, 32 insertions(+), 10 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index 7fa086a..5d29087 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs @@ -70,16 +70,29 @@ namespace OpenSim.Services.Connectors.Hypergrid public UserAgentServiceConnector(IConfigSource config) { - } + IConfig serviceConfig = config.Configs["UserAgentService"]; + if (serviceConfig == null) + { + m_log.Error("[USER AGENT CONNECTOR]: UserAgentService missing from ini"); + throw new Exception("UserAgent connector init error"); + } - public bool LoginAgentToGrid(AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, IPEndPoint ipaddress, out string reason) - { - // not available over remote calls - reason = "Method not available over remote calls"; - return false; + string serviceURI = serviceConfig.GetString("UserAgentServerURI", + String.Empty); + + if (serviceURI == String.Empty) + { + m_log.Error("[USER AGENT CONNECTOR]: No Server URI named in section UserAgentService"); + throw new Exception("UserAgent connector init error"); + } + m_ServerURL = serviceURI; + + m_log.DebugFormat("[USER AGENT CONNECTOR]: UserAgentServiceConnector started for {0}", m_ServerURL); } - public bool LoginAgentToGrid(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, out string reason) + + // The Login service calls this interface with a non-null [client] ipaddress + public bool LoginAgentToGrid(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, IPEndPoint ipaddress, out string reason) { reason = String.Empty; @@ -90,7 +103,7 @@ namespace OpenSim.Services.Connectors.Hypergrid return false; } - string uri = m_ServerURL + "/homeagent/" + aCircuit.AgentID + "/"; + string uri = m_ServerURL + "/homeagent/" + aCircuit.AgentID + "/"; Console.WriteLine(" >>> LoginAgentToGrid <<< " + uri); @@ -102,7 +115,7 @@ namespace OpenSim.Services.Connectors.Hypergrid //AgentCreateRequest.Headers.Add("Authorization", authKey); // Fill it in - OSDMap args = PackCreateAgentArguments(aCircuit, gatekeeper, destination); + OSDMap args = PackCreateAgentArguments(aCircuit, gatekeeper, destination, ipaddress); string strBuffer = ""; byte[] buffer = new byte[1]; @@ -199,7 +212,14 @@ namespace OpenSim.Services.Connectors.Hypergrid } - protected OSDMap PackCreateAgentArguments(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination) + + // The simulators call this interface + public bool LoginAgentToGrid(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, out string reason) + { + return LoginAgentToGrid(aCircuit, gatekeeper, destination, null, out reason); + } + + protected OSDMap PackCreateAgentArguments(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, IPEndPoint ipaddress) { OSDMap args = null; try @@ -217,6 +237,8 @@ namespace OpenSim.Services.Connectors.Hypergrid args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString()); args["destination_name"] = OSD.FromString(destination.RegionName); args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); + if (ipaddress != null) + args["client_ip"] = OSD.FromString(ipaddress.Address.ToString()); return args; } -- cgit v1.1 From 953a487f5e18a293acf59bfd590e1f03203494ec Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 4 Sep 2010 18:09:17 -0700 Subject: One more debug message to track an issue on Danger grid. --- OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index 5d29087..6d3c64a 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs @@ -66,6 +66,7 @@ namespace OpenSim.Services.Connectors.Hypergrid { m_log.DebugFormat("[USER AGENT CONNECTOR]: Malformed Uri {0}: {1}", m_ServerURL, e.Message); } + m_log.DebugFormat("[USER AGENT CONNECTOR]: new connector to {0} ({1})", url, m_ServerURL); } public UserAgentServiceConnector(IConfigSource config) -- cgit v1.1