From 08dc07dc7691ce8ee3c81528bb45b9fdfc603a68 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 13 Jul 2011 00:48:36 +0100 Subject: refactor: Move all callers of the obsoleted SychronousRestObjectPoster.BeginPostObject() to the identical SynchronousRestObjectRequester.MakeRequest() --- OpenSim/Services/HypergridService/HGInstantMessageService.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/HypergridService/HGInstantMessageService.cs b/OpenSim/Services/HypergridService/HGInstantMessageService.cs index ded589d..bb31fc9 100644 --- a/OpenSim/Services/HypergridService/HGInstantMessageService.cs +++ b/OpenSim/Services/HypergridService/HGInstantMessageService.cs @@ -326,7 +326,6 @@ namespace OpenSim.Services.HypergridService // This is recursive!!!!! return TrySendInstantMessage(im, url, false, foreigner); } - } private bool UndeliveredMessage(GridInstantMessage im) @@ -335,15 +334,14 @@ namespace OpenSim.Services.HypergridService && (!im.fromGroup || (im.fromGroup && m_ForwardOfflineGroupMessages))) { m_log.DebugFormat("[HG IM SERVICE]: Message saved"); - return SynchronousRestObjectPoster.BeginPostObject( - "POST", m_RestURL + "/SaveMessage/", im); + return SynchronousRestObjectRequester.MakeRequest( + "POST", m_RestURL + "/SaveMessage/", im); } - else { return false; } } } -} +} \ No newline at end of file -- cgit v1.1 From 61798793086e29eecca495b0163124fe51f1ba3c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 16 Jul 2011 01:53:25 +0100 Subject: minor: remove mono compiler warnings --- .../Hypergrid/UserAgentServiceConnector.cs | 71 +++++++++++----------- 1 file changed, 36 insertions(+), 35 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index 6265bcd..08a3876 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs @@ -244,6 +244,7 @@ namespace OpenSim.Services.Connectors.Hypergrid { m_log.Debug("[USER AGENT CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message); } + // Add the input arguments args["gatekeeper_serveruri"] = OSD.FromString(gatekeeper.ServerURI); args["gatekeeper_host"] = OSD.FromString(gatekeeper.ExternalHostName); @@ -429,7 +430,7 @@ namespace OpenSim.Services.Connectors.Hypergrid paramList.Add(hash); XmlRpcRequest request = new XmlRpcRequest("status_notification", paramList); - string reason = string.Empty; +// string reason = string.Empty; // Send and get reply List friendsOnline = new List(); @@ -438,17 +439,17 @@ namespace OpenSim.Services.Connectors.Hypergrid { response = request.Send(m_ServerURL, 6000); } - catch (Exception e) + catch { m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0}", m_ServerURL); - reason = "Exception: " + e.Message; +// reason = "Exception: " + e.Message; return friendsOnline; } if (response.IsFault) { m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString); - reason = "XMLRPC Fault"; +// reason = "XMLRPC Fault"; return friendsOnline; } @@ -460,7 +461,7 @@ namespace OpenSim.Services.Connectors.Hypergrid if (hash == null) { m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetOnlineFriends Got null response from {0}! THIS IS BAAAAD", m_ServerURL); - reason = "Internal error 1"; +// reason = "Internal error 1"; return friendsOnline; } @@ -476,10 +477,10 @@ namespace OpenSim.Services.Connectors.Hypergrid } } - catch (Exception e) + catch { m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetOnlineFriends response."); - reason = "Exception: " + e.Message; +// reason = "Exception: " + e.Message; } return friendsOnline; @@ -500,7 +501,7 @@ namespace OpenSim.Services.Connectors.Hypergrid paramList.Add(hash); XmlRpcRequest request = new XmlRpcRequest("get_online_friends", paramList); - string reason = string.Empty; +// string reason = string.Empty; // Send and get reply List online = new List(); @@ -509,17 +510,17 @@ namespace OpenSim.Services.Connectors.Hypergrid { response = request.Send(m_ServerURL, 10000); } - catch (Exception e) + catch { m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0}", m_ServerURL); - reason = "Exception: " + e.Message; +// reason = "Exception: " + e.Message; return online; } if (response.IsFault) { m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString); - reason = "XMLRPC Fault"; +// reason = "XMLRPC Fault"; return online; } @@ -531,7 +532,7 @@ namespace OpenSim.Services.Connectors.Hypergrid if (hash == null) { m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetOnlineFriends Got null response from {0}! THIS IS BAAAAD", m_ServerURL); - reason = "Internal error 1"; +// reason = "Internal error 1"; return online; } @@ -547,10 +548,10 @@ namespace OpenSim.Services.Connectors.Hypergrid } } - catch (Exception e) + catch { m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetOnlineFriends response."); - reason = "Exception: " + e.Message; +// reason = "Exception: " + e.Message; } return online; @@ -565,7 +566,7 @@ namespace OpenSim.Services.Connectors.Hypergrid paramList.Add(hash); XmlRpcRequest request = new XmlRpcRequest("get_server_urls", paramList); - string reason = string.Empty; +// string reason = string.Empty; // Send and get reply Dictionary serverURLs = new Dictionary(); @@ -574,17 +575,17 @@ namespace OpenSim.Services.Connectors.Hypergrid { response = request.Send(m_ServerURL, 10000); } - catch (Exception e) + catch { m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0}", m_ServerURL); - reason = "Exception: " + e.Message; +// reason = "Exception: " + e.Message; return serverURLs; } if (response.IsFault) { m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString); - reason = "XMLRPC Fault"; +// reason = "XMLRPC Fault"; return serverURLs; } @@ -596,7 +597,7 @@ namespace OpenSim.Services.Connectors.Hypergrid if (hash == null) { m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetServerURLs Got null response from {0}! THIS IS BAAAAD", m_ServerURL); - reason = "Internal error 1"; +// reason = "Internal error 1"; return serverURLs; } @@ -611,10 +612,10 @@ namespace OpenSim.Services.Connectors.Hypergrid } } - catch (Exception e) + catch { m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetOnlineFriends response."); - reason = "Exception: " + e.Message; +// reason = "Exception: " + e.Message; } return serverURLs; @@ -629,7 +630,7 @@ namespace OpenSim.Services.Connectors.Hypergrid paramList.Add(hash); XmlRpcRequest request = new XmlRpcRequest("locate_user", paramList); - string reason = string.Empty; +// string reason = string.Empty; // Send and get reply string url = string.Empty; @@ -638,17 +639,17 @@ namespace OpenSim.Services.Connectors.Hypergrid { response = request.Send(m_ServerURL, 10000); } - catch (Exception e) + catch { m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0}", m_ServerURL); - reason = "Exception: " + e.Message; +// reason = "Exception: " + e.Message; return url; } if (response.IsFault) { m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString); - reason = "XMLRPC Fault"; +// reason = "XMLRPC Fault"; return url; } @@ -660,7 +661,7 @@ namespace OpenSim.Services.Connectors.Hypergrid if (hash == null) { m_log.ErrorFormat("[USER AGENT CONNECTOR]: LocateUser Got null response from {0}! THIS IS BAAAAD", m_ServerURL); - reason = "Internal error 1"; +// reason = "Internal error 1"; return url; } @@ -669,10 +670,10 @@ namespace OpenSim.Services.Connectors.Hypergrid url = hash["URL"].ToString(); } - catch (Exception e) + catch { m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on LocateUser response."); - reason = "Exception: " + e.Message; +// reason = "Exception: " + e.Message; } return url; @@ -688,7 +689,7 @@ namespace OpenSim.Services.Connectors.Hypergrid paramList.Add(hash); XmlRpcRequest request = new XmlRpcRequest("get_uui", paramList); - string reason = string.Empty; +// string reason = string.Empty; // Send and get reply string uui = string.Empty; @@ -697,17 +698,17 @@ namespace OpenSim.Services.Connectors.Hypergrid { response = request.Send(m_ServerURL, 10000); } - catch (Exception e) + catch { m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0}", m_ServerURL); - reason = "Exception: " + e.Message; +// reason = "Exception: " + e.Message; return uui; } if (response.IsFault) { m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString); - reason = "XMLRPC Fault"; +// reason = "XMLRPC Fault"; return uui; } @@ -719,7 +720,7 @@ namespace OpenSim.Services.Connectors.Hypergrid if (hash == null) { m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetUUI Got null response from {0}! THIS IS BAAAAD", m_ServerURL); - reason = "Internal error 1"; +// reason = "Internal error 1"; return uui; } @@ -728,10 +729,10 @@ namespace OpenSim.Services.Connectors.Hypergrid uui = hash["UUI"].ToString(); } - catch (Exception e) + catch { m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on LocateUser response."); - reason = "Exception: " + e.Message; +// reason = "Exception: " + e.Message; } return uui; -- cgit v1.1 From 4b5a6b655becd5162054bc53365fdcd9c7ed1772 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 16 Jul 2011 03:52:30 +0100 Subject: add test for resizing one part in a group --- OpenSim/Services/Connectors/MapImage/MapImageServiceConnector.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/MapImage/MapImageServiceConnector.cs b/OpenSim/Services/Connectors/MapImage/MapImageServiceConnector.cs index 520d639..69e2d17 100644 --- a/OpenSim/Services/Connectors/MapImage/MapImageServiceConnector.cs +++ b/OpenSim/Services/Connectors/MapImage/MapImageServiceConnector.cs @@ -50,7 +50,6 @@ namespace OpenSim.Services.Connectors MethodBase.GetCurrentMethod().DeclaringType); private string m_ServerURI = String.Empty; - private IImprovedAssetCache m_Cache = null; public MapImageServicesConnector() { -- cgit v1.1 From 71ef4a8fb3f582ee76ceb1ec613b32ad2e4bc058 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 18 Jul 2011 12:32:32 +0300 Subject: When an uncached asset is requested multiple times concurrently, only load it once Signed-off-by: root --- .../Connectors/Asset/AssetServiceConnector.cs | 58 ++++++++++++++++++---- 1 file changed, 49 insertions(+), 9 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs index f1da4fa..fdab254 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs @@ -48,6 +48,13 @@ namespace OpenSim.Services.Connectors private string m_ServerURI = String.Empty; private IImprovedAssetCache m_Cache = null; + private delegate void AssetRetrievedEx(AssetBase asset); + + // Keeps track of concurrent requests for the same asset, so that it's only loaded once. + // Maps: Asset ID -> Handlers which will be called when the asset has been loaded + private Dictionary m_AssetHandlers = new Dictionary(); + + public AssetServicesConnector() { } @@ -178,23 +185,56 @@ namespace OpenSim.Services.Connectors if (asset == null) { - bool result = false; - - AsynchronousRestObjectRequester. - MakeRequest("GET", uri, 0, + lock (m_AssetHandlers) + { + AssetRetrievedEx handlerEx = new AssetRetrievedEx(delegate(AssetBase _asset) { handler(id, sender, _asset); }); + + AssetRetrievedEx handlers; + if (m_AssetHandlers.TryGetValue(id, out handlers)) + { + // Someone else is already loading this asset. It will notify our handler when done. + handlers += handlerEx; + return true; + } + + // Load the asset ourselves + handlers += handlerEx; + m_AssetHandlers.Add(id, handlers); + } + + bool success = false; + try + { + AsynchronousRestObjectRequester.MakeRequest("GET", uri, 0, delegate(AssetBase a) { if (m_Cache != null) m_Cache.Cache(a); - handler(id, sender, a); - result = true; - }); - return result; + AssetRetrievedEx handlers; + lock (m_AssetHandlers) + { + handlers = m_AssetHandlers[id]; + m_AssetHandlers.Remove(id); + } + handlers.Invoke(a); + }); + + success = true; + } + finally + { + if (!success) + { + lock (m_AssetHandlers) + { + m_AssetHandlers.Remove(id); + } + } + } } else { - //Util.FireAndForget(delegate { handler(id, sender, asset); }); handler(id, sender, asset); } -- cgit v1.1 From 667b54f5a2a04fa5a2859397868d270eab3913f1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 23 Jul 2011 01:59:14 +0100 Subject: Don't load current/next/everyone/base permissions from the library item xml files - always use PermissionMask.All instead (which was the existing default). Library items always need the same permissions, so it doesn't make sense to load them from the xml files. This just opens the door to permissions mistakes. --- .../Services/InventoryService/LibraryService.cs | 37 +++++++--------------- 1 file changed, 11 insertions(+), 26 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/InventoryService/LibraryService.cs b/OpenSim/Services/InventoryService/LibraryService.cs index 383f311..b46add3 100644 --- a/OpenSim/Services/InventoryService/LibraryService.cs +++ b/OpenSim/Services/InventoryService/LibraryService.cs @@ -93,26 +93,6 @@ namespace OpenSim.Services.InventoryService LoadLibraries(pLibrariesLocation); } - public InventoryItemBase CreateItem(UUID inventoryID, UUID assetID, string name, string description, - int assetType, int invType, UUID parentFolderID) - { - InventoryItemBase item = new InventoryItemBase(); - item.Owner = libOwner; - item.CreatorId = libOwner.ToString(); - item.ID = inventoryID; - item.AssetID = assetID; - item.Description = description; - item.Name = name; - item.AssetType = assetType; - item.InvType = invType; - item.Folder = parentFolderID; - item.BasePermissions = 0x7FFFFFFF; - item.EveryOnePermissions = 0x7FFFFFFF; - item.CurrentPermissions = 0x7FFFFFFF; - item.NextPermissions = 0x7FFFFFFF; - return item; - } - /// /// Use the asset set information at path to load assets /// @@ -193,22 +173,27 @@ namespace OpenSim.Services.InventoryService item.Description = config.GetString("description", item.Name); item.InvType = config.GetInt("inventoryType", 0); item.AssetType = config.GetInt("assetType", item.InvType); - item.CurrentPermissions = (uint)config.GetLong("currentPermissions", 0x7FFFFFFF); - item.NextPermissions = (uint)config.GetLong("nextPermissions", 0x7FFFFFFF); - item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", 0x7FFFFFFF); - item.BasePermissions = (uint)config.GetLong("basePermissions", 0x7FFFFFFF); - item.Flags = (uint)config.GetInt("flags", 0); + item.CurrentPermissions = (uint)PermissionMask.All; + item.NextPermissions = (uint)PermissionMask.All; + item.EveryOnePermissions = (uint)PermissionMask.All; +// item.EveryOnePermissions = (uint)PermissionMask.All - (uint)PermissionMask.Modify; + item.BasePermissions = (uint)PermissionMask.All; if (libraryFolders.ContainsKey(item.Folder)) { InventoryFolderImpl parentFolder = libraryFolders[item.Folder]; + try { +// m_log.DebugFormat( +// "[LIBRARY INVENTORY]: Adding item {0} {1}, OwnerPermissions {2:X} to {3}", +// item.Name, item.ID, item.CurrentPermissions, item.Folder); + parentFolder.Items.Add(item.ID, item); } catch (Exception) { - m_log.WarnFormat("[LIBRARY INVENTORY] Item {1} [{0}] not added, duplicate item", item.ID, item.Name); + m_log.WarnFormat("[LIBRARY INVENTORY]: Item {1} [{0}] not added, duplicate item", item.ID, item.Name); } } else -- cgit v1.1 From fcaa4f601231a6feb7fd5ea40e35fba6220c6235 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 23 Jul 2011 02:05:51 +0100 Subject: Revert "Don't load current/next/everyone/base permissions from the library item xml files - always use PermissionMask.All instead (which was the existing default)." There actually are uses for this. I will correct the perms instead since some entries appear to be wrong. This reverts commit 667b54f5a2a04fa5a2859397868d270eab3913f1. --- .../Services/InventoryService/LibraryService.cs | 37 +++++++++++++++------- 1 file changed, 26 insertions(+), 11 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/InventoryService/LibraryService.cs b/OpenSim/Services/InventoryService/LibraryService.cs index b46add3..383f311 100644 --- a/OpenSim/Services/InventoryService/LibraryService.cs +++ b/OpenSim/Services/InventoryService/LibraryService.cs @@ -93,6 +93,26 @@ namespace OpenSim.Services.InventoryService LoadLibraries(pLibrariesLocation); } + public InventoryItemBase CreateItem(UUID inventoryID, UUID assetID, string name, string description, + int assetType, int invType, UUID parentFolderID) + { + InventoryItemBase item = new InventoryItemBase(); + item.Owner = libOwner; + item.CreatorId = libOwner.ToString(); + item.ID = inventoryID; + item.AssetID = assetID; + item.Description = description; + item.Name = name; + item.AssetType = assetType; + item.InvType = invType; + item.Folder = parentFolderID; + item.BasePermissions = 0x7FFFFFFF; + item.EveryOnePermissions = 0x7FFFFFFF; + item.CurrentPermissions = 0x7FFFFFFF; + item.NextPermissions = 0x7FFFFFFF; + return item; + } + /// /// Use the asset set information at path to load assets /// @@ -173,27 +193,22 @@ namespace OpenSim.Services.InventoryService item.Description = config.GetString("description", item.Name); item.InvType = config.GetInt("inventoryType", 0); item.AssetType = config.GetInt("assetType", item.InvType); - item.CurrentPermissions = (uint)PermissionMask.All; - item.NextPermissions = (uint)PermissionMask.All; - item.EveryOnePermissions = (uint)PermissionMask.All; -// item.EveryOnePermissions = (uint)PermissionMask.All - (uint)PermissionMask.Modify; - item.BasePermissions = (uint)PermissionMask.All; + item.CurrentPermissions = (uint)config.GetLong("currentPermissions", 0x7FFFFFFF); + item.NextPermissions = (uint)config.GetLong("nextPermissions", 0x7FFFFFFF); + item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", 0x7FFFFFFF); + item.BasePermissions = (uint)config.GetLong("basePermissions", 0x7FFFFFFF); + item.Flags = (uint)config.GetInt("flags", 0); if (libraryFolders.ContainsKey(item.Folder)) { InventoryFolderImpl parentFolder = libraryFolders[item.Folder]; - try { -// m_log.DebugFormat( -// "[LIBRARY INVENTORY]: Adding item {0} {1}, OwnerPermissions {2:X} to {3}", -// item.Name, item.ID, item.CurrentPermissions, item.Folder); - parentFolder.Items.Add(item.ID, item); } catch (Exception) { - m_log.WarnFormat("[LIBRARY INVENTORY]: Item {1} [{0}] not added, duplicate item", item.ID, item.Name); + m_log.WarnFormat("[LIBRARY INVENTORY] Item {1} [{0}] not added, duplicate item", item.ID, item.Name); } } else -- cgit v1.1 From f0895028e96e39ca179cad8c103042397ad870e5 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 23 Jul 2011 02:13:11 +0100 Subject: Remove manually permissions settings on all current library items so that they use the defaults instead. Some items had completely wrong permissions - this is easier than correcting them all. The ability to set permissions in xml is retained since there are use cases for this (e.g. to create no-mod library scripts) --- OpenSim/Services/InventoryService/LibraryService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/InventoryService/LibraryService.cs b/OpenSim/Services/InventoryService/LibraryService.cs index 383f311..2e9d2b1 100644 --- a/OpenSim/Services/InventoryService/LibraryService.cs +++ b/OpenSim/Services/InventoryService/LibraryService.cs @@ -193,10 +193,10 @@ namespace OpenSim.Services.InventoryService item.Description = config.GetString("description", item.Name); item.InvType = config.GetInt("inventoryType", 0); item.AssetType = config.GetInt("assetType", item.InvType); - item.CurrentPermissions = (uint)config.GetLong("currentPermissions", 0x7FFFFFFF); - item.NextPermissions = (uint)config.GetLong("nextPermissions", 0x7FFFFFFF); - item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", 0x7FFFFFFF); - item.BasePermissions = (uint)config.GetLong("basePermissions", 0x7FFFFFFF); + item.CurrentPermissions = (uint)config.GetLong("currentPermissions", (uint)PermissionMask.All); + item.NextPermissions = (uint)config.GetLong("nextPermissions", (uint)PermissionMask.All); + item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", (uint)PermissionMask.All); + item.BasePermissions = (uint)config.GetLong("basePermissions", (uint)PermissionMask.All); item.Flags = (uint)config.GetInt("flags", 0); if (libraryFolders.ContainsKey(item.Folder)) -- cgit v1.1 From be9b4ad23abcb2dec2291679c758f0dc0bc6096e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 23 Jul 2011 02:18:23 +0100 Subject: For default everyone permissions on library items, make notecards and scripts non-modifiable (but still copyable, etc). Users should not be given the impression that they can modify these items. This still does not solve the issue where library items cannot be dragged into prims or user inventory any time after they are initially seen. Curiously, manually copying and pasting still appears to work. On the surface, this seems to have something to do with library item caching on the client, since deleting the cache allows drag to work again once Not sure what the exact problem is. --- OpenSim/Services/InventoryService/LibraryService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/InventoryService/LibraryService.cs b/OpenSim/Services/InventoryService/LibraryService.cs index 2e9d2b1..f90895b 100644 --- a/OpenSim/Services/InventoryService/LibraryService.cs +++ b/OpenSim/Services/InventoryService/LibraryService.cs @@ -195,7 +195,8 @@ namespace OpenSim.Services.InventoryService item.AssetType = config.GetInt("assetType", item.InvType); item.CurrentPermissions = (uint)config.GetLong("currentPermissions", (uint)PermissionMask.All); item.NextPermissions = (uint)config.GetLong("nextPermissions", (uint)PermissionMask.All); - item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", (uint)PermissionMask.All); + item.EveryOnePermissions + = (uint)config.GetLong("everyonePermissions", (uint)PermissionMask.All - (uint)PermissionMask.Modify); item.BasePermissions = (uint)config.GetLong("basePermissions", (uint)PermissionMask.All); item.Flags = (uint)config.GetInt("flags", 0); -- cgit v1.1 From 504de8bc4792eda165d71a2c7481cb43cb92759a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 23 Jul 2011 03:46:55 +0100 Subject: Pass the first name and last name from the agent circuit data to the authorization service rather than from the account. This is to accomodate situations where the authorization service is being used by the hypergrid, where visitors have no user account. See http://opensimulator.org/mantis/view.php?id=5517, this code is somewhat adapted/cleaned up from Michelle's patch I'm a little ambivalent about this since visitors could put anything in firstname/lastname so it's not much of an auth measure. It's up to the auth service to decide which data it actually uses. Possibly we should be passing through other info such as agent circuit ip --- .../AuthorizationService/AuthorizationService.cs | 5 ++-- .../Services/Interfaces/IAuthorizationService.cs | 32 ++++++++++++---------- 2 files changed, 21 insertions(+), 16 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/AuthorizationService/AuthorizationService.cs b/OpenSim/Services/AuthorizationService/AuthorizationService.cs index d658368..03da6e1 100644 --- a/OpenSim/Services/AuthorizationService/AuthorizationService.cs +++ b/OpenSim/Services/AuthorizationService/AuthorizationService.cs @@ -48,10 +48,11 @@ namespace OpenSim.Services.AuthorizationService m_log.Info("[AUTHORIZATION CONNECTOR]: Local Authorization service enabled"); } - public bool IsAuthorizedForRegion(string userID, string regionID, out string message) + public bool IsAuthorizedForRegion( + string userID, string firstName, string lastName, string regionID, out string message) { message = "Authorized"; return true; } } -} +} \ No newline at end of file diff --git a/OpenSim/Services/Interfaces/IAuthorizationService.cs b/OpenSim/Services/Interfaces/IAuthorizationService.cs index c5d577a..e5c68f6 100644 --- a/OpenSim/Services/Interfaces/IAuthorizationService.cs +++ b/OpenSim/Services/Interfaces/IAuthorizationService.cs @@ -34,14 +34,21 @@ namespace OpenSim.Services.Interfaces public interface IAuthorizationService { - ////////////////////////////////////////////////////// - // Authorized - // - // This method returns a simple true false indicating - // whether or not a user has access to the region - // - bool IsAuthorizedForRegion(string userID, string regionID, out string message); - + /// + /// Check whether the user should be given access to the region. + /// + /// + /// We also supply user first name and last name for situations where the user does not have an account + /// on the region (e.g. they're a visitor via Hypergrid). + /// + /// + /// /param> + /// + /// + /// + /// + bool IsAuthorizedForRegion( + string userID, string firstName, string lastName, string regionID, out string message); } public class AuthorizationRequest @@ -63,7 +70,8 @@ namespace OpenSim.Services.Interfaces m_regionID = RegionID; } - public AuthorizationRequest(string ID,string FirstName, string SurName, string Email, string RegionName, string RegionID) + public AuthorizationRequest( + string ID, string FirstName, string SurName, string Email, string RegionName, string RegionID) { m_userID = ID; m_firstname = FirstName; @@ -108,9 +116,6 @@ namespace OpenSim.Services.Interfaces get { return m_regionID; } set { m_regionID = value; } } - - - } public class AuthorizationResponse @@ -126,7 +131,6 @@ namespace OpenSim.Services.Interfaces { m_isAuthorized = isAuthorized; m_message = message; - } public bool IsAuthorized @@ -141,4 +145,4 @@ namespace OpenSim.Services.Interfaces set { m_message = value; } } } -} +} \ No newline at end of file -- cgit v1.1 From 2f5995f5c0a7720e28a8d88296dd1b8f07a9ac9a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 30 Jul 2011 00:58:17 +0100 Subject: Temporary code to change bad AvatarHeight values in the AvatarService to the default Ruth height. I was persuaded to do this because simulators on osgrid will persist in inserting bad values for an unknown length of time, even after the original simulator bug which was inserting bad values is out in an osgrid distro This code can be removed at some point in the future, though I think there is an argument for having services police these values in open grids. --- OpenSim/Services/AvatarService/AvatarService.cs | 28 ++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/AvatarService/AvatarService.cs b/OpenSim/Services/AvatarService/AvatarService.cs index 53ca7c8..c4c7cad 100644 --- a/OpenSim/Services/AvatarService/AvatarService.cs +++ b/OpenSim/Services/AvatarService/AvatarService.cs @@ -109,7 +109,33 @@ namespace OpenSim.Services.AvatarService foreach (KeyValuePair kvp in avatar.Data) { av.Data["Name"] = kvp.Key; - av.Data["Value"] = kvp.Value; + + // justincc 20110730. Yes, this is a hack to get around the fact that a bug in OpenSim is causing + // various simulators on osgrid to inject bad values. Since these simulators might be around for a + // long time, we are going to manually police the value. + // + // It should be possible to remove this in half a year if we don't want to police values server side. + if (kvp.Key == "AvatarHeight") + { + float height; + if (!float.TryParse(kvp.Value, out height) || height < 0 || height > 10) + { + string rawHeight = kvp.Value.Replace(",", "."); + + if (!float.TryParse(rawHeight, out height) || height < 0 || height > 10) + height = 1.771488f; + + m_log.DebugFormat( + "[AVATAR SERVICE]: Rectifying height of avatar {0} from {1} to {2}", + principalID, kvp.Value, height); + } + + av.Data["Value"] = height.ToString(); + } + else + { + av.Data["Value"] = kvp.Value; + } if (!m_Database.Store(av)) { -- cgit v1.1 From b6ac1c46cd473b129b70344f0001f1e8f97d8860 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 2 Aug 2011 00:13:04 +0100 Subject: Get rid of AvatarAppearance.Owner to simplify the code. This is not used for anything - appearances are always properties of objects with ids (ScenePresence, AgentCircuitData) and just has the potential to get out of sync when the appearance is cloned. --- OpenSim/Services/AvatarService/AvatarService.cs | 2 +- OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs | 2 +- .../Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs | 4 ++-- OpenSim/Services/Interfaces/IAvatarService.cs | 4 ++-- OpenSim/Services/LLLoginService/LLLoginService.cs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/AvatarService/AvatarService.cs b/OpenSim/Services/AvatarService/AvatarService.cs index c4c7cad..c59a9e0 100644 --- a/OpenSim/Services/AvatarService/AvatarService.cs +++ b/OpenSim/Services/AvatarService/AvatarService.cs @@ -54,7 +54,7 @@ namespace OpenSim.Services.AvatarService public AvatarAppearance GetAppearance(UUID principalID) { AvatarData avatar = GetAvatar(principalID); - return avatar.ToAvatarAppearance(principalID); + return avatar.ToAvatarAppearance(); } public bool SetAppearance(UUID principalID, AvatarAppearance appearance) diff --git a/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs b/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs index 1a93ae7..8fdb4d0 100644 --- a/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs +++ b/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs @@ -89,7 +89,7 @@ namespace OpenSim.Services.Connectors public AvatarAppearance GetAppearance(UUID userID) { AvatarData avatar = GetAvatar(userID); - return avatar.ToAvatarAppearance(userID); + return avatar.ToAvatarAppearance(); } public bool SetAppearance(UUID userID, AvatarAppearance appearance) diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs index 810399c..360f0dd 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs @@ -213,7 +213,7 @@ namespace OpenSim.Services.Connectors.SimianGrid wearables[11] = new AvatarWearable(map["UnderpantsItem"].AsUUID(), map["UnderpantsAsset"].AsUUID()); wearables[12] = new AvatarWearable(map["SkirtItem"].AsUUID(), map["SkirtAsset"].AsUUID()); - AvatarAppearance appearance = new AvatarAppearance(userID); + AvatarAppearance appearance = new AvatarAppearance(); appearance.Wearables = wearables; appearance.AvatarHeight = (float)map["Height"].AsReal(); @@ -257,7 +257,7 @@ namespace OpenSim.Services.Connectors.SimianGrid if (avatar.AvatarType == 1) // LLAvatar { - AvatarAppearance appearance = avatar.ToAvatarAppearance(userID); + AvatarAppearance appearance = avatar.ToAvatarAppearance(); OSDMap map = new OSDMap(); diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs index d7af562..0d5ab7d 100644 --- a/OpenSim/Services/Interfaces/IAvatarService.cs +++ b/OpenSim/Services/Interfaces/IAvatarService.cs @@ -180,9 +180,9 @@ namespace OpenSim.Services.Interfaces } } - public AvatarAppearance ToAvatarAppearance(UUID owner) + public AvatarAppearance ToAvatarAppearance() { - AvatarAppearance appearance = new AvatarAppearance(owner); + AvatarAppearance appearance = new AvatarAppearance(); if (Data.Count == 0) return appearance; diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 2b15896..00405a1 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -785,7 +785,7 @@ namespace OpenSim.Services.LLLoginService if (avatar != null) aCircuit.Appearance = new AvatarAppearance(avatar); else - aCircuit.Appearance = new AvatarAppearance(account.PrincipalID); + aCircuit.Appearance = new AvatarAppearance(); //aCircuit.BaseFolder = irrelevant aCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); -- cgit v1.1 From 8d33a2eaa10ed75146f45cca4d6c19ac814d5fee Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 2 Aug 2011 00:26:17 +0100 Subject: In GridService, have GetRegionByName() call GetRegionsByName() with a max return of 1 instead of duplicating code. This also fixes the problem where this method would not return a hypergrid region, unlike GetRegionsByName() --- OpenSim/Services/GridService/GridService.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 985d77b..1253b5a 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -322,16 +322,17 @@ namespace OpenSim.Services.GridService public GridRegion GetRegionByName(UUID scopeID, string regionName) { - List rdatas = m_Database.Get(regionName + "%", scopeID); - if ((rdatas != null) && (rdatas.Count > 0)) - return RegionData2RegionInfo(rdatas[0]); // get the first + List rinfos = GetRegionsByName(scopeID, regionName, 1); + + if (rinfos.Count > 0) + return rinfos[0]; return null; } public List GetRegionsByName(UUID scopeID, string name, int maxNumber) { - m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name); +// m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name); List rdatas = m_Database.Get(name + "%", scopeID); -- cgit v1.1 From e6fb9d74ef10e381731b31367a96ad751484a867 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 2 Aug 2011 00:40:23 +0100 Subject: Revert "In GridService, have GetRegionByName() call GetRegionsByName() with a max return of 1 instead of duplicating code." This reverts commit 8d33a2eaa10ed75146f45cca4d6c19ac814d5fee. Better fix will be along in a minute --- OpenSim/Services/GridService/GridService.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 1253b5a..985d77b 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -322,17 +322,16 @@ namespace OpenSim.Services.GridService public GridRegion GetRegionByName(UUID scopeID, string regionName) { - List rinfos = GetRegionsByName(scopeID, regionName, 1); - - if (rinfos.Count > 0) - return rinfos[0]; + List rdatas = m_Database.Get(regionName + "%", scopeID); + if ((rdatas != null) && (rdatas.Count > 0)) + return RegionData2RegionInfo(rdatas[0]); // get the first return null; } public List GetRegionsByName(UUID scopeID, string name, int maxNumber) { -// m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name); + m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name); List rdatas = m_Database.Get(name + "%", scopeID); -- cgit v1.1 From 17e9d61f4383627434b7b8249cea1a487f001099 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 2 Aug 2011 00:52:48 +0100 Subject: Change GridService.GetRegionByName() to only return info if there is an exact region name match, unlike GetRegionsByName() This should fix the first part of http://opensimulator.org/mantis/view.php?id=5606, and maybe 5605. Thanks to Melanie for helping with this. --- OpenSim/Services/GridService/GridService.cs | 2 +- OpenSim/Services/Interfaces/IGridService.cs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 985d77b..a6fbc00 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -322,7 +322,7 @@ namespace OpenSim.Services.GridService public GridRegion GetRegionByName(UUID scopeID, string regionName) { - List rdatas = m_Database.Get(regionName + "%", scopeID); + List rdatas = m_Database.Get(regionName, scopeID); if ((rdatas != null) && (rdatas.Count > 0)) return RegionData2RegionInfo(rdatas[0]); // get the first diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index a34f0be..41dd20c 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs @@ -71,6 +71,12 @@ namespace OpenSim.Services.Interfaces /// GridRegion GetRegionByPosition(UUID scopeID, int x, int y); + /// + /// Get information about a region which exactly matches the name given. + /// + /// + /// + /// Returns the region information if the name matched. Null otherwise. GridRegion GetRegionByName(UUID scopeID, string regionName); /// -- cgit v1.1 From b7f81d34928cb2d7296b91a8569adb488c264e36 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 2 Aug 2011 01:06:32 +0100 Subject: If GetRegionByName can't match something in the local db, then search the hypergrid if that functionality has been enabled. This should fix the problem today where old style HG addresses (e.g. "hg.osgrid.org:80:Vue-6400") stopped working since 8c3eb324c4b666e7abadef4a714d1bd8d5f71ac2 --- OpenSim/Services/GridService/GridService.cs | 33 +++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index a6fbc00..f663dd6 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -320,18 +320,25 @@ namespace OpenSim.Services.GridService return null; } - public GridRegion GetRegionByName(UUID scopeID, string regionName) + public GridRegion GetRegionByName(UUID scopeID, string name) { - List rdatas = m_Database.Get(regionName, scopeID); + List rdatas = m_Database.Get(name, scopeID); if ((rdatas != null) && (rdatas.Count > 0)) return RegionData2RegionInfo(rdatas[0]); // get the first + if (m_AllowHypergridMapSearch) + { + GridRegion r = GetHypergridRegionByName(scopeID, name); + if (r != null) + return r; + } + return null; } public List GetRegionsByName(UUID scopeID, string name, int maxNumber) { - m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name); +// m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name); List rdatas = m_Database.Get(name + "%", scopeID); @@ -340,7 +347,7 @@ namespace OpenSim.Services.GridService if (rdatas != null) { - m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count); +// m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count); foreach (RegionData rdata in rdatas) { if (count++ < maxNumber) @@ -348,9 +355,9 @@ namespace OpenSim.Services.GridService } } - if (m_AllowHypergridMapSearch && (rdatas == null || (rdatas != null && rdatas.Count == 0)) && name.Contains(".")) + if (m_AllowHypergridMapSearch && (rdatas == null || (rdatas != null && rdatas.Count == 0))) { - GridRegion r = m_HypergridLinker.LinkRegion(scopeID, name); + GridRegion r = GetHypergridRegionByName(scopeID, name); if (r != null) rinfos.Add(r); } @@ -358,6 +365,20 @@ namespace OpenSim.Services.GridService return rinfos; } + /// + /// Get a hypergrid region. + /// + /// + /// + /// null if no hypergrid region could be found. + protected GridRegion GetHypergridRegionByName(UUID scopeID, string name) + { + if (name.Contains(".")) + return m_HypergridLinker.LinkRegion(scopeID, name); + else + return null; + } + public List GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) { int xminSnap = (int)(xmin / Constants.RegionSize) * (int)Constants.RegionSize; -- cgit v1.1 From f18780d0e3a6e5130b1c1d86c71630801dc70c57 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 5 Aug 2011 22:56:53 +0100 Subject: Get "show region" command in GridService to show grid co-ordinates rather than meters co-ord. This makes it consistent with "show regions" Addresses http://opensimulator.org/mantis/view.php?id=5619 --- OpenSim/Services/GridService/GridService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index f663dd6..0a4372a 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -510,8 +510,9 @@ namespace OpenSim.Services.GridService OpenSim.Data.RegionFlags flags = (OpenSim.Data.RegionFlags)Convert.ToInt32(r.Data["flags"]); MainConsole.Instance.Output(String.Format("{0,-20} {1}\n{2,-20} {3}\n{4,-39} {5}\n\n", r.RegionName, r.RegionID, - String.Format("{0},{1}", r.posX, r.posY), r.Data["serverURI"], - r.Data["owner_uuid"].ToString(), flags.ToString())); + String.Format("{0},{1}", r.posX / Constants.RegionSize, r.posY / Constants.RegionSize), + r.Data["serverURI"], + r.Data["owner_uuid"], flags)); } return; } -- cgit v1.1 From 76f46b25454c0c9376130a59cc1b766c0d105dd0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 6 Aug 2011 01:15:49 +0100 Subject: Do proper locking of m_localScenes list in SceneManager --- OpenSim/Services/HypergridService/HGInstantMessageService.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/HypergridService/HGInstantMessageService.cs b/OpenSim/Services/HypergridService/HGInstantMessageService.cs index bb31fc9..0d59636 100644 --- a/OpenSim/Services/HypergridService/HGInstantMessageService.cs +++ b/OpenSim/Services/HypergridService/HGInstantMessageService.cs @@ -95,7 +95,6 @@ namespace OpenSim.Services.HypergridService m_InGatekeeper = serverConfig.GetBoolean("InGatekeeper", false); m_log.DebugFormat("[HG IM SERVICE]: Starting... InRobust? {0}", m_InGatekeeper); - if (gridService == string.Empty || presenceService == string.Empty) throw new Exception(String.Format("Incomplete specifications, InstantMessage Service cannot function.")); @@ -120,7 +119,7 @@ namespace OpenSim.Services.HypergridService public bool IncomingInstantMessage(GridInstantMessage im) { - m_log.DebugFormat("[HG IM SERVICE]: Received message from {0} to {1}", im.fromAgentID, im.toAgentID); +// m_log.DebugFormat("[HG IM SERVICE]: Received message from {0} to {1}", im.fromAgentID, im.toAgentID); UUID toAgentID = new UUID(im.toAgentID); bool success = false; @@ -142,7 +141,7 @@ namespace OpenSim.Services.HypergridService public bool OutgoingInstantMessage(GridInstantMessage im, string url, bool foreigner) { - m_log.DebugFormat("[HG IM SERVICE]: Sending message from {0} to {1}@{2}", im.fromAgentID, im.toAgentID, url); +// m_log.DebugFormat("[HG IM SERVICE]: Sending message from {0} to {1}@{2}", im.fromAgentID, im.toAgentID, url); if (url != string.Empty) return TrySendInstantMessage(im, url, true, foreigner); else @@ -333,7 +332,7 @@ namespace OpenSim.Services.HypergridService if (m_RestURL != string.Empty && (im.offline != 0) && (!im.fromGroup || (im.fromGroup && m_ForwardOfflineGroupMessages))) { - m_log.DebugFormat("[HG IM SERVICE]: Message saved"); +// m_log.DebugFormat("[HG IM SERVICE]: Message saved"); return SynchronousRestObjectRequester.MakeRequest( "POST", m_RestURL + "/SaveMessage/", im); -- cgit v1.1 From cace6eaa8a82018fbb21ab83ce1bf95ea0a1e154 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 11 Aug 2011 02:06:32 +0100 Subject: comment out some of the currently less useful debug log messages --- OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs index b8703c6..2267325 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs @@ -97,7 +97,7 @@ namespace OpenSim.Services.Connectors.SimianGrid } } - m_log.DebugFormat("[SIMIAN ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); +// m_log.DebugFormat("[SIMIAN ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); m_GridUserService.LoggedOut(client.AgentId.ToString(), client.SessionId, client.Scene.RegionInfo.RegionID, position, lookat); } } -- cgit v1.1 From 70ea62544716134447884e999898267497b85a12 Mon Sep 17 00:00:00 2001 From: Snoopy Pfeffer Date: Sun, 14 Aug 2011 18:20:20 +0200 Subject: Added optional Login Service parameter "Currency" to be able to change the currency name shown in the viewer. --- OpenSim/Services/LLLoginService/LLLoginResponse.cs | 19 ++++++++++++++++++- OpenSim/Services/LLLoginService/LLLoginService.cs | 4 +++- 2 files changed, 21 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index f68c078..1a874c8 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs @@ -183,6 +183,8 @@ namespace OpenSim.Services.LLLoginService private BuddyList m_buddyList = null; + private string currency; + static LLLoginResponse() { // This is being set, but it's not used @@ -218,7 +220,7 @@ namespace OpenSim.Services.LLLoginService public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo, GridRegion destination, List invSkel, FriendInfo[] friendsList, ILibraryService libService, string where, string startlocation, Vector3 position, Vector3 lookAt, List gestures, string message, - GridRegion home, IPEndPoint clientIP, string mapTileURL, string searchURL) + GridRegion home, IPEndPoint clientIP, string mapTileURL, string searchURL, string currency) : this() { FillOutInventoryData(invSkel, libService); @@ -236,6 +238,7 @@ namespace OpenSim.Services.LLLoginService StartLocation = where; MapTileURL = mapTileURL; SearchURL = searchURL; + Currency = currency; FillOutHomeData(pinfo, home); LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z); @@ -382,6 +385,8 @@ namespace OpenSim.Services.LLLoginService initialOutfit.Add(InitialOutfitHash); mapTileURL = String.Empty; searchURL = String.Empty; + + currency = String.Empty; } @@ -456,6 +461,12 @@ namespace OpenSim.Services.LLLoginService responseData["buddy-list"] = m_buddyList.ToArray(); } + if (currency != String.Empty) + { + // responseData["real_currency"] = currency; + responseData["currency"] = currency; + } + responseData["login"] = "true"; return responseData; @@ -940,6 +951,12 @@ namespace OpenSim.Services.LLLoginService set { m_buddyList = value; } } + public string Currency + { + get { return currency; } + set { currency = value; } + } + #endregion public class UserInfo diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 00405a1..4ccc7ff 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -75,6 +75,7 @@ namespace OpenSim.Services.LLLoginService protected bool m_AllowRemoteSetLoginLevel; protected string m_MapTileURL; protected string m_SearchURL; + protected string m_Currency; protected string m_AllowedClients; protected string m_DeniedClients; @@ -108,6 +109,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); + m_Currency = m_LoginServerConfig.GetString("Currency", string.Empty); m_AllowedClients = m_LoginServerConfig.GetString("AllowedClients", string.Empty); m_DeniedClients = m_LoginServerConfig.GetString("DeniedClients", string.Empty); @@ -408,7 +410,7 @@ namespace OpenSim.Services.LLLoginService // Finally, fill out the response and return it // LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService, - where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL, m_SearchURL); + where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL, m_SearchURL, m_Currency); m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client."); return response; -- cgit v1.1 From 6b51d8a10e44eed7c39b58aab256789ab188ecca Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 17 Aug 2011 23:24:41 +0100 Subject: In the asset service, check that an asset exists before attempting to store it. --- OpenSim/Services/AssetService/AssetService.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs index c7a259d..d40aa4b 100644 --- a/OpenSim/Services/AssetService/AssetService.cs +++ b/OpenSim/Services/AssetService/AssetService.cs @@ -174,10 +174,12 @@ namespace OpenSim.Services.AssetService public virtual string Store(AssetBase asset) { -// m_log.DebugFormat( -// "[ASSET SERVICE]: Storing asset {0} {1}, bytes {2}", asset.Name, asset.ID, asset.Data.Length); - - m_Database.StoreAsset(asset); + if (!m_Database.ExistsAsset(asset.FullID)) + { +// m_log.DebugFormat( +// "[ASSET SERVICE]: Storing asset {0} {1}, bytes {2}", asset.Name, asset.FullID, asset.Data.Length); + m_Database.StoreAsset(asset); + } return asset.ID; } -- cgit v1.1 From eb8b6b7d523dd6ef540d7860fc3e2121d8f60f09 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 17 Aug 2011 23:28:57 +0100 Subject: minor: remove mono compiler warning --- OpenSim/Services/HypergridService/HGInstantMessageService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/HypergridService/HGInstantMessageService.cs b/OpenSim/Services/HypergridService/HGInstantMessageService.cs index 0d59636..0c9cfd3 100644 --- a/OpenSim/Services/HypergridService/HGInstantMessageService.cs +++ b/OpenSim/Services/HypergridService/HGInstantMessageService.cs @@ -120,7 +120,7 @@ namespace OpenSim.Services.HypergridService public bool IncomingInstantMessage(GridInstantMessage im) { // m_log.DebugFormat("[HG IM SERVICE]: Received message from {0} to {1}", im.fromAgentID, im.toAgentID); - UUID toAgentID = new UUID(im.toAgentID); +// UUID toAgentID = new UUID(im.toAgentID); bool success = false; if (m_IMSimConnector != null) -- cgit v1.1 From 3146f4bae0d6c0b190fb6b8477c690046a1c79af Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 18 Aug 2011 23:36:43 +0100 Subject: Don't need to try both AssetService.Get and GetCached in GetMesh since Get always calls GetCached and code paths were identical --- OpenSim/Services/Interfaces/IAssetService.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/IAssetService.cs b/OpenSim/Services/Interfaces/IAssetService.cs index 1ac1cec..80494f1 100644 --- a/OpenSim/Services/Interfaces/IAssetService.cs +++ b/OpenSim/Services/Interfaces/IAssetService.cs @@ -56,7 +56,7 @@ namespace OpenSim.Services.Interfaces byte[] GetData(string id); /// - /// Synchronously fetches an asset from the local cache only + /// Synchronously fetches an asset from the local cache only. /// /// Asset ID /// The fetched asset, or null if it did not exist in the local cache @@ -75,7 +75,9 @@ namespace OpenSim.Services.Interfaces /// /// Creates a new asset /// - /// Returns a random ID if none is passed into it + /// + /// Returns a random ID if none is passed via the asset argument. + /// /// /// string Store(AssetBase asset); @@ -83,7 +85,9 @@ namespace OpenSim.Services.Interfaces /// /// Update an asset's content /// + /// /// Attachments and bare scripts need this!! + /// /// /// /// -- cgit v1.1 From 138a5e04b80fd3892c5240f0f54b97b3b1ccb06a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 22 Aug 2011 23:10:43 +0100 Subject: minor: remove mono compiler warning --- .../AuthenticationService/WebkeyOrPasswordAuthenticationService.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs b/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs index 3590e12..2c6cebd 100644 --- a/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs +++ b/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs @@ -42,15 +42,13 @@ namespace OpenSim.Services.AuthenticationService public class WebkeyOrPasswordAuthenticationService : AuthenticationServiceBase, IAuthenticationService { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - private IConfigSource m_config; + private Dictionary m_svcChecks = new Dictionary(); public WebkeyOrPasswordAuthenticationService(IConfigSource config) : base(config) { - this.m_config = config; m_svcChecks["web_login_key"] = new WebkeyAuthenticationService(config); m_svcChecks["password"] = new PasswordAuthenticationService(config); } -- cgit v1.1 From be357f8feeb438e3292292d163918a307d69c69a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 30 Aug 2011 01:58:32 +0100 Subject: Fix bug in persisting saved appearances for npcs Assets have to be marked non-local as well as non-temporary to persist. This is now done. Hopefully addresses http://opensimulator.org/mantis/view.php?id=5660 --- OpenSim/Services/AssetService/AssetService.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs index d40aa4b..2ea513b 100644 --- a/OpenSim/Services/AssetService/AssetService.cs +++ b/OpenSim/Services/AssetService/AssetService.cs @@ -83,7 +83,7 @@ namespace OpenSim.Services.AssetService if (assetLoaderEnabled) { - m_log.InfoFormat("[ASSET]: Loading default asset set from {0}", loaderArgs); + m_log.DebugFormat("[ASSET]: Loading default asset set from {0}", loaderArgs); m_AssetLoader.ForEachDefaultXmlAsset( loaderArgs, @@ -100,7 +100,7 @@ namespace OpenSim.Services.AssetService }); } - m_log.Info("[ASSET SERVICE]: Local asset service enabled"); + m_log.Debug("[ASSET SERVICE]: Local asset service enabled"); } } } @@ -180,6 +180,11 @@ namespace OpenSim.Services.AssetService // "[ASSET SERVICE]: Storing asset {0} {1}, bytes {2}", asset.Name, asset.FullID, asset.Data.Length); m_Database.StoreAsset(asset); } +// else +// { +// m_log.DebugFormat( +// "[ASSET SERVICE]: Not storing asset {0} {1}, bytes {2} as it already exists", asset.Name, asset.FullID, asset.Data.Length); +// } return asset.ID; } -- cgit v1.1 From 37a5cf5783052ca904be68811d12266b8b449315 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 30 Aug 2011 22:08:43 +0100 Subject: minor: comment out friends number logging from login for now --- 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 4ccc7ff..6fec276 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -403,7 +403,7 @@ namespace OpenSim.Services.LLLoginService if (m_FriendsService != null) { friendsList = m_FriendsService.GetFriends(account.PrincipalID); - m_log.DebugFormat("[LLOGIN SERVICE]: Retrieved {0} friends", friendsList.Length); +// m_log.DebugFormat("[LLOGIN SERVICE]: Retrieved {0} friends", friendsList.Length); } // -- cgit v1.1