From c63369017f0ac8e204f79978f20d5c2abdf5bef2 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Sat, 15 Dec 2007 19:42:23 +0000 Subject: * Make inventory operations sync rather than async. This is to alleviate race conditions such as that in mantis #190 * Make inventory messages more verbose. Hopefully they aren't now too verbose * This may resolve some grid instability but it's likely there's much more out there. --- .../Grid/InventoryServer/GridInventoryService.cs | 36 +++++++++++++++++++--- OpenSim/Grid/UserServer/UserLoginService.cs | 14 ++++++--- 2 files changed, 40 insertions(+), 10 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/InventoryServer/GridInventoryService.cs b/OpenSim/Grid/InventoryServer/GridInventoryService.cs index 6ae1d82..150a262 100644 --- a/OpenSim/Grid/InventoryServer/GridInventoryService.cs +++ b/OpenSim/Grid/InventoryServer/GridInventoryService.cs @@ -31,6 +31,7 @@ using System.Collections.Generic; using System.Text; using OpenSim.Framework; using OpenSim.Framework.Communications; +using OpenSim.Framework.Console; using libsecondlife; namespace OpenSim.Grid.InventoryServer @@ -105,9 +106,10 @@ namespace OpenSim.Grid.InventoryServer public InventoryCollection GetUserInventory(Guid rawUserID) { - Console.WriteLine("Request for Inventory for " + rawUserID.ToString()); LLUUID userID = new LLUUID(rawUserID); + MainLog.Instance.Verbose("INVENTORY", "Request for inventory for " + userID.ToStringHyphenated()); + InventoryCollection invCollection = new InventoryCollection(); List folders; List allItems; @@ -124,7 +126,9 @@ namespace OpenSim.Grid.InventoryServer { LLUUID userID = new LLUUID(rawUserID); - Console.WriteLine("Creating New Set of Inventory Folders for " + userID.ToStringHyphenated()); + MainLog.Instance.Verbose( + "INVENTORY", "Creating new set of inventory folders for " + userID.ToStringHyphenated()); + CreateNewUserInventory(userID); return true; } @@ -145,27 +149,49 @@ namespace OpenSim.Grid.InventoryServer AddItem(item); } - public bool AddInventoryFolder( InventoryFolderBase folder) + public bool AddInventoryFolder(InventoryFolderBase folder) { + // Right now, this actions act more like an update/insert combination than a simple create. + MainLog.Instance.Verbose( + "INVENTORY", + "Updating in " + folder.parentID.ToStringHyphenated() + + ", folder " + folder.name); + AddNewInventoryFolder(folder.agentID, folder); return true; } public bool MoveInventoryFolder(InventoryFolderBase folder) - { + { + MainLog.Instance.Verbose( + "INVENTORY", + "Moving folder " + folder.folderID + + " to " + folder.parentID.ToStringHyphenated()); + MoveExistingInventoryFolder(folder); return true; } public bool AddInventoryItem( InventoryItemBase item) { - Console.WriteLine("creating new item for " + item.avatarID.ToString()); + // Right now, this actions act more like an update/insert combination than a simple create. + MainLog.Instance.Verbose( + "INVENTORY", + "Updating in " + item.parentFolderID.ToStringHyphenated() + + ", item " + item.inventoryName); + AddNewInventoryItem(item.avatarID, item); return true; } public override void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) { + // extra spaces to align with other inventory messages + MainLog.Instance.Verbose( + "INVENTORY", + "Deleting in " + item.parentFolderID.ToStringHyphenated() + + ", item " + item.inventoryName); + DeleteItem(item); } diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index 02db6d0..ccba1de 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs @@ -60,7 +60,7 @@ namespace OpenSim.Grid.UserServer public override void CustomiseResponse(LoginResponse response, UserProfileData theUser) { bool tryDefault = false; - System.Console.WriteLine("Load information from the gridserver"); + MainLog.Instance.Verbose("LOGIN", "Load information from the gridserver"); RegionProfileData SimInfo = new RegionProfileData(); try { @@ -69,7 +69,7 @@ namespace OpenSim.Grid.UserServer m_config.GridSendKey, m_config.GridRecvKey); // Customise the response - System.Console.WriteLine("Home Location"); + MainLog.Instance.Verbose("LOGIN", "Home Location"); response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * 256).ToString() + ",r" + (SimInfo.regionLocY * 256).ToString() + "], " + "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + @@ -128,7 +128,11 @@ namespace OpenSim.Grid.UserServer // Load information from the gridserver ulong defaultHandle = (((ulong)m_config.DefaultX * 256) << 32) | ((ulong) m_config.DefaultY * 256); - MainLog.Instance.Warn("Home region not available: sending to default region " + defaultHandle.ToString()); + + MainLog.Instance.Warn( + "LOGIN", + "Home region not available: sending to default region " + defaultHandle.ToString()); + SimInfo = new RegionProfileData(); try { @@ -137,7 +141,7 @@ namespace OpenSim.Grid.UserServer m_config.GridSendKey, m_config.GridRecvKey); // Customise the response - System.Console.WriteLine("Home Location"); + MainLog.Instance.Verbose("LOGIN", "Home Location"); response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * 256).ToString() + ",r" + (SimInfo.regionLocY * 256).ToString() + "], " + "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + @@ -189,7 +193,7 @@ namespace OpenSim.Grid.UserServer catch (Exception e) { MainLog.Instance.Warn("LOGIN", "Default region also not available"); - MainLog.Instance.Verbose("LOGIN", e.ToString()); + MainLog.Instance.Warn("LOGIN", e.ToString()); } } -- cgit v1.1