From 651f9f47d0dec64e70bc257f4695313fad839b7a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 21 Dec 2011 14:56:38 -0800 Subject: HG: Verify that the user is local --- OpenSim/Services/HypergridService/UserAgentService.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index cdc560c..8538660 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs @@ -161,6 +161,14 @@ namespace OpenSim.Services.HypergridService { m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}", agentCircuit.firstname, agentCircuit.lastname, ((clientIP == null) ? "stored IP" : clientIP.Address.ToString()), gatekeeper.ServerURI); + + if (m_UserAccountService.GetUserAccount(UUID.Zero, agentCircuit.AgentID) == null) + { + m_log.WarnFormat("[USER AGENT SERVICE]: Someone attempted to lauch a foreign user from here {0} {1}", agentCircuit.firstname, agentCircuit.lastname); + reason = "Forbidden to launch your agents from here"; + return false; + } + // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination GridRegion region = new GridRegion(gatekeeper); region.ServerURI = gatekeeper.ServerURI; -- cgit v1.1 From 6b08c051a33d97d94d9c68d287926939f1a5d6b2 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Thu, 22 Dec 2011 15:31:51 -0800 Subject: Enables processing of hypergrid links through simiangrid services. Thanks otakup0pe --- .../SimianGrid/SimianGridServiceConnector.cs | 81 +++++++++++++++------- 1 file changed, 56 insertions(+), 25 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs index 918544f..67a65ff 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs @@ -341,26 +341,54 @@ namespace OpenSim.Services.Connectors.SimianGrid public List GetHyperlinks(UUID scopeID) { - // Hypergrid/linked regions are not supported - return new List(); + List foundRegions = new List(); + + NameValueCollection requestArgs = new NameValueCollection + { + { "RequestMethod", "GetScenes" }, + { "HyperGrid", "true" }, + { "Enabled", "1" } + }; + + OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs); + if (response["Success"].AsBoolean()) + { + // m_log.DebugFormat("[SIMIAN GRID CONNECTOR] found regions with name {0}",name); + + OSDArray array = response["Scenes"] as OSDArray; + if (array != null) + { + for (int i = 0; i < array.Count; i++) + { + GridRegion region = ResponseToGridRegion(array[i] as OSDMap); + if (region != null) + foundRegions.Add(region); + } + } + } + + return foundRegions; } - + public int GetRegionFlags(UUID scopeID, UUID regionID) { - const int REGION_ONLINE = 4; - NameValueCollection requestArgs = new NameValueCollection { { "RequestMethod", "GetScene" }, { "SceneID", regionID.ToString() } }; - // m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request region flags for {0}",regionID.ToString()); + m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request region flags for {0}",regionID.ToString()); OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs); if (response["Success"].AsBoolean()) { - return response["Enabled"].AsBoolean() ? REGION_ONLINE : 0; + OSDMap extraData = response["ExtraData"] as OSDMap; + int enabled = response["Enabled"].AsBoolean() ? (int) OpenSim.Data.RegionFlags.RegionOnline : 0; + int hypergrid = extraData["HyperGrid"].AsBoolean() ? (int) OpenSim.Data.RegionFlags.Hyperlink : 0; + int flags = enabled | hypergrid; + m_log.DebugFormat("[SGGC] enabled - {0} hg - {1} flags - {2}", enabled, hypergrid, flags); + return flags; } else { @@ -411,24 +439,27 @@ namespace OpenSim.Services.Connectors.SimianGrid Vector3d minPosition = response["MinPosition"].AsVector3d(); region.RegionLocX = (int)minPosition.X; region.RegionLocY = (int)minPosition.Y; - - Uri httpAddress = response["Address"].AsUri(); - region.ExternalHostName = httpAddress.Host; - region.HttpPort = (uint)httpAddress.Port; - - region.ServerURI = extraData["ServerURI"].AsString(); - - IPAddress internalAddress; - IPAddress.TryParse(extraData["InternalAddress"].AsString(), out internalAddress); - if (internalAddress == null) - internalAddress = IPAddress.Any; - - region.InternalEndPoint = new IPEndPoint(internalAddress, extraData["InternalPort"].AsInteger()); - region.TerrainImage = extraData["MapTexture"].AsUUID(); - region.Access = (byte)extraData["Access"].AsInteger(); - region.RegionSecret = extraData["RegionSecret"].AsString(); - region.EstateOwner = extraData["EstateOwner"].AsUUID(); - region.Token = extraData["Token"].AsString(); + + if ( ! extraData["HyperGrid"] ) { + Uri httpAddress = response["Address"].AsUri(); + region.ExternalHostName = httpAddress.Host; + region.HttpPort = (uint)httpAddress.Port; + + IPAddress internalAddress; + IPAddress.TryParse(extraData["InternalAddress"].AsString(), out internalAddress); + if (internalAddress == null) + internalAddress = IPAddress.Any; + + region.InternalEndPoint = new IPEndPoint(internalAddress, extraData["InternalPort"].AsInteger()); + region.TerrainImage = extraData["MapTexture"].AsUUID(); + region.Access = (byte)extraData["Access"].AsInteger(); + region.RegionSecret = extraData["RegionSecret"].AsString(); + region.EstateOwner = extraData["EstateOwner"].AsUUID(); + region.Token = extraData["Token"].AsString(); + region.ServerURI = extraData["ServerURI"].AsString(); + } else { + region.ServerURI = response["Address"]; + } return region; } -- cgit v1.1 From 26bb95fe3d5239c183bc3b312ef05e73fc06749c Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 23 Dec 2011 10:58:30 -0800 Subject: HG: AAdded a few missing /'s at the end of URLs --- OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs | 2 +- OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs | 2 ++ .../Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs index 7cfd6e8..ff1dd5f 100644 --- a/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs @@ -53,7 +53,7 @@ namespace OpenSim.Services.Connectors public virtual string Helo() { - HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI + "/helo"); + HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI + "/helo/"); // Eventually we need to switch to HEAD /* req.Method = "HEAD"; */ diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs index 9573e21..99523a1 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs @@ -86,6 +86,8 @@ namespace OpenSim.Services.Connectors.SimianGrid public SimianAssetServiceConnector(string url) { + if (!url.EndsWith("/") && !url.EndsWith("=")) + url = url + '/'; m_serverUrl = url; } diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs index 39df1f5..f828abb 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs @@ -92,7 +92,10 @@ namespace OpenSim.Services.Connectors.SimianGrid public SimianInventoryServiceConnector(string url) { + if (!url.EndsWith("/") && !url.EndsWith("=")) + url = url + '/'; m_serverUrl = url; + } public void Initialise(IConfigSource source) -- cgit v1.1 From b6cfe15c7c0b3697709179cbbf32818576919642 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 24 Dec 2011 07:44:26 -0800 Subject: HG: more / love for Xmas --- .../Connectors/Asset/HGAssetServiceConnector.cs | 21 +++++++++++++++-- .../Connectors/Hypergrid/HeloServiceConnector.cs | 27 ++++++++++++++++++++-- 2 files changed, 44 insertions(+), 4 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs index 5c31639..bb5d51f 100644 --- a/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs @@ -29,7 +29,9 @@ using log4net; using Nini.Config; using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Reflection; +using System.Web; using OpenSim.Framework; using OpenSim.Services.Interfaces; using OpenSim.Services.Connectors.Hypergrid; @@ -73,11 +75,26 @@ namespace OpenSim.Services.Connectors if (Uri.TryCreate(id, UriKind.Absolute, out assetUri) && assetUri.Scheme == Uri.UriSchemeHttp) { - url = "http://" + assetUri.Authority; - assetID = assetUri.LocalPath.Trim(new char[] {'/'}); + // Simian + if (assetUri.Query != string.Empty) + { + NameValueCollection qscoll = HttpUtility.ParseQueryString(assetUri.Query); + assetID = qscoll["id"]; + if (assetID != null) + url = id.Replace(assetID, ""); // Malformed again, as simian expects + else + url = id; // !!! best effort + } + else // robust + { + url = "http://" + assetUri.Authority; + assetID = assetUri.LocalPath.Trim(new char[] { '/' }); + } + return true; } + m_log.DebugFormat("[HG ASSET SERVICE]: Malformed URL {0}", id); return false; } diff --git a/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs index ff1dd5f..8ac89cc 100644 --- a/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs @@ -47,13 +47,36 @@ namespace OpenSim.Services.Connectors public HeloServicesConnector(string serverURI) { - m_ServerURI = serverURI.TrimEnd('/'); + if (!serverURI.EndsWith("=")) + m_ServerURI = serverURI.TrimEnd('/') + "/helo/"; + else + { + // Simian sends malformed urls like this: + // http://valley.virtualportland.org/simtest/Grid/?id= + // + try + { + Uri uri = new Uri(serverURI + "xxx"); + if (uri.Query == string.Empty) + m_ServerURI = serverURI.TrimEnd('/') + "/helo/"; + else + { + serverURI = serverURI + "xxx"; + m_ServerURI = serverURI.Replace("?" + uri.Query, ""); + m_ServerURI = m_ServerURI.TrimEnd('/') + "/helo/"; + } + } + catch (UriFormatException e) + { + m_log.WarnFormat("[HELO SERVICE]: Malformed URL {0}", serverURI); + } + } } public virtual string Helo() { - HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI + "/helo/"); + HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI); // Eventually we need to switch to HEAD /* req.Method = "HEAD"; */ -- cgit v1.1 From 70e36ee2b41da03e41b4f61ab348bc85bd872801 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 29 Dec 2011 12:17:58 -0800 Subject: HG: more adjustments for making HG Simian work. Added server_uri as new key on get_agent_home in UAS. --- OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs | 2 +- OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs index 8ac89cc..c030bca 100644 --- a/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs @@ -62,7 +62,7 @@ namespace OpenSim.Services.Connectors else { serverURI = serverURI + "xxx"; - m_ServerURI = serverURI.Replace("?" + uri.Query, ""); + m_ServerURI = serverURI.Replace(uri.Query, ""); m_ServerURI = m_ServerURI.TrimEnd('/') + "/helo/"; } } diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index 0c55c2e..57b6d16 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs @@ -334,6 +334,9 @@ namespace OpenSim.Services.Connectors.Hypergrid UInt32.TryParse((string)hash["http_port"], out p); region.HttpPort = p; } + if (hash.ContainsKey("server_uri") && hash["server_uri"] != null) + region.ServerURI = (string)hash["server_uri"]; + if (hash["internal_port"] != null) { int p = 0; -- cgit v1.1 From 42f5394677a0a033e501f343cc3ccf02627e09d8 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 29 Dec 2011 15:39:12 -0800 Subject: Added field LocalToGrid in UserAccount. Context: make HG work in Simian. --- OpenSim/Services/Interfaces/IUserAccountService.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs index 6cc8eb8..4f80549 100644 --- a/OpenSim/Services/Interfaces/IUserAccountService.cs +++ b/OpenSim/Services/Interfaces/IUserAccountService.cs @@ -37,11 +37,13 @@ namespace OpenSim.Services.Interfaces { public UserAccount() { + LocalToGrid = true; } public UserAccount(UUID principalID) { PrincipalID = principalID; + LocalToGrid = true; } /// @@ -70,6 +72,7 @@ namespace OpenSim.Services.Interfaces Email = email; ServiceURLs = new Dictionary(); Created = Util.UnixTimeSinceEpoch(); + LocalToGrid = true; } public UserAccount(UUID scopeID, UUID principalID, string firstName, string lastName, string email) @@ -81,6 +84,7 @@ namespace OpenSim.Services.Interfaces Email = email; ServiceURLs = new Dictionary(); Created = Util.UnixTimeSinceEpoch(); + LocalToGrid = true; } public string FirstName; @@ -91,6 +95,7 @@ namespace OpenSim.Services.Interfaces public int UserLevel; public int UserFlags; public string UserTitle; + public Boolean LocalToGrid; public Dictionary ServiceURLs; @@ -119,6 +124,8 @@ namespace OpenSim.Services.Interfaces UserFlags = Convert.ToInt32(kvp["UserFlags"].ToString()); if (kvp.ContainsKey("UserTitle")) UserTitle = kvp["UserTitle"].ToString(); + if (kvp.ContainsKey("LocalToGrid")) + Boolean.TryParse(kvp["LocalToGrid"].ToString(), out LocalToGrid); if (kvp.ContainsKey("Created")) Created = Convert.ToInt32(kvp["Created"].ToString()); @@ -152,6 +159,7 @@ namespace OpenSim.Services.Interfaces result["UserLevel"] = UserLevel.ToString(); result["UserFlags"] = UserFlags.ToString(); result["UserTitle"] = UserTitle; + result["LocalToGrid"] = LocalToGrid.ToString(); string str = string.Empty; foreach (KeyValuePair kvp in ServiceURLs) -- cgit v1.1 From 967ea519800a5a6b3bfba586172a218e545c2009 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Thu, 29 Dec 2011 16:37:16 -0800 Subject: Set the local grid flag in the user account through the simian connector This should make bi-directional hypergrid work. --- .../Connectors/SimianGrid/SimianUserAccountServiceConnector.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs index 91e2976..4350749 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs @@ -287,6 +287,10 @@ namespace OpenSim.Services.Connectors.SimianGrid account.UserFlags = response["UserFlags"].AsInteger(); account.UserLevel = response["AccessLevel"].AsInteger(); account.UserTitle = response["UserTitle"].AsString(); + account.LocalToGrid = true; + if (response.ContainsKey("LocalToGrid")) + account.LocalToGrid = (response["LocalToGrid"].AsString() == "true" ? true : false); + GetFirstLastName(response["Name"].AsString(), out account.FirstName, out account.LastName); // Cache the user account info -- cgit v1.1 From 5aad1f7afed9770b94b4cabdd2f681781a16d662 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 30 Dec 2011 10:40:57 -0800 Subject: Default LocalToGrid to true. Fixes minor bug introduced yesterday where old robust UserAccount service would result is LocalToGrid at the sim being false. --- OpenSim/Services/Interfaces/IUserAccountService.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs index 4f80549..1b85980 100644 --- a/OpenSim/Services/Interfaces/IUserAccountService.cs +++ b/OpenSim/Services/Interfaces/IUserAccountService.cs @@ -37,13 +37,11 @@ namespace OpenSim.Services.Interfaces { public UserAccount() { - LocalToGrid = true; } public UserAccount(UUID principalID) { PrincipalID = principalID; - LocalToGrid = true; } /// @@ -72,7 +70,6 @@ namespace OpenSim.Services.Interfaces Email = email; ServiceURLs = new Dictionary(); Created = Util.UnixTimeSinceEpoch(); - LocalToGrid = true; } public UserAccount(UUID scopeID, UUID principalID, string firstName, string lastName, string email) @@ -84,7 +81,6 @@ namespace OpenSim.Services.Interfaces Email = email; ServiceURLs = new Dictionary(); Created = Util.UnixTimeSinceEpoch(); - LocalToGrid = true; } public string FirstName; @@ -95,7 +91,7 @@ namespace OpenSim.Services.Interfaces public int UserLevel; public int UserFlags; public string UserTitle; - public Boolean LocalToGrid; + public Boolean LocalToGrid = true; public Dictionary ServiceURLs; -- cgit v1.1 From 5d8ed077bc01b46cdd4a6854cc08c735ebb66c24 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 30 Dec 2011 19:17:35 -0800 Subject: Bring back the Hyperlinker to the Robust console. Moved the config to [GridService]. Changed all HG-related .inis, including HyperSimianGrid. No changes in user-facing inis. --- OpenSim/Services/GridService/HypergridLinker.cs | 55 +++++++++++-------------- 1 file changed, 25 insertions(+), 30 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index 90c022f..78eab3d 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs @@ -102,50 +102,45 @@ namespace OpenSim.Services.GridService public HypergridLinker(IConfigSource config, GridService gridService, IRegionData db) { - IConfig modulesConfig = config.Configs["Modules"]; - if (modulesConfig == null) - return; - - if (modulesConfig.GetString("HypergridLinker", "") != "HypergridLinker") - return; + IConfig gridConfig = config.Configs["GridService"]; + if (gridConfig == null) + return; - m_log.DebugFormat("[HYPERGRID LINKER]: Starting with db {0}", db.GetType()); + if (!gridConfig.GetBoolean("HypergridLinker", false)) + return; m_Database = db; m_GridService = gridService; + m_log.DebugFormat("[HYPERGRID LINKER]: Starting with db {0}", db.GetType()); - IConfig gridConfig = config.Configs["GridService"]; - if (gridConfig != null) - { - string assetService = gridConfig.GetString("AssetService", string.Empty); + string assetService = gridConfig.GetString("AssetService", string.Empty); - Object[] args = new Object[] { config }; + Object[] args = new Object[] { config }; - if (assetService != string.Empty) - m_AssetService = ServerUtils.LoadPlugin(assetService, args); + if (assetService != string.Empty) + m_AssetService = ServerUtils.LoadPlugin(assetService, args); - string scope = gridConfig.GetString("ScopeID", string.Empty); - if (scope != string.Empty) - UUID.TryParse(scope, out m_ScopeID); + string scope = gridConfig.GetString("ScopeID", string.Empty); + if (scope != string.Empty) + UUID.TryParse(scope, out m_ScopeID); // m_Check4096 = gridConfig.GetBoolean("Check4096", true); - m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles"); + m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles"); - m_ThisGatekeeper = gridConfig.GetString("Gatekeeper", string.Empty); - try - { - m_ThisGatekeeperURI = new Uri(m_ThisGatekeeper); - } - catch - { - m_log.WarnFormat("[HYPERGRID LINKER]: Malformed URL in [GridService], variable Gatekeeper = {0}", m_ThisGatekeeper); - } + m_ThisGatekeeper = gridConfig.GetString("Gatekeeper", string.Empty); + try + { + m_ThisGatekeeperURI = new Uri(m_ThisGatekeeper); + } + catch + { + m_log.WarnFormat("[HYPERGRID LINKER]: Malformed URL in [GridService], variable Gatekeeper = {0}", m_ThisGatekeeper); + } - m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService); + m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService); - m_log.Debug("[HYPERGRID LINKER]: Loaded all services..."); - } + m_log.Debug("[HYPERGRID LINKER]: Loaded all services..."); if (!string.IsNullOrEmpty(m_MapTileDirectory)) { -- cgit v1.1 From 014a86c26b138e4fc861fd30634e866b83dbabdb Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 2 Jan 2012 19:46:30 +0000 Subject: Adding commented out log messages and some minor formatting for future bug hunting. No functional changes. --- OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs index fdab254..d7b2ff8 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs @@ -100,6 +100,8 @@ namespace OpenSim.Services.Connectors public AssetBase Get(string id) { +// m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Synchronous get request for {0}", id); + string uri = m_ServerURI + "/assets/" + id; AssetBase asset = null; @@ -119,6 +121,8 @@ namespace OpenSim.Services.Connectors public AssetBase GetCached(string id) { +// m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Cache request for {0}", id); + if (m_Cache != null) return m_Cache.Get(id); @@ -177,6 +181,8 @@ namespace OpenSim.Services.Connectors public bool Get(string id, Object sender, AssetRetrieved handler) { +// m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Potentially asynchronous get request for {0}", id); + string uri = m_ServerURI + "/assets/" + id; AssetBase asset = null; -- cgit v1.1 From 6941058824e418bcdc2932c35f226bbcc5cea2ad Mon Sep 17 00:00:00 2001 From: BlueWall Date: Sun, 1 Jan 2012 14:57:13 -0500 Subject: Profile Updates Update basic profile to use the replaceable interface, making configuration less error-prone. Add support to query avatar's home user account and profile service for regions usng the updated OpenProfileModule with Hypergrid. --- .../Hypergrid/UserAgentServiceConnector.cs | 54 ++++++++++++++++++++++ .../Services/HypergridService/UserAgentService.cs | 25 ++++++++++ OpenSim/Services/Interfaces/IHypergridServices.cs | 1 + 3 files changed, 80 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index 57b6d16..5b27cf6 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs @@ -561,6 +561,60 @@ namespace OpenSim.Services.Connectors.Hypergrid return online; } + public Dictionary GetUserInfo (UUID userID) + { + Hashtable hash = new Hashtable(); + hash["userID"] = userID.ToString(); + + IList paramList = new ArrayList(); + paramList.Add(hash); + + XmlRpcRequest request = new XmlRpcRequest("get_user_info", paramList); + + Dictionary info = new Dictionary(); + XmlRpcResponse response = null; + try + { + response = request.Send(m_ServerURL, 10000); + } + catch + { + m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0} for GetUserInfo", m_ServerURL); + return info; + } + + if (response.IsFault) + { + m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} for GetServerURLs returned an error: {1}", m_ServerURL, response.FaultString); + return info; + } + + hash = (Hashtable)response.Value; + try + { + if (hash == null) + { + m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetUserInfo Got null response from {0}! THIS IS BAAAAD", m_ServerURL); + return info; + } + + // Here is the actual response + foreach (object key in hash.Keys) + { + if (hash[key] != null) + { + info.Add(key.ToString(), hash[key]); + } + } + } + catch + { + m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetOnlineFriends response."); + } + + return info; + } + public Dictionary GetServerURLs(UUID userID) { Hashtable hash = new Hashtable(); diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index 8538660..f681df4 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs @@ -488,6 +488,31 @@ namespace OpenSim.Services.HypergridService return online; } + public Dictionary GetUserInfo(UUID userID) + { + Dictionary info = new Dictionary(); + + if (m_UserAccountService == null) + { + m_log.WarnFormat("[USER AGENT SERVICE]: Unable to get user flags because user account service is missing"); + info["result"] = "fail"; + info["message"] = "UserAccountService is missing!"; + return info; + } + + UserAccount account = m_UserAccountService.GetUserAccount(UUID.Zero /*!!!*/, userID); + + if (account != null) + { + info.Add("user_flags", (object)account.UserFlags); + info.Add("user_created", (object)account.Created); + info.Add("user_title", (object)account.UserTitle); + info.Add("result", "success"); + } + + return info; + } + public Dictionary GetServerURLs(UUID userID) { if (m_UserAccountService == null) diff --git a/OpenSim/Services/Interfaces/IHypergridServices.cs b/OpenSim/Services/Interfaces/IHypergridServices.cs index e86ec51..5b293ac 100644 --- a/OpenSim/Services/Interfaces/IHypergridServices.cs +++ b/OpenSim/Services/Interfaces/IHypergridServices.cs @@ -55,6 +55,7 @@ namespace OpenSim.Services.Interfaces void LogoutAgent(UUID userID, UUID sessionID); GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt); Dictionary GetServerURLs(UUID userID); + Dictionary GetUserInfo(UUID userID); string LocateUser(UUID userID); // Tries to get the universal user identifier for the targetUserId -- cgit v1.1