From 53d3f46add698dd862c018e614778c1c19b0eda4 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 4 Jan 2010 18:47:47 +0000 Subject: First stage port of the XInventoryService --- .../Services/InventoryService/XInventoryService.cs | 474 +++++++++++++++++++++ 1 file changed, 474 insertions(+) create mode 100644 OpenSim/Services/InventoryService/XInventoryService.cs (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs new file mode 100644 index 0000000..1e7f206 --- /dev/null +++ b/OpenSim/Services/InventoryService/XInventoryService.cs @@ -0,0 +1,474 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using OpenMetaverse; +using log4net; +using Nini.Config; +using System.Reflection; +using OpenSim.Services.Base; +using OpenSim.Services.Interfaces; +using OpenSim.Data; +using OpenSim.Framework; + +namespace OpenSim.Services.InventoryService +{ + public class XInventoryService : ServiceBase, IInventoryService + { + private static readonly ILog m_log = + LogManager.GetLogger( + MethodBase.GetCurrentMethod().DeclaringType); + + protected IXInventoryData m_Database; + + public XInventoryService(IConfigSource config) : base(config) + { + string dllName = String.Empty; + string connString = String.Empty; + //string realm = "Inventory"; // OSG version doesn't use this + + // + // Try reading the [InventoryService] section first, if it exists + // + IConfig authConfig = config.Configs["InventoryService"]; + if (authConfig != null) + { + dllName = authConfig.GetString("StorageProvider", dllName); + connString = authConfig.GetString("ConnectionString", connString); + // realm = authConfig.GetString("Realm", realm); + } + + // + // Try reading the [DatabaseService] section, if it exists + // + IConfig dbConfig = config.Configs["DatabaseService"]; + if (dbConfig != null) + { + if (dllName == String.Empty) + dllName = dbConfig.GetString("StorageProvider", String.Empty); + if (connString == String.Empty) + connString = dbConfig.GetString("ConnectionString", String.Empty); + } + + // + // We tried, but this doesn't exist. We can't proceed. + // + if (dllName == String.Empty) + throw new Exception("No StorageProvider configured"); + + m_Database = LoadPlugin(dllName, + new Object[] {connString, String.Empty}); + if (m_Database == null) + throw new Exception("Could not find a storage interface in the given module"); + } + + public bool CreateUserInventory(UUID principalID) + { + // This is braindeaad. We can't ever communicate that we fixed + // an existing inventory. Well, just return root folder status, + // but check sanity anyway. + // + bool result = false; + + InventoryFolderBase rootFolder = GetRootFolder(principalID); + + if (rootFolder == null) + { + rootFolder = ConvertToOpenSim(CreateFolder(principalID, UUID.Zero, (int)AssetType.Folder, "My Inventory")); + result = true; + } + + XInventoryFolder[] sysFolders = GetSystemFolders(principalID); + + if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Animation) return true; return false; })) + CreateFolder(principalID, rootFolder.ID, (int)AssetType.Animation, "Animations"); + if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Bodypart) return true; return false; })) + CreateFolder(principalID, rootFolder.ID, (int)AssetType.Bodypart, "Body Parts"); + if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.CallingCard) return true; return false; })) + CreateFolder(principalID, rootFolder.ID, (int)AssetType.CallingCard, "Calling Cards"); + if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Clothing) return true; return false; })) + CreateFolder(principalID, rootFolder.ID, (int)AssetType.Clothing, "Clothing"); + if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Gesture) return true; return false; })) + CreateFolder(principalID, rootFolder.ID, (int)AssetType.Gesture, "Gestures"); + if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Landmark) return true; return false; })) + CreateFolder(principalID, rootFolder.ID, (int)AssetType.Landmark, "Landmarks"); + if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.LostAndFoundFolder) return true; return false; })) + CreateFolder(principalID, rootFolder.ID, (int)AssetType.LostAndFoundFolder, "Lost And Found"); + if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Notecard) return true; return false; })) + CreateFolder(principalID, rootFolder.ID, (int)AssetType.Notecard, "Notecards"); + if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Object) return true; return false; })) + CreateFolder(principalID, rootFolder.ID, (int)AssetType.Object, "Objects"); + if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.SnapshotFolder) return true; return false; })) + CreateFolder(principalID, rootFolder.ID, (int)AssetType.SnapshotFolder, "Photo Album"); + if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.LSLText) return true; return false; })) + CreateFolder(principalID, rootFolder.ID, (int)AssetType.LSLText, "Scripts"); + if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Sound) return true; return false; })) + CreateFolder(principalID, rootFolder.ID, (int)AssetType.Sound, "Sounds"); + if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.Texture) return true; return false; })) + CreateFolder(principalID, rootFolder.ID, (int)AssetType.Texture, "Textures"); + if (!Array.Exists(sysFolders, delegate (XInventoryFolder f) { if (f.type == (int)AssetType.TrashFolder) return true; return false; })) + CreateFolder(principalID, rootFolder.ID, (int)AssetType.TrashFolder, "Trash"); + + return result; + } + + private XInventoryFolder CreateFolder(UUID principalID, UUID parentID, int type, string name) + { + XInventoryFolder newFolder = new XInventoryFolder(); + + newFolder.folderName = name; + newFolder.type = type; + newFolder.version = 1; + newFolder.folderID = UUID.Random(); + newFolder.agentID = principalID; + newFolder.parentFolderID = parentID; + + m_Database.StoreFolder(newFolder); + + return newFolder; + } + + private XInventoryFolder[] GetSystemFolders(UUID principalID) + { + XInventoryFolder[] allFolders = m_Database.GetFolders( + new string[] { "agentID" }, + new string[] { principalID.ToString() }); + + XInventoryFolder[] sysFolders = Array.FindAll( + allFolders, + delegate (XInventoryFolder f) + { + if (f.type > 0) + return true; + return false; + }); + + return sysFolders; + } + + public List GetInventorySkeleton(UUID principalID) + { + XInventoryFolder[] allFolders = m_Database.GetFolders( + new string[] { "agentID" }, + new string[] { principalID.ToString() }); + + if (allFolders.Length == 0) + return null; + + List folders = new List(); + + foreach (XInventoryFolder x in allFolders) + folders.Add(ConvertToOpenSim(x)); + + return folders; + } + + public InventoryFolderBase GetRootFolder(UUID principalID) + { + XInventoryFolder[] folders = m_Database.GetFolders( + new string[] { "agentID", "parentFolderID"}, + new string[] { principalID.ToString(), UUID.Zero.ToString() }); + + if (folders.Length == 0) + return null; + + return ConvertToOpenSim(folders[0]); + } + + public InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) + { + XInventoryFolder[] folders = m_Database.GetFolders( + new string[] { "agentID", "type"}, + new string[] { principalID.ToString(), ((int)type).ToString() }); + + if (folders.Length == 0) + return null; + + return ConvertToOpenSim(folders[0]); + } + + public InventoryCollection GetFolderContent(UUID principalID, UUID folderID) + { + InventoryCollection inventory = new InventoryCollection(); + inventory.UserID = principalID; + inventory.Folders = new List(); + inventory.Items = new List(); + + XInventoryFolder[] folders = m_Database.GetFolders( + new string[] { "agentID", "parentFolderID"}, + new string[] { principalID.ToString(), UUID.Zero.ToString() }); + + foreach (XInventoryFolder x in folders) + inventory.Folders.Add(ConvertToOpenSim(x)); + + XInventoryItem[] items = m_Database.GetItems( + new string[] { "avatarID", "parentFolderID"}, + new string[] { principalID.ToString(), UUID.Zero.ToString() }); + + foreach (XInventoryItem i in items) + inventory.Items.Add(ConvertToOpenSim(i)); + + return inventory; + } + + public List GetFolderItems(UUID principalID, UUID folderID) + { + List invItems = new List(); + + XInventoryItem[] items = m_Database.GetItems( + new string[] { "avatarID", "parentFolderID"}, + new string[] { principalID.ToString(), UUID.Zero.ToString() }); + + foreach (XInventoryItem i in items) + invItems.Add(ConvertToOpenSim(i)); + + return invItems; + } + + public bool AddFolder(InventoryFolderBase folder) + { + XInventoryFolder xFolder = ConvertFromOpenSim(folder); + return m_Database.StoreFolder(xFolder); + } + + public bool UpdateFolder(InventoryFolderBase folder) + { + return AddFolder(folder); + } + + public bool MoveFolder(InventoryFolderBase folder) + { + XInventoryFolder[] x = m_Database.GetFolders( + new string[] { "folderID" }, + new string[] { folder.ID.ToString() }); + + if (x.Length == 0) + return false; + + x[0].parentFolderID = folder.ParentID; + + return m_Database.StoreFolder(x[0]); + } + + // We don't check the principal's ID here + // + public bool DeleteFolders(UUID principalID, List folderIDs) + { + foreach (UUID id in folderIDs) + { + InventoryFolderBase f = new InventoryFolderBase(); + f.ID = id; + PurgeFolder(f); + m_Database.DeleteFolders("folderID", id.ToString()); + } + + return true; + } + + public bool PurgeFolder(InventoryFolderBase folder) + { + XInventoryFolder[] subFolders = m_Database.GetFolders( + new string[] { "parentFolderID" }, + new string[] { folder.ID.ToString() }); + + foreach (XInventoryFolder x in subFolders) + PurgeFolder(ConvertToOpenSim(x)); + + m_Database.DeleteItems("parentFolderID", folder.ID.ToString()); + + return true; + } + + public bool AddItem(InventoryItemBase item) + { + return m_Database.StoreItem(ConvertFromOpenSim(item)); + } + + public bool UpdateItem(InventoryItemBase item) + { + return m_Database.StoreItem(ConvertFromOpenSim(item)); + } + + public bool MoveItems(UUID principalID, List items) + { + foreach (InventoryItemBase i in items) + { + m_Database.MoveItem(principalID.ToString(), i.ID.ToString(), + i.Folder.ToString()); + } + + return true; + } + + public bool DeleteItems(UUID principalID, List itemIDs) + { + foreach (UUID id in itemIDs) + m_Database.DeleteItems("inventoryID", id.ToString()); + + return true; + } + + public InventoryItemBase GetItem(InventoryItemBase item) + { + XInventoryItem[] items = m_Database.GetItems( + new string[] { "inventoryID" }, + new string[] { item.ID.ToString() }); + + if (items.Length == 0) + return null; + + return ConvertToOpenSim(items[0]); + } + + public InventoryFolderBase GetFolder(InventoryFolderBase folder) + { + XInventoryFolder[] folders = m_Database.GetFolders( + new string[] { "folderID"}, + new string[] { folder.ID.ToString() }); + + if (folders.Length == 0) + return null; + + return ConvertToOpenSim(folders[0]); + } + + public List GetActiveGestures(UUID userId) + { + return null; + } + + public int GetAssetPermissions(UUID userID, UUID assetID) + { + return 0; + } + + // CM never needed those. Left unimplemented. + // Obsolete in core + // + public InventoryCollection GetUserInventory(UUID userID) + { + return null; + } + public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) + { + } + + // Unused. + // + public bool HasInventoryForUser(UUID userID) + { + return false; + } + + // CM Helpers + // + private InventoryFolderBase ConvertToOpenSim(XInventoryFolder folder) + { + InventoryFolderBase newFolder = new InventoryFolderBase(); + + newFolder.ParentID = folder.parentFolderID; + newFolder.Type = (short)folder.type; + newFolder.Version = (ushort)folder.version; + newFolder.Name = folder.folderName; + newFolder.Owner = folder.agentID; + newFolder.ID = folder.folderID; + + return newFolder; + } + + private XInventoryFolder ConvertFromOpenSim(InventoryFolderBase folder) + { + XInventoryFolder newFolder = new XInventoryFolder(); + + newFolder.parentFolderID = folder.ParentID; + newFolder.type = (int)folder.Type; + newFolder.version = (int)folder.Version; + newFolder.folderName = folder.Name; + newFolder.agentID = folder.Owner; + newFolder.folderID = folder.ID; + + return newFolder; + } + + private InventoryItemBase ConvertToOpenSim(XInventoryItem item) + { + InventoryItemBase newItem = new InventoryItemBase(); + + newItem.AssetID = item.assetID; + newItem.AssetType = item.assetType; + newItem.Name = item.inventoryName; + newItem.Owner = item.avatarID; + newItem.ID = item.inventoryID; + newItem.InvType = item.invType; + newItem.Folder = item.parentFolderID; + newItem.CreatorId = item.creatorID.ToString(); + newItem.Description = item.inventoryDescription; + newItem.NextPermissions = (uint)item.inventoryNextPermissions; + newItem.CurrentPermissions = (uint)item.inventoryCurrentPermissions; + newItem.BasePermissions = (uint)item.inventoryBasePermissions; + newItem.EveryOnePermissions = (uint)item.inventoryEveryOnePermissions; + newItem.GroupPermissions = (uint)item.inventoryGroupPermissions; + newItem.GroupID = item.groupID; + newItem.GroupOwned = item.groupOwned; + newItem.SalePrice = item.salePrice; + newItem.SaleType = (byte)item.saleType; + newItem.Flags = (uint)item.flags; + newItem.CreationDate = item.creationDate; + + return newItem; + } + + private XInventoryItem ConvertFromOpenSim(InventoryItemBase item) + { + XInventoryItem newItem = new XInventoryItem(); + + newItem.assetID = item.AssetID; + newItem.assetType = item.AssetType; + newItem.inventoryName = item.Name; + newItem.avatarID = item.Owner; + newItem.inventoryID = item.ID; + newItem.invType = item.InvType; + newItem.parentFolderID = item.Folder; + newItem.creatorID = item.CreatorIdAsUuid; + newItem.inventoryDescription = item.Description; + newItem.inventoryNextPermissions = (int)item.NextPermissions; + newItem.inventoryCurrentPermissions = (int)item.CurrentPermissions; + newItem.inventoryBasePermissions = (int)item.BasePermissions; + newItem.inventoryEveryOnePermissions = (int)item.EveryOnePermissions; + newItem.inventoryGroupPermissions = (int)item.GroupPermissions; + newItem.groupID = item.GroupID; + newItem.groupOwned = item.GroupOwned; + newItem.salePrice = item.SalePrice; + newItem.saleType = (int)item.SaleType; + newItem.flags = (int)item.Flags; + newItem.creationDate = item.CreationDate; + + return newItem; + } + } +} -- cgit v1.1 From 0907d5d69e10ba5be79a6d03366ce3cfa59c0bec Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 4 Jan 2010 20:52:44 +0000 Subject: Finish conversion if XInventoryService --- .../Services/InventoryService/XInventoryService.cs | 58 +++++++++++++++++----- 1 file changed, 46 insertions(+), 12 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index 1e7f206..2c79c77 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs @@ -183,7 +183,10 @@ namespace OpenSim.Services.InventoryService List folders = new List(); foreach (XInventoryFolder x in allFolders) + { + m_log.DebugFormat("[INVENTORY]: Adding folder {0} to skeleton", x.folderName); folders.Add(ConvertToOpenSim(x)); + } return folders; } @@ -214,35 +217,48 @@ namespace OpenSim.Services.InventoryService public InventoryCollection GetFolderContent(UUID principalID, UUID folderID) { + // This method doesn't receive a valud principal id from the + // connector. So we disregard the principal and look + // by ID. + // + m_log.DebugFormat("[INVENTORY]: Fetch contents for folder {0}", folderID.ToString()); InventoryCollection inventory = new InventoryCollection(); inventory.UserID = principalID; inventory.Folders = new List(); inventory.Items = new List(); XInventoryFolder[] folders = m_Database.GetFolders( - new string[] { "agentID", "parentFolderID"}, - new string[] { principalID.ToString(), UUID.Zero.ToString() }); + new string[] { "parentFolderID"}, + new string[] { folderID.ToString() }); foreach (XInventoryFolder x in folders) + { + m_log.DebugFormat("[INVENTORY]: Adding folder {0} to response", x.folderName); inventory.Folders.Add(ConvertToOpenSim(x)); + } XInventoryItem[] items = m_Database.GetItems( - new string[] { "avatarID", "parentFolderID"}, - new string[] { principalID.ToString(), UUID.Zero.ToString() }); + new string[] { "parentFolderID"}, + new string[] { folderID.ToString() }); foreach (XInventoryItem i in items) + { + m_log.DebugFormat("[INVENTORY]: Adding item {0} to response", i.inventoryName); inventory.Items.Add(ConvertToOpenSim(i)); + } return inventory; } public List GetFolderItems(UUID principalID, UUID folderID) { + // Since we probably don't get a valid principal here, either ... + // List invItems = new List(); XInventoryItem[] items = m_Database.GetItems( - new string[] { "avatarID", "parentFolderID"}, - new string[] { principalID.ToString(), UUID.Zero.ToString() }); + new string[] { "parentFolderID"}, + new string[] { UUID.Zero.ToString() }); foreach (XInventoryItem i in items) invItems.Add(ConvertToOpenSim(i)); @@ -279,6 +295,8 @@ namespace OpenSim.Services.InventoryService // public bool DeleteFolders(UUID principalID, List folderIDs) { + // Ignore principal ID, it's bogus at connector level + // foreach (UUID id in folderIDs) { InventoryFolderBase f = new InventoryFolderBase(); @@ -297,7 +315,10 @@ namespace OpenSim.Services.InventoryService new string[] { folder.ID.ToString() }); foreach (XInventoryFolder x in subFolders) + { PurgeFolder(ConvertToOpenSim(x)); + m_Database.DeleteFolders("folderID", x.folderID.ToString()); + } m_Database.DeleteItems("parentFolderID", folder.ID.ToString()); @@ -316,10 +337,11 @@ namespace OpenSim.Services.InventoryService public bool MoveItems(UUID principalID, List items) { + // Principal is b0rked. *sigh* + // foreach (InventoryItemBase i in items) { - m_Database.MoveItem(principalID.ToString(), i.ID.ToString(), - i.Folder.ToString()); + m_Database.MoveItem(i.ID.ToString(), i.Folder.ToString()); } return true; @@ -327,6 +349,8 @@ namespace OpenSim.Services.InventoryService public bool DeleteItems(UUID principalID, List itemIDs) { + // Just use the ID... *facepalms* + // foreach (UUID id in itemIDs) m_Database.DeleteItems("inventoryID", id.ToString()); @@ -357,14 +381,24 @@ namespace OpenSim.Services.InventoryService return ConvertToOpenSim(folders[0]); } - public List GetActiveGestures(UUID userId) + public List GetActiveGestures(UUID principalID) { - return null; + XInventoryItem[] items = m_Database.GetActiveGestures(principalID); + + if (items.Length == 0) + return null; + + List ret = new List(); + + foreach (XInventoryItem x in items) + ret.Add(ConvertToOpenSim(x)); + + return ret; } - public int GetAssetPermissions(UUID userID, UUID assetID) + public int GetAssetPermissions(UUID principalID, UUID assetID) { - return 0; + return m_Database.GetAssetPermissions(principalID, assetID); } // CM never needed those. Left unimplemented. -- cgit v1.1 From 0f3314c04ccd07e0ff9b5be69903b0a72dd73115 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Thu, 8 Apr 2010 15:00:01 -0700 Subject: Backported GetTextureModule and IAssetService.GetCached() --- OpenSim/Services/AssetService/AssetService.cs | 5 +++++ OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs | 8 ++++++++ .../Services/Connectors/Asset/HGAssetServiceConnector.cs | 14 ++++++++++++++ OpenSim/Services/Interfaces/IAssetService.cs | 10 +++++++++- 4 files changed, 36 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs index b9723a8..ed87f3f 100644 --- a/OpenSim/Services/AssetService/AssetService.cs +++ b/OpenSim/Services/AssetService/AssetService.cs @@ -93,6 +93,11 @@ namespace OpenSim.Services.AssetService return m_Database.GetAsset(assetID); } + public AssetBase GetCached(string id) + { + return Get(id); + } + public AssetMetadata GetMetadata(string id) { UUID assetID; diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs index 8e311d7..84fbcd3 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs @@ -111,6 +111,14 @@ namespace OpenSim.Services.Connectors return asset; } + public AssetBase GetCached(string id) + { + if (m_Cache != null) + return m_Cache.Get(id); + + return null; + } + public AssetMetadata GetMetadata(string id) { if (m_Cache != null) diff --git a/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs index 677169d..34df54a 100644 --- a/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs @@ -116,6 +116,20 @@ namespace OpenSim.Services.Connectors return null; } + public AssetBase GetCached(string id) + { + string url = string.Empty; + string assetID = string.Empty; + + if (StringToUrlAndAssetID(id, out url, out assetID)) + { + IAssetService connector = GetConnector(url); + return connector.GetCached(assetID); + } + + return null; + } + public AssetMetadata GetMetadata(string id) { string url = string.Empty; diff --git a/OpenSim/Services/Interfaces/IAssetService.cs b/OpenSim/Services/Interfaces/IAssetService.cs index 6dfe78d..3be6815 100644 --- a/OpenSim/Services/Interfaces/IAssetService.cs +++ b/OpenSim/Services/Interfaces/IAssetService.cs @@ -51,7 +51,15 @@ namespace OpenSim.Services.Interfaces byte[] GetData(string id); /// - /// Get an asset asynchronously + /// 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 + AssetBase GetCached(string id); + + /// + /// Get an asset synchronously or asynchronously (depending on whether + /// it is locally cached) and fire a callback with the fetched asset /// /// The asset id /// Represents the requester. Passed back via the handler -- cgit v1.1 From 71f42f185a48ef96391b39fa0197c1a8b793e969 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 24 Apr 2010 16:45:25 +0200 Subject: Plumb a data path to initialize an attachment from an alternate source --- OpenSim/Services/Interfaces/IAttachmentsService.cs | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 OpenSim/Services/Interfaces/IAttachmentsService.cs (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/IAttachmentsService.cs b/OpenSim/Services/Interfaces/IAttachmentsService.cs new file mode 100644 index 0000000..3b9f2f2 --- /dev/null +++ b/OpenSim/Services/Interfaces/IAttachmentsService.cs @@ -0,0 +1,31 @@ +//////////////////////////////////////////////////////////////// +// +// (c) 2009, 2010 Careminster Limited and Melanie Thielker +// +// All rights reserved +// +using System; +using System.Diagnostics; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Threading; +using System.Reflection; +using OpenSim.Framework; +using OpenSim.Framework.Console; +using OpenSim.Server.Base; +using OpenSim.Services.Base; +using OpenSim.Services.Interfaces; +using Nini.Config; +using log4net; +using Careminster; +using OpenMetaverse; + +namespace Careminster +{ + public interface IAttachmentsService + { + string Get(string id); + void Store(string id, string data); + } +} -- cgit v1.1 From 27b3f23ff3c7b040885784b46a90e9523e633e93 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 24 Apr 2010 16:53:47 +0200 Subject: Remove some usings that stopped compilation --- OpenSim/Services/Interfaces/IAttachmentsService.cs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/IAttachmentsService.cs b/OpenSim/Services/Interfaces/IAttachmentsService.cs index 3b9f2f2..bdde369 100644 --- a/OpenSim/Services/Interfaces/IAttachmentsService.cs +++ b/OpenSim/Services/Interfaces/IAttachmentsService.cs @@ -5,23 +5,9 @@ // All rights reserved // using System; -using System.Diagnostics; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Threading; -using System.Reflection; -using OpenSim.Framework; -using OpenSim.Framework.Console; -using OpenSim.Server.Base; -using OpenSim.Services.Base; -using OpenSim.Services.Interfaces; using Nini.Config; -using log4net; -using Careminster; -using OpenMetaverse; -namespace Careminster +namespace OpenSim.Services.Interfaces { public interface IAttachmentsService { -- cgit v1.1 From 9c79fd630819412f4db94c86caea73200933db5d Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 30 Apr 2010 05:33:45 +0100 Subject: Treat a UserLevel of -1 as an unverified account and refer them to their activation email. --- OpenSim/Services/LLLoginService/LLLoginResponse.cs | 5 +++++ OpenSim/Services/LLLoginService/LLLoginService.cs | 6 ++++++ 2 files changed, 11 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index ee30fa3..0cd8f5b 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs @@ -57,6 +57,7 @@ namespace OpenSim.Services.LLLoginService public static LLFailedLoginResponse InventoryProblem; public static LLFailedLoginResponse DeadRegionProblem; public static LLFailedLoginResponse LoginBlockedProblem; + public static LLFailedLoginResponse UnverifiedAccountProblem; public static LLFailedLoginResponse AlreadyLoggedInProblem; public static LLFailedLoginResponse InternalError; @@ -80,6 +81,10 @@ namespace OpenSim.Services.LLLoginService LoginBlockedProblem = new LLFailedLoginResponse("presence", "Logins are currently restricted. Please try again later.", "false"); + UnverifiedAccountProblem = new LLFailedLoginResponse("presence", + "Your account has not yet been verified. Please check " + + "your email and click the provided link.", + "false"); AlreadyLoggedInProblem = new LLFailedLoginResponse("presence", "You appear to be already logged in. " + "If this is not the case please wait for your session to timeout. " + diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 4d7dfd1..5301140 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -164,6 +164,12 @@ namespace OpenSim.Services.LLLoginService return LLFailedLoginResponse.UserProblem; } + if (account.UserLevel < 0) + { + m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: Unverified account"); + return LLFailedLoginResponse.UnverifiedAccountProblem; + } + if (account.UserLevel < m_MinLoginLevel) { m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: login is blocked for user level {0}", account.UserLevel); -- cgit v1.1 From 881fcb7def0ef1ff81c6de10137abcdca8bc7679 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 30 Apr 2010 23:32:58 +0200 Subject: Allow retrieval if admin users in scope mode --- .../Services/UserAccountService/UserAccountService.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index 7b38aa6..35e2826 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs @@ -104,6 +104,12 @@ namespace OpenSim.Services.UserAccountService d = m_Database.Get( new string[] { "ScopeID", "FirstName", "LastName" }, new string[] { scopeID.ToString(), firstName, lastName }); + if (d.Length < 1) + { + d = m_Database.Get( + new string[] { "ScopeID", "FirstName", "LastName" }, + new string[] { UUID.Zero.ToString(), firstName, lastName }); + } } else { @@ -172,6 +178,12 @@ namespace OpenSim.Services.UserAccountService d = m_Database.Get( new string[] { "ScopeID", "Email" }, new string[] { scopeID.ToString(), email }); + if (d.Length < 1) + { + d = m_Database.Get( + new string[] { "ScopeID", "Email" }, + new string[] { UUID.Zero.ToString(), email }); + } } else { @@ -195,6 +207,12 @@ namespace OpenSim.Services.UserAccountService d = m_Database.Get( new string[] { "ScopeID", "PrincipalID" }, new string[] { scopeID.ToString(), principalID.ToString() }); + if (d.Length < 1) + { + d = m_Database.Get( + new string[] { "ScopeID", "PrincipalID" }, + new string[] { UUID.Zero.ToString(), principalID.ToString() }); + } } else { -- cgit v1.1 From 175f3f992ab487add20253329bef481a4d20f8aa Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 3 May 2010 01:50:32 +0200 Subject: Make the IUserAccountData properly unpack the god mode data, so grid gods work again --- .../Services/Connectors/UserAccounts/UserAccountServiceConnector.cs | 2 +- OpenSim/Services/Interfaces/IUserAccountService.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs index 1527db2..38c191a 100644 --- a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs @@ -113,7 +113,7 @@ namespace OpenSim.Services.Connectors public virtual UserAccount GetUserAccount(UUID scopeID, UUID userID) { - m_log.DebugFormat("[ACCOUNTS CONNECTOR]: GetUSerAccount {0}", userID); + m_log.DebugFormat("[ACCOUNTS CONNECTOR]: GetUserAccount {0}", userID); Dictionary sendData = new Dictionary(); //sendData["SCOPEID"] = scopeID.ToString(); sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString(); diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs index befd14e..e316731 100644 --- a/OpenSim/Services/Interfaces/IUserAccountService.cs +++ b/OpenSim/Services/Interfaces/IUserAccountService.cs @@ -84,11 +84,11 @@ namespace OpenSim.Services.Interfaces if (kvp.ContainsKey("ScopeID")) UUID.TryParse(kvp["ScopeID"].ToString(), out ScopeID); if (kvp.ContainsKey("UserLevel")) - Convert.ToInt32(kvp["UserLevel"].ToString()); + UserLevel = Convert.ToInt32(kvp["UserLevel"].ToString()); if (kvp.ContainsKey("UserFlags")) - Convert.ToInt32(kvp["UserFlags"].ToString()); + UserFlags = Convert.ToInt32(kvp["UserFlags"].ToString()); if (kvp.ContainsKey("UserTitle")) - Email = kvp["UserTitle"].ToString(); + UserTitle = kvp["UserTitle"].ToString(); if (kvp.ContainsKey("Created")) Convert.ToInt32(kvp["Created"].ToString()); -- cgit v1.1 From 65775b87e5000a07634240ab8ce39aaecd30d1e6 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 5 May 2010 23:06:36 +0200 Subject: Add a XMLRPC method to remotely set the login level for the LLLoginService. This requires a special XMLRPC call, which has to supply the credentials of a god user (User level >= 200). Disabled by default. Also Adds a configuration option to set the initial permitted login level. --- OpenSim/Services/Interfaces/ILoginService.cs | 1 + OpenSim/Services/LLLoginService/LLLoginService.cs | 53 +++++++++++++++++++++++ 2 files changed, 54 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/ILoginService.cs b/OpenSim/Services/Interfaces/ILoginService.cs index 49efbe2..513ab4a 100644 --- a/OpenSim/Services/Interfaces/ILoginService.cs +++ b/OpenSim/Services/Interfaces/ILoginService.cs @@ -48,6 +48,7 @@ namespace OpenSim.Services.Interfaces public interface ILoginService { LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, IPEndPoint clientIP); + Hashtable SetLevel(string firstName, string lastName, string passwd, int level, IPEndPoint clientIP); } diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 5301140..5b950e0 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -26,6 +26,7 @@ */ using System; +using System.Collections; using System.Collections.Generic; using System.Net; using System.Reflection; @@ -70,6 +71,7 @@ namespace OpenSim.Services.LLLoginService private bool m_RequireInventory; protected int m_MinLoginLevel; private string m_GatekeeperURL; + private bool m_AllowRemoteSetLoginLevel; IConfig m_LoginServerConfig; @@ -93,6 +95,8 @@ namespace OpenSim.Services.LLLoginService m_DefaultRegionName = m_LoginServerConfig.GetString("DefaultRegion", String.Empty); m_WelcomeMessage = m_LoginServerConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); m_RequireInventory = m_LoginServerConfig.GetBoolean("RequireInventory", true); + m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false); + m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0); m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty); // These are required; the others aren't @@ -147,6 +151,55 @@ namespace OpenSim.Services.LLLoginService { } + public Hashtable SetLevel(string firstName, string lastName, string passwd, int level, IPEndPoint clientIP) + { + Hashtable response = new Hashtable(); + response["success"] = "false"; + + if (!m_AllowRemoteSetLoginLevel) + return response; + + try + { + UserAccount account = m_UserAccountService.GetUserAccount(UUID.Zero, firstName, lastName); + if (account == null) + { + m_log.InfoFormat("[LLOGIN SERVICE]: Set Level failed, user {0} {1} not found", firstName, lastName); + return response; + } + + if (account.UserLevel < 200) + { + m_log.InfoFormat("[LLOGIN SERVICE]: Set Level failed, reason: user level too low"); + return response; + } + + // + // Authenticate this user + // + // We don't support clear passwords here + // + string token = m_AuthenticationService.Authenticate(account.PrincipalID, passwd, 30); + UUID secureSession = UUID.Zero; + if ((token == string.Empty) || (token != string.Empty && !UUID.TryParse(token, out secureSession))) + { + m_log.InfoFormat("[LLOGIN SERVICE]: SetLevel failed, reason: authentication failed"); + return response; + } + } + catch (Exception e) + { + m_log.Error("[LLOGIN SERVICE]: SetLevel failed, exception " + e.ToString()); + return response; + } + + m_MinLoginLevel = level; + m_log.InfoFormat("[LLOGIN SERVICE]: Login level set to {0} by {1} {2}", level, firstName, lastName); + + response["success"] = true; + return response; + } + public LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, IPEndPoint clientIP) { bool success = false; -- cgit v1.1 From 733a07e061cdcb6095677758a264ba976bb94b93 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 6 May 2010 00:34:49 +0200 Subject: Plumb the viewer version string through into AgentCircuitData. Now all that is left os to figure out what black magic turns AgentCircuitData into AgentData and then copy that into the ScenePresence, where m_Viewer is already added with this commit and waits for the data. --- OpenSim/Services/Interfaces/ILoginService.cs | 2 +- OpenSim/Services/LLLoginService/LLLoginService.cs | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/ILoginService.cs b/OpenSim/Services/Interfaces/ILoginService.cs index 513ab4a..9e57339 100644 --- a/OpenSim/Services/Interfaces/ILoginService.cs +++ b/OpenSim/Services/Interfaces/ILoginService.cs @@ -47,7 +47,7 @@ namespace OpenSim.Services.Interfaces public interface ILoginService { - LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, IPEndPoint clientIP); + LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, string clientVersion, IPEndPoint clientIP); Hashtable SetLevel(string firstName, string lastName, string passwd, int level, IPEndPoint clientIP); } diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 5b950e0..9efdd11 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -200,7 +200,7 @@ namespace OpenSim.Services.LLLoginService return response; } - public LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, IPEndPoint clientIP) + public LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, string clientVersion, IPEndPoint clientIP) { bool success = false; UUID session = UUID.Random(); @@ -326,7 +326,7 @@ namespace OpenSim.Services.LLLoginService // Instantiate/get the simulation interface and launch an agent at the destination // string reason = string.Empty; - AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, out where, out reason); + AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, clientVersion, out where, out reason); if (aCircuit == null) { @@ -592,7 +592,7 @@ namespace OpenSim.Services.LLLoginService } protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarData avatar, - UUID session, UUID secureSession, Vector3 position, string currentWhere, out string where, out string reason) + UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, out string where, out string reason) { where = currentWhere; ISimulationService simConnector = null; @@ -632,7 +632,7 @@ namespace OpenSim.Services.LLLoginService if (m_UserAgentService == null && simConnector != null) { circuitCode = (uint)Util.RandomClass.Next(); ; - aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position); + aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, viewer); success = LaunchAgentDirectly(simConnector, destination, aCircuit, out reason); if (!success && m_GridService != null) { @@ -657,7 +657,7 @@ namespace OpenSim.Services.LLLoginService if (m_UserAgentService != null) { circuitCode = (uint)Util.RandomClass.Next(); ; - aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position); + aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, viewer); success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, out reason); if (!success && m_GridService != null) { @@ -686,7 +686,7 @@ namespace OpenSim.Services.LLLoginService } private AgentCircuitData MakeAgent(GridRegion region, UserAccount account, - AvatarData avatar, UUID session, UUID secureSession, uint circuit, Vector3 position) + AvatarData avatar, UUID session, UUID secureSession, uint circuit, Vector3 position, string viewer) { AgentCircuitData aCircuit = new AgentCircuitData(); @@ -707,6 +707,7 @@ namespace OpenSim.Services.LLLoginService aCircuit.SecureSessionID = secureSession; aCircuit.SessionID = session; aCircuit.startpos = position; + aCircuit.Viewer = viewer; SetServiceURLs(aCircuit, account); return aCircuit; -- cgit v1.1 From 9079ad5ceb3cfb9ddb0c255289b288be40f6567e Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Thu, 13 May 2010 12:40:18 -0700 Subject: Add some debug output to GetAgent to try and track down our presence problems --- OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs b/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs index 41ebeaf..9f86078 100644 --- a/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs +++ b/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs @@ -300,6 +300,14 @@ namespace OpenSim.Services.Connectors { pinfo = new PresenceInfo((Dictionary)replyData["result"]); } + else + { + m_log.DebugFormat("[PRESENCE CONNECTOR]: Invalid reply (result not dictionary) received from presence server when querying for sessionID {0}", sessionID.ToString()); + } + } + else + { + m_log.DebugFormat("[PRESENCE CONNECTOR]: Invalid reply received from presence server when querying for sessionID {0}", sessionID.ToString()); } return pinfo; -- cgit v1.1 From 1c040d8c1ed5ee1ba1e80aa1d248a9b06d1790a5 Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Tue, 18 May 2010 03:24:43 -0700 Subject: Fix to the scenario where we send an agent to a neighbouring sim (via teleport), then tell our neighbours to close the agents.. thereby disconnecting the user. Added a new CloseChildAgent method in lieu of CloseAgent. This has been a long standing problem - with any luck this will cure it. --- .../Connectors/Simulation/SimulationServiceConnector.cs | 14 +++++++++++++- OpenSim/Services/Interfaces/ISimulationService.cs | 8 ++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index ff0dd7e..8e0063b 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -442,7 +442,7 @@ namespace OpenSim.Services.Connectors.Simulation return true; } - public bool CloseAgent(GridRegion destination, UUID id) + private bool CloseAgent(GridRegion destination, UUID id, bool ChildOnly) { string uri = string.Empty; try @@ -459,6 +459,8 @@ namespace OpenSim.Services.Connectors.Simulation WebRequest request = WebRequest.Create(uri); request.Method = "DELETE"; + if (ChildOnly) + request.Method += "CHILD"; request.Timeout = 10000; StreamReader sr = null; @@ -491,6 +493,16 @@ namespace OpenSim.Services.Connectors.Simulation return true; } + public bool CloseChildAgent(GridRegion destination, UUID id) + { + return CloseAgent(destination, id, true); + } + + public bool CloseAgent(GridRegion destination, UUID id) + { + return CloseAgent(destination, id, false); + } + #endregion Agents #region Objects diff --git a/OpenSim/Services/Interfaces/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs index 67d7cbe..33d6fde 100644 --- a/OpenSim/Services/Interfaces/ISimulationService.cs +++ b/OpenSim/Services/Interfaces/ISimulationService.cs @@ -71,6 +71,14 @@ namespace OpenSim.Services.Interfaces bool ReleaseAgent(UUID originRegion, UUID id, string uri); /// + /// Close child agent. + /// + /// + /// + /// + bool CloseChildAgent(GridRegion destination, UUID id); + + /// /// Close agent. /// /// -- cgit v1.1 From e7bf6afd3afa5fc4760b417e0c0e079f23d20f59 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 29 May 2010 05:14:18 +0200 Subject: Get the user's DOB back from the server response properly. --- OpenSim/Services/Interfaces/IUserAccountService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs index e316731..09d1d87 100644 --- a/OpenSim/Services/Interfaces/IUserAccountService.cs +++ b/OpenSim/Services/Interfaces/IUserAccountService.cs @@ -91,7 +91,7 @@ namespace OpenSim.Services.Interfaces UserTitle = kvp["UserTitle"].ToString(); if (kvp.ContainsKey("Created")) - Convert.ToInt32(kvp["Created"].ToString()); + Created = Convert.ToInt32(kvp["Created"].ToString()); if (kvp.ContainsKey("ServiceURLs") && kvp["ServiceURLs"] != null) { ServiceURLs = new Dictionary(); -- cgit v1.1 From 2f409116db570be77fc75df188a4044250dce226 Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Sat, 29 May 2010 01:03:59 -0700 Subject: Stop IGridService from throwing a fatal exception when an IPEndPoint cannot be resolved, and add some handlers to deal with this cleanly; a condition was observed on OSGrid where a neighbouring region with an invalid (unresolveable) hostname would prevent a region from starting. This is bad. --- .../Connectors/Hypergrid/GatekeeperServiceConnector.cs | 14 ++++++++++++-- OpenSim/Services/Connectors/Land/LandServiceConnector.cs | 2 ++ .../Connectors/Neighbour/NeighbourServiceConnector.cs | 4 +++- .../Connectors/SimianGrid/SimianGridServiceConnector.cs | 4 +++- .../Connectors/Simulation/SimulationServiceConnector.cs | 8 ++++++-- OpenSim/Services/Interfaces/IGridService.cs | 8 ++++++-- OpenSim/Services/LLLoginService/LLLoginResponse.cs | 1 + 7 files changed, 33 insertions(+), 8 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index c426bba..6f159a0 100644 --- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs @@ -87,7 +87,12 @@ namespace OpenSim.Services.Connectors.Hypergrid paramList.Add(hash); XmlRpcRequest request = new XmlRpcRequest("link_region", paramList); - string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/"; + IPEndPoint ext = info.ExternalEndPoint; + string uri = ""; + if (ext != null) + { + uri = "http://" + ext.Address + ":" + info.HttpPort + "/"; + } //m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri); XmlRpcResponse response = null; try @@ -189,7 +194,12 @@ namespace OpenSim.Services.Connectors.Hypergrid paramList.Add(hash); XmlRpcRequest request = new XmlRpcRequest("get_region", paramList); - string uri = "http://" + gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/"; + IPEndPoint ext = gatekeeper.ExternalEndPoint; + string uri = ""; + if (ext != null) + { + uri = "http://" + ext.Address + ":" + gatekeeper.HttpPort + "/"; + } m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + uri); XmlRpcResponse response = null; try diff --git a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs index 06bc11c..0223a77 100644 --- a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs +++ b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs @@ -83,6 +83,8 @@ namespace OpenSim.Services.Connectors if (info != null) // just to be sure { XmlRpcRequest request = new XmlRpcRequest("land_data", paramList); + + //Possible nullref from info.externalendpoint will be caught here string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/"; XmlRpcResponse response = request.Send(uri, 10000); if (response.IsFault) diff --git a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs b/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs index 0a982f8..daf0439 100644 --- a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs +++ b/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs @@ -87,7 +87,9 @@ namespace OpenSim.Services.Connectors public bool DoHelloNeighbourCall(GridRegion region, RegionInfo thisRegion) { - string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/region/" + thisRegion.RegionID + "/"; + IPEndPoint ext = region.ExternalEndPoint; + if (ext == null) return false; + string uri = "http://" + ext.Address + ":" + region.HttpPort + "/region/" + thisRegion.RegionID + "/"; //m_log.Debug(" >>> DoHelloNeighbourCall <<< " + uri); WebRequest HelloNeighbourRequest = WebRequest.Create(uri); diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs index 3a61226..57924b7 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs @@ -104,6 +104,8 @@ namespace OpenSim.Services.Connectors.SimianGrid public string RegisterRegion(UUID scopeID, GridRegion regionInfo) { + IPEndPoint ext = regionInfo.ExternalEndPoint; + if (ext == null) return "Region registration for " + regionInfo.RegionName + " failed: Could not resolve EndPoint"; Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0); Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, 4096.0); @@ -114,7 +116,7 @@ namespace OpenSim.Services.Connectors.SimianGrid { "ServerURI", OSD.FromString(regionInfo.ServerURI) }, { "InternalAddress", OSD.FromString(regionInfo.InternalEndPoint.Address.ToString()) }, { "InternalPort", OSD.FromInteger(regionInfo.InternalEndPoint.Port) }, - { "ExternalAddress", OSD.FromString(regionInfo.ExternalEndPoint.Address.ToString()) }, + { "ExternalAddress", OSD.FromString(ext.Address.ToString()) }, { "ExternalPort", OSD.FromInteger(regionInfo.ExternalEndPoint.Port) }, { "MapTexture", OSD.FromUUID(regionInfo.TerrainImage) }, { "Access", OSD.FromInteger(regionInfo.Access) }, diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 8e0063b..748faef 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -348,9 +348,11 @@ namespace OpenSim.Services.Connectors.Simulation public bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent) { + IPEndPoint ext = destination.ExternalEndPoint; agent = null; + if (ext == null) return false; // Eventually, we want to use a caps url instead of the agentID - string uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; + string uri = "http://" + ext.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; //Console.WriteLine(" >>> DoRetrieveRootAgentCall <<< " + uri); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); @@ -514,8 +516,10 @@ namespace OpenSim.Services.Connectors.Simulation public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall) { + IPEndPoint ext = destination.ExternalEndPoint; + if (ext == null) return false; string uri - = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + ObjectPath() + sog.UUID + "/"; + = "http://" + ext.Address + ":" + destination.HttpPort + ObjectPath() + sog.UUID + "/"; //m_log.Debug(" >>> DoCreateObjectCall <<< " + uri); WebRequest ObjectCreateRequest = WebRequest.Create(uri); diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index e55b633..94cee57 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs @@ -259,9 +259,13 @@ namespace OpenSim.Services.Interfaces } catch (SocketException e) { - throw new Exception( + /*throw new Exception( "Unable to resolve local hostname " + m_externalHostName + " innerException of type '" + - e + "' attached to this exception", e); + e + "' attached to this exception", e);*/ + // Don't throw a fatal exception here, instead, return Null and handle it in the caller. + // Reason is, on systems such as OSgrid it has occured that known hostnames stop + // resolving and thus make surrounding regions crash out with this exception. + return null; } return new IPEndPoint(ia, m_internalEndPoint.Port); diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index edf41bc..6a2cbeb 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs @@ -327,6 +327,7 @@ namespace OpenSim.Services.LLLoginService private void FillOutRegionData(GridRegion destination) { IPEndPoint endPoint = destination.ExternalEndPoint; + if (endPoint == null) return; SimAddress = endPoint.Address.ToString(); SimPort = (uint)endPoint.Port; RegionX = (uint)destination.RegionLocX; -- cgit v1.1 From 31439293ccdb5df914dc13287a8f178529fccb6b Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Sat, 29 May 2010 03:56:34 -0700 Subject: Meta7 Communities : Authorization service added, skeleton, not yet functional --- .../Services/Meta7Communities/Meta7Communities.cs | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 OpenSim/Services/Meta7Communities/Meta7Communities.cs (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Meta7Communities/Meta7Communities.cs b/OpenSim/Services/Meta7Communities/Meta7Communities.cs new file mode 100644 index 0000000..32f5c32 --- /dev/null +++ b/OpenSim/Services/Meta7Communities/Meta7Communities.cs @@ -0,0 +1,59 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Reflection; +using Nini.Config; +using log4net; +using OpenSim.Framework; +using OpenSim.Framework.Console; +using OpenSim.Data; +using OpenSim.Services.Interfaces; +using OpenSim.Services.AuthorizationService; +using OpenMetaverse; + +namespace OpenSim.Services.Meta7Communities +{ + public class Meta7Communities : AuthorizationServiceBase, IAuthorizationService + { + private static readonly ILog m_log = + LogManager.GetLogger( + MethodBase.GetCurrentMethod().DeclaringType); + + public Meta7Communities(IConfigSource config) + : base(config) + { + m_log.Info("[Communities]: Local Authorization service enabled"); + } + + public bool IsAuthorizedForRegion(string userID, string regionID, out string message) + { + message = "NO GOATS"; + return false; + } + } +} -- cgit v1.1 From 84e30bee6dce30853cf4438382b39e65ec3fa622 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 29 May 2010 12:34:02 +0200 Subject: Revert "Meta7 Communities : Authorization service added, skeleton, not yet functional" This reverts commit 31439293ccdb5df914dc13287a8f178529fccb6b. --- .../Services/Meta7Communities/Meta7Communities.cs | 59 ---------------------- 1 file changed, 59 deletions(-) delete mode 100644 OpenSim/Services/Meta7Communities/Meta7Communities.cs (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Meta7Communities/Meta7Communities.cs b/OpenSim/Services/Meta7Communities/Meta7Communities.cs deleted file mode 100644 index 32f5c32..0000000 --- a/OpenSim/Services/Meta7Communities/Meta7Communities.cs +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Reflection; -using Nini.Config; -using log4net; -using OpenSim.Framework; -using OpenSim.Framework.Console; -using OpenSim.Data; -using OpenSim.Services.Interfaces; -using OpenSim.Services.AuthorizationService; -using OpenMetaverse; - -namespace OpenSim.Services.Meta7Communities -{ - public class Meta7Communities : AuthorizationServiceBase, IAuthorizationService - { - private static readonly ILog m_log = - LogManager.GetLogger( - MethodBase.GetCurrentMethod().DeclaringType); - - public Meta7Communities(IConfigSource config) - : base(config) - { - m_log.Info("[Communities]: Local Authorization service enabled"); - } - - public bool IsAuthorizedForRegion(string userID, string regionID, out string message) - { - message = "NO GOATS"; - return false; - } - } -} -- cgit v1.1 From 06fa0388750b939ede9e3d7783e41a574e101397 Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Mon, 28 Jun 2010 07:09:05 -0700 Subject: Return a UUID.Zero if the asset fails to upload --- OpenSim/Services/AssetService/AssetService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs index 470a4dd..3122382 100644 --- a/OpenSim/Services/AssetService/AssetService.cs +++ b/OpenSim/Services/AssetService/AssetService.cs @@ -144,7 +144,10 @@ namespace OpenSim.Services.AssetService public string Store(AssetBase asset) { //m_log.DebugFormat("[ASSET SERVICE]: Store asset {0} {1}", asset.Name, asset.ID); - m_Database.StoreAsset(asset); + if (!m_Database.StoreAsset(asset)) + { + return UUID.Zero.ToString(); + } return asset.ID; } -- cgit v1.1 From 8dc7c0849eecaea09ce3571bab28b44c17bb3743 Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Tue, 29 Jun 2010 23:18:48 -0700 Subject: The other half of the asset fix. Implement an exponentially incrementing retry timer for asset upload failures. Total queue time in the ballpark of 24 hours, which should be a reasonable time for any grid admin to get their asset service back online. This should stop lost assets. --- .../Connectors/Asset/AssetServiceConnector.cs | 99 +++++++++++++++++++--- 1 file changed, 88 insertions(+), 11 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs index 65b3537..ae600bb 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs @@ -30,6 +30,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Reflection; +using System.Timers; using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Console; @@ -48,7 +49,9 @@ namespace OpenSim.Services.Connectors private string m_ServerURI = String.Empty; private IImprovedAssetCache m_Cache = null; - + private int m_retryCounter; + private Dictionary> m_retryQueue = new Dictionary>(); + private Timer m_retryTimer; public AssetServicesConnector() { } @@ -85,6 +88,55 @@ namespace OpenSim.Services.Connectors MainConsole.Instance.Commands.AddCommand("asset", false, "dump asset", "dump asset ", "dump one cached asset", HandleDumpAsset); + + m_retryTimer = new Timer(); + m_retryTimer.Elapsed += new ElapsedEventHandler(retryCheck); + m_retryTimer.Interval = 60000; + } + + protected void retryCheck(object source, ElapsedEventArgs e) + { + m_retryCounter++; + if (m_retryCounter > 60) m_retryCounter -= 60; + List keys = new List(); + foreach (int a in m_retryQueue.Keys) + { + keys.Add(a); + } + foreach (int a in keys) + { + //We exponentially fall back on frequency until we reach one attempt per hour + //The net result is that we end up in the queue for roughly 24 hours.. + //24 hours worth of assets could be a lot, so the hope is that the region admin + //will have gotten the asset connector back online quickly! + + int timefactor = a ^ 2; + if (timefactor > 60) + { + timefactor = 60; + } + + //First, find out if we care about this timefactor + if (timefactor % a == 0) + { + //Yes, we do! + List retrylist = m_retryQueue[a]; + m_retryQueue.Remove(a); + + foreach(AssetBase ass in retrylist) + { + Store(ass); //Store my ass. This function will put it back in the dictionary if it fails + } + } + } + + if (m_retryQueue.Count == 0) + { + //It might only be one tick per minute, but I have + //repented and abandoned my wasteful ways + m_retryCounter = 0; + m_retryTimer.Stop(); + } } protected void SetCache(IImprovedAssetCache cache) @@ -222,20 +274,45 @@ namespace OpenSim.Services.Connectors } catch (Exception e) { - m_log.WarnFormat("[ASSET CONNECTOR]: Unable to send asset {0} to asset server. Reason: {1}", asset.ID, e.Message); + newID = UUID.Zero.ToString(); } - if (newID != String.Empty) + if (newID == UUID.Zero.ToString()) { - // Placing this here, so that this work with old asset servers that don't send any reply back - // SynchronousRestObjectRequester returns somethins that is not an empty string - if (newID != null) - asset.ID = newID; - - if (m_Cache != null) - m_Cache.Cache(asset); + //The asset upload failed, put it in a queue for later + asset.UploadAttempts++; + if (asset.UploadAttempts > 30) + { + //By this stage we've been in the queue for a good few hours; + //We're going to drop the asset. + m_log.ErrorFormat("[Assets] Dropping asset {0} - Upload has been in the queue for too long.", asset.ID.ToString()); + } + else + { + if (!m_retryQueue.ContainsKey(asset.UploadAttempts)) + { + m_retryQueue.Add(asset.UploadAttempts, new List()); + } + List m_queue = m_retryQueue[asset.UploadAttempts]; + m_queue.Add(asset); + m_log.WarnFormat("[Assets] Upload failed: {0} - Requeuing asset for another run.", asset.ID.ToString()); + m_retryTimer.Start(); + } + } + else + { + if (newID != String.Empty) + { + // Placing this here, so that this work with old asset servers that don't send any reply back + // SynchronousRestObjectRequester returns somethins that is not an empty string + if (newID != null) + asset.ID = newID; + + if (m_Cache != null) + m_Cache.Cache(asset); + } } - return newID; + return asset.ID; } public bool UpdateContent(string id, byte[] data) -- cgit v1.1 From 1cb7695fb0bcdcbdbb6f2a410fd9f337438afef7 Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Thu, 1 Jul 2010 08:48:02 -0700 Subject: Catch newid == null which is what happens if the asset service is offline (seems a connection failure does not throw an exception) --- OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs index ae600bb..bc56963 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs @@ -271,6 +271,10 @@ namespace OpenSim.Services.Connectors { newID = SynchronousRestObjectRequester. MakeRequest("POST", uri, asset); + if (newID == null) + { + newID = UUID.Zero.ToString(); + } } catch (Exception e) { -- cgit v1.1 From 38384cc79c04fe9b97070104283be02511c4e12c Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Thu, 1 Jul 2010 08:52:30 -0700 Subject: Report asset upload success if it has previously failed --- OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs index bc56963..bbccef9 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs @@ -305,6 +305,10 @@ namespace OpenSim.Services.Connectors } else { + if (asset.UploadAttempts > 0) + { + m_log.InfoFormat("[Assets] Upload of {0} succeeded after {1} failed attempts", asset.ID.ToString(), asset.UploadAttempts.ToString())); + } if (newID != String.Empty) { // Placing this here, so that this work with old asset servers that don't send any reply back -- cgit v1.1 From b38a22506b31041e29a1271db32046efcb14af4e Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Thu, 1 Jul 2010 08:55:52 -0700 Subject: Fix build break --- OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs index bbccef9..94acd6c 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs @@ -307,7 +307,7 @@ namespace OpenSim.Services.Connectors { if (asset.UploadAttempts > 0) { - m_log.InfoFormat("[Assets] Upload of {0} succeeded after {1} failed attempts", asset.ID.ToString(), asset.UploadAttempts.ToString())); + m_log.InfoFormat("[Assets] Upload of {0} succeeded after {1} failed attempts", asset.ID.ToString(), asset.UploadAttempts.ToString()); } if (newID != String.Empty) { -- cgit v1.1 From 071d601dcbd812bf2e3b163a53323ab5e00a315e Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Thu, 1 Jul 2010 09:46:57 -0700 Subject: Cache all assets on upload so that the client can still retrieve the asset if it enters a retry queue --- OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs index 94acd6c..e63dd50 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs @@ -256,11 +256,10 @@ namespace OpenSim.Services.Connectors public string Store(AssetBase asset) { + if (m_Cache != null) + m_Cache.Cache(asset); if (asset.Temporary || asset.Local) { - if (m_Cache != null) - m_Cache.Cache(asset); - return asset.ID; } -- cgit v1.1 From 2b49cb922799aadcdb93225d74735fcf7da94bbd Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Sat, 3 Jul 2010 06:09:20 -0700 Subject: Make sure the AssetServiceConnector times out within 30 seconds. If it doesn't, the client will get bored and give an upload error, instead of granting success and entering the asset into our retry queue. --- OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs index e63dd50..1f40312 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs @@ -269,8 +269,8 @@ namespace OpenSim.Services.Connectors try { newID = SynchronousRestObjectRequester. - MakeRequest("POST", uri, asset); - if (newID == null) + MakeRequest("POST", uri, asset, 25); + if (newID == null || newID == "") { newID = UUID.Zero.ToString(); } -- cgit v1.1 From 3368e3853ae931e8e7137dc10a410265b4afbd5a Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Sun, 4 Jul 2010 06:45:04 -0700 Subject: Check cached asset to make sure it contains data, and if not, re-request --- OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs index 1f40312..ad18a23 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs @@ -151,8 +151,8 @@ namespace OpenSim.Services.Connectors AssetBase asset = null; if (m_Cache != null) asset = m_Cache.Get(id); - - if (asset == null) + + if (asset == null || asset.Data == null || asset.Data.Length == 0) { asset = SynchronousRestObjectRequester. MakeRequest("GET", uri, 0); @@ -229,7 +229,7 @@ namespace OpenSim.Services.Connectors if (m_Cache != null) asset = m_Cache.Get(id); - if (asset == null) + if (asset == null || asset.Data == null || asset.Data.Length == 0) { bool result = false; -- cgit v1.1 From d9ae8370632810ae10bc1ca4e7a2c51431200d0d Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 4 Aug 2010 00:45:15 +0200 Subject: Allow specifying default region flags. Correct a typo. --- OpenSim/Services/GridService/GridService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index f49d86d..ebaed42 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -124,7 +124,7 @@ namespace OpenSim.Services.GridService { // Regions reserved for the null key cannot be taken. if ((string)region.Data["PrincipalID"] == UUID.Zero.ToString()) - return "Region location us reserved"; + return "Region location is reserved"; // Treat it as an auth request // @@ -210,6 +210,7 @@ namespace OpenSim.Services.GridService { int newFlags = 0; string regionName = rdata.RegionName.Trim().Replace(' ', '_'); + newFlags = ParseFlags(newFlags, gridConfig.GetString("DefaultRegionFlags", String.Empty)); newFlags = ParseFlags(newFlags, gridConfig.GetString("Region_" + regionName, String.Empty)); newFlags = ParseFlags(newFlags, gridConfig.GetString("Region_" + rdata.RegionID.ToString(), String.Empty)); rdata.Data["flags"] = newFlags.ToString(); -- cgit v1.1 From a390541e1c114db419d9a2eb1ac576a582c35e67 Mon Sep 17 00:00:00 2001 From: sacha Date: Fri, 6 Aug 2010 14:38:11 +0000 Subject: Allowing the expected purge trash folder... Please validate !!! --- OpenSim/Services/InventoryService/XInventoryService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index f581f76..fc5020d 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs @@ -329,8 +329,8 @@ namespace OpenSim.Services.InventoryService if (!m_AllowDelete) return false; - if (!ParentIsTrash(folder.ID)) - return false; +// if (!ParentIsTrash(folder.ID)) +// return false; XInventoryFolder[] subFolders = m_Database.GetFolders( new string[] { "parentFolderID" }, @@ -342,6 +342,7 @@ namespace OpenSim.Services.InventoryService m_Database.DeleteFolders("folderID", x.folderID.ToString()); } + if (!ParentIsTrash(folder.ID)) m_Database.DeleteItems("parentFolderID", folder.ID.ToString()); return true; -- cgit v1.1 From 5da272d0425cc6a971b60a1e5fad556d4d66eb52 Mon Sep 17 00:00:00 2001 From: sacha Date: Fri, 6 Aug 2010 14:45:54 +0000 Subject: reverese my last commit --- OpenSim/Services/InventoryService/XInventoryService.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index fc5020d..541489f 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs @@ -329,8 +329,8 @@ namespace OpenSim.Services.InventoryService if (!m_AllowDelete) return false; -// if (!ParentIsTrash(folder.ID)) -// return false; + if (!ParentIsTrash(folder.ID)) + return false; XInventoryFolder[] subFolders = m_Database.GetFolders( new string[] { "parentFolderID" }, @@ -342,8 +342,6 @@ namespace OpenSim.Services.InventoryService m_Database.DeleteFolders("folderID", x.folderID.ToString()); } - if (!ParentIsTrash(folder.ID)) - m_Database.DeleteItems("parentFolderID", folder.ID.ToString()); return true; } -- cgit v1.1 From 42613ec53602093335ebe3ce5127d797318bdf23 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 6 Aug 2010 15:18:48 +0200 Subject: Allow the trash folder itself to be passed to PurgeFolder --- OpenSim/Services/InventoryService/XInventoryService.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index 541489f..26c5b33 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs @@ -541,6 +541,9 @@ namespace OpenSim.Services.InventoryService if (folder.Length < 1) return false; + if (folder[0].type == (int)AssetType.TrashFolder) + return true; + UUID parentFolder = folder[0].parentFolderID; while (parentFolder != UUID.Zero) -- cgit v1.1 From c554de75010a442753cce29ee06d2b60d7b4701a Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 7 Aug 2010 05:45:52 +0200 Subject: Correct display of landmark about info. Also correct region maturity rating in LM info. Maturity is NOT the parcel's setting, that is only for the image and text. Parcel maturity is governed by region maturity. --- OpenSim/Services/Connectors/Land/LandServiceConnector.cs | 5 ++++- OpenSim/Services/Interfaces/ILandService.cs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs index 0223a77..c439dc5 100644 --- a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs +++ b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs @@ -64,7 +64,7 @@ namespace OpenSim.Services.Connectors m_GridService = gridServices; } - public virtual LandData GetLandData(ulong regionHandle, uint x, uint y) + public virtual LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess) { LandData landData = null; Hashtable hash = new Hashtable(); @@ -74,6 +74,7 @@ namespace OpenSim.Services.Connectors IList paramList = new ArrayList(); paramList.Add(hash); + regionAccess = 42; // Default to adult. Better safe... try { @@ -109,6 +110,8 @@ namespace OpenSim.Services.Connectors landData.SalePrice = Convert.ToInt32(hash["SalePrice"]); landData.SnapshotID = new UUID((string)hash["SnapshotID"]); landData.UserLocation = Vector3.Parse((string)hash["UserLocation"]); + if (hash["RegionAccess"] != null) + regionAccess = (byte)Convert.ToInt32((string)hash["RegionAccess"]); m_log.DebugFormat("[OGS1 GRID SERVICES] Got land data for parcel {0}", landData.Name); } catch (Exception e) diff --git a/OpenSim/Services/Interfaces/ILandService.cs b/OpenSim/Services/Interfaces/ILandService.cs index e2f1d1d..7a12aff 100644 --- a/OpenSim/Services/Interfaces/ILandService.cs +++ b/OpenSim/Services/Interfaces/ILandService.cs @@ -33,6 +33,6 @@ namespace OpenSim.Services.Interfaces { public interface ILandService { - LandData GetLandData(ulong regionHandle, uint x, uint y); + LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess); } } -- cgit v1.1 From 4c5788c4c0975dbf3af58e2184a90965fcf0e893 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 7 Aug 2010 22:24:17 +0100 Subject: Add search URL to Login Service --- OpenSim/Services/LLLoginService/LLLoginResponse.cs | 18 +++++++++++++++++- OpenSim/Services/LLLoginService/LLLoginService.cs | 4 +++- 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index 240f5b1..c1da463 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs @@ -178,6 +178,8 @@ namespace OpenSim.Services.LLLoginService // Web map private string mapTileURL; + private string searchURL; + // Error Flags private string errorReason; private string errorMessage; @@ -226,7 +228,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) + GridRegion home, IPEndPoint clientIP, string mapTileURL, string searchURL) : this() { FillOutInventoryData(invSkel, libService); @@ -243,6 +245,7 @@ namespace OpenSim.Services.LLLoginService BuddList = ConvertFriendListItem(friendsList); StartLocation = where; MapTileURL = mapTileURL; + SearchURL = searchURL; FillOutHomeData(pinfo, home); LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z); @@ -416,6 +419,7 @@ namespace OpenSim.Services.LLLoginService InitialOutfitHash["gender"] = "female"; initialOutfit.Add(InitialOutfitHash); mapTileURL = String.Empty; + searchURL = String.Empty; } @@ -479,6 +483,9 @@ namespace OpenSim.Services.LLLoginService responseData["region_x"] = (Int32)(RegionX); responseData["region_y"] = (Int32)(RegionY); + if (searchURL != String.Empty) + responseData["search"] = searchURL; + if (mapTileURL != String.Empty) responseData["map-server-url"] = mapTileURL; @@ -581,6 +588,9 @@ namespace OpenSim.Services.LLLoginService if (mapTileURL != String.Empty) map["map-server-url"] = OSD.FromString(mapTileURL); + if (searchURL != String.Empty) + map["search"] = OSD.FromString(searchURL); + if (m_buddyList != null) { map["buddy-list"] = ArrayListToOSDArray(m_buddyList.ToArray()); @@ -938,6 +948,12 @@ namespace OpenSim.Services.LLLoginService set { mapTileURL = value; } } + public string SearchURL + { + get { return searchURL; } + set { searchURL = value; } + } + public string Message { get { return welcomeMessage; } diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 9446126..f9fe7f0 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -74,6 +74,7 @@ namespace OpenSim.Services.LLLoginService protected string m_GatekeeperURL; protected bool m_AllowRemoteSetLoginLevel; protected string m_MapTileURL; + protected string m_SearchURL; IConfig m_LoginServerConfig; @@ -102,6 +103,7 @@ namespace OpenSim.Services.LLLoginService m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0); 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) @@ -364,7 +366,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); + where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL, m_SearchURL); m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client."); return response; -- cgit v1.1 From 32ccc19a6238b2b0f4fa81efdc3115dd58578b00 Mon Sep 17 00:00:00 2001 From: meta7 Date: Sun, 8 Aug 2010 18:56:47 -0700 Subject: Make fallbacks work, the destination was never actually updated with the fallback details. --- OpenSim/Services/LLLoginService/LLLoginService.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index f9fe7f0..2674eef 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -344,9 +344,10 @@ namespace OpenSim.Services.LLLoginService // // Instantiate/get the simulation interface and launch an agent at the destination // - string reason = string.Empty; - AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, clientVersion, clientIP, out where, out reason); - + string reason = string.Empty; + GridRegion dest; + AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, clientVersion, clientIP, out where, out reason, out dest); + destination = dest; if (aCircuit == null) { m_PresenceService.LogoutAgent(session); @@ -605,7 +606,7 @@ namespace OpenSim.Services.LLLoginService } protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarData avatar, - UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, IPEndPoint clientIP, out string where, out string reason) + UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, IPEndPoint clientIP, out string where, out string reason, out GridRegion dest) { where = currentWhere; ISimulationService simConnector = null; @@ -690,8 +691,8 @@ namespace OpenSim.Services.LLLoginService } } } - } - + } + dest = destination; if (success) return aCircuit; else -- cgit v1.1 From f20dc512e87983b9ba6b86f806489380d3cfef5a Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 9 Aug 2010 02:46:09 +0200 Subject: Whitespace conflict --- OpenSim/Services/LLLoginService/LLLoginService.cs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 602616f..0bf75b0 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -691,11 +691,7 @@ namespace OpenSim.Services.LLLoginService } } } -<<<<<<< HEAD:OpenSim/Services/LLLoginService/LLLoginService.cs - } -======= } ->>>>>>> master:OpenSim/Services/LLLoginService/LLLoginService.cs dest = destination; if (success) return aCircuit; -- cgit v1.1 From 042eb80a62c4a4d74e00a59b6aeed679e35d519e Mon Sep 17 00:00:00 2001 From: sacha Date: Sat, 14 Aug 2010 08:59:57 +0000 Subject: clearing some debugmessages --- OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs index 38c191a..67c482b 100644 --- a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs @@ -113,7 +113,7 @@ namespace OpenSim.Services.Connectors public virtual UserAccount GetUserAccount(UUID scopeID, UUID userID) { - m_log.DebugFormat("[ACCOUNTS CONNECTOR]: GetUserAccount {0}", userID); + // m_log.DebugFormat("[ACCOUNTS CONNECTOR]: GetUserAccount {0}", userID); Dictionary sendData = new Dictionary(); //sendData["SCOPEID"] = scopeID.ToString(); sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString(); -- cgit v1.1 From cc8864b0e3ae0ee594813eb0a1115eeb5765291e Mon Sep 17 00:00:00 2001 From: meta7 Date: Fri, 20 Aug 2010 11:00:14 -0700 Subject: Get maturity level from access number. This addresses mantis #269 --- OpenSim/Services/Interfaces/IGridService.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index ac234dc..cce8f2c 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs @@ -324,6 +324,12 @@ namespace OpenSim.Services.Interfaces if (kvp.ContainsKey("regionName")) RegionName = (string)kvp["regionName"]; + if (kvp.ContainsKey("access")) + { + byte access = Convert.ToByte((string)kvp["access"]); + Maturity = (int)Util.ConvertAccessLevelToMaturity(access); + } + if (kvp.ContainsKey("serverIP")) { //int port = 0; -- cgit v1.1 From b1790ba56ec4ee61a2df6747b1fa42ae0c37da15 Mon Sep 17 00:00:00 2001 From: meta7 Date: Fri, 20 Aug 2010 11:25:31 -0700 Subject: Delete items as well as folders in XInventoryService.PurgeFolder - this should make emptying the trash work properly. --- OpenSim/Services/InventoryService/XInventoryService.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index 26c5b33..e3f0a19 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs @@ -342,6 +342,17 @@ namespace OpenSim.Services.InventoryService m_Database.DeleteFolders("folderID", x.folderID.ToString()); } + XInventoryItem[] items = m_Database.GetItems( + new string[] { "parentFolderID" }, + new string[] { folder.ID.ToString() }); + + List itemlist = new List(); + foreach (XInventoryItem i in items) + { + itemlist.Add(i.inventoryID); + } + + DeleteItems(folder.Owner, itemlist); return true; } -- cgit v1.1 From 47080834346b2528a65e5b4d5e59130206b0cb83 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 20 Aug 2010 18:53:33 +0200 Subject: Use the database mthod directly to delete items in a single sql swoop --- OpenSim/Services/InventoryService/XInventoryService.cs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index e3f0a19..3efdce4 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs @@ -342,17 +342,7 @@ namespace OpenSim.Services.InventoryService m_Database.DeleteFolders("folderID", x.folderID.ToString()); } - XInventoryItem[] items = m_Database.GetItems( - new string[] { "parentFolderID" }, - new string[] { folder.ID.ToString() }); - - List itemlist = new List(); - foreach (XInventoryItem i in items) - { - itemlist.Add(i.inventoryID); - } - - DeleteItems(folder.Owner, itemlist); + m_Database.DeleteItems("parentFolderID", folder.id.ToString()); return true; } -- cgit v1.1 From c448151f6b8f30bd0361db0b0f8f8075f7192618 Mon Sep 17 00:00:00 2001 From: meta7 Date: Fri, 20 Aug 2010 11:38:59 -0700 Subject: Someone from germany broke the build :P mentioning no names --- OpenSim/Services/InventoryService/XInventoryService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index 3efdce4..f63ab16 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs @@ -342,7 +342,7 @@ namespace OpenSim.Services.InventoryService m_Database.DeleteFolders("folderID", x.folderID.ToString()); } - m_Database.DeleteItems("parentFolderID", folder.id.ToString()); + m_Database.DeleteItems("parentFolderID", folder.ID.ToString()); return true; } -- cgit v1.1 From 50cc22c9e68aa62a529bf62553dc2f0739f3d0a2 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 7 Sep 2010 20:19:52 +0100 Subject: Fix Simian regression --- .../SimianGrid/SimianAssetServiceConnector.cs | 37 +++++++++-------- .../SimianAuthenticationServiceConnector.cs | 35 ++++++++-------- .../SimianGrid/SimianAvatarServiceConnector.cs | 35 ++++++++-------- .../SimianGrid/SimianGridServiceConnector.cs | 35 ++++++++-------- .../SimianGrid/SimianInventoryServiceConnector.cs | 47 ++++++++++++---------- .../SimianGrid/SimianPresenceServiceConnector.cs | 35 ++++++++-------- .../SimianUserAccountServiceConnector.cs | 35 ++++++++-------- 7 files changed, 140 insertions(+), 119 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs index 99e6983..6d5b30e 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs @@ -81,7 +81,7 @@ namespace OpenSim.Services.Connectors.SimianGrid public SimianAssetServiceConnector(IConfigSource source) { - Initialise(source); + CommonInit(source); } public void Initialise(IConfigSource source) @@ -91,25 +91,28 @@ namespace OpenSim.Services.Connectors.SimianGrid { string name = moduleConfig.GetString("AssetServices", ""); if (name == Name) - { - IConfig gridConfig = source.Configs["AssetService"]; - if (gridConfig != null) - { - string serviceUrl = gridConfig.GetString("AssetServerURI"); - if (!String.IsNullOrEmpty(serviceUrl)) - { - if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) - serviceUrl = serviceUrl + '/'; - m_serverUrl = serviceUrl; - } - } + CommonInit(source); + } + } - if (String.IsNullOrEmpty(m_serverUrl)) - m_log.Info("[SIMIAN ASSET CONNECTOR]: No AssetServerURI specified, disabling connector"); - else - m_Enabled = true; + private void CommonInit(IConfigSource source) + { + IConfig gridConfig = source.Configs["AssetService"]; + if (gridConfig != null) + { + string serviceUrl = gridConfig.GetString("AssetServerURI"); + if (!String.IsNullOrEmpty(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"); + else + m_Enabled = true; } #region IAssetService diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs index 68f73ee..51a09f8 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs @@ -69,7 +69,7 @@ namespace OpenSim.Services.Connectors.SimianGrid public SimianAuthenticationServiceConnector(IConfigSource source) { - Initialise(source); + CommonInit(source); } public void Initialise(IConfigSource source) @@ -79,24 +79,27 @@ namespace OpenSim.Services.Connectors.SimianGrid { string name = moduleConfig.GetString("AuthenticationServices", ""); if (name == Name) - { - IConfig gridConfig = source.Configs["AuthenticationService"]; - if (gridConfig != null) - { - string serviceUrl = gridConfig.GetString("AuthenticationServerURI"); - if (!String.IsNullOrEmpty(serviceUrl)) - { - if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) - serviceUrl = serviceUrl + '/'; - m_serverUrl = serviceUrl; - m_Enabled = true; - } - } + CommonInit(source); + } + } - if (String.IsNullOrEmpty(m_serverUrl)) - m_log.Info("[SIMIAN AUTH CONNECTOR]: No AuthenticationServerURI specified, disabling connector"); + private void CommonInit(IConfigSource source) + { + IConfig gridConfig = source.Configs["AuthenticationService"]; + if (gridConfig != null) + { + string serviceUrl = gridConfig.GetString("AuthenticationServerURI"); + if (!String.IsNullOrEmpty(serviceUrl)) + { + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; + m_Enabled = true; } } + + 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 7e56bd1..3505c64 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs @@ -74,7 +74,7 @@ namespace OpenSim.Services.Connectors.SimianGrid public SimianAvatarServiceConnector(IConfigSource source) { - Initialise(source); + CommonInit(source); } public void Initialise(IConfigSource source) @@ -84,24 +84,27 @@ namespace OpenSim.Services.Connectors.SimianGrid { string name = moduleConfig.GetString("AvatarServices", ""); if (name == Name) - { - IConfig gridConfig = source.Configs["AvatarService"]; - if (gridConfig != null) - { - string serviceUrl = gridConfig.GetString("AvatarServerURI"); - if (!String.IsNullOrEmpty(serviceUrl)) - { - if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) - serviceUrl = serviceUrl + '/'; - m_serverUrl = serviceUrl; - m_Enabled = true; - } - } + CommonInit(source); + } + } - if (String.IsNullOrEmpty(m_serverUrl)) - m_log.Info("[SIMIAN AVATAR CONNECTOR]: No AvatarServerURI specified, disabling connector"); + private void CommonInit(IConfigSource source) + { + IConfig gridConfig = source.Configs["AvatarService"]; + if (gridConfig != null) + { + string serviceUrl = gridConfig.GetString("AvatarServerURI"); + if (!String.IsNullOrEmpty(serviceUrl)) + { + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; + m_Enabled = true; } } + + 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/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs index 4fceef6..c2c7168 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs @@ -98,7 +98,7 @@ namespace OpenSim.Services.Connectors.SimianGrid public SimianGridServiceConnector(IConfigSource source) { - Initialise(source); + CommonInit(source); } public void Initialise(IConfigSource source) @@ -108,24 +108,27 @@ namespace OpenSim.Services.Connectors.SimianGrid { string name = moduleConfig.GetString("GridServices", ""); if (name == Name) - { - IConfig gridConfig = source.Configs["GridService"]; - if (gridConfig != null) - { - string serviceUrl = gridConfig.GetString("GridServerURI"); - if (!String.IsNullOrEmpty(serviceUrl)) - { - if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) - serviceUrl = serviceUrl + '/'; - m_serverUrl = serviceUrl; - m_Enabled = true; - } - } + CommonInit(source); + } + } - if (String.IsNullOrEmpty(m_serverUrl)) - m_log.Info("[SIMIAN GRID CONNECTOR]: No GridServerURI specified, disabling connector"); + private void CommonInit(IConfigSource source) + { + IConfig gridConfig = source.Configs["GridService"]; + if (gridConfig != null) + { + string serviceUrl = gridConfig.GetString("GridServerURI"); + if (!String.IsNullOrEmpty(serviceUrl)) + { + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; + m_Enabled = true; } } + + 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 eb118ae..470eccd 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs @@ -88,7 +88,7 @@ namespace OpenSim.Services.Connectors.SimianGrid public SimianInventoryServiceConnector(IConfigSource source) { - Initialise(source); + CommonInit(source); } public void Initialise(IConfigSource source) @@ -98,36 +98,39 @@ namespace OpenSim.Services.Connectors.SimianGrid { string name = moduleConfig.GetString("InventoryServices", ""); if (name == Name) + CommonInit(source); + } + } + + private void CommonInit(IConfigSource source) + { + IConfig gridConfig = source.Configs["InventoryService"]; + if (gridConfig != null) + { + string serviceUrl = gridConfig.GetString("InventoryServerURI"); + if (!String.IsNullOrEmpty(serviceUrl)) { - IConfig gridConfig = source.Configs["InventoryService"]; + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; + + gridConfig = source.Configs["UserAccountService"]; if (gridConfig != null) { - string serviceUrl = gridConfig.GetString("InventoryServerURI"); + serviceUrl = gridConfig.GetString("UserAccountServerURI"); if (!String.IsNullOrEmpty(serviceUrl)) { - if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) - serviceUrl = serviceUrl + '/'; - m_serverUrl = serviceUrl; - - gridConfig = source.Configs["UserAccountService"]; - if (gridConfig != null) - { - serviceUrl = gridConfig.GetString("UserAccountServerURI"); - if (!String.IsNullOrEmpty(serviceUrl)) - { - m_userServerUrl = serviceUrl; - m_Enabled = true; - } - } + m_userServerUrl = serviceUrl; + m_Enabled = true; } } - - 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"); } } + + 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 074c80f..077be3c 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs @@ -99,7 +99,7 @@ namespace OpenSim.Services.Connectors.SimianGrid public SimianPresenceServiceConnector(IConfigSource source) { - Initialise(source); + CommonInit(source); } public void Initialise(IConfigSource source) @@ -109,24 +109,27 @@ namespace OpenSim.Services.Connectors.SimianGrid { string name = moduleConfig.GetString("PresenceServices", ""); if (name == Name) + CommonInit(source); + } + } + + private void CommonInit(IConfigSource source) + { + IConfig gridConfig = source.Configs["PresenceService"]; + if (gridConfig != null) + { + string serviceUrl = gridConfig.GetString("PresenceServerURI"); + if (!String.IsNullOrEmpty(serviceUrl)) { - IConfig gridConfig = source.Configs["PresenceService"]; - if (gridConfig != null) - { - string serviceUrl = gridConfig.GetString("PresenceServerURI"); - if (!String.IsNullOrEmpty(serviceUrl)) - { - if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) - serviceUrl = serviceUrl + '/'; - m_serverUrl = serviceUrl; - m_Enabled = true; - } - } - - if (String.IsNullOrEmpty(m_serverUrl)) - m_log.Info("[SIMIAN PRESENCE CONNECTOR]: No PresenceServerURI specified, disabling connector"); + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; + m_Enabled = true; } } + + 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/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs index deb8695..694aa72 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs @@ -73,7 +73,7 @@ namespace OpenSim.Services.Connectors.SimianGrid public SimianUserAccountServiceConnector(IConfigSource source) { - Initialise(source); + CommonInit(source); } public void Initialise(IConfigSource source) @@ -83,24 +83,27 @@ namespace OpenSim.Services.Connectors.SimianGrid { string name = moduleConfig.GetString("UserAccountServices", ""); if (name == Name) - { - IConfig gridConfig = source.Configs["UserAccountService"]; - if (gridConfig != null) - { - string serviceUrl = gridConfig.GetString("UserAccountServerURI"); - if (!String.IsNullOrEmpty(serviceUrl)) - { - if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) - serviceUrl = serviceUrl + '/'; - m_serverUrl = serviceUrl; - m_Enabled = true; - } - } + CommonInit(source); + } + } - if (String.IsNullOrEmpty(m_serverUrl)) - m_log.Info("[SIMIAN ACCOUNT CONNECTOR]: No UserAccountServerURI specified, disabling connector"); + private void CommonInit(IConfigSource source) + { + IConfig gridConfig = source.Configs["UserAccountService"]; + if (gridConfig != null) + { + string serviceUrl = gridConfig.GetString("UserAccountServerURI"); + if (!String.IsNullOrEmpty(serviceUrl)) + { + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; + m_Enabled = true; } } + + 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 7f7bbbb84a42d7fd984b637eaf7f1ce115d5fe19 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 14 Sep 2010 23:05:42 +0100 Subject: Fix the above --- OpenSim/Services/Connectors/Simulation/EstateDataService.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/EstateDataService.cs b/OpenSim/Services/Connectors/Simulation/EstateDataService.cs index 2eedebb..8a8b46d 100644 --- a/OpenSim/Services/Connectors/Simulation/EstateDataService.cs +++ b/OpenSim/Services/Connectors/Simulation/EstateDataService.cs @@ -60,9 +60,8 @@ namespace OpenSim.Services.Connectors if (dbConfig != null) { dllName = dbConfig.GetString("StorageProvider", String.Empty); - connString = dbConfig.GetString("EstateConnectionString", String.Empty); - if (String.IsNullOrEmpty(connString)) - connString = dbConfig.GetString("ConnectionString", String.Empty); + connString = dbConfig.GetString("ConnectionString", String.Empty); + connString = dbConfig.GetString("EstateConnectionString", connString); } // Try reading the [EstateDataStore] section, if it exists @@ -70,7 +69,7 @@ namespace OpenSim.Services.Connectors if (estConfig != null) { dllName = estConfig.GetString("StorageProvider", dllName); - connString = dbConfig.GetString("ConnectionString", connString); + connString = estConfig.GetString("ConnectionString", connString); } // We tried, but this doesn't exist. We can't proceed -- cgit v1.1 From 77eb8ade8c030fd174bc24306e8c4adfd415b769 Mon Sep 17 00:00:00 2001 From: meta7 Date: Wed, 15 Sep 2010 08:08:29 -0700 Subject: Don't throw an exception if the authorizationservice is missing a serviceuri config entry. Not every authorization service will need a URI. --- .../Services/Connectors/Authorization/AuthorizationServiceConnector.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs b/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs index 4eb4bd2..8ae12ad 100644 --- a/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs @@ -77,7 +77,6 @@ namespace OpenSim.Services.Connectors if (serviceURI == String.Empty) { m_log.Error("[AUTHORIZATION CONNECTOR]: No Server URI named in section AuthorizationService"); - throw new Exception("Authorization connector init error"); } m_ServerURI = serviceURI; -- cgit v1.1 From 571693d7b6d9d7e138dbaf1e4dd958e453b8bd32 Mon Sep 17 00:00:00 2001 From: meta7 Date: Wed, 15 Sep 2010 08:16:38 -0700 Subject: Revert last commit --- .../Services/Connectors/Authorization/AuthorizationServiceConnector.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs b/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs index 8ae12ad..4eb4bd2 100644 --- a/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs @@ -77,6 +77,7 @@ namespace OpenSim.Services.Connectors if (serviceURI == String.Empty) { m_log.Error("[AUTHORIZATION CONNECTOR]: No Server URI named in section AuthorizationService"); + throw new Exception("Authorization connector init error"); } m_ServerURI = serviceURI; -- cgit v1.1 From d50a072336f584f8e484160ba50042020f35d112 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 16 Sep 2010 20:21:30 +0200 Subject: Suppress the strange "Result not Dictionary" messages that happen when a region queries for a nonexistent presence. --- OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs b/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs index 9f86078..f1c99ce 100644 --- a/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs +++ b/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs @@ -302,6 +302,9 @@ namespace OpenSim.Services.Connectors } else { + if (replyData["result"].ToString() == "null") + return null; + m_log.DebugFormat("[PRESENCE CONNECTOR]: Invalid reply (result not dictionary) received from presence server when querying for sessionID {0}", sessionID.ToString()); } } -- cgit v1.1 From 251f2444d049ed525ef41c4c4792ec446c53b973 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 17 Sep 2010 01:50:48 +0200 Subject: Revert "* Changed 11 calls for session info to the more optimized API method" This reverts commit 5dc9ea2f2487804d788b4b80d40d91bd792de4c2. Also makes online indicators and IM more robust --- OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs index b7e8538..0ef4974 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs @@ -291,8 +291,8 @@ namespace OpenSim.Services.Connectors.SimianGrid // Check if the user is online if (client.Scene is Scene) { - OpenSim.Services.Interfaces.PresenceInfo presence = ((Scene)client.Scene).PresenceService.GetAgent(avatarID); - if (presence != null) + OpenSim.Services.Interfaces.PresenceInfo[] presences = ((Scene)client.Scene).PresenceService.GetAgents(new string[] { avatarID.ToString() }); + if (presences != null && presences.Length > 0) flags |= ProfileFlags.Online; } -- cgit v1.1 From 50b03d08a8cdec9359adcece5b4645a6dc821d26 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 4 Oct 2010 00:04:42 +0200 Subject: Add linden prim renderer and update libOMV --- .../Connectors/SimianGrid/SimianUserAccountServiceConnector.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs index ddd2322..9c150ee 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs @@ -147,7 +147,7 @@ namespace OpenSim.Services.Connectors.SimianGrid if (account == null) { // Store null responses too, to avoid repeated lookups for missing accounts - m_accountCache.AddOrUpdate(userID, null, DateTime.Now + TimeSpan.FromSeconds(CACHE_EXPIRATION_SECONDS)); + m_accountCache.AddOrUpdate(userID, null, CACHE_EXPIRATION_SECONDS); } return account; @@ -225,7 +225,7 @@ namespace OpenSim.Services.Connectors.SimianGrid if (success) { // Cache the user account info - m_accountCache.AddOrUpdate(data.PrincipalID, data, DateTime.Now + TimeSpan.FromSeconds(CACHE_EXPIRATION_SECONDS)); + m_accountCache.AddOrUpdate(data.PrincipalID, data, CACHE_EXPIRATION_SECONDS); } else { @@ -290,7 +290,7 @@ namespace OpenSim.Services.Connectors.SimianGrid GetFirstLastName(response["Name"].AsString(), out account.FirstName, out account.LastName); // Cache the user account info - m_accountCache.AddOrUpdate(account.PrincipalID, account, DateTime.Now + TimeSpan.FromSeconds(CACHE_EXPIRATION_SECONDS)); + m_accountCache.AddOrUpdate(account.PrincipalID, account, CACHE_EXPIRATION_SECONDS); return account; } -- cgit v1.1 From ce3594f7f2b5a4af2d92d6b2c812f7241c61e82b Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 18 Oct 2010 22:58:04 +0100 Subject: Change substring matching to prefix matching in region search. This affects both map and login, as they use the same method. --- OpenSim/Services/GridService/GridService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index ce6f64b..e7988d6 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -323,7 +323,7 @@ namespace OpenSim.Services.GridService { m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name); - List rdatas = m_Database.Get("%" + name + "%", scopeID); + List rdatas = m_Database.Get(name + "%", scopeID); int count = 0; List rinfos = new List(); -- cgit v1.1 From 4f15b8d4e6be1e1fe88ad32aa43595861d1005ad Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 16 Nov 2010 20:44:39 +0100 Subject: Change the way attachments are persisted. Editing a worn attachment will now save properly, as will the results of a resizer script working. Attachment positions are no longer saved on each move, but instead are saved once on logout. Attachment script states are saved as part of the attachment now when detaching. --- OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 0626ebe..1730b95 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -565,6 +565,7 @@ namespace OpenSim.Services.Connectors.Simulation OSDMap args = new OSDMap(2); args["sog"] = OSD.FromString(sog.ToXml2()); args["extra"] = OSD.FromString(sog.ExtraToXmlString()); + args["modified"] = OSD.FromBoolean(sog.HasGroupChanged); string state = sog.GetStateSnapshot(); if (state.Length > 0) args["state"] = OSD.FromString(state); -- cgit v1.1 From 1cf8eb8a90749b215bc4e8b7beb37b927e101dce Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 21 Nov 2010 20:59:01 +0000 Subject: Start implementing Freeswitch in ROBUST --- .../FreeswitchService/FreeswitchService.cs | 12 ++++++-- .../FreeswitchService/FreeswitchServiceBase.cs | 36 +++++++++++++++++++++- OpenSim/Services/Interfaces/IFreeswitchService.cs | 4 ++- 3 files changed, 48 insertions(+), 4 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/FreeswitchService/FreeswitchService.cs b/OpenSim/Services/FreeswitchService/FreeswitchService.cs index 0a38300..109ef9b 100644 --- a/OpenSim/Services/FreeswitchService/FreeswitchService.cs +++ b/OpenSim/Services/FreeswitchService/FreeswitchService.cs @@ -33,19 +33,27 @@ using OpenSim.Framework; using OpenSim.Data; using OpenSim.Services.Interfaces; using OpenMetaverse; +using System.Collections; namespace OpenSim.Services.FreeswitchService { public class FreeswitchService : FreeswitchServiceBase, IFreeswitchService { - //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public FreeswitchService(IConfigSource config) : base(config) { // Perform initilialization here } + public Hashtable HandleDirectoryRequest(Hashtable requestBody) + { + return new Hashtable(); + } - // Implement IFreeswitchService here + public Hashtable HandleDialplanRequest(Hashtable requestBody) + { + return new Hashtable(); + } } } diff --git a/OpenSim/Services/FreeswitchService/FreeswitchServiceBase.cs b/OpenSim/Services/FreeswitchService/FreeswitchServiceBase.cs index 83fecef..ebbb1b0 100644 --- a/OpenSim/Services/FreeswitchService/FreeswitchServiceBase.cs +++ b/OpenSim/Services/FreeswitchService/FreeswitchServiceBase.cs @@ -31,11 +31,28 @@ using Nini.Config; using OpenSim.Framework; using OpenSim.Services.Interfaces; using OpenSim.Services.Base; +using log4net; namespace OpenSim.Services.FreeswitchService { public class FreeswitchServiceBase : ServiceBase { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + protected string m_freeSwitchRealm; + protected string m_freeSwitchSIPProxy; + protected bool m_freeSwitchAttemptUseSTUN = false; + protected string m_freeSwitchEchoServer; + protected int m_freeSwitchEchoPort = 50505; + protected string m_freeSwitchDefaultWellKnownIP; + protected int m_freeSwitchDefaultTimeout = 5000; + protected string m_freeSwitchContext = "default"; + protected string m_freeSwitchServerUser = "freeswitch"; + protected string m_freeSwitchServerPass = "password"; + protected readonly string m_freeSwitchAPIPrefix = "/fsapi"; + + protected bool m_Enabled = false; + public FreeswitchServiceBase(IConfigSource config) : base(config) { // @@ -44,7 +61,24 @@ namespace OpenSim.Services.FreeswitchService IConfig freeswitchConfig = config.Configs["FreeswitchService"]; if (freeswitchConfig != null) { - // Read config here !! + m_freeSwitchDefaultWellKnownIP = freeswitchConfig.GetString("ServerAddress", String.Empty); + if (m_freeSwitchDefaultWellKnownIP == String.Empty) + { + m_log.Error("[FREESWITCH]: No FreeswitchServerAddress given, can't continue"); + return; + } + + m_freeSwitchRealm = freeswitchConfig.GetString("Realm", m_freeSwitchDefaultWellKnownIP); + m_freeSwitchSIPProxy = freeswitchConfig.GetString("SIPProxy", m_freeSwitchDefaultWellKnownIP + ":5060"); + m_freeSwitchEchoServer = freeswitchConfig.GetString("EchoServer", m_freeSwitchDefaultWellKnownIP); + m_freeSwitchEchoPort = freeswitchConfig.GetInt("EchoPort", m_freeSwitchEchoPort); + m_freeSwitchAttemptUseSTUN = freeswitchConfig.GetBoolean("AttemptSTUN", false); // This may not work + m_freeSwitchDefaultTimeout = freeswitchConfig.GetInt("DefaultTimeout", m_freeSwitchDefaultTimeout); + m_freeSwitchContext = freeswitchConfig.GetString("Context", m_freeSwitchContext); + m_freeSwitchServerUser = freeswitchConfig.GetString("UserName", m_freeSwitchServerUser); + m_freeSwitchServerPass = freeswitchConfig.GetString("Password", m_freeSwitchServerPass); + + m_Enabled = true; } } } diff --git a/OpenSim/Services/Interfaces/IFreeswitchService.cs b/OpenSim/Services/Interfaces/IFreeswitchService.cs index d1f635b..2b3ffeb 100644 --- a/OpenSim/Services/Interfaces/IFreeswitchService.cs +++ b/OpenSim/Services/Interfaces/IFreeswitchService.cs @@ -27,11 +27,13 @@ using System; using OpenSim.Framework; +using System.Collections; namespace OpenSim.Services.Interfaces { public interface IFreeswitchService { - // Place anything the connector eeds to access here! + Hashtable HandleDirectoryRequest(Hashtable requestBody); + Hashtable HandleDialplanRequest(Hashtable requestBody); } } -- cgit v1.1 From 83a427a8f9ef0ea99beab3f7f196be1f064879c8 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 21 Nov 2010 21:18:03 +0000 Subject: Move Dialplan and Directory from the region module to the ROBUST server --- .../FreeswitchService/FreeswitchService.cs | 337 ++++++++++++++++++++- 1 file changed, 333 insertions(+), 4 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/FreeswitchService/FreeswitchService.cs b/OpenSim/Services/FreeswitchService/FreeswitchService.cs index 109ef9b..b62a65a 100644 --- a/OpenSim/Services/FreeswitchService/FreeswitchService.cs +++ b/OpenSim/Services/FreeswitchService/FreeswitchService.cs @@ -26,6 +26,7 @@ */ using System; +using System.Text; using System.Reflection; using Nini.Config; using log4net; @@ -46,14 +47,342 @@ namespace OpenSim.Services.FreeswitchService // Perform initilialization here } - public Hashtable HandleDirectoryRequest(Hashtable requestBody) + public Hashtable HandleDialplanRequest(Hashtable request) { - return new Hashtable(); + m_log.DebugFormat("[FreeSwitchVoice] HandleDialplanRequest called with {0}",request.ToString()); + + Hashtable response = new Hashtable(); + + foreach (DictionaryEntry item in request) + { + m_log.InfoFormat("[FreeSwitchDirectory] requestBody item {0} {1}",item.Key, item.Value); + } + + string requestcontext = (string) request["Hunt-Context"]; + response["content_type"] = "text/xml"; + response["keepalive"] = false; + response["int_response_code"] = 200; + + if (m_freeSwitchContext != String.Empty && m_freeSwitchContext != requestcontext) + { + m_log.Debug("[FreeSwitchDirectory] returning empty as it's for another context"); + response["str_response_string"] = ""; + } + else + { + response["str_response_string"] = String.Format(@" + +
+ " + + +/* + + + + + + */ + + @" + + + + + + + + + + + + + + + + + + + + +
+
", m_freeSwitchContext, m_freeSwitchRealm); + } + + return response; } - public Hashtable HandleDialplanRequest(Hashtable requestBody) + public Hashtable HandleDirectoryRequest(Hashtable request) + { + Hashtable response = new Hashtable(); + string domain = (string) request["domain"]; + if (domain != m_freeSwitchRealm) { + response["content_type"] = "text/xml"; + response["keepalive"] = false; + response["int_response_code"] = 200; + response["str_response_string"] = ""; + } else { + m_log.DebugFormat("[FreeSwitchDirectory] HandleDirectoryRequest called with {0}",request.ToString()); + + // information in the request we might be interested in + + // Request 1 sip_auth for users account + + //Event-Calling-Function=sofia_reg_parse_auth + //Event-Calling-Line-Number=1494 + //action=sip_auth + //sip_user_agent=Vivox-SDK-2.1.3010.6151-Mac%20(Feb-11-2009/16%3A42%3A41) + //sip_auth_username=xhZuXKmRpECyr2AARJYyGgg%3D%3D (==) + //sip_auth_realm=9.20.151.43 + //sip_contact_user=xhZuXKmRpECyr2AARJYyGgg%3D%3D (==) + //sip_contact_host=192.168.0.3 // this shouldnt really be a local IP, investigate STUN servers + //sip_to_user=xhZuXKmRpECyr2AARJYyGgg%3D%3D + //sip_to_host=9.20.151.43 + //sip_auth_method=REGISTER + //user=xhZuXKmRpECyr2AARJYyGgg%3D%3D + //domain=9.20.151.43 + //ip=9.167.220.137 // this is the correct IP rather than sip_contact_host above when through a vpn or NAT setup + + foreach (DictionaryEntry item in request) + { + m_log.InfoFormat("[FreeSwitchDirectory] requestBody item {0} {1}", item.Key, item.Value); + } + + string eventCallingFunction = (string) request["Event-Calling-Function"]; + if (eventCallingFunction == null) + { + eventCallingFunction = "sofia_reg_parse_auth"; + } + + if (eventCallingFunction.Length == 0) + { + eventCallingFunction = "sofia_reg_parse_auth"; + } + + if (eventCallingFunction == "sofia_reg_parse_auth") + { + string sipAuthMethod = (string)request["sip_auth_method"]; + + if (sipAuthMethod == "REGISTER") + { + response = HandleRegister(m_freeSwitchContext, m_freeSwitchRealm, request); + } + else if (sipAuthMethod == "INVITE") + { + response = HandleInvite(m_freeSwitchContext, m_freeSwitchRealm, request); + } + else + { + m_log.ErrorFormat("[FreeSwitchVoice] HandleDirectoryRequest unknown sip_auth_method {0}",sipAuthMethod); + response["int_response_code"] = 404; + response["content_type"] = "text/xml"; + response["str_response_string"] = ""; + } + } + else if (eventCallingFunction == "switch_xml_locate_user") + { + response = HandleLocateUser(m_freeSwitchRealm, request); + } + else if (eventCallingFunction == "user_data_function") // gets called when an avatar to avatar call is made + { + response = HandleLocateUser(m_freeSwitchRealm, request); + } + else if (eventCallingFunction == "user_outgoing_channel") + { + response = HandleRegister(m_freeSwitchContext, m_freeSwitchRealm, request); + } + else if (eventCallingFunction == "config_sofia") // happens once on freeswitch startup + { + response = HandleConfigSofia(m_freeSwitchContext, m_freeSwitchRealm, request); + } + else if (eventCallingFunction == "switch_load_network_lists") + { + //response = HandleLoadNetworkLists(request); + response["int_response_code"] = 404; + response["keepalive"] = false; + response["content_type"] = "text/xml"; + response["str_response_string"] = ""; + } + else + { + m_log.ErrorFormat("[FreeSwitchVoice] HandleDirectoryRequest unknown Event-Calling-Function {0}",eventCallingFunction); + response["int_response_code"] = 404; + response["keepalive"] = false; + response["content_type"] = "text/xml"; + response["str_response_string"] = ""; + } + } + return response; + } + + private Hashtable HandleRegister(string Context, string Realm, Hashtable request) + { + m_log.Info("[FreeSwitchDirectory] HandleRegister called"); + + // TODO the password we return needs to match that sent in the request, this is hard coded for now + string password = "1234"; + string domain = (string) request["domain"]; + string user = (string) request["user"]; + + Hashtable response = new Hashtable(); + response["content_type"] = "text/xml"; + response["keepalive"] = false; + response["int_response_code"] = 200; + + response["str_response_string"] = String.Format( + "\r\n" + + "\r\n" + + "
\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + ""+ + "\r\n" + + "\r\n" + + "\r\n" + + "
\r\n" + + "
\r\n", + domain , user, password, Context); + + return response; + } + + private Hashtable HandleInvite(string Context, string Realm, Hashtable request) + { + m_log.Info("[FreeSwitchDirectory] HandleInvite called"); + + // TODO the password we return needs to match that sent in the request, this is hard coded for now + string password = "1234"; + string domain = (string) request["domain"]; + string user = (string) request["user"]; + string sipRequestUser = (string) request["sip_request_user"]; + + Hashtable response = new Hashtable(); + response["content_type"] = "text/xml"; + response["keepalive"] = false; + response["int_response_code"] = 200; + response["str_response_string"] = String.Format( + "\r\n" + + "\r\n" + + "
\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + ""+ + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + ""+ + "\r\n" + + "\r\n" + + "\r\n" + + "
\r\n" + + "
\r\n", + domain , user, password,sipRequestUser, Context); + + return response; + } + + private Hashtable HandleLocateUser(String Realm, Hashtable request) + { + m_log.Info("[FreeSwitchDirectory] HandleLocateUser called"); + + // TODO the password we return needs to match that sent in the request, this is hard coded for now + string domain = (string) request["domain"]; + string user = (string) request["user"]; + + Hashtable response = new Hashtable(); + response["content_type"] = "text/xml"; + response["keepalive"] = false; + response["int_response_code"] = 200; + response["str_response_string"] = String.Format( + "\r\n" + + "\r\n" + + "
\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n"+ + "\r\n"+ + ""+ + "\r\n"+ + "\r\n" + + "\r\n" + + "
\r\n" + + "
\r\n", + domain , user); + + return response; + } + + private Hashtable HandleConfigSofia(string Context, string Realm, Hashtable request) { - return new Hashtable(); + m_log.Info("[FreeSwitchDirectory] HandleConfigSofia called"); + + // TODO the password we return needs to match that sent in the request, this is hard coded for now + string domain = (string) request["domain"]; + + Hashtable response = new Hashtable(); + response["content_type"] = "text/xml"; + response["keepalive"] = false; + response["int_response_code"] = 200; + response["str_response_string"] = String.Format( + "\r\n" + + "\r\n" + + "
\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + ""+ + "\r\n" + + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n" + + "
\r\n" + + "
\r\n", + domain, Context); + + return response; } } } -- cgit v1.1 From 5f8a0f3d1f4cd9948ced87e312bcd0c4a616ef2a Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 21 Nov 2010 23:41:56 +0000 Subject: Add the remote connector for freeswitch config retrieval --- .../Freeswitch/RemoteFreeswitchConnector.cs | 103 +++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 OpenSim/Services/Connectors/Freeswitch/RemoteFreeswitchConnector.cs (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Freeswitch/RemoteFreeswitchConnector.cs b/OpenSim/Services/Connectors/Freeswitch/RemoteFreeswitchConnector.cs new file mode 100644 index 0000000..d63d99d --- /dev/null +++ b/OpenSim/Services/Connectors/Freeswitch/RemoteFreeswitchConnector.cs @@ -0,0 +1,103 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using log4net; +using System; +using System.IO; +using System.Collections; +using System.Reflection; +using Nini.Config; +using OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Framework.Servers.HttpServer; +using OpenSim.Services.Interfaces; +using OpenSim.Server.Base; +using OpenMetaverse; + +namespace OpenSim.Services.Connectors +{ + public class RemoteFreeswitchConnector : IFreeswitchService + { + private static readonly ILog m_log = + LogManager.GetLogger( + MethodBase.GetCurrentMethod().DeclaringType); + + private string m_ServerURI = String.Empty; + + public RemoteFreeswitchConnector() + { + } + + public RemoteFreeswitchConnector(string serverURI) + { + m_ServerURI = Path.Combine(serverURI.TrimEnd('/'), "region-config"); + } + + public RemoteFreeswitchConnector(IConfigSource source) + { + Initialise(source); + } + + public virtual void Initialise(IConfigSource source) + { + IConfig freeswitchConfig = source.Configs["FreeSwitchVoice"]; + if (freeswitchConfig == null) + { + m_log.Error("[FREESWITCH CONNECTOR]: FreeSwitchVoice missing from OpenSim.ini"); + throw new Exception("Freeswitch connector init error"); + } + + string serviceURI = freeswitchConfig.GetString("FreeswitchServiceURL", + String.Empty); + + if (serviceURI == String.Empty) + { + m_log.Error("[FREESWITCH CONNECTOR]: No FreeswitchServiceURL named in section FreeSwitchVoice"); + throw new Exception("Freeswitch connector init error"); + } + m_ServerURI = serviceURI; + } + + public Hashtable HandleDirectoryRequest(Hashtable requestBody) + { + // not used here + return new Hashtable(); + } + + public Hashtable HandleDialplanRequest(Hashtable requestBody) + { + // not used here + return new Hashtable(); + } + + public string GetJsonConfig() + { + return SynchronousRestFormsRequester.MakeRequest("GET", + m_ServerURI, String.Empty); + } + } +} -- cgit v1.1 From 7e9a3019ac719b88defd69bded0f9b801194fe85 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 22 Nov 2010 00:55:11 +0100 Subject: Fox the buglets in Freeswitch. Grid mode works now and there is no reason why standalone should not. --- OpenSim/Services/Connectors/Freeswitch/RemoteFreeswitchConnector.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Freeswitch/RemoteFreeswitchConnector.cs b/OpenSim/Services/Connectors/Freeswitch/RemoteFreeswitchConnector.cs index d63d99d..c9bba0b 100644 --- a/OpenSim/Services/Connectors/Freeswitch/RemoteFreeswitchConnector.cs +++ b/OpenSim/Services/Connectors/Freeswitch/RemoteFreeswitchConnector.cs @@ -54,7 +54,7 @@ namespace OpenSim.Services.Connectors public RemoteFreeswitchConnector(string serverURI) { - m_ServerURI = Path.Combine(serverURI.TrimEnd('/'), "region-config"); + m_ServerURI = serverURI.TrimEnd('/') + "/region-config"; } public RemoteFreeswitchConnector(IConfigSource source) @@ -79,7 +79,7 @@ namespace OpenSim.Services.Connectors m_log.Error("[FREESWITCH CONNECTOR]: No FreeswitchServiceURL named in section FreeSwitchVoice"); throw new Exception("Freeswitch connector init error"); } - m_ServerURI = serviceURI; + m_ServerURI = serviceURI.TrimEnd('/') + "/region-config"; } public Hashtable HandleDirectoryRequest(Hashtable requestBody) @@ -96,6 +96,7 @@ namespace OpenSim.Services.Connectors public string GetJsonConfig() { + m_log.DebugFormat("[FREESWITCH CONNECTOR]: Requesting config from {0}", m_ServerURI); return SynchronousRestFormsRequester.MakeRequest("GET", m_ServerURI, String.Empty); } -- cgit v1.1 From 571becefb652869fa844188cadf8aca1fea774ab Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 22 Nov 2010 23:31:29 +0100 Subject: Fix some crashes caused by the addition of the CreatorData column --- OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs index 88fbda3..b3bfcc2 100644 --- a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs @@ -302,6 +302,8 @@ namespace OpenSim.Services.Connectors public bool AddItem(InventoryItemBase item) { + if (item.CreatorData == null) + item.CreatorData = String.Empty; Dictionary ret = MakeRequest("ADDITEM", new Dictionary { { "AssetID", item.AssetID.ToString() }, @@ -335,6 +337,8 @@ namespace OpenSim.Services.Connectors public bool UpdateItem(InventoryItemBase item) { + if (item.CreatorData == null) + item.CreatorData = String.Empty; Dictionary ret = MakeRequest("UPDATEITEM", new Dictionary { { "AssetID", item.AssetID.ToString() }, @@ -558,7 +562,10 @@ namespace OpenSim.Services.Connectors item.InvType = int.Parse(data["InvType"].ToString()); item.Folder = new UUID(data["Folder"].ToString()); item.CreatorId = data["CreatorId"].ToString(); - item.CreatorData = data["CreatorData"].ToString(); + if (data.ContainsKey("CreatorData")) + item.CreatorData = data["CreatorData"].ToString(); + else + item.CreatorData = String.Empty; item.Description = data["Description"].ToString(); item.NextPermissions = uint.Parse(data["NextPermissions"].ToString()); item.CurrentPermissions = uint.Parse(data["CurrentPermissions"].ToString()); -- cgit v1.1 From ee9aca9c5270e22407c3aa4aa96c76ca92f90bb9 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 25 Nov 2010 20:34:55 +0100 Subject: Add the ability for gods to impersonate users. For this, bit 6 needs to be set in the target's UserFlags and the impersonator must have UserLevel 200 or above. The user can then log in using the target's name and their own password. --- .../AuthenticationServiceBase.cs | 8 +++ .../PasswordAuthenticationService.cs | 62 +++++++++++++++++++--- .../WebkeyAuthenticationService.cs | 5 ++ .../SimianUserAccountServiceConnector.cs | 5 ++ .../UserAccounts/UserAccountServiceConnector.cs | 5 ++ OpenSim/Services/Interfaces/IUserAccountService.cs | 1 + OpenSim/Services/LLLoginService/LLLoginService.cs | 3 +- .../UserAccountService/UserAccountService.cs | 15 ++++++ 8 files changed, 96 insertions(+), 8 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs b/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs index edc1097..5980f0c 100644 --- a/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs +++ b/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs @@ -31,6 +31,8 @@ using log4net; using Nini.Config; using System.Reflection; using OpenSim.Services.Base; +using OpenSim.Server.Base; +using OpenSim.Services.Interfaces; using OpenSim.Data; using OpenSim.Framework; @@ -49,6 +51,12 @@ namespace OpenSim.Services.AuthenticationService MethodBase.GetCurrentMethod().DeclaringType); protected IAuthenticationData m_Database; + protected IUserAccountService m_UserAccountService = null; + + public AuthenticationServiceBase(IConfigSource config, IUserAccountService acct) : this(config) + { + m_UserAccountService = acct; + } public AuthenticationServiceBase(IConfigSource config) : base(config) { diff --git a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs index 17619ff..cf7496f 100644 --- a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs +++ b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs @@ -51,6 +51,12 @@ namespace OpenSim.Services.AuthenticationService LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); + public PasswordAuthenticationService(IConfigSource config, IUserAccountService userService) : + base(config, userService) + { + m_log.Debug("[AUTH SERVICE]: Started with User Account access"); + } + public PasswordAuthenticationService(IConfigSource config) : base(config) { @@ -58,28 +64,70 @@ namespace OpenSim.Services.AuthenticationService public string Authenticate(UUID principalID, string password, int lifetime) { + m_log.DebugFormat("[AUTH SERVICE]: Authenticating for {0}, user account service present: {1}", principalID, m_UserAccountService != null); AuthenticationData data = m_Database.Get(principalID); + UserAccount user = null; + if (m_UserAccountService != null) + user = m_UserAccountService.GetUserAccount(UUID.Zero, principalID); + + if (data == null || data.Data == null) + { + m_log.DebugFormat("[AUTH SERVICE]: PrincipalID {0} or its data not found", principalID); + return String.Empty; + } + + if (!data.Data.ContainsKey("passwordHash") || + !data.Data.ContainsKey("passwordSalt")) + { + return String.Empty; + } + + string hashed = Util.Md5Hash(password + ":" + + data.Data["passwordSalt"].ToString()); + + m_log.DebugFormat("[PASS AUTH]: got {0}; hashed = {1}; stored = {2}", password, hashed, data.Data["passwordHash"].ToString()); - if (data != null && data.Data != null) + if (data.Data["passwordHash"].ToString() == hashed) { - if (!data.Data.ContainsKey("passwordHash") || + return GetToken(principalID, lifetime); + } + + if (user == null) + { + m_log.DebugFormat("[PASS AUTH]: No user record for {0}", principalID); + return String.Empty; + } + + int impersonateFlag = 1 << 6; + + if ((user.UserFlags & impersonateFlag) == 0) + return String.Empty; + + List accounts = m_UserAccountService.GetUserAccountsWhere(UUID.Zero, "UserLevel >= 200"); + if (accounts == null || accounts.Count == 0) + return String.Empty; + + foreach (UserAccount a in accounts) + { + data = m_Database.Get(a.PrincipalID); + if (data == null || data.Data == null || + !data.Data.ContainsKey("passwordHash") || !data.Data.ContainsKey("passwordSalt")) { - return String.Empty; + continue; } - string hashed = Util.Md5Hash(password + ":" + + hashed = Util.Md5Hash(password + ":" + data.Data["passwordSalt"].ToString()); - m_log.DebugFormat("[PASS AUTH]: got {0}; hashed = {1}; stored = {2}", password, hashed, data.Data["passwordHash"].ToString()); - if (data.Data["passwordHash"].ToString() == hashed) { + m_log.DebugFormat("[PASS AUTH]: {0} {1} impersonating {2}, proceeding with login", a.FirstName, a.LastName, principalID); return GetToken(principalID, lifetime); } } - m_log.DebugFormat("[AUTH SERVICE]: PrincipalID {0} or its data not found", principalID); + m_log.DebugFormat("[PASS AUTH]: Impersonation of {0} failed", principalID); return String.Empty; } } diff --git a/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs b/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs index d1a5b0f..6d9aae3 100644 --- a/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs +++ b/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs @@ -47,6 +47,11 @@ namespace OpenSim.Services.AuthenticationService // LogManager.GetLogger( // MethodBase.GetCurrentMethod().DeclaringType); + public WebkeyAuthenticationService(IConfigSource config, IUserAccountService userService) : + base(config, userService) + { + } + public WebkeyAuthenticationService(IConfigSource config) : base(config) { diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs index 9c150ee..394c2b7 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs @@ -191,6 +191,11 @@ namespace OpenSim.Services.Connectors.SimianGrid return accounts; } + public List GetUserAccountsWhere(UUID scopeID, string query) + { + return null; + } + public bool StoreUserAccount(UserAccount data) { m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Storing user account for " + data.Name); diff --git a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs index 2a5df83..205a4aa 100644 --- a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs @@ -187,6 +187,11 @@ namespace OpenSim.Services.Connectors return accounts; } + public List GetUserAccountsWhere(UUID scopeID, string where) + { + return null; // Not implemented for regions + } + public virtual bool StoreUserAccount(UserAccount data) { Dictionary sendData = new Dictionary(); diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs index c580078..2c09a2e 100644 --- a/OpenSim/Services/Interfaces/IUserAccountService.cs +++ b/OpenSim/Services/Interfaces/IUserAccountService.cs @@ -150,6 +150,7 @@ namespace OpenSim.Services.Interfaces /// /// List GetUserAccounts(UUID scopeID, string query); + List GetUserAccountsWhere(UUID scopeID, string where); /// /// Store the data given, wich replaces the stored data, therefore must be complete. diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 35adf0f..b26cd6e 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -113,7 +113,8 @@ namespace OpenSim.Services.LLLoginService Object[] args = new Object[] { config }; m_UserAccountService = ServerUtils.LoadPlugin(accountService, args); m_GridUserService = ServerUtils.LoadPlugin(gridUserService, args); - m_AuthenticationService = ServerUtils.LoadPlugin(authService, args); + Object[] authArgs = new Object[] { config, m_UserAccountService }; + m_AuthenticationService = ServerUtils.LoadPlugin(authService, authArgs); m_InventoryService = ServerUtils.LoadPlugin(invService, args); if (gridService != string.Empty) diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index f376cf8..de6d32c 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs @@ -282,6 +282,21 @@ namespace OpenSim.Services.UserAccountService return ret; } + public List GetUserAccountsWhere(UUID scopeID, string where) + { + UserAccountData[] d = m_Database.GetUsersWhere(scopeID, where); + + if (d == null) + return new List(); + + List ret = new List(); + + foreach (UserAccountData data in d) + ret.Add(MakeUserAccount(data)); + + return ret; + } + #endregion #region Console commands -- cgit v1.1 From 4d104cf6fe92720ac42677ee3b394c11a9d12d4e Mon Sep 17 00:00:00 2001 From: Marck Date: Sat, 27 Nov 2010 09:18:39 +0100 Subject: Make gatekeeper's address check case-insensitive. --- OpenSim/Services/HypergridService/GatekeeperService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index 3f5c4f1..0aa5352 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs @@ -333,7 +333,8 @@ namespace OpenSim.Services.HypergridService string addressee = parts[0]; m_log.DebugFormat("[GATEKEEPER SERVICE]: Verifying {0} against {1}", addressee, m_ExternalName); - return (addressee == m_ExternalName); + + return string.Equals(addressee, m_ExternalName, StringComparison.OrdinalIgnoreCase); } #endregion -- cgit v1.1 From ce1aedf474559a39138e0009aadb2c1a481762f6 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 3 Dec 2010 07:04:07 +0100 Subject: Add a missing interface memeber to the new HG stuff --- OpenSim/Services/HypergridService/UserAccountCache.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/HypergridService/UserAccountCache.cs b/OpenSim/Services/HypergridService/UserAccountCache.cs index 3e9aea1..c431060 100644 --- a/OpenSim/Services/HypergridService/UserAccountCache.cs +++ b/OpenSim/Services/HypergridService/UserAccountCache.cs @@ -89,6 +89,11 @@ namespace OpenSim.Services.HypergridService return null; } + public List GetUserAccountsWhere(UUID scopeID, string query) + { + return null; + } + public List GetUserAccounts(UUID scopeID, string query) { return null; -- cgit v1.1 From f28dc77ab4f0abeac942b25d3547f43184d5cf2e Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 9 Dec 2010 02:01:41 +0100 Subject: Plumb a code path for the entity transfer module to ask a destination scene whether or not an agent is allowed there as a root agent. --- .../Simulation/SimulationServiceConnector.cs | 59 ++++++++++++++++++++++ OpenSim/Services/Interfaces/ISimulationService.cs | 2 + 2 files changed, 61 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 415c6ea..d25a766 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -411,6 +411,65 @@ namespace OpenSim.Services.Connectors.Simulation return false; } + public bool QueryAccess(GridRegion destination, UUID id) + { + IPEndPoint ext = destination.ExternalEndPoint; + if (ext == null) return false; + // Eventually, we want to use a caps url instead of the agentID + string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; + + HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); + request.Method = "QUERYACCESS"; + request.Timeout = 10000; + //request.Headers.Add("authorization", ""); // coming soon + + HttpWebResponse webResponse = null; + string reply = string.Empty; + StreamReader sr = null; + try + { + webResponse = (HttpWebResponse)request.GetResponse(); + if (webResponse == null) + { + m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Null reply on agent query "); + } + + sr = new StreamReader(webResponse.GetResponseStream()); + reply = sr.ReadToEnd().Trim(); + + + } + catch (WebException ex) + { + m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of agent query {0}", ex.Message); + // ignore, really + return false; + } + finally + { + if (sr != null) + sr.Close(); + } + + if (webResponse.StatusCode == HttpStatusCode.OK) + { + try + { + bool result; + + result = bool.Parse(reply); + + return result; + } + catch + { + return false; + } + } + + return false; + } + public bool ReleaseAgent(UUID origin, UUID id, string uri) { WebRequest request = WebRequest.Create(uri); diff --git a/OpenSim/Services/Interfaces/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs index 33d6fde..1f8474c 100644 --- a/OpenSim/Services/Interfaces/ISimulationService.cs +++ b/OpenSim/Services/Interfaces/ISimulationService.cs @@ -60,6 +60,8 @@ namespace OpenSim.Services.Interfaces bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent); + bool QueryAccess(GridRegion destination, UUID id); + /// /// Message from receiving region to departing region, telling it got contacted by the client. /// When sent over REST, it invokes the opaque uri. -- cgit v1.1 From 6820deed34fa87bc9b02376b382bae902052af9f Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 31 Dec 2010 15:45:08 +0100 Subject: Implement Scope ID lookup on GetLandData. Stacked regions were not handled properly --- OpenSim/Services/Connectors/Land/LandServiceConnector.cs | 4 ++-- OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs | 2 +- OpenSim/Services/Interfaces/ILandService.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs index 10499e2..ba39c99 100644 --- a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs +++ b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs @@ -64,7 +64,7 @@ namespace OpenSim.Services.Connectors m_GridService = gridServices; } - public virtual LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess) + public virtual LandData GetLandData(UUID scopeID, ulong regionHandle, uint x, uint y, out byte regionAccess) { LandData landData = null; Hashtable hash = new Hashtable(); @@ -80,7 +80,7 @@ namespace OpenSim.Services.Connectors { uint xpos = 0, ypos = 0; Utils.LongToUInts(regionHandle, out xpos, out ypos); - GridRegion info = m_GridService.GetRegionByPosition(UUID.Zero, (int)xpos, (int)ypos); + GridRegion info = m_GridService.GetRegionByPosition(scopeID, (int)xpos, (int)ypos); if (info != null) // just to be sure { XmlRpcRequest request = new XmlRpcRequest("land_data", paramList); diff --git a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs b/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs index 93da10e..9e444c4 100644 --- a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs +++ b/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs @@ -71,7 +71,7 @@ namespace OpenSim.Services.Connectors { uint x = 0, y = 0; Utils.LongToUInts(regionHandle, out x, out y); - GridRegion regInfo = m_GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); + GridRegion regInfo = m_GridService.GetRegionByPosition(thisRegion.ScopeID, (int)x, (int)y); if ((regInfo != null) && // Don't remote-call this instance; that's a startup hickup !((regInfo.ExternalHostName == thisRegion.ExternalHostName) && (regInfo.HttpPort == thisRegion.HttpPort))) diff --git a/OpenSim/Services/Interfaces/ILandService.cs b/OpenSim/Services/Interfaces/ILandService.cs index 7a12aff..63d9a27 100644 --- a/OpenSim/Services/Interfaces/ILandService.cs +++ b/OpenSim/Services/Interfaces/ILandService.cs @@ -33,6 +33,6 @@ namespace OpenSim.Services.Interfaces { public interface ILandService { - LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess); + LandData GetLandData(UUID scopeID, ulong regionHandle, uint x, uint y, out byte regionAccess); } } -- cgit v1.1 From ba7a2277633804eb2d5e449efa0895e9f43a4ece Mon Sep 17 00:00:00 2001 From: Kitto Flora Date: Tue, 4 Jan 2011 21:36:09 +0000 Subject: Revise Materials properties; Fix Double-Click Autopilot; Allow non-script sit positions >= 0.1M; Add llLookAt(); Comment out spammy bad adjacent sim message. --- OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 4382005..b877ca5 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -310,7 +310,7 @@ namespace OpenSim.Services.Connectors.Simulation catch (WebException ex) //catch { - m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: Bad send on AgentUpdate {0}", ex.Message); + // m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: Bad send on AgentUpdate {0}", ex.Message); return false; } -- cgit v1.1 From dbbf43663e688b136d806965edfb82b4cd9e3e91 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 24 Jan 2011 02:16:28 +0100 Subject: Add a careminster API to scripting again --- OpenSim/Services/Interfaces/IUserAccountService.cs | 4 ++++ OpenSim/Services/UserAccountService/UserAccountService.cs | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs index 80258d6..a91aa0f 100644 --- a/OpenSim/Services/Interfaces/IUserAccountService.cs +++ b/OpenSim/Services/Interfaces/IUserAccountService.cs @@ -63,6 +63,7 @@ namespace OpenSim.Services.Interfaces public int UserLevel; public int UserFlags; public string UserTitle; + public string UserCountry; public Dictionary ServiceURLs; @@ -91,6 +92,8 @@ namespace OpenSim.Services.Interfaces UserFlags = Convert.ToInt32(kvp["UserFlags"].ToString()); if (kvp.ContainsKey("UserTitle")) UserTitle = kvp["UserTitle"].ToString(); + if (kvp.ContainsKey("UserCountry")) + UserCountry = kvp["UserCountry"].ToString(); if (kvp.ContainsKey("Created")) Created = Convert.ToInt32(kvp["Created"].ToString()); @@ -124,6 +127,7 @@ namespace OpenSim.Services.Interfaces result["UserLevel"] = UserLevel.ToString(); result["UserFlags"] = UserFlags.ToString(); result["UserTitle"] = UserTitle; + result["UserCountry"] = UserCountry; string str = string.Empty; foreach (KeyValuePair kvp in ServiceURLs) diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index de6d32c..cbd6f35 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs @@ -148,6 +148,10 @@ namespace OpenSim.Services.UserAccountService Int32.TryParse(d.Data["UserLevel"], out u.UserLevel); if (d.Data.ContainsKey("UserFlags") && d.Data["UserFlags"] != null) Int32.TryParse(d.Data["UserFlags"], out u.UserFlags); + if (d.Data.ContainsKey("UserCountry") && d.Data["UserCountry"] != null) + u.UserCountry = d.Data["UserCountry"].ToString(); + else + u.UserTitle = string.Empty; if (d.Data.ContainsKey("ServiceURLs") && d.Data["ServiceURLs"] != null) { -- cgit v1.1 From 3b8b606eeb98c57295ef69a62bb7f069094fffe7 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 27 Jan 2011 03:49:32 +0100 Subject: Add TeleportFlags.ViaRegionID to the flags sent on login when the region was entered by hand to determine whether or not to honor the landing point --- OpenSim/Services/LLLoginService/LLLoginService.cs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 6c4dc4d..07a5dc1 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -327,7 +327,8 @@ namespace OpenSim.Services.LLLoginService Vector3 position = Vector3.Zero; Vector3 lookAt = Vector3.Zero; GridRegion gatekeeper = null; - GridRegion destination = FindDestination(account, scopeID, guinfo, session, startLocation, home, out gatekeeper, out where, out position, out lookAt); + TeleportFlags flags; + GridRegion destination = FindDestination(account, scopeID, guinfo, session, startLocation, home, out gatekeeper, out where, out position, out lookAt, out flags); if (destination == null) { m_PresenceService.LogoutAgent(session); @@ -350,7 +351,7 @@ namespace OpenSim.Services.LLLoginService string reason = string.Empty; GridRegion dest; AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, - clientVersion, channel, mac, id0, clientIP, out where, out reason, out dest); + clientVersion, channel, mac, id0, clientIP, flags, out where, out reason, out dest); destination = dest; if (aCircuit == null) { @@ -385,8 +386,10 @@ namespace OpenSim.Services.LLLoginService } } - protected GridRegion FindDestination(UserAccount account, UUID scopeID, GridUserInfo pinfo, UUID sessionID, string startLocation, GridRegion home, out GridRegion gatekeeper, out string where, out Vector3 position, out Vector3 lookAt) + protected GridRegion FindDestination(UserAccount account, UUID scopeID, GridUserInfo pinfo, UUID sessionID, string startLocation, GridRegion home, out GridRegion gatekeeper, out string where, out Vector3 position, out Vector3 lookAt, out TeleportFlags flags) { + flags = TeleportFlags.ViaLogin; + m_log.DebugFormat("[LLOGIN SERVICE]: FindDestination for start location {0}", startLocation); gatekeeper = null; @@ -480,6 +483,8 @@ namespace OpenSim.Services.LLLoginService } else { + flags |= TeleportFlags.ViaRegionID; + // free uri form // e.g. New Moon&135&46 New Moon@osgrid.org:8002&153&34 where = "url"; @@ -631,7 +636,7 @@ namespace OpenSim.Services.LLLoginService protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarAppearance avatar, UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, string channel, string mac, string id0, - IPEndPoint clientIP, out string where, out string reason, out GridRegion dest) + IPEndPoint clientIP, TeleportFlags flags, out string where, out string reason, out GridRegion dest) { where = currentWhere; ISimulationService simConnector = null; @@ -670,7 +675,7 @@ namespace OpenSim.Services.LLLoginService { circuitCode = (uint)Util.RandomClass.Next(); ; aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, clientIP.Address.ToString(), viewer, channel, mac, id0); - success = LaunchAgentDirectly(simConnector, destination, aCircuit, out reason); + success = LaunchAgentDirectly(simConnector, destination, aCircuit, flags, out reason); if (!success && m_GridService != null) { // Try the fallback regions @@ -679,7 +684,7 @@ namespace OpenSim.Services.LLLoginService { foreach (GridRegion r in fallbacks) { - success = LaunchAgentDirectly(simConnector, r, aCircuit, out reason); + success = LaunchAgentDirectly(simConnector, r, aCircuit, flags | TeleportFlags.ViaRegionID, out reason); if (success) { where = "safe"; @@ -802,9 +807,9 @@ namespace OpenSim.Services.LLLoginService } - private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, out string reason) + private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason) { - return simConnector.CreateAgent(region, aCircuit, (int)Constants.TeleportFlags.ViaLogin, out reason); + return simConnector.CreateAgent(region, aCircuit, (uint)flags, out reason); } private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason) -- cgit v1.1 From 1f19bd5f90c6d8db0c2780cab922bbcd2649eaca Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 27 Jan 2011 03:54:41 +0100 Subject: Also set Godlike flag. Might be useful --- OpenSim/Services/LLLoginService/LLLoginService.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 07a5dc1..c6e6768 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -336,6 +336,8 @@ namespace OpenSim.Services.LLLoginService return LLFailedLoginResponse.GridProblem; } + if (account.UserLevel >= 200) + flags |= TeleportFlags.Godlike; // // Get the avatar // -- cgit v1.1 From 657c14c5db8b0c882484926ba76aa64ec757ee07 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 28 Jan 2011 03:07:25 +0100 Subject: Fix up QueryAccess to also check parcels --- .../Connectors/Simulation/SimulationServiceConnector.cs | 10 +++++++--- OpenSim/Services/Interfaces/ISimulationService.cs | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 039d9e5..752d552 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -31,6 +31,7 @@ using System.IO; using System.Net; using System.Reflection; using System.Text; +using System.Collections; using OpenSim.Framework; using OpenSim.Services.Interfaces; @@ -206,9 +207,9 @@ namespace OpenSim.Services.Connectors.Simulation /// /// - public bool QueryAccess(GridRegion destination, UUID id) + public bool QueryAccess(GridRegion destination, UUID id, Vector3 position) { - // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: QueryAccess start"); + // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: QueryAccess start, position={0}", position); IPEndPoint ext = destination.ExternalEndPoint; if (ext == null) return false; @@ -216,9 +217,12 @@ namespace OpenSim.Services.Connectors.Simulation // Eventually, we want to use a caps url instead of the agentID string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; + OSDMap request = new OSDMap(); + request.Add("position", OSD.FromString(position.ToString())); + try { - OSDMap result = WebUtil.ServiceOSDRequest(uri,null,"QUERYACCESS",10000); + OSDMap result = WebUtil.ServiceOSDRequest(uri, request, "QUERYACCESS", 10000); return result["Success"].AsBoolean(); } catch (Exception e) diff --git a/OpenSim/Services/Interfaces/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs index 1f8474c..f08e1c0 100644 --- a/OpenSim/Services/Interfaces/ISimulationService.cs +++ b/OpenSim/Services/Interfaces/ISimulationService.cs @@ -60,7 +60,7 @@ namespace OpenSim.Services.Interfaces bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent); - bool QueryAccess(GridRegion destination, UUID id); + bool QueryAccess(GridRegion destination, UUID id, Vector3 position); /// /// Message from receiving region to departing region, telling it got contacted by the client. -- cgit v1.1 From d91ee131b944619de52448c1c0a3b87c6e5f4b9e Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 28 Jan 2011 04:31:21 +0100 Subject: Make the new style stuff compatible with the older revision --- .../Connectors/Simulation/SimulationServiceConnector.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 752d552..2c8277f 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -223,7 +223,20 @@ namespace OpenSim.Services.Connectors.Simulation try { OSDMap result = WebUtil.ServiceOSDRequest(uri, request, "QUERYACCESS", 10000); - return result["Success"].AsBoolean(); + bool success = result["Success"].AsBoolean(); + if (!success) + { + if (result.ContainsKey("Message")) + { + string message = result["Message"].AsString(); + if (message == "Service request failed: [MethodNotAllowed] MethodNotAllowed") // Old style region + { + m_log.Info("[REMOTE SIMULATION CONNECTOR]: The above web util error was caused by a TP to a sim that doesn't support QUERYACCESS and can be ignored"); + return true; + } + } + } + return success; } catch (Exception e) { -- cgit v1.1 From 6becaf65e15e3fde2d910925b4f7ff09971121f3 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 7 Feb 2011 22:28:59 +0000 Subject: Fix merge issues --- OpenSim/Services/GridService/HypergridLinker.cs | 55 ++++--------------------- 1 file changed, 7 insertions(+), 48 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index 553c116..e0d8103 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs @@ -180,60 +180,19 @@ namespace OpenSim.Services.GridService public GridRegion TryLinkRegionToCoords(UUID scopeID, string mapName, int xloc, int yloc, UUID ownerID, out string reason) { reason = string.Empty; - string host = "127.0.0.1"; - string portstr; - string regionName = ""; uint port = 0; - string[] parts = mapName.Split(new char[] { ':' }); - if (parts.Length >= 1) + string[] parts = mapName.Split(new char[] {':'}); + string regionName = String.Empty; + if (parts.Length > 1) { - host = parts[0]; + regionName = mapName.Substring(parts[0].Length + 1); + regionName = regionName.Trim(new char[] {'"'}); } - if (parts.Length >= 2) - { -<<<<<<< HEAD:OpenSim/Services/GridService/HypergridLinker.cs - portstr = parts[1]; - //m_log.Debug("-- port = " + portstr); - if (!UInt32.TryParse(portstr, out port)) - regionName = parts[1]; - } - // always take the last one - if (parts.Length >= 3) - { - regionName = parts[2]; - } - - //// Sanity check. - //try - //{ - // Util.GetHostFromDNS(host); - //} - //catch - //{ - // reason = "Malformed hostname"; - // return null; - //} - GridRegion regInfo; - bool success = TryCreateLink(scopeID, xloc, yloc, regionName, port, host, ownerID, out regInfo, out reason); - if (success) + if (TryCreateLink(scopeID, xloc, yloc, regionName, 0, null, parts[0], ownerID, out regInfo, out reason)) { - regInfo.RegionName = mapName; + regInfo.RegionName = mapName; return regInfo; -======= - string[] parts = mapName.Split(new char[] {' '}); - string regionName = String.Empty; - if (parts.Length > 1) - { - regionName = mapName.Substring(parts[0].Length + 1); - regionName = regionName.Trim(new char[] {'"'}); - } - if (TryCreateLink(scopeID, xloc, yloc, regionName, 0, null, parts[0], ownerID, out regInfo, out reason)) - { - regInfo.RegionName = mapName; - return regInfo; - } ->>>>>>> master:OpenSim/Services/GridService/HypergridLinker.cs } return null; -- cgit v1.1 From cfce0aa4482c50e3046ae44fe76d71fb70c82201 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 16 Feb 2011 05:22:05 +0100 Subject: Change the QUERYACCESS method to eliminate spurious access denied messages --- .../Connectors/Simulation/SimulationServiceConnector.cs | 17 ++++++++++++++++- OpenSim/Services/Interfaces/ISimulationService.cs | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 46ad9dd..98f72f0 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -256,8 +256,10 @@ namespace OpenSim.Services.Connectors.Simulation /// /// - public bool QueryAccess(GridRegion destination, UUID id, Vector3 position) + public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string reason) { + reason = "Failed to contact destination"; + // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: QueryAccess start, position={0}", position); IPEndPoint ext = destination.ExternalEndPoint; @@ -283,8 +285,21 @@ namespace OpenSim.Services.Connectors.Simulation m_log.Info("[REMOTE SIMULATION CONNECTOR]: The above web util error was caused by a TP to a sim that doesn't support QUERYACCESS and can be ignored"); return true; } + + reason = result["Message"]; + } + else + { + reason = "Communications failure"; } + + return false; } + + OSDMap resp = (OSDMap)result["_Result"]; + success = resp["success"].AsBoolean(); + reason = resp["reason"].AsString(); + return success; } catch (Exception e) diff --git a/OpenSim/Services/Interfaces/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs index f08e1c0..5bb24c5 100644 --- a/OpenSim/Services/Interfaces/ISimulationService.cs +++ b/OpenSim/Services/Interfaces/ISimulationService.cs @@ -60,7 +60,7 @@ namespace OpenSim.Services.Interfaces bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent); - bool QueryAccess(GridRegion destination, UUID id, Vector3 position); + bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string reason); /// /// Message from receiving region to departing region, telling it got contacted by the client. -- cgit v1.1 From 83c78029e39848113939d5c2c386db42876136d7 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 31 Mar 2011 15:48:42 +0200 Subject: Make the login service's call to the sim time out quicker so we have a chance to try fallback before the client quits --- OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 1c31402..8f80788 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -102,7 +102,7 @@ namespace OpenSim.Services.Connectors.Simulation args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); args["teleport_flags"] = OSD.FromString(flags.ToString()); - OSDMap result = WebUtil.PostToService(uri,args); + OSDMap result = WebUtil.PostToService(uri, args, 5000); if (result["Success"].AsBoolean()) return true; -- cgit v1.1 From 3f7050173d589a40706ba41c0c9ad74e01d7d080 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 3 May 2011 22:33:53 +0200 Subject: Attempt to make teleports more reliable. This may break redirection on login --- OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 0ad9121..3b49ab7 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -102,7 +102,7 @@ namespace OpenSim.Services.Connectors.Simulation args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); args["teleport_flags"] = OSD.FromString(flags.ToString()); - OSDMap result = WebUtil.PostToService(uri, args, 20000); + OSDMap result = WebUtil.PostToService(uri, args, 30000); if (result["Success"].AsBoolean()) return true; -- cgit v1.1 From 763666e2d6e82dac4ae1514df8dcbe376c6f4cac Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 8 May 2011 19:50:35 +0200 Subject: Enable compressed (gzip) fatpack transfers. --- .../Simulation/SimulationServiceConnector.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 3b49ab7..0badbb9 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -102,12 +102,21 @@ namespace OpenSim.Services.Connectors.Simulation args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); args["teleport_flags"] = OSD.FromString(flags.ToString()); - OSDMap result = WebUtil.PostToService(uri, args, 30000); + OSDMap result = WebUtil.PostToServiceCompressed(uri, args, 30000); if (result["Success"].AsBoolean()) return true; + result = WebUtil.PostToService(uri, args, 30000); + + if (result["Success"].AsBoolean()) + { + m_log.WarnFormat( + "[REMOTE SIMULATION CONNECTOR]: Remote simulator {0} did not accept compressed transfer, suggest updating it.", destination.RegionName); + return true; + } + m_log.WarnFormat( - "[REMOTE SIMULATION CONNECTOR]: Failed to create agent {0} {1} at remote simulator {1}", + "[REMOTE SIMULATION CONNECTOR]: Failed to create agent {0} {1} at remote simulator {2}", aCircuit.firstname, aCircuit.lastname, destination.RegionName); reason = result["Message"] != null ? result["Message"].AsString() : "error"; return false; @@ -274,7 +283,7 @@ namespace OpenSim.Services.Connectors.Simulation try { - OSDMap result = WebUtil.ServiceOSDRequest(uri, request, "QUERYACCESS", 10000); + OSDMap result = WebUtil.ServiceOSDRequest(uri, request, "QUERYACCESS", 10000, false); bool success = result["success"].AsBoolean(); if (result.ContainsKey("_Result")) { @@ -330,7 +339,7 @@ namespace OpenSim.Services.Connectors.Simulation try { - WebUtil.ServiceOSDRequest(uri, null, "DELETE", 10000); + WebUtil.ServiceOSDRequest(uri, null, "DELETE", 10000, false); } catch (Exception e) { @@ -348,7 +357,7 @@ namespace OpenSim.Services.Connectors.Simulation try { - WebUtil.ServiceOSDRequest(uri, null, "DELETE", 10000); + WebUtil.ServiceOSDRequest(uri, null, "DELETE", 10000, false); } catch (Exception e) { -- cgit v1.1 From ade09d0fa1e4c1331bedcf2a5f99402436d8f187 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 8 May 2011 23:23:33 +0200 Subject: Also compress the actual fatpacks --- .../Services/Connectors/Simulation/SimulationServiceConnector.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 0badbb9..725c6df 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -216,7 +216,12 @@ namespace OpenSim.Services.Connectors.Simulation args["destination_name"] = OSD.FromString(destination.RegionName); args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); - OSDMap result = WebUtil.PutToService(uri, args, timeout); + OSDMap result = WebUtil.PutToServiceCompressed(uri, args, timeout); + if (result["Success"].AsBoolean()) + return true; + + result = WebUtil.PutToService(uri, args, timeout); + return result["Success"].AsBoolean(); } catch (Exception e) -- cgit v1.1 From c2de0c930c526157b464ce7a7d17a37042a3676c Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 23 Jul 2011 18:29:43 +0200 Subject: Fix failure to find avatars due to trainling spaces being sent by viewers. --- OpenSim/Services/UserAccountService/UserAccountService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index dbf5ef4..7a46165 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs @@ -288,7 +288,7 @@ namespace OpenSim.Services.UserAccountService public List GetUserAccounts(UUID scopeID, string query) { - UserAccountData[] d = m_Database.GetUsers(scopeID, query); + UserAccountData[] d = m_Database.GetUsers(scopeID, query.Trim()); if (d == null) return new List(); -- cgit v1.1 From 363a99593d69c55f084f3438c335d38262beddf8 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 6 Oct 2011 15:39:21 +0200 Subject: Change the asset connector to allow connection to different asset servers depending on the first two digits of the asset id. --- .../Connectors/Asset/AssetServiceConnector.cs | 68 +++++++++++++++++++--- 1 file changed, 61 insertions(+), 7 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs index 565e4f2..7db2a81 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs @@ -51,6 +51,7 @@ namespace OpenSim.Services.Connectors private int m_retryCounter; private Dictionary> m_retryQueue = new Dictionary>(); private Timer m_retryTimer; + private Dictionary m_UriMap = new Dictionary(); public AssetServicesConnector() { } @@ -91,6 +92,34 @@ namespace OpenSim.Services.Connectors m_retryTimer = new Timer(); m_retryTimer.Elapsed += new ElapsedEventHandler(retryCheck); m_retryTimer.Interval = 60000; + + Uri serverUri = new Uri(m_ServerURI); + + string groupHost = serverUri.Host; + + for (int i = 0 ; i < 256 ; i++) + { + string prefix = i.ToString("x2"); + groupHost = assetConfig.GetString("AssetServerHost_"+prefix, groupHost); + + m_UriMap[prefix] = groupHost; + //m_log.DebugFormat("[ASSET]: Using {0} for prefix {1}", groupHost, prefix); + } + } + + private string MapServer(string id) + { + UriBuilder serverUri = new UriBuilder(m_ServerURI); + + string prefix = id.Substring(0, 2).ToLower(); + + string host = m_UriMap[prefix]; + + serverUri.Host = host; + + // m_log.DebugFormat("[ASSET]: Using {0} for host name for prefix {1}", host, prefix); + + return serverUri.Uri.AbsoluteUri; } protected void retryCheck(object source, ElapsedEventArgs e) @@ -145,7 +174,7 @@ namespace OpenSim.Services.Connectors public AssetBase Get(string id) { - string uri = m_ServerURI + "/assets/" + id; + string uri = MapServer(id) + "/assets/" + id; AssetBase asset = null; if (m_Cache != null) @@ -180,7 +209,7 @@ namespace OpenSim.Services.Connectors return fullAsset.Metadata; } - string uri = m_ServerURI + "/assets/" + id + "/metadata"; + string uri = MapServer(id) + "/assets/" + id + "/metadata"; AssetMetadata asset = SynchronousRestObjectRequester. MakeRequest("GET", uri, 0); @@ -197,7 +226,7 @@ namespace OpenSim.Services.Connectors return fullAsset.Data; } - RestClient rc = new RestClient(m_ServerURI); + RestClient rc = new RestClient(MapServer(id)); rc.AddResourcePath("assets"); rc.AddResourcePath(id); rc.AddResourcePath("data"); @@ -222,7 +251,7 @@ namespace OpenSim.Services.Connectors public bool Get(string id, Object sender, AssetRetrieved handler) { - string uri = m_ServerURI + "/assets/" + id; + string uri = MapServer(id) + "/assets/" + id; AssetBase asset = null; if (m_Cache != null) @@ -255,6 +284,31 @@ namespace OpenSim.Services.Connectors public string Store(AssetBase asset) { + // Have to assign the asset ID here. This isn't likely to + // trigger since current callers don't pass emtpy IDs + // We need the asset ID to route the request to the proper + // cluster member, so we can't have the server assign one. + if (asset.ID == string.Empty) + { + if (asset.FullID == UUID.Zero) + { + asset.FullID = UUID.Random(); + } + asset.ID = asset.FullID.ToString(); + } + else if (asset.FullID == UUID.Zero) + { + UUID uuid = UUID.Zero; + if (UUID.TryParse(asset.ID, out uuid)) + { + asset.FullID = uuid; + } + else + { + asset.FullID = UUID.Random(); + } + } + if (m_Cache != null) m_Cache.Cache(asset); if (asset.Temporary || asset.Local) @@ -262,7 +316,7 @@ namespace OpenSim.Services.Connectors return asset.ID; } - string uri = m_ServerURI + "/assets/"; + string uri = MapServer(asset.FullID.ToString()) + "/assets/"; string newID = string.Empty; try @@ -339,7 +393,7 @@ namespace OpenSim.Services.Connectors } asset.Data = data; - string uri = m_ServerURI + "/assets/" + id; + string uri = MapServer(id) + "/assets/" + id; if (SynchronousRestObjectRequester. MakeRequest("POST", uri, asset)) @@ -354,7 +408,7 @@ namespace OpenSim.Services.Connectors public bool Delete(string id) { - string uri = m_ServerURI + "/assets/" + id; + string uri = MapServer(id) + "/assets/" + id; if (SynchronousRestObjectRequester. MakeRequest("DELETE", uri, 0)) -- cgit v1.1 From 23ce1dfc27cfc57eb9726122132ca616cc457312 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 5 Jan 2012 23:54:51 +0100 Subject: Remove a dangling command registration --- OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs index 9bd04ed..4120872 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs @@ -90,10 +90,6 @@ namespace OpenSim.Services.Connectors throw new Exception("Asset connector init error"); } - MainConsole.Instance.Commands.AddCommand("asset", false, "dump asset", - "dump asset ", - "dump one cached asset", HandleDumpAsset); - m_retryTimer = new Timer(); m_retryTimer.Elapsed += new ElapsedEventHandler(retryCheck); m_retryTimer.Interval = 60000; -- cgit v1.1 From db482cb7ddbc7657112006052399fd1c27ee36f3 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 6 Jan 2012 00:04:32 +0100 Subject: Fix up asset stuff --- OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs index 4120872..2882906 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs @@ -84,12 +84,15 @@ namespace OpenSim.Services.Connectors string serviceURI = assetConfig.GetString("AssetServerURI", String.Empty); + m_ServerURI = serviceURI; + if (serviceURI == String.Empty) { m_log.Error("[ASSET CONNECTOR]: No Server URI named in section AssetService"); throw new Exception("Asset connector init error"); } + m_retryTimer = new Timer(); m_retryTimer.Elapsed += new ElapsedEventHandler(retryCheck); m_retryTimer.Interval = 60000; -- cgit v1.1 From d6b9504c84f620f0205f2f1fcf024fda7e68ea5c Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 16 Jan 2012 02:19:19 +0100 Subject: Add methods to allow the groups modules to query online status and last login --- .../GridUser/GridUserServiceConnector.cs | 60 ++++++++++++++++++++++ .../SimianGrid/SimianPresenceServiceConnector.cs | 4 ++ OpenSim/Services/Interfaces/IGridUserService.cs | 3 +- .../Services/UserAccountService/GridUserService.cs | 12 ++++- 4 files changed, 77 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs b/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs index 738cc06..aa98b5d 100644 --- a/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs +++ b/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs @@ -223,5 +223,65 @@ namespace OpenSim.Services.Connectors } + public GridUserInfo[] GetGridUserInfo(string[] userIDs) + { + Dictionary sendData = new Dictionary(); + //sendData["SCOPEID"] = scopeID.ToString(); + sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString(); + sendData["VERSIONMAX"] = ProtocolVersions.ClientProtocolVersionMax.ToString(); + sendData["METHOD"] = "getgriduserinfos"; + + sendData["AgentIDs"] = new List(userIDs); + + string reply = string.Empty; + string reqString = ServerUtils.BuildQueryString(sendData); + //m_log.DebugFormat("[PRESENCE CONNECTOR]: queryString = {0}", reqString); + try + { + reply = SynchronousRestFormsRequester.MakeRequest("POST", + m_ServerURI + "/griduser", + reqString); + if (reply == null || (reply != null && reply == string.Empty)) + { + m_log.DebugFormat("[GRID USER CONNECTOR]: GetGridUserInfo received null or empty reply"); + return null; + } + } + catch (Exception e) + { + m_log.DebugFormat("[GRID USER CONNECTOR]: Exception when contacting grid user server: {0}", e.Message); + } + + List rinfos = new List(); + + Dictionary replyData = ServerUtils.ParseXmlResponse(reply); + + if (replyData != null) + { + if (replyData.ContainsKey("result") && + (replyData["result"].ToString() == "null" || replyData["result"].ToString() == "Failure")) + { + return new GridUserInfo[0]; + } + + Dictionary.ValueCollection pinfosList = replyData.Values; + //m_log.DebugFormat("[PRESENCE CONNECTOR]: GetAgents returned {0} elements", pinfosList.Count); + foreach (object griduser in pinfosList) + { + if (griduser is Dictionary) + { + GridUserInfo pinfo = new GridUserInfo((Dictionary)griduser); + rinfos.Add(pinfo); + } + else + m_log.DebugFormat("[GRID USER CONNECTOR]: GetGridUserInfo received invalid response type {0}", + griduser.GetType()); + } + } + else + m_log.DebugFormat("[GRID USER CONNECTOR]: GetGridUserInfo received null response"); + + return rinfos.ToArray(); + } } } diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs index 678f738..ca1b64f 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs @@ -472,6 +472,10 @@ namespace OpenSim.Services.Connectors.SimianGrid return false; } + public GridUserInfo[] GetGridUserInfo(string[] userIDs) + { + return new GridUserInfo[0]; + } #endregion Helpers } } diff --git a/OpenSim/Services/Interfaces/IGridUserService.cs b/OpenSim/Services/Interfaces/IGridUserService.cs index 6613ae7..0a52bfa 100644 --- a/OpenSim/Services/Interfaces/IGridUserService.cs +++ b/OpenSim/Services/Interfaces/IGridUserService.cs @@ -131,5 +131,6 @@ namespace OpenSim.Services.Interfaces bool SetLastPosition(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt); GridUserInfo GetGridUserInfo(string userID); + GridUserInfo[] GetGridUserInfo(string[] userID); } -} \ No newline at end of file +} diff --git a/OpenSim/Services/UserAccountService/GridUserService.cs b/OpenSim/Services/UserAccountService/GridUserService.cs index 9b18915..ac3d8fd 100644 --- a/OpenSim/Services/UserAccountService/GridUserService.cs +++ b/OpenSim/Services/UserAccountService/GridUserService.cs @@ -73,6 +73,16 @@ namespace OpenSim.Services.UserAccountService return info; } + public GridUserInfo[] GetGridUserInfo(string[] userIDs) + { + List ret = new List(); + + foreach (string id in userIDs) + ret.Add(GetGridUserInfo(id)); + + return ret.ToArray(); + } + public GridUserInfo LoggedIn(string userID) { m_log.DebugFormat("[GRID USER SERVICE]: User {0} is online", userID); @@ -156,4 +166,4 @@ namespace OpenSim.Services.UserAccountService return m_Database.Store(d); } } -} \ No newline at end of file +} -- cgit v1.1 From e3213065173e1408a138eb0bce0c9e936073b19b Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 14 Feb 2012 00:02:53 +0100 Subject: Prevent object loss and positioning outside the region with failed object sim crossings --- OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 24a23dd..8ab3b64 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -433,11 +433,14 @@ namespace OpenSim.Services.Connectors.Simulation args["destination_name"] = OSD.FromString(destination.RegionName); args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); - WebUtil.PostToService(uri, args, 40000); + OSDMap response = WebUtil.PostToService(uri, args, 40000); + if (response["Success"] == "False") + return false; } catch (Exception e) { m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR] CreateObject failed with exception; {0}",e.ToString()); + return false; } return true; -- cgit v1.1 From 95f43ab73ebac860cbcd534f07d60404f257b0bb Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 24 Feb 2012 18:17:30 +0100 Subject: Add a cache on GridService requests --- OpenSim/Services/Connectors/Grid/GridServiceConnector.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs index 1599a56..7deaf95 100644 --- a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs +++ b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs @@ -48,6 +48,9 @@ namespace OpenSim.Services.Connectors private string m_ServerURI = String.Empty; + private ExpiringCache m_regionCache = + new ExpiringCache(); + public GridServicesConnector() { } @@ -265,6 +268,11 @@ namespace OpenSim.Services.Connectors public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) { + ulong regionHandle = Util.UIntsToLong((uint)x, (uint)y); + + if (m_regionCache.Contains(regionHandle)) + return (GridRegion)m_regionCache[regionHandle]; + Dictionary sendData = new Dictionary(); sendData["SCOPEID"] = scopeID.ToString(); @@ -306,6 +314,8 @@ namespace OpenSim.Services.Connectors else m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition received null reply"); + m_regionCache.Add(regionHandle, rinfo, TimeSpan.FromSeconds(600)); + return rinfo; } -- cgit v1.1 From 0964af41be176bda881ad2f1ca6e45c97f82b093 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 27 Mar 2012 01:46:02 +0100 Subject: Replace HG linker with core version --- OpenSim/Services/GridService/HypergridLinker.cs | 62 +++++++++++++++++++------ 1 file changed, 49 insertions(+), 13 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index 46d68c2..78eab3d 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs @@ -176,6 +176,7 @@ namespace OpenSim.Services.GridService #region Link Region + // from map search public GridRegion LinkRegion(UUID scopeID, string regionDescriptor) { string reason = string.Empty; @@ -185,7 +186,7 @@ namespace OpenSim.Services.GridService private static Random random = new Random(); - // From the command line link-region + // From the command line link-region (obsolete) and the map public GridRegion TryLinkRegionToCoords(UUID scopeID, string mapName, int xloc, int yloc, out string reason) { return TryLinkRegionToCoords(scopeID, mapName, xloc, yloc, UUID.Zero, out reason); @@ -194,19 +195,54 @@ namespace OpenSim.Services.GridService public GridRegion TryLinkRegionToCoords(UUID scopeID, string mapName, int xloc, int yloc, UUID ownerID, out string reason) { reason = string.Empty; - uint port = 0; - string[] parts = mapName.Split(new char[] {':'}); - string regionName = String.Empty; - if (parts.Length > 1) + GridRegion regInfo = null; + + if (!mapName.StartsWith("http")) { - regionName = mapName.Substring(parts[0].Length + 1); - regionName = regionName.Trim(new char[] {'"'}); + string host = "127.0.0.1"; + string portstr; + string regionName = ""; + uint port = 0; + string[] parts = mapName.Split(new char[] { ':' }); + if (parts.Length >= 1) + { + host = parts[0]; + } + if (parts.Length >= 2) + { + portstr = parts[1]; + //m_log.Debug("-- port = " + portstr); + if (!UInt32.TryParse(portstr, out port)) + regionName = parts[1]; + } + // always take the last one + if (parts.Length >= 3) + { + regionName = parts[2]; + } + + + bool success = TryCreateLink(scopeID, xloc, yloc, regionName, port, host, ownerID, out regInfo, out reason); + if (success) + { + regInfo.RegionName = mapName; + return regInfo; + } } - GridRegion regInfo; - if (TryCreateLink(scopeID, xloc, yloc, regionName, 0, null, parts[0], ownerID, out regInfo, out reason)) + else { - regInfo.RegionName = mapName; - return regInfo; + string[] parts = mapName.Split(new char[] {' '}); + string regionName = String.Empty; + if (parts.Length > 1) + { + regionName = mapName.Substring(parts[0].Length + 1); + regionName = regionName.Trim(new char[] {'"'}); + } + if (TryCreateLink(scopeID, xloc, yloc, regionName, 0, null, parts[0], ownerID, out regInfo, out reason)) + { + regInfo.RegionName = mapName; + return regInfo; + } } return null; @@ -219,7 +255,7 @@ namespace OpenSim.Services.GridService public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string remoteRegionName, uint externalPort, string externalHostName, string serverURI, UUID ownerID, out GridRegion regInfo, out string reason) { - m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}, in {2}-{3}", + m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0} {1}, in {2}-{3}", ((serverURI == null) ? (externalHostName + ":" + externalPort) : serverURI), remoteRegionName, xloc / Constants.RegionSize, yloc / Constants.RegionSize); @@ -342,7 +378,7 @@ namespace OpenSim.Services.GridService regInfo.RegionSecret = handle.ToString(); AddHyperlinkRegion(regInfo, handle); - m_log.Info("[HYPERGRID LINKER]: Successfully linked to region_uuid " + regInfo.RegionID); + m_log.InfoFormat("[HYPERGRID LINKER]: Successfully linked to region {0} with image {1}", regInfo.RegionName, regInfo.TerrainImage); return true; } -- cgit v1.1 From fd19601c6ba3b474201e2dde514c7d7c94e74e82 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 26 Apr 2012 16:17:46 +0100 Subject: Help big boobies to dance (avatar visualParams). May not persist and need more lobe ? --- OpenSim/Services/Interfaces/IAvatarService.cs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs index cda7113..8412c35 100644 --- a/OpenSim/Services/Interfaces/IAvatarService.cs +++ b/OpenSim/Services/Interfaces/IAvatarService.cs @@ -162,10 +162,16 @@ namespace OpenSim.Services.Interfaces } // Visual Params - string[] vps = new string[AvatarAppearance.VISUALPARAM_COUNT]; + // string[] vps = new string[AvatarAppearance.VISUALPARAM_COUNT]; + // byte[] binary = appearance.VisualParams; + + // for (int i = 0 ; i < AvatarAppearance.VISUALPARAM_COUNT ; i++) + + byte[] binary = appearance.VisualParams; + string[] vps = new string[binary.Length]; - for (int i = 0 ; i < AvatarAppearance.VISUALPARAM_COUNT ; i++) + for (int i = 0; i < binary.Length; i++) { vps[i] = binary[i].ToString(); } @@ -265,10 +271,14 @@ namespace OpenSim.Services.Interfaces if (Data.ContainsKey("VisualParams")) { string[] vps = Data["VisualParams"].Split(new char[] {','}); - byte[] binary = new byte[AvatarAppearance.VISUALPARAM_COUNT]; + // byte[] binary = new byte[AvatarAppearance.VISUALPARAM_COUNT]; + + // for (int i = 0 ; i < vps.Length && i < binary.Length ; i++) + byte[] binary = new byte[vps.Length]; + + for (int i = 0; i < vps.Length; i++) - for (int i = 0 ; i < vps.Length && i < binary.Length ; i++) - binary[i] = (byte)Convert.ToInt32(vps[i]); + binary[i] = (byte)Convert.ToInt32(vps[i]); appearance.VisualParams = binary; } -- cgit v1.1 From d8f6faa89e23482f7359c1f99066d2c306950fef Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 1 Jun 2012 23:04:13 +0200 Subject: Fix impersonation, it got broken in a merge --- .../PasswordAuthenticationService.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs index 0d7ced9..769c3c2 100644 --- a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs +++ b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs @@ -103,6 +103,8 @@ namespace OpenSim.Services.AuthenticationService if ((user.UserFlags & impersonateFlag) == 0) return String.Empty; + m_log.DebugFormat("[PASS AUTH]: Attempting impersonation"); + List accounts = m_UserAccountService.GetUserAccountsWhere(UUID.Zero, "UserLevel >= 200"); if (accounts == null || accounts.Count == 0) return String.Empty; @@ -117,6 +119,8 @@ namespace OpenSim.Services.AuthenticationService continue; } +// m_log.DebugFormat("[PASS AUTH]: Trying {0}", data.PrincipalID); + hashed = Util.Md5Hash(password + ":" + data.Data["passwordSalt"].ToString()); @@ -125,13 +129,12 @@ namespace OpenSim.Services.AuthenticationService m_log.DebugFormat("[PASS AUTH]: {0} {1} impersonating {2}, proceeding with login", a.FirstName, a.LastName, principalID); return GetToken(principalID, lifetime); } - else - { - m_log.DebugFormat( - "[AUTH SERVICE]: Salted hash {0} of given password did not match salted hash of {1} for PrincipalID {2}. Authentication failure.", - hashed, data.Data["passwordHash"], principalID); - return String.Empty; - } +// else +// { +// m_log.DebugFormat( +// "[AUTH SERVICE]: Salted hash {0} of given password did not match salted hash of {1} for PrincipalID {2}. Authentication failure.", +// hashed, data.Data["passwordHash"], data.PrincipalID); +// } } m_log.DebugFormat("[PASS AUTH]: Impersonation of {0} failed", principalID); -- cgit v1.1 From 26c5b329886e3bbf81e2c853ef2fc6d648ad5273 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 7 Jun 2012 22:39:03 +0200 Subject: Add the ability to query the MYSQL databse for a list of the stored prim UUIDs --- OpenSim/Services/Connectors/Simulation/SimulationDataService.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs b/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs index ccef50b..620bb10 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs @@ -148,5 +148,10 @@ namespace OpenSim.Services.Connectors { m_database.RemoveRegionWindlightSettings(regionID); } + + public UUID[] GetObjectIDs(UUID regionID) + { + return m_database.GetObjectIDs(regionID); + } } } -- cgit v1.1 From 236b5a0298659410c95129e6689cf192eb16fe4e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 11 Jul 2012 20:54:55 +0100 Subject: Replace a Multicast Delegate by a simple list of delegates in access Get Can't seen more than one evocation on the multicast on this case, even expanding its evocation list (as it should be used in case one fails). With the list i do see what we want. --- .../Connectors/Asset/AssetServiceConnector.cs | 28 ++++++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs index 2882906..d8e0be4 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs @@ -55,7 +55,10 @@ namespace OpenSim.Services.Connectors // 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(); +// private Dictionary m_AssetHandlers = new Dictionary(); + + private Dictionary> m_AssetHandlers = new Dictionary>(); + private Dictionary m_UriMap = new Dictionary(); public AssetServicesConnector() @@ -269,16 +272,21 @@ namespace OpenSim.Services.Connectors { AssetRetrievedEx handlerEx = new AssetRetrievedEx(delegate(AssetBase _asset) { handler(id, sender, _asset); }); - AssetRetrievedEx handlers; +// AssetRetrievedEx handlers; + List handlers; if (m_AssetHandlers.TryGetValue(id, out handlers)) { // Someone else is already loading this asset. It will notify our handler when done. - handlers += handlerEx; +// handlers += handlerEx; + handlers.Add(handlerEx); return true; } // Load the asset ourselves - handlers += handlerEx; +// handlers += handlerEx; + handlers = new List(); + handlers.Add(handlerEx); + m_AssetHandlers.Add(id, handlers); } @@ -290,14 +298,24 @@ namespace OpenSim.Services.Connectors { if (m_Cache != null) m_Cache.Cache(a); - +/* AssetRetrievedEx handlers; lock (m_AssetHandlers) { handlers = m_AssetHandlers[id]; m_AssetHandlers.Remove(id); } + handlers.Invoke(a); +*/ + List handlers; + lock (m_AssetHandlers) + { + handlers = m_AssetHandlers[id]; + m_AssetHandlers.Remove(id); + } + foreach (AssetRetrievedEx h in handlers) + h.Invoke(a); }); success = true; -- cgit v1.1 From 065046845d7a4e8df524b0a4a0f175ebe3f4c4d9 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 11 Jul 2012 21:10:46 +0100 Subject: be paranoic (?) --- 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 d8e0be4..45ebf3a 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs @@ -316,6 +316,8 @@ namespace OpenSim.Services.Connectors } foreach (AssetRetrievedEx h in handlers) h.Invoke(a); + if (handlers != null) + handlers.Clear(); }); success = true; @@ -324,10 +326,14 @@ namespace OpenSim.Services.Connectors { if (!success) { + List handlers; lock (m_AssetHandlers) { + handlers = m_AssetHandlers[id]; m_AssetHandlers.Remove(id); } + if (handlers != null) + handlers.Clear(); } } } -- cgit v1.1 From d58743ddc18032e9468926990fc888a7719c0813 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 3 Aug 2012 01:30:05 +0200 Subject: Add a reason message for a code path that lacks one --- OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index cd93386..e1c2243 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -86,6 +86,7 @@ namespace OpenSim.Services.Connectors.Simulation reason = String.Empty; if (destination == null) { + reason = "Destination not found"; m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Given destination is null"); return false; } -- cgit v1.1 From 7d1bec00d5cda6d7024a3d64b5913b5c08c15a3f Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 15 Aug 2012 01:08:30 +0200 Subject: Add a skeleton for a name value storage associated with regions --- .../Connectors/Simulation/SimulationDataService.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs b/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs index 6db830b..96c02d9 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs @@ -168,5 +168,20 @@ namespace OpenSim.Services.Connectors { return m_database.GetObjectIDs(regionID); } + + public void SaveExtra(UUID regionID, string name, string val) + { + m_database.SaveExtra(regionID, name, val); + } + + public void RemoveExtra(UUID regionID, string name) + { + m_database.RemoveExtra(regionID, name); + } + + public Dictionary GetExtra(UUID regionID) + { + return m_database.GetExtra(regionID); + } } } -- cgit v1.1 From c313de630f2fec6793da2bc1f51dd54be82cb3e8 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 15 Aug 2012 23:31:38 +0200 Subject: Add a real_id field to the login response if impersonation is used. The wrapper script needs this for proper logging. --- .../PasswordAuthenticationService.cs | 10 ++++++++++ .../AuthenticationService/WebkeyAuthenticationService.cs | 7 +++++++ .../WebkeyOrPasswordAuthenticationService.cs | 16 +++++++++++++--- .../Authentication/AuthenticationServicesConnector.cs | 7 +++++++ .../SimianGrid/SimianAuthenticationServiceConnector.cs | 5 +++++ OpenSim/Services/Interfaces/IAuthenticationService.cs | 1 + OpenSim/Services/LLLoginService/LLLoginResponse.cs | 13 ++++++++++++- OpenSim/Services/LLLoginService/LLLoginService.cs | 5 +++-- 8 files changed, 58 insertions(+), 6 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs index 769c3c2..9d12d47 100644 --- a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs +++ b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs @@ -64,6 +64,15 @@ namespace OpenSim.Services.AuthenticationService public string Authenticate(UUID principalID, string password, int lifetime) { + UUID realID; + + return Authenticate(principalID, password, lifetime, out realID); + } + + public string Authenticate(UUID principalID, string password, int lifetime, out UUID realID) + { + realID = UUID.Zero; + m_log.DebugFormat("[AUTH SERVICE]: Authenticating for {0}, user account service present: {1}", principalID, m_UserAccountService != null); AuthenticationData data = m_Database.Get(principalID); UserAccount user = null; @@ -127,6 +136,7 @@ namespace OpenSim.Services.AuthenticationService if (data.Data["passwordHash"].ToString() == hashed) { m_log.DebugFormat("[PASS AUTH]: {0} {1} impersonating {2}, proceeding with login", a.FirstName, a.LastName, principalID); + realID = a.PrincipalID; return GetToken(principalID, lifetime); } // else diff --git a/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs b/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs index d02ff9b..47b4fa6 100644 --- a/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs +++ b/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs @@ -60,6 +60,13 @@ namespace OpenSim.Services.AuthenticationService { } + public string Authenticate(UUID principalID, string password, int lifetime, out UUID realID) + { + realID = UUID.Zero; + + return Authenticate(principalID, password, lifetime); + } + public string Authenticate(UUID principalID, string password, int lifetime) { if (new UUID(password) == UUID.Zero) diff --git a/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs b/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs index 2c6cebd..7fbf36d 100644 --- a/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs +++ b/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs @@ -55,6 +55,13 @@ namespace OpenSim.Services.AuthenticationService public string Authenticate(UUID principalID, string password, int lifetime) { + UUID realID; + + return Authenticate(principalID, password, lifetime, out realID); + } + + public string Authenticate(UUID principalID, string password, int lifetime, out UUID realID) + { AuthenticationData data = m_Database.Get(principalID); string result = String.Empty; if (data != null && data.Data != null) @@ -62,7 +69,7 @@ namespace OpenSim.Services.AuthenticationService if (data.Data.ContainsKey("webLoginKey")) { m_log.DebugFormat("[AUTH SERVICE]: Attempting web key authentication for PrincipalID {0}", principalID); - result = m_svcChecks["web_login_key"].Authenticate(principalID, password, lifetime); + result = m_svcChecks["web_login_key"].Authenticate(principalID, password, lifetime, out realID); if (result == String.Empty) { m_log.DebugFormat("[AUTH SERVICE]: Web Login failed for PrincipalID {0}", principalID); @@ -71,12 +78,15 @@ namespace OpenSim.Services.AuthenticationService if (result == string.Empty && data.Data.ContainsKey("passwordHash") && data.Data.ContainsKey("passwordSalt")) { m_log.DebugFormat("[AUTH SERVICE]: Attempting password authentication for PrincipalID {0}", principalID); - result = m_svcChecks["password"].Authenticate(principalID, password, lifetime); + result = m_svcChecks["password"].Authenticate(principalID, password, lifetime, out realID); if (result == String.Empty) { m_log.DebugFormat("[AUTH SERVICE]: Password login failed for PrincipalID {0}", principalID); } } + + realID = UUID.Zero; + if (result == string.Empty) { m_log.DebugFormat("[AUTH SERVICE]: Both password and webLoginKey-based authentication failed for PrincipalID {0}", principalID); @@ -89,4 +99,4 @@ namespace OpenSim.Services.AuthenticationService return result; } } -} \ No newline at end of file +} diff --git a/OpenSim/Services/Connectors/Authentication/AuthenticationServicesConnector.cs b/OpenSim/Services/Connectors/Authentication/AuthenticationServicesConnector.cs index 2b77154..f996aca 100644 --- a/OpenSim/Services/Connectors/Authentication/AuthenticationServicesConnector.cs +++ b/OpenSim/Services/Connectors/Authentication/AuthenticationServicesConnector.cs @@ -81,6 +81,13 @@ namespace OpenSim.Services.Connectors m_ServerURI = serviceURI; } + public string Authenticate(UUID principalID, string password, int lifetime, out UUID realID) + { + realID = UUID.Zero; + + return Authenticate(principalID, password, lifetime); + } + public string Authenticate(UUID principalID, string password, int lifetime) { Dictionary sendData = new Dictionary(); diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs index 69f6ed2..331d485 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs @@ -102,6 +102,11 @@ namespace OpenSim.Services.Connectors.SimianGrid m_log.Info("[SIMIAN AUTH CONNECTOR]: No AuthenticationServerURI specified, disabling connector"); } + public string Authenticate(UUID principalID, string password, int lifetime, out UUID realID) + { + return Authenticate(principalID, password, lifetime); + } + public string Authenticate(UUID principalID, string password, int lifetime) { NameValueCollection requestArgs = new NameValueCollection diff --git a/OpenSim/Services/Interfaces/IAuthenticationService.cs b/OpenSim/Services/Interfaces/IAuthenticationService.cs index cee8bc0..cdcfad9 100644 --- a/OpenSim/Services/Interfaces/IAuthenticationService.cs +++ b/OpenSim/Services/Interfaces/IAuthenticationService.cs @@ -67,6 +67,7 @@ namespace OpenSim.Services.Interfaces // various services. // string Authenticate(UUID principalID, string password, int lifetime); + string Authenticate(UUID principalID, string password, int lifetime, out UUID realID); ////////////////////////////////////////////////////// // Verification diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index a4b3cbd..e2f947c 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs @@ -150,6 +150,7 @@ namespace OpenSim.Services.LLLoginService private UUID agentID; private UUID sessionID; private UUID secureSessionID; + private UUID realID; // Login Flags private string dst; @@ -232,7 +233,7 @@ namespace OpenSim.Services.LLLoginService 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 profileURL, string openIDURL, string searchURL, string currency, - string DSTZone) + string DSTZone, UUID realID) : this() { FillOutInventoryData(invSkel, libService); @@ -245,6 +246,7 @@ namespace OpenSim.Services.LLLoginService AgentID = account.PrincipalID; SessionID = aCircuit.SessionID; SecureSessionID = aCircuit.SecureSessionID; + RealID = realID; Message = message; BuddList = ConvertFriendListItem(friendsList); StartLocation = where; @@ -456,6 +458,7 @@ namespace OpenSim.Services.LLLoginService SessionID = UUID.Random(); SecureSessionID = UUID.Random(); AgentID = UUID.Random(); + RealID = UUID.Zero; Hashtable InitialOutfitHash = new Hashtable(); InitialOutfitHash["folder_name"] = "Nightclub Female"; @@ -499,6 +502,7 @@ namespace OpenSim.Services.LLLoginService responseData["http_port"] = (Int32)SimHttpPort; responseData["agent_id"] = AgentID.ToString(); + responseData["real_id"] = RealID.ToString(); responseData["session_id"] = SessionID.ToString(); responseData["secure_session_id"] = SecureSessionID.ToString(); responseData["circuit_code"] = CircuitCode; @@ -581,6 +585,7 @@ namespace OpenSim.Services.LLLoginService map["sim_ip"] = OSD.FromString(SimAddress); map["agent_id"] = OSD.FromUUID(AgentID); + map["real_id"] = OSD.FromUUID(RealID); map["session_id"] = OSD.FromUUID(SessionID); map["secure_session_id"] = OSD.FromUUID(SecureSessionID); map["circuit_code"] = OSD.FromInteger(CircuitCode); @@ -888,6 +893,12 @@ namespace OpenSim.Services.LLLoginService set { secureSessionID = value; } } + public UUID RealID + { + get { return realID; } + set { realID = value; } + } + public Int32 CircuitCode { get { return circuitCode; } diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index ed887d9..988a9b9 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -327,7 +327,8 @@ namespace OpenSim.Services.LLLoginService if (!passwd.StartsWith("$1$")) passwd = "$1$" + Util.Md5Hash(passwd); passwd = passwd.Remove(0, 3); //remove $1$ - string token = m_AuthenticationService.Authenticate(account.PrincipalID, passwd, 30); + UUID realID; + string token = m_AuthenticationService.Authenticate(account.PrincipalID, passwd, 30, out realID); UUID secureSession = UUID.Zero; if ((token == string.Empty) || (token != string.Empty && !UUID.TryParse(token, out secureSession))) { @@ -459,7 +460,7 @@ namespace OpenSim.Services.LLLoginService = new LLLoginResponse( account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService, where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, - m_MapTileURL, m_ProfileURL, m_OpenIDURL, m_SearchURL, m_Currency, m_DSTZone); + m_MapTileURL, m_ProfileURL, m_OpenIDURL, m_SearchURL, m_Currency, m_DSTZone, realID); m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to {0} {1}", firstName, lastName); -- cgit v1.1 From db3f0a37485bfecc831104d9dbcd397404364e79 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 16 Aug 2012 15:26:16 +0100 Subject: fix vs2010 build --- .../Services/AuthenticationService/PasswordAuthenticationService.cs | 1 - .../Services/AuthenticationService/WebkeyAuthenticationService.cs | 1 - .../AuthenticationService/WebkeyOrPasswordAuthenticationService.cs | 5 ++++- .../Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs index 9d12d47..a069838 100644 --- a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs +++ b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs @@ -65,7 +65,6 @@ namespace OpenSim.Services.AuthenticationService public string Authenticate(UUID principalID, string password, int lifetime) { UUID realID; - return Authenticate(principalID, password, lifetime, out realID); } diff --git a/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs b/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs index 47b4fa6..1510168 100644 --- a/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs +++ b/OpenSim/Services/AuthenticationService/WebkeyAuthenticationService.cs @@ -63,7 +63,6 @@ namespace OpenSim.Services.AuthenticationService public string Authenticate(UUID principalID, string password, int lifetime, out UUID realID) { realID = UUID.Zero; - return Authenticate(principalID, password, lifetime); } diff --git a/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs b/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs index 7fbf36d..bbc8470 100644 --- a/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs +++ b/OpenSim/Services/AuthenticationService/WebkeyOrPasswordAuthenticationService.cs @@ -64,6 +64,7 @@ namespace OpenSim.Services.AuthenticationService { AuthenticationData data = m_Database.Get(principalID); string result = String.Empty; + realID = UUID.Zero; if (data != null && data.Data != null) { if (data.Data.ContainsKey("webLoginKey")) @@ -85,7 +86,7 @@ namespace OpenSim.Services.AuthenticationService } } - realID = UUID.Zero; + if (result == string.Empty) { @@ -96,6 +97,8 @@ namespace OpenSim.Services.AuthenticationService { m_log.DebugFormat("[AUTH SERVICE]: PrincipalID {0} or its data not found", principalID); } + + return result; } } diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs index 331d485..ffae0da 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs @@ -104,6 +104,7 @@ namespace OpenSim.Services.Connectors.SimianGrid public string Authenticate(UUID principalID, string password, int lifetime, out UUID realID) { + realID = UUID.Zero; return Authenticate(principalID, password, lifetime); } -- cgit v1.1 From 9ae293881addf98844b8f292298bc0674ebbed0d Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 4 Sep 2012 22:53:52 +0200 Subject: Make friend notifies and closing child agents async because both can block the heartbeat thread if the sim being contacted is unresponsive --- .../Connectors/Friends/FriendsSimConnector.cs | 68 ++++++++++++---------- .../Simulation/SimulationServiceConnector.cs | 21 +++---- 2 files changed, 47 insertions(+), 42 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs index 3fd0c53..6cd21d1 100644 --- a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs +++ b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs @@ -144,44 +144,48 @@ namespace OpenSim.Services.Connectors.Friends private bool Call(GridRegion region, Dictionary sendData) { - string reqString = ServerUtils.BuildQueryString(sendData); - //m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: queryString = {0}", reqString); - if (region == null) - return false; - - string path = ServicePath(); - if (!region.ServerURI.EndsWith("/")) - path = "/" + path; - string uri = region.ServerURI + path; - m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: calling {0}", uri); - - try - { - string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString); - if (reply != string.Empty) + Util.FireAndForget(x => { + string reqString = ServerUtils.BuildQueryString(sendData); + //m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: queryString = {0}", reqString); + if (region == null) + return; + + string path = ServicePath(); + if (!region.ServerURI.EndsWith("/")) + path = "/" + path; + string uri = region.ServerURI + path; + m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: calling {0}", uri); + + try { - Dictionary replyData = ServerUtils.ParseXmlResponse(reply); - - if (replyData.ContainsKey("RESULT")) + string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString); + if (reply != string.Empty) { - if (replyData["RESULT"].ToString().ToLower() == "true") - return true; + Dictionary replyData = ServerUtils.ParseXmlResponse(reply); + + if (replyData.ContainsKey("RESULT")) + { +// if (replyData["RESULT"].ToString().ToLower() == "true") +// return; +// else + return; + } else - return false; + m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: reply data does not contain result field"); + } else - m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: reply data does not contain result field"); - + m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: received empty reply"); + } + catch (Exception e) + { + m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: Exception when contacting remote sim at {0}: {1}", uri, e.Message); } - else - m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: received empty reply"); - } - catch (Exception e) - { - m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: Exception when contacting remote sim at {0}: {1}", uri, e.Message); - } - - return false; + + return; + }); + + return true; } } } diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index e1c2243..508baf7 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -395,17 +395,18 @@ namespace OpenSim.Services.Connectors.Simulation private bool CloseAgent(GridRegion destination, UUID id, bool ChildOnly) { // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: CloseAgent start"); + Util.FireAndForget(x => { + string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; - string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; - - try - { - WebUtil.ServiceOSDRequest(uri, null, "DELETE", 10000, false); - } - catch (Exception e) - { - m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR] CloseAgent failed with exception; {0}",e.ToString()); - } + try + { + WebUtil.ServiceOSDRequest(uri, null, "DELETE", 10000, false); + } + catch (Exception e) + { + m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR] CloseAgent failed with exception; {0}",e.ToString()); + } + }); return true; } -- cgit v1.1 From 041fcd6a72e1822656d58f87a398e3a0f065a486 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 6 Sep 2012 17:18:34 +0100 Subject: remove extra '/' in assets url --- .../Connectors/Asset/AssetServicesConnector.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 45ebf3a..7ad6f0b 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -181,7 +181,8 @@ namespace OpenSim.Services.Connectors public AssetBase Get(string id) { - string uri = MapServer(id) + "/assets/" + id; +// string uri = MapServer(id) + "/assets/" + id; + string uri = MapServer(id) + "assets/" + id; AssetBase asset = null; if (m_Cache != null) @@ -218,7 +219,8 @@ namespace OpenSim.Services.Connectors return fullAsset.Metadata; } - string uri = MapServer(id) + "/assets/" + id + "/metadata"; +// string uri = MapServer(id) + "/assets/" + id + "/metadata"; + string uri = MapServer(id) + "assets/" + id + "/metadata"; AssetMetadata asset = SynchronousRestObjectRequester. MakeRequest("GET", uri, 0); @@ -260,7 +262,8 @@ namespace OpenSim.Services.Connectors public bool Get(string id, Object sender, AssetRetrieved handler) { - string uri = MapServer(id) + "/assets/" + id; +// string uri = MapServer(id) + "/assets/" + id; + string uri = MapServer(id) + "assets/" + id; AssetBase asset = null; if (m_Cache != null) @@ -379,7 +382,9 @@ namespace OpenSim.Services.Connectors return asset.ID; } - string uri = MapServer(asset.FullID.ToString()) + "/assets/"; +// string uri = MapServer(asset.FullID.ToString()) + "/assets/"; + + string uri = MapServer(asset.FullID.ToString()) + "assets/"; string newID = string.Empty; try @@ -456,7 +461,8 @@ namespace OpenSim.Services.Connectors } asset.Data = data; - string uri = MapServer(id) + "/assets/" + id; +// string uri = MapServer(id) + "/assets/" + id; + string uri = MapServer(id) + "assets/" + id; if (SynchronousRestObjectRequester. MakeRequest("POST", uri, asset)) @@ -471,7 +477,8 @@ namespace OpenSim.Services.Connectors public bool Delete(string id) { - string uri = MapServer(id) + "/assets/" + id; +// string uri = MapServer(id) + "/assets/" + id; + string uri = MapServer(id) + "assets/" + id; if (SynchronousRestObjectRequester. MakeRequest("DELETE", uri, 0)) -- cgit v1.1 From 27d345c9a0047af44296184557aed25719b2759e Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 6 Sep 2012 17:02:55 +0200 Subject: Revert " remove extra '/' in assets url" This reverts commit 041fcd6a72e1822656d58f87a398e3a0f065a486. --- .../Connectors/Asset/AssetServicesConnector.cs | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 7ad6f0b..45ebf3a 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -181,8 +181,7 @@ namespace OpenSim.Services.Connectors public AssetBase Get(string id) { -// string uri = MapServer(id) + "/assets/" + id; - string uri = MapServer(id) + "assets/" + id; + string uri = MapServer(id) + "/assets/" + id; AssetBase asset = null; if (m_Cache != null) @@ -219,8 +218,7 @@ namespace OpenSim.Services.Connectors return fullAsset.Metadata; } -// string uri = MapServer(id) + "/assets/" + id + "/metadata"; - string uri = MapServer(id) + "assets/" + id + "/metadata"; + string uri = MapServer(id) + "/assets/" + id + "/metadata"; AssetMetadata asset = SynchronousRestObjectRequester. MakeRequest("GET", uri, 0); @@ -262,8 +260,7 @@ namespace OpenSim.Services.Connectors public bool Get(string id, Object sender, AssetRetrieved handler) { -// string uri = MapServer(id) + "/assets/" + id; - string uri = MapServer(id) + "assets/" + id; + string uri = MapServer(id) + "/assets/" + id; AssetBase asset = null; if (m_Cache != null) @@ -382,9 +379,7 @@ namespace OpenSim.Services.Connectors return asset.ID; } -// string uri = MapServer(asset.FullID.ToString()) + "/assets/"; - - string uri = MapServer(asset.FullID.ToString()) + "assets/"; + string uri = MapServer(asset.FullID.ToString()) + "/assets/"; string newID = string.Empty; try @@ -461,8 +456,7 @@ namespace OpenSim.Services.Connectors } asset.Data = data; -// string uri = MapServer(id) + "/assets/" + id; - string uri = MapServer(id) + "assets/" + id; + string uri = MapServer(id) + "/assets/" + id; if (SynchronousRestObjectRequester. MakeRequest("POST", uri, asset)) @@ -477,8 +471,7 @@ namespace OpenSim.Services.Connectors public bool Delete(string id) { -// string uri = MapServer(id) + "/assets/" + id; - string uri = MapServer(id) + "assets/" + id; + string uri = MapServer(id) + "/assets/" + id; if (SynchronousRestObjectRequester. MakeRequest("DELETE", uri, 0)) -- cgit v1.1 From b9d026666dbabb210cc013d29eb79fe214594dd9 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 6 Sep 2012 17:11:44 +0200 Subject: Change string concatenation to Path.Combine to eliminate extra slashes. Windoze barfs on them. --- .../Services/Connectors/Asset/AssetServicesConnector.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 45ebf3a..2a3dacc 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -181,7 +181,7 @@ namespace OpenSim.Services.Connectors public AssetBase Get(string id) { - string uri = MapServer(id) + "/assets/" + id; + string uri = Path.Combine(MapServer(id), Path.Combine("assets", id)); AssetBase asset = null; if (m_Cache != null) @@ -218,7 +218,7 @@ namespace OpenSim.Services.Connectors return fullAsset.Metadata; } - string uri = MapServer(id) + "/assets/" + id + "/metadata"; + string uri = Path.Combine(MapServer(id), Path.Combine("assets", id)); AssetMetadata asset = SynchronousRestObjectRequester. MakeRequest("GET", uri, 0); @@ -260,7 +260,7 @@ namespace OpenSim.Services.Connectors public bool Get(string id, Object sender, AssetRetrieved handler) { - string uri = MapServer(id) + "/assets/" + id; + string uri = Path.Combine(MapServer(id), Path.Combine("assets", id)); AssetBase asset = null; if (m_Cache != null) @@ -379,7 +379,9 @@ namespace OpenSim.Services.Connectors return asset.ID; } - string uri = MapServer(asset.FullID.ToString()) + "/assets/"; + string uri = Path.Combine(MapServer(asset.FullID.ToString()), "/assets/"); + if (!uri.EndsWith("/")) + uri += "/"; string newID = string.Empty; try @@ -456,7 +458,7 @@ namespace OpenSim.Services.Connectors } asset.Data = data; - string uri = MapServer(id) + "/assets/" + id; + string uri = Path.Combine(MapServer(id), Path.Combine("assets", id)); if (SynchronousRestObjectRequester. MakeRequest("POST", uri, asset)) @@ -471,7 +473,7 @@ namespace OpenSim.Services.Connectors public bool Delete(string id) { - string uri = MapServer(id) + "/assets/" + id; + string uri = Path.Combine(MapServer(id), Path.Combine("assets", id)); if (SynchronousRestObjectRequester. MakeRequest("DELETE", uri, 0)) -- cgit v1.1 From 3257f4d5d21116e9fb8e08f3277b3521d38bc11c Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 6 Sep 2012 17:31:41 +0200 Subject: Revert "Change string concatenation to Path.Combine to eliminate extra slashes." This reverts commit b9d026666dbabb210cc013d29eb79fe214594dd9. --- .../Services/Connectors/Asset/AssetServicesConnector.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 2a3dacc..45ebf3a 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -181,7 +181,7 @@ namespace OpenSim.Services.Connectors public AssetBase Get(string id) { - string uri = Path.Combine(MapServer(id), Path.Combine("assets", id)); + string uri = MapServer(id) + "/assets/" + id; AssetBase asset = null; if (m_Cache != null) @@ -218,7 +218,7 @@ namespace OpenSim.Services.Connectors return fullAsset.Metadata; } - string uri = Path.Combine(MapServer(id), Path.Combine("assets", id)); + string uri = MapServer(id) + "/assets/" + id + "/metadata"; AssetMetadata asset = SynchronousRestObjectRequester. MakeRequest("GET", uri, 0); @@ -260,7 +260,7 @@ namespace OpenSim.Services.Connectors public bool Get(string id, Object sender, AssetRetrieved handler) { - string uri = Path.Combine(MapServer(id), Path.Combine("assets", id)); + string uri = MapServer(id) + "/assets/" + id; AssetBase asset = null; if (m_Cache != null) @@ -379,9 +379,7 @@ namespace OpenSim.Services.Connectors return asset.ID; } - string uri = Path.Combine(MapServer(asset.FullID.ToString()), "/assets/"); - if (!uri.EndsWith("/")) - uri += "/"; + string uri = MapServer(asset.FullID.ToString()) + "/assets/"; string newID = string.Empty; try @@ -458,7 +456,7 @@ namespace OpenSim.Services.Connectors } asset.Data = data; - string uri = Path.Combine(MapServer(id), Path.Combine("assets", id)); + string uri = MapServer(id) + "/assets/" + id; if (SynchronousRestObjectRequester. MakeRequest("POST", uri, asset)) @@ -473,7 +471,7 @@ namespace OpenSim.Services.Connectors public bool Delete(string id) { - string uri = Path.Combine(MapServer(id), Path.Combine("assets", id)); + string uri = MapServer(id) + "/assets/" + id; if (SynchronousRestObjectRequester. MakeRequest("DELETE", uri, 0)) -- cgit v1.1 From ac6448810e999c4c0c0035fff43b45db9a094094 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 6 Sep 2012 17:39:30 +0200 Subject: Prevent double slashes, try #3 --- OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 45ebf3a..091e41a 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -126,6 +126,9 @@ namespace OpenSim.Services.Connectors // m_log.DebugFormat("[ASSET]: Using {0} for host name for prefix {1}", host, prefix); + string ret = serverUri.Uri.AbsoluteUri; + if (ret.EndsWith("/")) + ret = ret.Substring(0, ret.Length - 1); return serverUri.Uri.AbsoluteUri; } -- cgit v1.1 From f53ca6285bc21155a2fdad953b9063a4f8cd5d21 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 6 Sep 2012 18:41:21 +0100 Subject: Prevent double slashes, try #4 --- OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 091e41a..9e04601 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -129,7 +129,7 @@ namespace OpenSim.Services.Connectors string ret = serverUri.Uri.AbsoluteUri; if (ret.EndsWith("/")) ret = ret.Substring(0, ret.Length - 1); - return serverUri.Uri.AbsoluteUri; + return ret; } protected void retryCheck(object source, ElapsedEventArgs e) -- cgit v1.1 From 52d74cf274fbf002e7ec6ad82fe1a38dc2c02d59 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 14 Sep 2012 00:11:23 +0200 Subject: Allow setting max connections for an endpoint --- OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 9e04601..daf38bc 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -193,7 +193,7 @@ namespace OpenSim.Services.Connectors if (asset == null || asset.Data == null || asset.Data.Length == 0) { asset = SynchronousRestObjectRequester. - MakeRequest("GET", uri, 0); + MakeRequest("GET", uri, 0, 30); if (m_Cache != null) m_Cache.Cache(asset); @@ -321,7 +321,7 @@ namespace OpenSim.Services.Connectors h.Invoke(a); if (handlers != null) handlers.Clear(); - }); + }, 30); success = true; } -- cgit v1.1 From 2aa7a22129e2b5c226d3937c31bdcbdbc65a20f8 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 14 Sep 2012 23:09:07 +0200 Subject: Sequence/throttle asset retrievals. --- .../Connectors/Asset/AssetServicesConnector.cs | 104 +++++++++++++-------- 1 file changed, 67 insertions(+), 37 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index daf38bc..9d6d9ad 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -27,6 +27,7 @@ using log4net; using System; +using System.Threading; using System.Collections.Generic; using System.IO; using System.Reflection; @@ -50,7 +51,7 @@ namespace OpenSim.Services.Connectors private IImprovedAssetCache m_Cache = null; private int m_retryCounter; private Dictionary> m_retryQueue = new Dictionary>(); - private Timer m_retryTimer; + private System.Timers.Timer m_retryTimer; private delegate void AssetRetrievedEx(AssetBase asset); // Keeps track of concurrent requests for the same asset, so that it's only loaded once. @@ -61,6 +62,8 @@ namespace OpenSim.Services.Connectors private Dictionary m_UriMap = new Dictionary(); + private Thread[] m_fetchThreads; + public AssetServicesConnector() { } @@ -96,7 +99,7 @@ namespace OpenSim.Services.Connectors } - m_retryTimer = new Timer(); + m_retryTimer = new System.Timers.Timer(); m_retryTimer.Elapsed += new ElapsedEventHandler(retryCheck); m_retryTimer.Interval = 60000; @@ -112,6 +115,14 @@ namespace OpenSim.Services.Connectors m_UriMap[prefix] = groupHost; //m_log.DebugFormat("[ASSET]: Using {0} for prefix {1}", groupHost, prefix); } + + m_fetchThreads = new Thread[2]; + + for (int i = 0 ; i < 2 ; i++) + { + m_fetchThreads[i] = new Thread(AssetRequestProcessor); + m_fetchThreads[i].Start(); + } } private string MapServer(string id) @@ -261,37 +272,25 @@ namespace OpenSim.Services.Connectors return null; } - public bool Get(string id, Object sender, AssetRetrieved handler) + private class QueuedAssetRequest { - string uri = MapServer(id) + "/assets/" + id; - - AssetBase asset = null; - if (m_Cache != null) - asset = m_Cache.Get(id); + public string uri; + public string id; + } - if (asset == null || asset.Data == null || asset.Data.Length == 0) - { - lock (m_AssetHandlers) - { - AssetRetrievedEx handlerEx = new AssetRetrievedEx(delegate(AssetBase _asset) { handler(id, sender, _asset); }); + private OpenMetaverse.BlockingQueue m_requestQueue = + new OpenMetaverse.BlockingQueue(); -// AssetRetrievedEx handlers; - List handlers; - if (m_AssetHandlers.TryGetValue(id, out handlers)) - { - // Someone else is already loading this asset. It will notify our handler when done. -// handlers += handlerEx; - handlers.Add(handlerEx); - return true; - } + private void AssetRequestProcessor() + { + QueuedAssetRequest r; - // Load the asset ourselves -// handlers += handlerEx; - handlers = new List(); - handlers.Add(handlerEx); + while (true) + { + r = m_requestQueue.Dequeue(); - m_AssetHandlers.Add(id, handlers); - } + string uri = r.uri; + string id = r.id; bool success = false; try @@ -301,16 +300,7 @@ namespace OpenSim.Services.Connectors { if (m_Cache != null) m_Cache.Cache(a); -/* - AssetRetrievedEx handlers; - lock (m_AssetHandlers) - { - handlers = m_AssetHandlers[id]; - m_AssetHandlers.Remove(id); - } - handlers.Invoke(a); -*/ List handlers; lock (m_AssetHandlers) { @@ -340,6 +330,46 @@ namespace OpenSim.Services.Connectors } } } + } + + public bool Get(string id, Object sender, AssetRetrieved handler) + { + string uri = MapServer(id) + "/assets/" + id; + + AssetBase asset = null; + if (m_Cache != null) + asset = m_Cache.Get(id); + + if (asset == null || asset.Data == null || asset.Data.Length == 0) + { + lock (m_AssetHandlers) + { + AssetRetrievedEx handlerEx = new AssetRetrievedEx(delegate(AssetBase _asset) { handler(id, sender, _asset); }); + +// AssetRetrievedEx handlers; + List handlers; + if (m_AssetHandlers.TryGetValue(id, out handlers)) + { + // Someone else is already loading this asset. It will notify our handler when done. +// handlers += handlerEx; + handlers.Add(handlerEx); + return true; + } + + // Load the asset ourselves +// handlers += handlerEx; + handlers = new List(); + handlers.Add(handlerEx); + + m_AssetHandlers.Add(id, handlers); + } + + QueuedAssetRequest request = new QueuedAssetRequest(); + request.id = id; + request.uri = uri; + + m_requestQueue.Enqueue(request); + } else { handler(id, sender, asset); -- cgit v1.1 From d5ea203f934416c4c703ca899c7981b2f5ee550c Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 5 Oct 2012 00:15:55 +0200 Subject: Fix threading in remote asset connector --- .../Connectors/Asset/AssetServicesConnector.cs | 37 ++++++++++++---------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 9d6d9ad..7f32ad3 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -295,25 +295,30 @@ namespace OpenSim.Services.Connectors bool success = false; try { - AsynchronousRestObjectRequester.MakeRequest("GET", uri, 0, - delegate(AssetBase a) - { - if (m_Cache != null) - m_Cache.Cache(a); + AssetBase a = SynchronousRestObjectRequester.MakeRequest("GET", uri, 0, 30); + if (a != null) + { + if (m_Cache != null) + m_Cache.Cache(a); - List handlers; - lock (m_AssetHandlers) + List handlers; + lock (m_AssetHandlers) + { + handlers = m_AssetHandlers[id]; + m_AssetHandlers.Remove(id); + } + foreach (AssetRetrievedEx h in handlers) + { + Util.FireAndForget(x => { - handlers = m_AssetHandlers[id]; - m_AssetHandlers.Remove(id); - } - foreach (AssetRetrievedEx h in handlers) h.Invoke(a); - if (handlers != null) - handlers.Clear(); - }, 30); + }); + } + if (handlers != null) + handlers.Clear(); - success = true; + success = true; + } } finally { @@ -326,7 +331,7 @@ namespace OpenSim.Services.Connectors m_AssetHandlers.Remove(id); } if (handlers != null) - handlers.Clear(); + handlers.Clear(); } } } -- cgit v1.1 From fd2bee8da19c950b4d9abf5af2f66c172dbc2268 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 2 Nov 2012 16:43:38 +0100 Subject: Squash reporting HelloNeighbor exception - it simply means the other sim is down, no need for yellow ink. --- .../Services/Connectors/Neighbour/NeighbourServicesConnector.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs index 7429293..7688e0f 100644 --- a/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs +++ b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs @@ -153,9 +153,9 @@ namespace OpenSim.Services.Connectors } catch (Exception e) { - m_log.WarnFormat( - "[NEIGHBOUR SERVICE CONNCTOR]: Unable to send HelloNeighbour from {0} to {1}. Exception {2}{3}", - thisRegion.RegionName, region.RegionName, e.Message, e.StackTrace); +// m_log.WarnFormat( +// "[NEIGHBOUR SERVICE CONNCTOR]: Unable to send HelloNeighbour from {0} to {1}. Exception {2}{3}", +// thisRegion.RegionName, region.RegionName, e.Message, e.StackTrace); return false; } @@ -202,4 +202,4 @@ namespace OpenSim.Services.Connectors return true; } } -} \ No newline at end of file +} -- cgit v1.1 From 93bede4e6aa0838e14f39f5e641b028267d2683c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 7 Dec 2012 21:26:58 +0000 Subject: revert the use of avatar skeleton and use avatar size provided by viewers, since at least for now seems good enought --- OpenSim/Services/Interfaces/IAvatarService.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs index 0caa521..260e1c6 100644 --- a/OpenSim/Services/Interfaces/IAvatarService.cs +++ b/OpenSim/Services/Interfaces/IAvatarService.cs @@ -201,7 +201,8 @@ namespace OpenSim.Services.Interfaces appearance.Serial = Int32.Parse(Data["Serial"]); if (Data.ContainsKey("AvatarHeight")) - appearance.AvatarHeight = float.Parse(Data["AvatarHeight"]); + appearance.SetSize(new Vector3(0.45f, 0.6f, float.Parse(Data["AvatarHeight"]))); +// appearance.AvatarHeight = float.Parse(Data["AvatarHeight"]); // Legacy Wearables if (Data.ContainsKey("BodyItem")) @@ -339,6 +340,7 @@ namespace OpenSim.Services.Interfaces appearance.Wearables[AvatarWearable.EYES].Wear( AvatarWearable.DefaultWearables[ AvatarWearable.EYES][0]); + } catch { -- cgit v1.1 From c73c2fb0707ee4dc78a354d932293f3e7e83ac50 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 7 Dec 2012 21:53:33 +0000 Subject: add some default size setting and checks --- OpenSim/Services/Interfaces/IAvatarService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs index 260e1c6..c0130f1 100644 --- a/OpenSim/Services/Interfaces/IAvatarService.cs +++ b/OpenSim/Services/Interfaces/IAvatarService.cs @@ -201,8 +201,13 @@ namespace OpenSim.Services.Interfaces appearance.Serial = Int32.Parse(Data["Serial"]); if (Data.ContainsKey("AvatarHeight")) - appearance.SetSize(new Vector3(0.45f, 0.6f, float.Parse(Data["AvatarHeight"]))); + { + float h = float.Parse(Data["AvatarHeight"]); + if( h == 0f) + h = 1.9f; + appearance.SetSize(new Vector3(0.45f, 0.6f, h )); // appearance.AvatarHeight = float.Parse(Data["AvatarHeight"]); + } // Legacy Wearables if (Data.ContainsKey("BodyItem")) -- cgit v1.1 From d1dd5a8ba9f707e63597d42cbe199a3f7ec15fe7 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 19 Dec 2012 13:04:41 +0100 Subject: Add the interfaces for the new Avination baked texture cache service --- OpenSim/Services/Interfaces/IBakedTextureService.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 OpenSim/Services/Interfaces/IBakedTextureService.cs (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/IBakedTextureService.cs b/OpenSim/Services/Interfaces/IBakedTextureService.cs new file mode 100644 index 0000000..8206ecd --- /dev/null +++ b/OpenSim/Services/Interfaces/IBakedTextureService.cs @@ -0,0 +1,17 @@ +//////////////////////////////////////////////////////////////// +// +// (c) 2009, 2010 Careminster Limited and Melanie Thielker +// +// All rights reserved +// +using System; +using Nini.Config; + +namespace OpenSim.Services.Interfaces +{ + public interface IBakedTextureService + { + string Get(string id); + void Store(string id, string data); + } +} -- cgit v1.1 From 797bfbfcfaf5485db755ad6a5b19a064210505fd Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 5 Mar 2013 12:02:22 +0100 Subject: Multiattach, part 1 --- OpenSim/Services/Interfaces/IAvatarService.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs index c0130f1..6011b1c 100644 --- a/OpenSim/Services/Interfaces/IAvatarService.cs +++ b/OpenSim/Services/Interfaces/IAvatarService.cs @@ -180,11 +180,18 @@ namespace OpenSim.Services.Interfaces // Attachments List attachments = appearance.GetAttachments(); + Dictionary> atts = new Dictionary>(); foreach (AvatarAttachment attach in attachments) { if (attach.ItemID != UUID.Zero) - Data["_ap_" + attach.AttachPoint] = attach.ItemID.ToString(); + { + if (!atts.ContainsKey(attach.AttachPoint)) + atts[attach.AttachPoint] = new List(); + atts[attach.AttachPoint].Add(attach.ItemID.ToString()); + } } + foreach (KeyValuePair> kvp in atts) + Data["_ap_" + kvp.Key] = string.Join(",", kvp.Value.ToArray()); } public AvatarAppearance ToAvatarAppearance() -- cgit v1.1 From 51de85b503e3994c2759f411779057afbffd0b83 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 5 Mar 2013 13:14:06 +0100 Subject: Multiattach, part 2 --- OpenSim/Services/Interfaces/IAvatarService.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs index 6011b1c..3663a7a 100644 --- a/OpenSim/Services/Interfaces/IAvatarService.cs +++ b/OpenSim/Services/Interfaces/IAvatarService.cs @@ -327,10 +327,16 @@ namespace OpenSim.Services.Interfaces if (!Int32.TryParse(pointStr, out point)) continue; - UUID uuid = UUID.Zero; - UUID.TryParse(_kvp.Value, out uuid); + List idList = new List(_kvp.Value.Split(new char[] {','})); - appearance.SetAttachment(point, uuid, UUID.Zero); + appearance.SetAttachment(point, UUID.Zero, UUID.Zero); + foreach (string id in idList) + { + UUID uuid = UUID.Zero; + UUID.TryParse(id, out uuid); + + appearance.SetAttachment(point | 0x80, uuid, UUID.Zero); + } } if (appearance.Wearables[AvatarWearable.BODY].Count == 0) -- cgit v1.1 From c341664c1b8ccf3bd7b81795b900b971a15ff318 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 24 Mar 2013 18:56:28 +0100 Subject: Phase 1 of implementing a transfer permission. Overwrite libOMV's PermissionMask with our own and add export permissions as well as a new definition for "All" as meaning "all conventional permissions" rather than "all possible permissions" --- .../Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs | 3 +++ OpenSim/Services/InventoryService/LibraryService.cs | 1 + OpenSim/Services/UserAccountService/UserAccountService.cs | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs index a391275..36325ce 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs @@ -38,12 +38,14 @@ using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; +using PermissionMask = OpenSim.Framework.PermissionMask; namespace OpenSim.Services.Connectors.SimianGrid { /// /// Permissions bitflags /// + /* [Flags] public enum PermissionMask : uint { @@ -55,6 +57,7 @@ namespace OpenSim.Services.Connectors.SimianGrid Damage = 1 << 20, All = 0x7FFFFFFF } + */ /// /// Connects avatar inventories to the SimianGrid backend diff --git a/OpenSim/Services/InventoryService/LibraryService.cs b/OpenSim/Services/InventoryService/LibraryService.cs index f90895b..c4a5572 100644 --- a/OpenSim/Services/InventoryService/LibraryService.cs +++ b/OpenSim/Services/InventoryService/LibraryService.cs @@ -38,6 +38,7 @@ using OpenSim.Services.Interfaces; using log4net; using Nini.Config; using OpenMetaverse; +using PermissionMask = OpenSim.Framework.PermissionMask; namespace OpenSim.Services.InventoryService { diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index a4f1bba..772ab97 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs @@ -36,6 +36,7 @@ using OpenSim.Framework; using OpenSim.Services.Interfaces; using OpenSim.Framework.Console; using GridRegion = OpenSim.Services.Interfaces.GridRegion; +using PermissionMask = OpenSim.Framework.PermissionMask; namespace OpenSim.Services.UserAccountService { @@ -684,4 +685,4 @@ namespace OpenSim.Services.UserAccountService } } } -} \ No newline at end of file +} -- cgit v1.1 From 528fc5358df93ae7a6f9e32f696550d21ef3d08c Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 8 Sep 2013 18:23:06 +0200 Subject: Fix exception when brokering HG asset ids --- OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 4b502b7..8b702e0 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -137,7 +137,13 @@ namespace OpenSim.Services.Connectors string prefix = id.Substring(0, 2).ToLower(); - string host = m_UriMap[prefix]; + string host; + + // HG URLs will not be valid UUIDS + if (m_UriMap.ContainsKey(prefix)) + host = m_UriMap[prefix]; + else + host = m_UriMap["00"]; serverUri.Host = host; -- cgit v1.1 From 958a8f274b8a25703935ab4092f190e9d54b8559 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 7 Dec 2013 01:29:15 +0000 Subject: Revert "Add support for user preferences (im via email)" This reverts commit 1842388bb4dcf5ecd57732ffa877b6ca1a3dec7b. --- OpenSim/Services/Interfaces/IUserProfilesService.cs | 5 ----- OpenSim/Services/UserProfilesService/UserProfilesService.cs | 12 ------------ 2 files changed, 17 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/IUserProfilesService.cs b/OpenSim/Services/Interfaces/IUserProfilesService.cs index 121baa8..319d307 100644 --- a/OpenSim/Services/Interfaces/IUserProfilesService.cs +++ b/OpenSim/Services/Interfaces/IUserProfilesService.cs @@ -57,11 +57,6 @@ namespace OpenSim.Services.Interfaces bool AvatarPropertiesRequest(ref UserProfileProperties prop, ref string result); bool AvatarPropertiesUpdate(ref UserProfileProperties prop, ref string result); #endregion Profile Properties - - #region User Preferences - bool UserPreferencesRequest(ref UserPreferences pref, ref string result); - bool UserPreferencesUpdate(ref UserPreferences pref, ref string result); - #endregion User Preferences #region Interests bool AvatarInterestsUpdate(UserProfileProperties prop, ref string result); diff --git a/OpenSim/Services/UserProfilesService/UserProfilesService.cs b/OpenSim/Services/UserProfilesService/UserProfilesService.cs index 69c7b91..d00f34d 100644 --- a/OpenSim/Services/UserProfilesService/UserProfilesService.cs +++ b/OpenSim/Services/UserProfilesService/UserProfilesService.cs @@ -163,18 +163,6 @@ namespace OpenSim.Services.ProfilesService } #endregion Interests - #region User Preferences - public bool UserPreferencesUpdate(ref UserPreferences pref, ref string result) - { - return ProfilesData.UpdateUserPreferences(ref pref, ref result); - } - - public bool UserPreferencesRequest(ref UserPreferences pref, ref string result) - { - return ProfilesData.GetUserPreferences(ref pref, ref result); - } - #endregion User Preferences - #region Utility public OSD AvatarImageAssetsRequest(UUID avatarId) { -- cgit v1.1 From 1eecb34e62987f43181bea912464b76eb4c6aa45 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 5 Jan 2014 21:16:30 +0000 Subject: Remove the core module extra profile settings support carried in with the latest patches. We don't need it. --- OpenSim/Services/UserProfilesService/UserProfilesService.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/UserProfilesService/UserProfilesService.cs b/OpenSim/Services/UserProfilesService/UserProfilesService.cs index dd26cdc..038e993 100644 --- a/OpenSim/Services/UserProfilesService/UserProfilesService.cs +++ b/OpenSim/Services/UserProfilesService/UserProfilesService.cs @@ -164,6 +164,7 @@ namespace OpenSim.Services.ProfilesService } #endregion Interests + /* #region User Preferences public bool UserPreferencesUpdate(ref UserPreferences pref, ref string result) { @@ -235,6 +236,7 @@ namespace OpenSim.Services.ProfilesService return ProfilesData.GetUserPreferences(ref pref, ref result); } #endregion User Preferences + */ #region Utility public OSD AvatarImageAssetsRequest(UUID avatarId) -- cgit v1.1 From 321bde8a3afc7cba63e008d8aa2a3adc733031c7 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 15 Jan 2014 22:20:42 +0100 Subject: Minor: Add prentheses to make a condition clearer --- OpenSim/Services/GridService/GridService.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index daebf8b..7f71835 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -283,7 +283,7 @@ namespace OpenSim.Services.GridService int flags = Convert.ToInt32(region.Data["flags"]); - if (!m_DeleteOnUnregister || (flags & (int)OpenSim.Framework.RegionFlags.Persistent) != 0) + if ((!m_DeleteOnUnregister) || ((flags & (int)OpenSim.Framework.RegionFlags.Persistent) != 0)) { flags &= ~(int)OpenSim.Framework.RegionFlags.RegionOnline; region.Data["flags"] = flags.ToString(); @@ -298,7 +298,6 @@ namespace OpenSim.Services.GridService } return true; - } return m_Database.Delete(regionID); -- cgit v1.1 From c0cdc6b74f634da9fc79691a7965b0648cbcf800 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 18 Mar 2014 02:16:00 +0100 Subject: Add delete maptile ability to MapImageService - yet untested --- .../MapImage/MapImageServicesConnector.cs | 60 ++++++++++++++++++++++ OpenSim/Services/Interfaces/IMapImageService.cs | 1 + .../Services/MapImageService/MapImageService.cs | 33 +++++++++++- 3 files changed, 92 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs b/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs index 30bfb70..267dd71 100644 --- a/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs +++ b/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs @@ -86,6 +86,66 @@ namespace OpenSim.Services.Connectors m_ServerURI = serviceURI.TrimEnd('/'); } + public bool RemoveMapTile(int x, int y, out string reason) + { + reason = string.Empty; + int tickstart = Util.EnvironmentTickCount(); + Dictionary sendData = new Dictionary(); + sendData["X"] = x.ToString(); + sendData["Y"] = y.ToString(); + + string reqString = ServerUtils.BuildQueryString(sendData); + string uri = m_ServerURI + "/removemap"; + + try + { + string reply = SynchronousRestFormsRequester.MakeRequest("POST", + uri, + reqString); + if (reply != string.Empty) + { + Dictionary replyData = ServerUtils.ParseXmlResponse(reply); + + if (replyData.ContainsKey("Result") && (replyData["Result"].ToString().ToLower() == "success")) + { + return true; + } + else if (replyData.ContainsKey("Result") && (replyData["Result"].ToString().ToLower() == "failure")) + { + m_log.DebugFormat("[MAP IMAGE CONNECTOR]: Delete failed: {0}", replyData["Message"].ToString()); + reason = replyData["Message"].ToString(); + return false; + } + else if (!replyData.ContainsKey("Result")) + { + m_log.DebugFormat("[MAP IMAGE CONNECTOR]: reply data does not contain result field"); + } + else + { + m_log.DebugFormat("[MAP IMAGE CONNECTOR]: unexpected result {0}", replyData["Result"].ToString()); + reason = "Unexpected result " + replyData["Result"].ToString(); + } + + } + else + { + m_log.DebugFormat("[MAP IMAGE CONNECTOR]: Map post received null reply"); + } + } + catch (Exception e) + { + m_log.DebugFormat("[MAP IMAGE CONNECTOR]: Exception when contacting map server at {0}: {1}", uri, e.Message); + } + finally + { + // This just dumps a warning for any operation that takes more than 100 ms + int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); + m_log.DebugFormat("[MAP IMAGE CONNECTOR]: map tile deleted in {0}ms", tickdiff); + } + + return false; + } + public bool AddMapTile(int x, int y, byte[] jpgData, out string reason) { reason = string.Empty; diff --git a/OpenSim/Services/Interfaces/IMapImageService.cs b/OpenSim/Services/Interfaces/IMapImageService.cs index a7b2cf1..78daa5f 100644 --- a/OpenSim/Services/Interfaces/IMapImageService.cs +++ b/OpenSim/Services/Interfaces/IMapImageService.cs @@ -35,6 +35,7 @@ namespace OpenSim.Services.Interfaces { //List GetMapBlocks(UUID scopeID, int minX, int minY, int maxX, int maxY); bool AddMapTile(int x, int y, byte[] imageData, out string reason); + bool RemoveMapTile(int x, int y, out string reason); byte[] GetMapTile(string fileName, out string format); } } diff --git a/OpenSim/Services/MapImageService/MapImageService.cs b/OpenSim/Services/MapImageService/MapImageService.cs index a85ee70..e2f256f 100644 --- a/OpenSim/Services/MapImageService/MapImageService.cs +++ b/OpenSim/Services/MapImageService/MapImageService.cs @@ -112,9 +112,38 @@ namespace OpenSim.Services.MapImageService reason = e.Message; return false; } + } + + return UpdateMultiResolutionFiles(x, y, out reason); + } + + public bool RemoveMapTile(int x, int y, out string reason) + { + reason = String.Empty; + string fileName = GetFileName(1, x, y); + + lock (m_Sync) + { + try + { + File.Delete(fileName); + } + catch (Exception e) + { + m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to save delete file {0}: {1}", fileName, e); + reason = e.Message; + return false; + } + } - // Also save in png format? + return UpdateMultiResolutionFiles(x, y, out reason); + } + private bool UpdateMultiResolutionFiles(int x, int y, out string reason) + { + reason = String.Empty; + lock (m_Sync) + { // Stitch seven more aggregate tiles together for (uint zoomLevel = 2; zoomLevel <= ZOOM_LEVELS; zoomLevel++) { @@ -126,7 +155,7 @@ namespace OpenSim.Services.MapImageService if (!CreateTile(zoomLevel, x1, y1)) { - m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to create tile for {0} at zoom level {1}", fileName, zoomLevel); + m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to create tile for {0},{1} at zoom level {1}", x, y, zoomLevel); reason = string.Format("Map tile at zoom level {0} failed", zoomLevel); return false; } -- cgit v1.1 From cbd7c7b9ecbe7bbe19d5c675322206bc8a977c5f Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 23 Aug 2014 17:27:01 +0200 Subject: Change the map tile system to be multi-grid hosting compatible --- .../MapImage/MapImageServicesConnector.cs | 8 +++-- OpenSim/Services/Interfaces/IMapImageService.cs | 6 ++-- .../Services/MapImageService/MapImageService.cs | 39 ++++++++++++---------- 3 files changed, 29 insertions(+), 24 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs b/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs index 725204d..ba4c3c5 100644 --- a/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs +++ b/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs @@ -86,13 +86,14 @@ namespace OpenSim.Services.Connectors m_ServerURI = serviceURI.TrimEnd('/'); } - public bool RemoveMapTile(int x, int y, out string reason) + public bool RemoveMapTile(int x, int y, UUID scopeID, out string reason) { reason = string.Empty; int tickstart = Util.EnvironmentTickCount(); Dictionary sendData = new Dictionary(); sendData["X"] = x.ToString(); sendData["Y"] = y.ToString(); + sendData["SCOPE"] = scopeID.ToString(); string reqString = ServerUtils.BuildQueryString(sendData); string uri = m_ServerURI + "/removemap"; @@ -146,13 +147,14 @@ namespace OpenSim.Services.Connectors return false; } - public bool AddMapTile(int x, int y, byte[] jpgData, out string reason) + public bool AddMapTile(int x, int y, byte[] jpgData, UUID scopeID, out string reason) { reason = string.Empty; int tickstart = Util.EnvironmentTickCount(); Dictionary sendData = new Dictionary(); sendData["X"] = x.ToString(); sendData["Y"] = y.ToString(); + sendData["SCOPE"] = scopeID.ToString(); sendData["TYPE"] = "image/jpeg"; sendData["DATA"] = Convert.ToBase64String(jpgData); @@ -212,7 +214,7 @@ namespace OpenSim.Services.Connectors } - public byte[] GetMapTile(string fileName, out string format) + public byte[] GetMapTile(string fileName, UUID scopeID, out string format) { format = string.Empty; new Exception("GetMapTile method not Implemented"); diff --git a/OpenSim/Services/Interfaces/IMapImageService.cs b/OpenSim/Services/Interfaces/IMapImageService.cs index 78daa5f..b8d45dd 100644 --- a/OpenSim/Services/Interfaces/IMapImageService.cs +++ b/OpenSim/Services/Interfaces/IMapImageService.cs @@ -34,8 +34,8 @@ namespace OpenSim.Services.Interfaces public interface IMapImageService { //List GetMapBlocks(UUID scopeID, int minX, int minY, int maxX, int maxY); - bool AddMapTile(int x, int y, byte[] imageData, out string reason); - bool RemoveMapTile(int x, int y, out string reason); - byte[] GetMapTile(string fileName, out string format); + bool AddMapTile(int x, int y, byte[] imageData, UUID scopeID, out string reason); + bool RemoveMapTile(int x, int y, UUID scopeID, out string reason); + byte[] GetMapTile(string fileName, UUID scopeID, out string format); } } diff --git a/OpenSim/Services/MapImageService/MapImageService.cs b/OpenSim/Services/MapImageService/MapImageService.cs index 31e147b..4887d1c 100644 --- a/OpenSim/Services/MapImageService/MapImageService.cs +++ b/OpenSim/Services/MapImageService/MapImageService.cs @@ -94,10 +94,10 @@ namespace OpenSim.Services.MapImageService #region IMapImageService - public bool AddMapTile(int x, int y, byte[] imageData, out string reason) + public bool AddMapTile(int x, int y, byte[] imageData, UUID scopeID, out string reason) { reason = string.Empty; - string fileName = GetFileName(1, x, y); + string fileName = GetFileName(1, x, y, scopeID); lock (m_Sync) { @@ -114,13 +114,13 @@ namespace OpenSim.Services.MapImageService } } - return UpdateMultiResolutionFiles(x, y, out reason); + return UpdateMultiResolutionFiles(x, y, scopeID, out reason); } - public bool RemoveMapTile(int x, int y, out string reason) + public bool RemoveMapTile(int x, int y, UUID scopeID, out string reason) { reason = String.Empty; - string fileName = GetFileName(1, x, y); + string fileName = GetFileName(1, x, y, scopeID); lock (m_Sync) { @@ -136,10 +136,10 @@ namespace OpenSim.Services.MapImageService } } - return UpdateMultiResolutionFiles(x, y, out reason); + return UpdateMultiResolutionFiles(x, y, scopeID, out reason); } - private bool UpdateMultiResolutionFiles(int x, int y, out string reason) + private bool UpdateMultiResolutionFiles(int x, int y, UUID scopeID, out string reason) { reason = String.Empty; lock (m_Sync) @@ -153,7 +153,7 @@ namespace OpenSim.Services.MapImageService int x1 = x - (x % width); int y1 = y - (y % width); - if (!CreateTile(zoomLevel, x1, y1)) + if (!CreateTile(zoomLevel, x1, y1, scopeID)) { m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to create tile for {0},{1} at zoom level {1}", x, y, zoomLevel); reason = string.Format("Map tile at zoom level {0} failed", zoomLevel); @@ -165,12 +165,13 @@ namespace OpenSim.Services.MapImageService return true; } - public byte[] GetMapTile(string fileName, out string format) + public byte[] GetMapTile(string fileName, UUID scopeID, out string format) { // m_log.DebugFormat("[MAP IMAGE SERVICE]: Getting map tile {0}", fileName); format = ".jpg"; - string fullName = Path.Combine(m_TilesStoragePath, fileName); + string fullName = Path.Combine(m_TilesStoragePath, scopeID.ToString()); + fullName = Path.Combine(fullName, fileName); if (File.Exists(fullName)) { format = Path.GetExtension(fileName).ToLower(); @@ -191,10 +192,12 @@ namespace OpenSim.Services.MapImageService #endregion - private string GetFileName(uint zoomLevel, int x, int y) + private string GetFileName(uint zoomLevel, int x, int y, UUID scopeID) { string extension = "jpg"; - return Path.Combine(m_TilesStoragePath, string.Format("map-{0}-{1}-{2}-objects.{3}", zoomLevel, x, y, extension)); + string path = Path.Combine(m_TilesStoragePath, scopeID.ToString()); + Directory.CreateDirectory(path); + return Path.Combine(path, string.Format("map-{0}-{1}-{2}-objects.{3}", zoomLevel, x, y, extension)); } private Bitmap GetInputTileImage(string fileName) @@ -235,7 +238,7 @@ namespace OpenSim.Services.MapImageService return null; } - private bool CreateTile(uint zoomLevel, int x, int y) + private bool CreateTile(uint zoomLevel, int x, int y, UUID scopeID) { // m_log.DebugFormat("[MAP IMAGE SERVICE]: Create tile for {0} {1}, zoom {2}", x, y, zoomLevel); int prevWidth = (int)Math.Pow(2, (double)zoomLevel - 2); @@ -250,13 +253,13 @@ namespace OpenSim.Services.MapImageService int yOut = y - (y % thisWidth); // Try to open the four input tiles from the previous zoom level - Bitmap inputBL = GetInputTileImage(GetFileName(zoomLevel - 1, xIn, yIn)); - Bitmap inputBR = GetInputTileImage(GetFileName(zoomLevel - 1, xIn + prevWidth, yIn)); - Bitmap inputTL = GetInputTileImage(GetFileName(zoomLevel - 1, xIn, yIn + prevWidth)); - Bitmap inputTR = GetInputTileImage(GetFileName(zoomLevel - 1, xIn + prevWidth, yIn + prevWidth)); + Bitmap inputBL = GetInputTileImage(GetFileName(zoomLevel - 1, xIn, yIn, scopeID)); + Bitmap inputBR = GetInputTileImage(GetFileName(zoomLevel - 1, xIn + prevWidth, yIn, scopeID)); + Bitmap inputTL = GetInputTileImage(GetFileName(zoomLevel - 1, xIn, yIn + prevWidth, scopeID)); + Bitmap inputTR = GetInputTileImage(GetFileName(zoomLevel - 1, xIn + prevWidth, yIn + prevWidth, scopeID)); // Open the output tile (current zoom level) - string outputFile = GetFileName(zoomLevel, xOut, yOut); + string outputFile = GetFileName(zoomLevel, xOut, yOut, scopeID); Bitmap output = GetOutputTileImage(outputFile); if (output == null) return false; -- cgit v1.1 From 1a7efc2c64ac70b4ea77a370964c7a3df2c283e2 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 23 Aug 2014 17:33:14 +0200 Subject: Change the map tile system to be multi-grid hosting compatible Conflicts: OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs --- .../MapImage/MapImageServicesConnector.cs | 8 +++-- OpenSim/Services/Interfaces/IMapImageService.cs | 6 ++-- .../Services/MapImageService/MapImageService.cs | 39 ++++++++++++---------- 3 files changed, 29 insertions(+), 24 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs b/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs index 267dd71..6095598 100644 --- a/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs +++ b/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs @@ -86,13 +86,14 @@ namespace OpenSim.Services.Connectors m_ServerURI = serviceURI.TrimEnd('/'); } - public bool RemoveMapTile(int x, int y, out string reason) + public bool RemoveMapTile(int x, int y, UUID scopeID, out string reason) { reason = string.Empty; int tickstart = Util.EnvironmentTickCount(); Dictionary sendData = new Dictionary(); sendData["X"] = x.ToString(); sendData["Y"] = y.ToString(); + sendData["SCOPE"] = scopeID.ToString(); string reqString = ServerUtils.BuildQueryString(sendData); string uri = m_ServerURI + "/removemap"; @@ -146,13 +147,14 @@ namespace OpenSim.Services.Connectors return false; } - public bool AddMapTile(int x, int y, byte[] jpgData, out string reason) + public bool AddMapTile(int x, int y, byte[] jpgData, UUID scopeID, out string reason) { reason = string.Empty; int tickstart = Util.EnvironmentTickCount(); Dictionary sendData = new Dictionary(); sendData["X"] = x.ToString(); sendData["Y"] = y.ToString(); + sendData["SCOPE"] = scopeID.ToString(); sendData["TYPE"] = "image/jpeg"; sendData["DATA"] = Convert.ToBase64String(jpgData); @@ -209,7 +211,7 @@ namespace OpenSim.Services.Connectors } - public byte[] GetMapTile(string fileName, out string format) + public byte[] GetMapTile(string fileName, UUID scopeID, out string format) { format = string.Empty; new Exception("GetMapTile method not Implemented"); diff --git a/OpenSim/Services/Interfaces/IMapImageService.cs b/OpenSim/Services/Interfaces/IMapImageService.cs index 78daa5f..b8d45dd 100644 --- a/OpenSim/Services/Interfaces/IMapImageService.cs +++ b/OpenSim/Services/Interfaces/IMapImageService.cs @@ -34,8 +34,8 @@ namespace OpenSim.Services.Interfaces public interface IMapImageService { //List GetMapBlocks(UUID scopeID, int minX, int minY, int maxX, int maxY); - bool AddMapTile(int x, int y, byte[] imageData, out string reason); - bool RemoveMapTile(int x, int y, out string reason); - byte[] GetMapTile(string fileName, out string format); + bool AddMapTile(int x, int y, byte[] imageData, UUID scopeID, out string reason); + bool RemoveMapTile(int x, int y, UUID scopeID, out string reason); + byte[] GetMapTile(string fileName, UUID scopeID, out string format); } } diff --git a/OpenSim/Services/MapImageService/MapImageService.cs b/OpenSim/Services/MapImageService/MapImageService.cs index e2f256f..9de5085 100644 --- a/OpenSim/Services/MapImageService/MapImageService.cs +++ b/OpenSim/Services/MapImageService/MapImageService.cs @@ -94,10 +94,10 @@ namespace OpenSim.Services.MapImageService #region IMapImageService - public bool AddMapTile(int x, int y, byte[] imageData, out string reason) + public bool AddMapTile(int x, int y, byte[] imageData, UUID scopeID, out string reason) { reason = string.Empty; - string fileName = GetFileName(1, x, y); + string fileName = GetFileName(1, x, y, scopeID); lock (m_Sync) { @@ -114,13 +114,13 @@ namespace OpenSim.Services.MapImageService } } - return UpdateMultiResolutionFiles(x, y, out reason); + return UpdateMultiResolutionFiles(x, y, scopeID, out reason); } - public bool RemoveMapTile(int x, int y, out string reason) + public bool RemoveMapTile(int x, int y, UUID scopeID, out string reason) { reason = String.Empty; - string fileName = GetFileName(1, x, y); + string fileName = GetFileName(1, x, y, scopeID); lock (m_Sync) { @@ -136,10 +136,10 @@ namespace OpenSim.Services.MapImageService } } - return UpdateMultiResolutionFiles(x, y, out reason); + return UpdateMultiResolutionFiles(x, y, scopeID, out reason); } - private bool UpdateMultiResolutionFiles(int x, int y, out string reason) + private bool UpdateMultiResolutionFiles(int x, int y, UUID scopeID, out string reason) { reason = String.Empty; lock (m_Sync) @@ -153,7 +153,7 @@ namespace OpenSim.Services.MapImageService int x1 = x - (x % width); int y1 = y - (y % width); - if (!CreateTile(zoomLevel, x1, y1)) + if (!CreateTile(zoomLevel, x1, y1, scopeID)) { m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to create tile for {0},{1} at zoom level {1}", x, y, zoomLevel); reason = string.Format("Map tile at zoom level {0} failed", zoomLevel); @@ -165,12 +165,13 @@ namespace OpenSim.Services.MapImageService return true; } - public byte[] GetMapTile(string fileName, out string format) + public byte[] GetMapTile(string fileName, UUID scopeID, out string format) { // m_log.DebugFormat("[MAP IMAGE SERVICE]: Getting map tile {0}", fileName); format = ".jpg"; - string fullName = Path.Combine(m_TilesStoragePath, fileName); + string fullName = Path.Combine(m_TilesStoragePath, scopeID.ToString()); + fullName = Path.Combine(fullName, fileName); if (File.Exists(fullName)) { format = Path.GetExtension(fileName).ToLower(); @@ -191,10 +192,12 @@ namespace OpenSim.Services.MapImageService #endregion - private string GetFileName(uint zoomLevel, int x, int y) + private string GetFileName(uint zoomLevel, int x, int y, UUID scopeID) { string extension = "jpg"; - return Path.Combine(m_TilesStoragePath, string.Format("map-{0}-{1}-{2}-objects.{3}", zoomLevel, x, y, extension)); + string path = Path.Combine(m_TilesStoragePath, scopeID.ToString()); + Directory.CreateDirectory(path); + return Path.Combine(path, string.Format("map-{0}-{1}-{2}-objects.{3}", zoomLevel, x, y, extension)); } private Bitmap GetInputTileImage(string fileName) @@ -235,7 +238,7 @@ namespace OpenSim.Services.MapImageService return null; } - private bool CreateTile(uint zoomLevel, int x, int y) + private bool CreateTile(uint zoomLevel, int x, int y, UUID scopeID) { // m_log.DebugFormat("[MAP IMAGE SERVICE]: Create tile for {0} {1}, zoom {2}", x, y, zoomLevel); int prevWidth = (int)Math.Pow(2, (double)zoomLevel - 2); @@ -250,13 +253,13 @@ namespace OpenSim.Services.MapImageService int yOut = y - (y % thisWidth); // Try to open the four input tiles from the previous zoom level - Bitmap inputBL = GetInputTileImage(GetFileName(zoomLevel - 1, xIn, yIn)); - Bitmap inputBR = GetInputTileImage(GetFileName(zoomLevel - 1, xIn + prevWidth, yIn)); - Bitmap inputTL = GetInputTileImage(GetFileName(zoomLevel - 1, xIn, yIn + prevWidth)); - Bitmap inputTR = GetInputTileImage(GetFileName(zoomLevel - 1, xIn + prevWidth, yIn + prevWidth)); + Bitmap inputBL = GetInputTileImage(GetFileName(zoomLevel - 1, xIn, yIn, scopeID)); + Bitmap inputBR = GetInputTileImage(GetFileName(zoomLevel - 1, xIn + prevWidth, yIn, scopeID)); + Bitmap inputTL = GetInputTileImage(GetFileName(zoomLevel - 1, xIn, yIn + prevWidth, scopeID)); + Bitmap inputTR = GetInputTileImage(GetFileName(zoomLevel - 1, xIn + prevWidth, yIn + prevWidth, scopeID)); // Open the output tile (current zoom level) - string outputFile = GetFileName(zoomLevel, xOut, yOut); + string outputFile = GetFileName(zoomLevel, xOut, yOut, scopeID); Bitmap output = GetOutputTileImage(outputFile); if (output == null) return false; -- cgit v1.1 From 39e052982baebb60801984965d8865886f20931d Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 23 Aug 2014 19:10:15 +0200 Subject: Fix a null ref that will cause an exception if a grid region doesnt' specify a URI. --- OpenSim/Services/Interfaces/IGridService.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index 3f4c958..a3d237f 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs @@ -141,6 +141,12 @@ namespace OpenSim.Services.Interfaces } } set { + if ( value == null) + { + m_serverURI = String.Empty; + return; + } + if ( value.EndsWith("/") ) { m_serverURI = value; } else { -- cgit v1.1 From 060984502eeabb59cade86e5e2b27db888229db3 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 17 Sep 2014 17:00:13 +0100 Subject: and another one --- OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index bf0cc35..9b0ebcf 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -284,9 +284,11 @@ namespace OpenSim.Services.Connectors byte[] ret = new byte[s.Length]; s.Read(ret, 0, (int)s.Length); + s.Close(); return ret; } + s.Close(); return null; } @@ -325,13 +327,16 @@ namespace OpenSim.Services.Connectors handlers = m_AssetHandlers[id]; m_AssetHandlers.Remove(id); } + foreach (AssetRetrievedEx h in handlers) { Util.FireAndForget(x => { - h.Invoke(a); + try { h.Invoke(a); } + catch { } }); } + if (handlers != null) handlers.Clear(); -- cgit v1.1 From f35f90bd7289598d6209d6b1de6222aff600dff5 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 18 Sep 2014 19:40:59 +0100 Subject: dont give a ring to each asset request, just one to rule them all, i mean thread not ring --- .../Connectors/Asset/AssetServicesConnector.cs | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 9b0ebcf..2c1d946 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -328,17 +328,24 @@ namespace OpenSim.Services.Connectors m_AssetHandlers.Remove(id); } - foreach (AssetRetrievedEx h in handlers) - { - Util.FireAndForget(x => + Util.FireAndForget(x => { - try { h.Invoke(a); } - catch { } + foreach (AssetRetrievedEx h in handlers) + { + // Util.FireAndForget(x => + // { + try { h.Invoke(a); } + catch { } + // }); + } + + if (handlers != null) + handlers.Clear(); + }); - } - if (handlers != null) - handlers.Clear(); +// if (handlers != null) +// handlers.Clear(); success = true; } -- cgit v1.1 From fd79f75ba6766e1edc196a73dd05fc5f806f82b2 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 24 Oct 2014 02:12:30 +0100 Subject: TEST**** wingridproxy detection at grid login. Untested possible not very reliable. Adds some load even on region servers because of code at BaseHttpServer. --- OpenSim/Services/Interfaces/ILoginService.cs | 4 ++-- OpenSim/Services/LLLoginService/LLLoginService.cs | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/ILoginService.cs b/OpenSim/Services/Interfaces/ILoginService.cs index ee9b0b1..7c44cd8 100644 --- a/OpenSim/Services/Interfaces/ILoginService.cs +++ b/OpenSim/Services/Interfaces/ILoginService.cs @@ -47,8 +47,8 @@ namespace OpenSim.Services.Interfaces public interface ILoginService { - LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, - string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP); + LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, + string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP, bool LibOMVclient); Hashtable SetLevel(string firstName, string lastName, string passwd, int level, IPEndPoint clientIP); } diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index ed62c43..1c1c9b0 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -247,13 +247,16 @@ namespace OpenSim.Services.LLLoginService } public LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, - string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP) + string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP, bool LibOMVclient) { bool success = false; UUID session = UUID.Random(); + if (clientVersion.Contains("Radegast")) + LibOMVclient = false; - m_log.InfoFormat("[LLOGIN SERVICE]: Login request for {0} {1} at {2} using viewer {3}, channel {4}, IP {5}, Mac {6}, Id0 {7}", - firstName, lastName, startLocation, clientVersion, channel, clientIP.Address.ToString(), mac, id0); + + m_log.InfoFormat("[LLOGIN SERVICE]: Login request for {0} {1} at {2} using viewer {3}, channel {4}, IP {5}, Mac {6}, Id0 {7}, Possible LibOMVGridProxy: {8} ", + firstName, lastName, startLocation, clientVersion, channel, clientIP.Address.ToString(), mac, id0, LibOMVclient.ToString()); try { -- cgit v1.1 From e59a9a54f1a7add2a5198a440a44c2aff2183890 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 26 Oct 2014 10:05:48 +0000 Subject: bug fix --- OpenSim/Services/Interfaces/IGridService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index 4e6a0f6..19ea0fe 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs @@ -445,7 +445,7 @@ namespace OpenSim.Services.Interfaces if (kvp.ContainsKey("sizeY")) RegionSizeY = Convert.ToInt32((string)kvp["sizeY"]); else - RegionSizeX = (int)Constants.RegionSize; + RegionSizeY = (int)Constants.RegionSize; if (kvp.ContainsKey("regionName")) RegionName = (string)kvp["regionName"]; -- cgit v1.1 From bedafb8fae9898ef0c5fc6470236ee7244e616a9 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 27 Mar 2015 19:32:50 -0700 Subject: varregion: refactor use of 'double heightmap[,]' into references to new class TerrainData and push the implementation from Scene into the database readers and writers. --- .../Services/Connectors/Simulation/SimulationDataService.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs b/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs index 96c02d9..4759838 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs @@ -100,6 +100,11 @@ namespace OpenSim.Services.Connectors return m_database.LoadObjects(regionUUID); } + public void StoreTerrain(TerrainData terrain, UUID regionID) + { + m_database.StoreTerrain(terrain, regionID); + } + public void StoreTerrain(double[,] terrain, UUID regionID) { m_database.StoreTerrain(terrain, regionID); @@ -110,6 +115,11 @@ namespace OpenSim.Services.Connectors return m_database.LoadTerrain(regionID); } + public TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ) + { + return m_database.LoadTerrain(regionID, pSizeX, pSizeY, pSizeZ); + } + public void StoreLandObject(ILandObject Parcel) { m_database.StoreLandObject(Parcel); -- cgit v1.1 From 07dead7dcb8b0f2a27a50748e4a460d9669903fc Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Sun, 29 Mar 2015 14:25:12 -0700 Subject: varregion: any conversions of use of Constants.RegionSize converted into Util.cs routines to convert region coords to and from world coords or handles. --- .../SimianGrid/SimianGridServiceConnector.cs | 8 ++-- OpenSim/Services/GridService/GridService.cs | 3 +- OpenSim/Services/GridService/HypergridLinker.cs | 55 ++++++++++++---------- OpenSim/Services/Interfaces/IGridService.cs | 16 +++---- OpenSim/Services/LLLoginService/LLLoginResponse.cs | 24 ++++++++-- OpenSim/Services/LLLoginService/LLLoginService.cs | 2 +- 6 files changed, 63 insertions(+), 45 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs index 3cf3416..312832f 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs @@ -112,7 +112,7 @@ namespace OpenSim.Services.Connectors.SimianGrid // m_log.Warn("Registering region " + regionInfo.RegionName + " (" + regionInfo.RegionID + ") that we are not tracking"); Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0); - Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, Constants.RegionHeight); + Vector3d maxPosition = minPosition + new Vector3d(regionInfo.RegionSizeX, regionInfo.RegionSizeY, Constants.RegionHeight); OSDMap extraData = new OSDMap { @@ -174,8 +174,8 @@ namespace OpenSim.Services.Connectors.SimianGrid if (region != null) { List regions = GetRegionRange(scopeID, - region.RegionLocX - NEIGHBOR_RADIUS, region.RegionLocX + (int)Constants.RegionSize + NEIGHBOR_RADIUS, - region.RegionLocY - NEIGHBOR_RADIUS, region.RegionLocY + (int)Constants.RegionSize + NEIGHBOR_RADIUS); + region.RegionLocX - NEIGHBOR_RADIUS, region.RegionLocX + region.RegionSizeX + NEIGHBOR_RADIUS, + region.RegionLocY - NEIGHBOR_RADIUS, region.RegionLocY + region.RegionSizeY + NEIGHBOR_RADIUS); for (int i = 0; i < regions.Count; i++) { @@ -240,7 +240,7 @@ namespace OpenSim.Services.Connectors.SimianGrid else { // m_log.InfoFormat("[SIMIAN GRID CONNECTOR]: Grid service did not find a match for region at {0},{1}", - // x / Constants.RegionSize, y / Constants.RegionSize); + // Util.WorldToRegionLoc(x), Util.WorldToRegionLoc(y)); return null; } } diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 76415ce..eb44dcb 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -655,7 +655,7 @@ namespace OpenSim.Services.GridService return; } - RegionData region = m_Database.Get(x * (int)Constants.RegionSize, y * (int)Constants.RegionSize, UUID.Zero); + RegionData region = m_Database.Get((int)Util.RegionToWorldLoc((uint)x), (int)Util.RegionToWorldLoc((uint)y), UUID.Zero); if (region == null) { MainConsole.Instance.OutputFormat("No region found at {0},{1}", x, y); @@ -673,6 +673,7 @@ namespace OpenSim.Services.GridService dispList.AddRow("Region Name", r.RegionName); dispList.AddRow("Region ID", r.RegionID); dispList.AddRow("Location", string.Format("{0},{1}", r.coordX, r.coordY)); + dispList.AddRow("Size", string.Format("{0}x{1}", r.sizeX, r.sizeY)); dispList.AddRow("URI", r.Data["serverURI"]); dispList.AddRow("Owner ID", r.Data["owner_uuid"]); dispList.AddRow("Flags", flags); diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index 4024295..0448b54 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs @@ -183,8 +183,8 @@ namespace OpenSim.Services.GridService public GridRegion LinkRegion(UUID scopeID, string regionDescriptor) { string reason = string.Empty; - int xloc = random.Next(0, Int16.MaxValue) * (int)Constants.RegionSize; - return TryLinkRegionToCoords(scopeID, regionDescriptor, xloc, 0, out reason); + uint xloc = Util.RegionToWorldLoc((uint)random.Next(0, Int16.MaxValue)); + return TryLinkRegionToCoords(scopeID, regionDescriptor, (int)xloc, 0, out reason); } private static Random random = new Random(); @@ -260,7 +260,7 @@ namespace OpenSim.Services.GridService { m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0} {1}, in {2}-{3}", ((serverURI == null) ? (externalHostName + ":" + externalPort) : serverURI), - remoteRegionName, xloc / Constants.RegionSize, yloc / Constants.RegionSize); + remoteRegionName, Util.WorldToRegionLoc((uint)xloc), Util.WorldToRegionLoc((uint)yloc)); reason = string.Empty; Uri uri = null; @@ -311,7 +311,7 @@ namespace OpenSim.Services.GridService if (region != null) { m_log.WarnFormat("[HYPERGRID LINKER]: Coordinates {0}-{1} are already occupied by region {2} with uuid {3}", - regInfo.RegionLocX / Constants.RegionSize, regInfo.RegionLocY / Constants.RegionSize, + Util.WorldToRegionLoc((uint)regInfo.RegionLocX), Util.WorldToRegionLoc((uint)regInfo.RegionLocY), region.RegionName, region.RegionID); reason = "Coordinates are already in use"; return false; @@ -347,7 +347,7 @@ namespace OpenSim.Services.GridService if (region != null) { m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates {0} {1}", - region.RegionLocX / Constants.RegionSize, region.RegionLocY / Constants.RegionSize); + Util.WorldToRegionLoc((uint)regInfo.RegionLocX), Util.WorldToRegionLoc((uint)regInfo.RegionLocY)); regInfo = region; return true; } @@ -424,10 +424,10 @@ namespace OpenSim.Services.GridService // { // uint ux = 0, uy = 0; // Utils.LongToUInts(realHandle, out ux, out uy); -// x = ux / Constants.RegionSize; -// y = uy / Constants.RegionSize; +// x = Util.WorldToRegionLoc(ux); +// y = Util.WorldToRegionLoc(uy); // -// const uint limit = (4096 - 1) * Constants.RegionSize; +// const uint limit = Util.RegionToWorldLoc(4096 - 1); // uint xmin = ux - limit; // uint xmax = ux + limit; // uint ymin = uy - limit; @@ -503,8 +503,9 @@ namespace OpenSim.Services.GridService foreach (RegionData r in regions) { MainConsole.Instance.Output(String.Format("{0}\n{2,-32} {1}\n", - r.RegionName, r.RegionID, String.Format("{0},{1} ({2},{3})", r.posX, r.posY, - r.posX / Constants.RegionSize, r.posY / Constants.RegionSize))); + r.RegionName, r.RegionID, + String.Format("{0},{1} ({2},{3})", r.posX, r.posY, + Util.WorldToRegionLoc((uint)r.posX), Util.WorldToRegionLoc((uint)r.posY))) ); } return; } @@ -529,8 +530,8 @@ namespace OpenSim.Services.GridService int xloc, yloc; string serverURI; string remoteName = null; - xloc = Convert.ToInt32(cmdparams[0]) * (int)Constants.RegionSize; - yloc = Convert.ToInt32(cmdparams[1]) * (int)Constants.RegionSize; + xloc = (int)Util.RegionToWorldLoc((uint)Convert.ToInt32(cmdparams[0])); + yloc = (int)Util.RegionToWorldLoc((uint)Convert.ToInt32(cmdparams[1])); serverURI = cmdparams[2]; if (cmdparams.Length > 3) remoteName = string.Join(" ", cmdparams, 3, cmdparams.Length - 3); @@ -601,13 +602,13 @@ namespace OpenSim.Services.GridService { // old format GridRegion regInfo; - int xloc, yloc; + uint xloc, yloc; uint externalPort; string externalHostName; try { - xloc = Convert.ToInt32(cmdparams[0]); - yloc = Convert.ToInt32(cmdparams[1]); + xloc = (uint)Convert.ToInt32(cmdparams[0]); + yloc = (uint)Convert.ToInt32(cmdparams[1]); externalPort = Convert.ToUInt32(cmdparams[3]); externalHostName = cmdparams[2]; //internalPort = Convert.ToUInt32(cmdparams[4]); @@ -621,10 +622,11 @@ namespace OpenSim.Services.GridService } // Convert cell coordinates given by the user to meters - xloc = xloc * (int)Constants.RegionSize; - yloc = yloc * (int)Constants.RegionSize; + xloc = Util.RegionToWorldLoc(xloc); + yloc = Util.RegionToWorldLoc(yloc); string reason = string.Empty; - if (TryCreateLink(UUID.Zero, xloc, yloc, string.Empty, externalPort, externalHostName, UUID.Zero, out regInfo, out reason)) + if (TryCreateLink(UUID.Zero, (int)xloc, (int)yloc, + string.Empty, externalPort, externalHostName, UUID.Zero, out regInfo, out reason)) { // What is this? The GridRegion instance will be discarded anyway, // which effectively ignores any local name given with the command. @@ -704,13 +706,13 @@ namespace OpenSim.Services.GridService private void ReadLinkFromConfig(IConfig config) { GridRegion regInfo; - int xloc, yloc; + uint xloc, yloc; uint externalPort; string externalHostName; uint realXLoc, realYLoc; - xloc = Convert.ToInt32(config.GetString("xloc", "0")); - yloc = Convert.ToInt32(config.GetString("yloc", "0")); + xloc = (uint)Convert.ToInt32(config.GetString("xloc", "0")); + yloc = (uint)Convert.ToInt32(config.GetString("yloc", "0")); externalPort = Convert.ToUInt32(config.GetString("externalPort", "0")); externalHostName = config.GetString("externalHostName", ""); realXLoc = Convert.ToUInt32(config.GetString("real-xloc", "0")); @@ -718,18 +720,19 @@ namespace OpenSim.Services.GridService if (m_enableAutoMapping) { - xloc = (int)((xloc % 100) + m_autoMappingX); - yloc = (int)((yloc % 100) + m_autoMappingY); + xloc = (uint)((xloc % 100) + m_autoMappingX); + yloc = (uint)((yloc % 100) + m_autoMappingY); } if (((realXLoc == 0) && (realYLoc == 0)) || (((realXLoc - xloc < 3896) || (xloc - realXLoc < 3896)) && ((realYLoc - yloc < 3896) || (yloc - realYLoc < 3896)))) { - xloc = xloc * (int)Constants.RegionSize; - yloc = yloc * (int)Constants.RegionSize; + xloc = Util.RegionToWorldLoc(xloc); + yloc = Util.RegionToWorldLoc(yloc); string reason = string.Empty; - if (TryCreateLink(UUID.Zero, xloc, yloc, string.Empty, externalPort, externalHostName, UUID.Zero, out regInfo, out reason)) + if (TryCreateLink(UUID.Zero, (int)xloc, (int)yloc, + string.Empty, externalPort, externalHostName, UUID.Zero, out regInfo, out reason)) { regInfo.RegionName = config.GetString("localName", ""); } diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index 19ea0fe..1119e48 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs @@ -179,14 +179,14 @@ namespace OpenSim.Services.Interfaces protected IPEndPoint m_internalEndPoint; /// - /// The co-ordinate of this region. + /// The co-ordinate of this region in region units. /// - public int RegionCoordX { get { return RegionLocX / (int)Constants.RegionSize; } } + public int RegionCoordX { get { return (int)Util.WorldToRegionLoc((uint)RegionLocX); } } /// - /// The co-ordinate of this region + /// The co-ordinate of this region in region units /// - public int RegionCoordY { get { return RegionLocY / (int)Constants.RegionSize; } } + public int RegionCoordY { get { return (int)Util.WorldToRegionLoc((uint)RegionLocY); } } /// /// The location of this region in meters. @@ -265,8 +265,8 @@ namespace OpenSim.Services.Interfaces public GridRegion(uint xcell, uint ycell) { - m_regionLocX = (int)(xcell * Constants.RegionSize); - m_regionLocY = (int)(ycell * Constants.RegionSize); + m_regionLocX = (int)Util.RegionToWorldLoc(xcell); + m_regionLocY = (int)Util.RegionToWorldLoc(ycell); RegionSizeX = (int)Constants.RegionSize; RegionSizeY = (int)Constants.RegionSize; } @@ -274,8 +274,8 @@ namespace OpenSim.Services.Interfaces public GridRegion(RegionInfo ConvertFrom) { m_regionName = ConvertFrom.RegionName; - m_regionLocX = (int)(ConvertFrom.RegionLocX * Constants.RegionSize); - m_regionLocY = (int)(ConvertFrom.RegionLocY * Constants.RegionSize); + m_regionLocX = (int)(ConvertFrom.WorldLocX); + m_regionLocY = (int)(ConvertFrom.WorldLocY); RegionSizeX = (int)ConvertFrom.RegionSizeX; RegionSizeY = (int)ConvertFrom.RegionSizeY; m_internalEndPoint = ConvertFrom.InternalEndPoint; diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index f641955..da351b9 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs @@ -368,7 +368,8 @@ namespace OpenSim.Services.LLLoginService private void FillOutHomeData(GridUserInfo pinfo, GridRegion home) { - int x = 1000 * (int)Constants.RegionSize, y = 1000 * (int)Constants.RegionSize; + int x = (int)Util.RegionToWorldLoc(1000); + int y = (int)Util.RegionToWorldLoc(1000); if (home != null) { x = home.RegionLocX; @@ -443,10 +444,23 @@ namespace OpenSim.Services.LLLoginService ErrorReason = "key"; welcomeMessage = "Welcome to OpenSim!"; seedCapability = String.Empty; - home = "{'region_handle':[r" + (1000*Constants.RegionSize).ToString() + ",r" + (1000*Constants.RegionSize).ToString() + "], 'position':[r" + - userProfile.homepos.X.ToString() + ",r" + userProfile.homepos.Y.ToString() + ",r" + - userProfile.homepos.Z.ToString() + "], 'look_at':[r" + userProfile.homelookat.X.ToString() + ",r" + - userProfile.homelookat.Y.ToString() + ",r" + userProfile.homelookat.Z.ToString() + "]}"; + home = "{'region_handle':[" + + "r" + Util.RegionToWorldLoc(1000).ToString() + + "," + + "r" + Util.RegionToWorldLoc(1000).ToString() + + "], 'position':[" + + "r" + userProfile.homepos.X.ToString() + + "," + + "r" + userProfile.homepos.Y.ToString() + + "," + + "r" + userProfile.homepos.Z.ToString() + + "], 'look_at':[" + + "r" + userProfile.homelookat.X.ToString() + + "," + + "r" + userProfile.homelookat.Y.ToString() + + "," + + "r" + userProfile.homelookat.Z.ToString() + + "]}"; lookAt = "[r0.99949799999999999756,r0.03166859999999999814,r0]"; RegionX = (uint) 255232; RegionY = (uint) 254976; diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 1c1c9b0..c833131 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -695,7 +695,7 @@ namespace OpenSim.Services.LLLoginService private GridRegion FindAlternativeRegion(UUID scopeID) { List hyperlinks = null; - List regions = m_GridService.GetFallbackRegions(scopeID, 1000 * (int)Constants.RegionSize, 1000 * (int)Constants.RegionSize); + List regions = m_GridService.GetFallbackRegions(scopeID, (int)Util.RegionToWorldLoc(1000), (int)Util.RegionToWorldLoc(1000)); if (regions != null && regions.Count > 0) { hyperlinks = m_GridService.GetHyperlinks(scopeID); -- cgit v1.1 From ce883e9b436a0d63cfe1d5c81f83477a266e727e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 26 Aug 2015 05:29:08 +0100 Subject: add more of the v03 checks and homeURL. Sending side only for now --- .../Connectors/Simulation/SimulationServiceConnector.cs | 8 ++++++-- OpenSim/Services/Interfaces/ISimulationService.cs | 14 +++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 0e74073..75c5b35 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -275,7 +275,7 @@ namespace OpenSim.Services.Connectors.Simulation /// /// - public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason) + public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string myversion, out string version, out string reason) { reason = "Failed to contact destination"; version = "Unknown"; @@ -286,10 +286,14 @@ namespace OpenSim.Services.Connectors.Simulation if (ext == null) return false; // Eventually, we want to use a caps url instead of the agentID - string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; + string uri = destination.ServerURI + AgentPath() + agentID + "/" + destination.RegionID.ToString() + "/"; OSDMap request = new OSDMap(); + request.Add("viaTeleport", OSD.FromBoolean(viaTeleport)); request.Add("position", OSD.FromString(position.ToString())); + request.Add("my_version", OSD.FromString(myversion)); + if (agentHomeURI != null) + request.Add("agent_home_uri", OSD.FromString(agentHomeURI)); try { diff --git a/OpenSim/Services/Interfaces/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs index 1c82b3e..b629177 100644 --- a/OpenSim/Services/Interfaces/ISimulationService.cs +++ b/OpenSim/Services/Interfaces/ISimulationService.cs @@ -75,7 +75,19 @@ namespace OpenSim.Services.Interfaces /// bool UpdateAgent(GridRegion destination, AgentPosition data); - bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason); + /// + /// Returns whether a propspective user is allowed to visit the region. + /// + /// Desired destination + /// The visitor's User ID + /// The visitor's Home URI. Will be missing (null) in older OpenSims. + /// True: via teleport; False: via cross (walking) + /// Position in the region + /// version that the requesting simulator is runing + /// version that the target simulator is running + /// [out] Optional error message + /// True: ok; False: not allowed + bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, out string version, out string reason); /// /// Message from receiving region to departing region, telling it got contacted by the client. -- cgit v1.1 From f2259d37e20bf4e654954b6caf78cf7776a17abd Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 28 Aug 2015 20:26:24 +0100 Subject: review gridservice module. Not merged os code for varsize, since that should be handle at db level --- OpenSim/Services/GridService/GridService.cs | 68 +++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index eb44dcb..6f610f8 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -56,6 +56,8 @@ namespace OpenSim.Services.GridService protected bool m_AllowDuplicateNames = false; protected bool m_AllowHypergridMapSearch = false; + private static Dictionary m_ExtraFeatures = new Dictionary(); + public GridService(IConfigSource config) : base(config) { @@ -128,6 +130,50 @@ namespace OpenSim.Services.GridService } } + private void SetExtraServiceURLs(IConfigSource config) + { + IConfig loginConfig = config.Configs["LoginService"]; + IConfig gridConfig = config.Configs["GridService"]; + + if (loginConfig == null || gridConfig == null) + return; + + string configVal; + + configVal = loginConfig.GetString("SearchURL", string.Empty); + if (!string.IsNullOrEmpty(configVal)) + m_ExtraFeatures["search-server-url"] = configVal; + + configVal = loginConfig.GetString("MapTileURL", string.Empty); + if (!string.IsNullOrEmpty(configVal)) + { + // This URL must end with '/', the viewer doesn't check + configVal = configVal.Trim(); + if (!configVal.EndsWith("/")) + configVal = configVal + "/"; + m_ExtraFeatures["map-server-url"] = configVal; + } + + configVal = loginConfig.GetString("DestinationGuide", string.Empty); + if (!string.IsNullOrEmpty(configVal)) + m_ExtraFeatures["destination-guide-url"] = configVal; + + configVal = Util.GetConfigVarFromSections( + config, "GatekeeperURI", new string[] { "Startup", "Hypergrid" }, String.Empty); + if (!string.IsNullOrEmpty(configVal)) + m_ExtraFeatures["GridURL"] = configVal; + + configVal = Util.GetConfigVarFromSections( + config, "GridName", new string[] { "Const", "Hypergrid" }, String.Empty); + if (string.IsNullOrEmpty(configVal)) + configVal = Util.GetConfigVarFromSections( + config, "gridname", new string[] { "GridInfo" }, String.Empty); + if (!string.IsNullOrEmpty(configVal)) + m_ExtraFeatures["GridName"] = configVal; + + m_ExtraFeatures["ExportSupported"] = gridConfig.GetString("ExportSupported", "true"); + } + #region IGridService public string RegisterRegion(UUID scopeID, GridRegion regionInfos) @@ -137,6 +183,8 @@ namespace OpenSim.Services.GridService if (regionInfos.RegionID == UUID.Zero) return "Invalid RegionID - cannot be zero UUID"; + // we should not need to check for overlaps + RegionData region = m_Database.Get(regionInfos.RegionLocX, regionInfos.RegionLocY, scopeID); if ((region != null) && (region.RegionID != regionInfos.RegionID)) { @@ -312,9 +360,15 @@ namespace OpenSim.Services.GridService if (region != null) { // Not really? Maybe? +/* this fails wiht var regions. My_sql db should now handle var regions List rdatas = m_Database.Get( region.posX - region.sizeX - 1, region.posY - region.sizeY - 1, region.posX + region.sizeX + 1, region.posY + region.sizeY + 1, scopeID); +*/ + // so send normal search area + List rdatas = m_Database.Get( + region.posX - 1, region.posY - 1, + region.posX + region.sizeX + 1, region.posY + region.sizeY + 1, scopeID); foreach (RegionData rdata in rdatas) { @@ -352,6 +406,7 @@ namespace OpenSim.Services.GridService // be the base coordinate of the region. // The snapping is technically unnecessary but is harmless because regions are always // multiples of the legacy region size (256). + public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) { int snapX = (int)(x / Constants.RegionSize) * (int)Constants.RegionSize; @@ -773,5 +828,18 @@ namespace OpenSim.Services.GridService m_Database.Store(r); } } + + /// + /// Gets the grid extra service URls we wish for the region to send in OpenSimExtras to dynamically refresh + /// parameters in the viewer used to access services like map, search and destination guides. + /// see "SimulatorFeaturesModule" + /// + /// + /// The grid extra service URls. + /// + public Dictionary GetExtraFeatures() + { + return m_ExtraFeatures; + } } } -- cgit v1.1 From ee4f61fe34b2ec716893c9bbb2899122054171f2 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 28 Aug 2015 20:49:29 +0100 Subject: review llLoginService for var support --- OpenSim/Services/LLLoginService/LLLoginService.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index c833131..b009e64 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -880,13 +880,6 @@ namespace OpenSim.Services.LLLoginService SetServiceURLs(aCircuit, account); return aCircuit; - - //m_UserAgentService.LoginAgentToGrid(aCircuit, GatekeeperServiceConnector, region, out reason); - //if (simConnector.CreateAgent(region, aCircuit, 0, out reason)) - // return aCircuit; - - //return null; - } private void SetServiceURLs(AgentCircuitData aCircuit, UserAccount account) @@ -921,7 +914,7 @@ namespace OpenSim.Services.LLLoginService if (!keyValue.EndsWith("/")) keyValue = keyValue + "/"; - if (!account.ServiceURLs.ContainsKey(keyName) || (account.ServiceURLs.ContainsKey(keyName) && account.ServiceURLs[keyName] != keyValue)) + if (!account.ServiceURLs.ContainsKey(keyName) || (account.ServiceURLs.ContainsKey(keyName) && (string)account.ServiceURLs[keyName] != keyValue)) { account.ServiceURLs[keyName] = keyValue; newUrls = true; -- cgit v1.1 From 46054d4f0258c8df91c2e0f081af2ea87375b515 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 28 Aug 2015 20:54:59 +0100 Subject: review ServiceBase for var --- OpenSim/Services/Base/ServiceBase.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Base/ServiceBase.cs b/OpenSim/Services/Base/ServiceBase.cs index ef30cba..22f27e0 100644 --- a/OpenSim/Services/Base/ServiceBase.cs +++ b/OpenSim/Services/Base/ServiceBase.cs @@ -26,6 +26,7 @@ */ using System; +using System.IO; using System.Collections.Generic; using System.Reflection; using log4net; @@ -45,9 +46,11 @@ namespace OpenSim.Services.Base public T LoadPlugin(string dllName, Object[] args) where T:class { - string[] parts = dllName.Split(new char[] {':'}); + string pathRoot = Path.GetPathRoot(dllName); + string noRoot = dllName.Substring(pathRoot.Length); + string[] parts = noRoot.Split(new char[] { ':' }); - dllName = parts[0]; + dllName = pathRoot + parts[0]; string className = String.Empty; -- cgit v1.1 From ecfd442c9bd7cbcfbe076855abd11e8565e4665c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 30 Aug 2015 11:02:59 +0100 Subject: cache in memory water texture --- .../Services/MapImageService/MapImageService.cs | 138 ++++++++++++++++----- 1 file changed, 105 insertions(+), 33 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/MapImageService/MapImageService.cs b/OpenSim/Services/MapImageService/MapImageService.cs index 4887d1c..2db1d14 100644 --- a/OpenSim/Services/MapImageService/MapImageService.cs +++ b/OpenSim/Services/MapImageService/MapImageService.cs @@ -36,6 +36,7 @@ using System.Drawing.Imaging; using System.IO; using System.Net; using System.Reflection; +using System.Threading; using Nini.Config; using log4net; @@ -65,6 +66,8 @@ namespace OpenSim.Services.MapImageService private static bool m_Initialized = false; private static string m_WaterTileFile = string.Empty; private static Color m_Watercolor = Color.FromArgb(29, 71, 95); + private static Bitmap m_WaterBitmap = null; + private static byte[] m_WaterBytes = null; public MapImageService(IConfigSource config) { @@ -87,6 +90,18 @@ namespace OpenSim.Services.MapImageService Bitmap waterTile = new Bitmap(IMAGE_WIDTH, IMAGE_WIDTH); FillImage(waterTile, m_Watercolor); waterTile.Save(m_WaterTileFile, ImageFormat.Jpeg); + m_WaterBitmap = waterTile; + } + + if (File.Exists(m_WaterTileFile)) + { + m_WaterBitmap = new Bitmap(m_WaterTileFile); + using (MemoryStream ms = new MemoryStream()) + { + m_WaterBitmap.Save(ms,ImageFormat.Jpeg); + ms.Seek(0, SeekOrigin.Begin); + m_WaterBytes = ms.ToArray(); + } } } } @@ -139,30 +154,82 @@ namespace OpenSim.Services.MapImageService return UpdateMultiResolutionFiles(x, y, scopeID, out reason); } + // When large varregions start up, they can send piles of new map tiles. This causes + // this multi-resolution routine to be called a zillion times an causes much CPU + // time to be spent creating multi-resolution tiles that will be replaced when + // the next maptile arrives. + private class mapToMultiRez + { + public int xx; + public int yy; + public UUID scopeID; + public mapToMultiRez(int pX, int pY, UUID pscopeID) + { + xx = pX; + yy = pY; + scopeID = pscopeID; + } + }; + private Queue multiRezToBuild = new Queue(); + private bool UpdateMultiResolutionFiles(int x, int y, UUID scopeID, out string reason) { reason = String.Empty; - lock (m_Sync) + + lock (multiRezToBuild) { - // Stitch seven more aggregate tiles together - for (uint zoomLevel = 2; zoomLevel <= ZOOM_LEVELS; zoomLevel++) - { - // Calculate the width (in full resolution tiles) and bottom-left - // corner of the current zoom level - int width = (int)Math.Pow(2, (double)(zoomLevel - 1)); - int x1 = x - (x % width); - int y1 = y - (y % width); + // m_log.DebugFormat("{0} UpdateMultiResolutionFilesAsync: scheduling update for <{1},{2}>", LogHeader, x, y); + multiRezToBuild.Enqueue(new mapToMultiRez(x, y, scopeID)); + if (multiRezToBuild.Count == 1) + Util.FireAndForget( + DoUpdateMultiResolutionFilesAsync); + } + + return true; + } - if (!CreateTile(zoomLevel, x1, y1, scopeID)) + private void DoUpdateMultiResolutionFilesAsync(object o) + { + // let acumulate large region tiles + Thread.Sleep(60 * 1000); // large regions take time to upload tiles + + while (multiRezToBuild.Count > 0) + { + mapToMultiRez toMultiRez = null; + lock (multiRezToBuild) + { + if (multiRezToBuild.Count > 0) + toMultiRez = multiRezToBuild.Dequeue(); + } + if (toMultiRez != null) + { + int x = toMultiRez.xx; + int y = toMultiRez.yy; + UUID scopeID = toMultiRez.scopeID; + // m_log.DebugFormat("{0} DoUpdateMultiResolutionFilesAsync: doing build for <{1},{2}>", LogHeader, x, y); + + int width = 1; + // Stitch seven more aggregate tiles together + for (uint zoomLevel = 2; zoomLevel <= ZOOM_LEVELS; zoomLevel++) { - m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to create tile for {0},{1} at zoom level {1}", x, y, zoomLevel); - reason = string.Format("Map tile at zoom level {0} failed", zoomLevel); - return false; + // Calculate the width (in full resolution tiles) and bottom-left + // corner of the current zoom level + width *= 2; + int x1 = x - (x % width); + int y1 = y - (y % width); + + lock (m_Sync) // must lock the reading and writing of the maptile files + { + if (!CreateTile(zoomLevel, x1, y1, scopeID)) + { + m_log.WarnFormat("[MAP IMAGE SERVICE]: Unable to create tile for {0},{1} at zoom level {1}", x, y, zoomLevel); + return; + } + } } } } - - return true; + return; } public byte[] GetMapTile(string fileName, UUID scopeID, out string format) @@ -178,9 +245,9 @@ namespace OpenSim.Services.MapImageService //m_log.DebugFormat("[MAP IMAGE SERVICE]: Found file {0}, extension {1}", fileName, format); return File.ReadAllBytes(fullName); } - else if (File.Exists(m_WaterTileFile)) + else if (m_WaterBytes != null) { - return File.ReadAllBytes(m_WaterTileFile); + return (byte[])m_WaterBytes.Clone(); } else { @@ -226,7 +293,7 @@ namespace OpenSim.Services.MapImageService { // Create a new output tile with a transparent background Bitmap bm = new Bitmap(IMAGE_WIDTH, IMAGE_WIDTH, PixelFormat.Format24bppRgb); - bm.MakeTransparent(); + //bm.MakeTransparent(); // 24bpp does not have transparency, this whould make it 32bpp return bm; } } @@ -260,48 +327,53 @@ namespace OpenSim.Services.MapImageService // Open the output tile (current zoom level) string outputFile = GetFileName(zoomLevel, xOut, yOut, scopeID); - Bitmap output = GetOutputTileImage(outputFile); - if (output == null) - return false; - FillImage(output, m_Watercolor); + + int ntiles = 0; + Bitmap output = (Bitmap)m_WaterBitmap.Clone(); if (inputBL != null) { ImageCopyResampled(output, inputBL, 0, HALF_WIDTH, 0, 0); inputBL.Dispose(); + ntiles++; } if (inputBR != null) { ImageCopyResampled(output, inputBR, HALF_WIDTH, HALF_WIDTH, 0, 0); inputBR.Dispose(); + ntiles++; } if (inputTL != null) { ImageCopyResampled(output, inputTL, 0, 0, 0, 0); inputTL.Dispose(); + ntiles++; } if (inputTR != null) { ImageCopyResampled(output, inputTR, HALF_WIDTH, 0, 0, 0); inputTR.Dispose(); + ntiles++; } // Write the modified output - try + if (ntiles == 0) + File.Delete(outputFile); + + else { - using (Bitmap final = new Bitmap(output)) + + try { - output.Dispose(); - final.Save(outputFile, ImageFormat.Jpeg); + output.Save(outputFile, ImageFormat.Jpeg); } - } - catch (Exception e) - { - m_log.WarnFormat("[MAP IMAGE SERVICE]: Oops on saving {0} {1}", outputFile, e); - } - - // Save also as png? + catch (Exception e) + { + m_log.WarnFormat("[MAP IMAGE SERVICE]: Oops on saving {0} {1}", outputFile, e); + } + } // Save also as png? + output.Dispose(); return true; } -- cgit v1.1