From e31e7c68c8abfd61fed6dabac5403d8adf42ae87 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 23 Apr 2012 15:27:04 +0300 Subject: [PATCH 1/9] Log the full exception when errors occur in BaseHttpServer --- .../Servers/HttpServer/BaseHttpServer.cs | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 0fbf90aac4..7d31a89126 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -356,7 +356,7 @@ namespace OpenSim.Framework.Servers.HttpServer } catch (Exception e) { - m_log.ErrorFormat("[BASE HTTP SERVER]: OnRequest() failed with {0}{1}", e.Message, e.StackTrace); + m_log.Error(String.Format("[BASE HTTP SERVER]: OnRequest() failed: {0}", e.Message), e); } } @@ -551,11 +551,11 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); + m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e.Message), e); } catch (IOException e) { - m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message); + m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.", e.Message), e); } return; @@ -658,15 +658,15 @@ namespace OpenSim.Framework.Servers.HttpServer // // An alternative may be to turn off all response write exceptions on the HttpListener, but let's go // with the minimum first - m_log.WarnFormat("[BASE HTTP SERVER]: HandleRequest threw {0}.\nNOTE: this may be spurious on Linux", e); + m_log.Warn(String.Format("[BASE HTTP SERVER]: HandleRequest threw {0}.\nNOTE: this may be spurious on Linux", e.Message), e); } catch (IOException e) { - m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}{1}", e.Message, e.StackTrace); + m_log.Error(String.Format("[BASE HTTP SERVER]: HandleRequest() threw {0}", e.Message), e); } catch (Exception e) { - m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}{1}", e.Message, e.StackTrace); + m_log.Error(String.Format("[BASE HTTP SERVER]: HandleRequest() threw {0}", e.Message), e); SendHTML500(response); } finally @@ -925,11 +925,11 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); + m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e.Message), e); } catch (IOException e) { - m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message); + m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}", e.Message), e); } } return; @@ -962,11 +962,11 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); + m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e.Message), e); } catch (IOException e) { - m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message); + m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}", e.Message), e); } } } @@ -1077,12 +1077,12 @@ namespace OpenSim.Framework.Servers.HttpServer } catch (IOException e) { - m_log.WarnFormat("[BASE HTTP SERVER]: LLSD IOException {0}.", e); + m_log.Warn(String.Format("[BASE HTTP SERVER]: LLSD IOException {0}", e.Message), e); } catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.WarnFormat("[BASE HTTP SERVER]: LLSD issue {0}.\nNOTE: this may be spurious on Linux.", e); + m_log.Warn(String.Format("[BASE HTTP SERVER]: LLSD issue {0}.\nNOTE: this may be spurious on Linux.", e.Message), e); } } } @@ -1334,8 +1334,8 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException f) { // This has to be here to prevent a Linux/Mono crash - m_log.WarnFormat( - "[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", f); + m_log.Warn( + String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", f.Message), f); } } catch(Exception) @@ -1630,11 +1630,11 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); + m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e.Message), e); } catch (IOException e) { - m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message); + m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}", e.Message), e); } } } @@ -1671,7 +1671,7 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); + m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e.Message), e); } } } @@ -1707,7 +1707,7 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); + m_log.Warn(String.Format("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e.Message), e); } } } @@ -1786,7 +1786,7 @@ namespace OpenSim.Framework.Servers.HttpServer public void httpServerException(object source, Exception exception) { - m_log.ErrorFormat("[BASE HTTP SERVER]: {0} had an exception {1}", source.ToString(), exception.ToString()); + m_log.Error(String.Format("[BASE HTTP SERVER]: {0} had an exception: {1}", source.ToString(), exception.Message), exception); /* if (HTTPDRunning)// && NotSocketErrors > 5) { From d25469f66e0f78f42cc6b77b169047e451e11bdb Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 27 Apr 2012 23:38:25 +0100 Subject: [PATCH 2/9] Add flags information (phantom, physics, etc.) to "show object" and "show part" console commands --- .../CoreModules/World/Objects/Commands/ObjectCommandsModule.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs index 06fea58ea3..8da913954e 100644 --- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs @@ -271,6 +271,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands sb.AppendFormat("Description: {0}\n", so.Description); sb.AppendFormat("Location: {0} @ {1}\n", so.AbsolutePosition, so.Scene.RegionInfo.RegionName); sb.AppendFormat("Parts: {0}\n", so.PrimCount); + sb.AppendFormat("Flags: {0}\n", so.RootPart.Flags); return sb; } @@ -283,6 +284,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands sb.AppendFormat("Parent: {0}", sop.IsRoot ? "Is Root\n" : string.Format("{0} {1}\n", sop.ParentGroup.Name, sop.ParentGroup.UUID)); sb.AppendFormat("Link number: {0}\n", sop.LinkNum); + sb.AppendFormat("Flags: {0}\n", sop.Flags); return sb; } From a90b0e302c110068cec0ee7109e796d2d5fdab4d Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 27 Apr 2012 23:46:33 +0100 Subject: [PATCH 3/9] Revert "Implement bulk inventory update over CAPS (not recursive by design," This reverts commit 6e7f13a72d4e43f8ca564247e0b56bf5706bbdb1. --- .../ClientStack/Linden/UDP/LLClientView.cs | 48 +------------------ 1 file changed, 1 insertion(+), 47 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index ae5cbfff55..36ef28162b 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -12296,7 +12296,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP ItemData.Add(ItemDataMap); } - llsd.Add("InventoryData", ItemData); + llsd.Add("ItemData", ItemData); eq.Enqueue(BuildEvent("RemoveInventoryItem", llsd), AgentId); @@ -12340,14 +12340,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP llsd), AgentId); } - private byte[] EncodeU32(uint val) - { - byte[] ret = BitConverter.GetBytes(val); - if (BitConverter.IsLittleEndian) - Array.Reverse(ret); - return ret; - } - public void SendBulkUpdateInventory(InventoryFolderBase[] folders, InventoryItemBase[] items) { IEventQueue eq = Scene.RequestModuleInterface(); @@ -12363,7 +12355,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP OSDMap AgentDataMap = new OSDMap(1); AgentDataMap.Add("AgentID", OSD.FromUUID(AgentId)); AgentDataMap.Add("SessionID", OSD.FromUUID(SessionId)); - AgentDataMap.Add("TransactionID", OSD.FromUUID(UUID.Random())); OSDArray AgentData = new OSDArray(1); AgentData.Add(AgentDataMap); @@ -12391,47 +12382,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP foreach (InventoryItemBase item in items) { OSDMap ItemDataMap = new OSDMap(); - - ItemDataMap.Add("ItemID", OSD.FromUUID(item.ID)); - ItemDataMap.Add("FolderID", OSD.FromUUID(item.Folder)); - - ItemDataMap.Add("CreatorID", OSD.FromUUID(item.CreatorIdAsUuid)); - ItemDataMap.Add("OwnerID", OSD.FromUUID(item.Owner)); - ItemDataMap.Add("GroupID", OSD.FromUUID(item.GroupID)); - ItemDataMap.Add("BaseMask", OSD.FromBinary(EncodeU32((uint)item.BasePermissions))); - ItemDataMap.Add("OwnerMask", OSD.FromBinary(EncodeU32((uint)item.CurrentPermissions))); - ItemDataMap.Add("GroupMask", OSD.FromBinary(EncodeU32((uint)item.GroupPermissions))); - ItemDataMap.Add("EveryoneMask", OSD.FromBinary(EncodeU32((uint)item.EveryOnePermissions))); - ItemDataMap.Add("NextOwnerMask", OSD.FromBinary(EncodeU32((uint)item.NextPermissions))); - ItemDataMap.Add("GroupOwned", OSD.FromBoolean(item.GroupOwned)); - ItemDataMap.Add("AssetID", OSD.FromUUID(item.AssetID)); - ItemDataMap.Add("Type", OSD.FromInteger(item.AssetType)); - ItemDataMap.Add("InvType", OSD.FromInteger(item.InvType)); - ItemDataMap.Add("Flags", OSD.FromBinary(EncodeU32((uint)item.Flags))); - ItemDataMap.Add("SaleType", OSD.FromInteger((byte)item.SaleType)); - ItemDataMap.Add("SalePrice", OSD.FromInteger(item.SalePrice)); - ItemDataMap.Add("Name", OSD.FromString(item.Name)); - ItemDataMap.Add("Description", OSD.FromString(item.Description)); - ItemDataMap.Add("CreationDate", OSD.FromInteger(item.CreationDate)); - - ItemDataMap.Add("CRC", OSD.FromBinary(EncodeU32( - Helpers.InventoryCRC(1000, 0, (sbyte)item.InvType, - (sbyte)item.AssetType, item.AssetID, - item.GroupID, 100, - item.Owner, item.CreatorIdAsUuid, - item.ID, item.Folder, - (uint)PermissionMask.All, 1, (uint)PermissionMask.All, (uint)PermissionMask.All, - (uint)PermissionMask.All) - ))); - ItemDataMap.Add("CallbackID", 0); - ItemData.Add(ItemDataMap); } llsd.Add("ItemData", ItemData); - - eq.Enqueue(BuildEvent("BulkUpdateInventory", - llsd), AgentId); } } } From 737e1771635061c1f7104499d282bcc279823f98 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 27 Apr 2012 23:46:46 +0100 Subject: [PATCH 4/9] Revert "Log the full exception when errors occur in BaseHttpServer" This reverts commit e31e7c68c8abfd61fed6dabac5403d8adf42ae87. Applied for patch assessment and accidentally committed too early. --- .../Servers/HttpServer/BaseHttpServer.cs | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 7d31a89126..0fbf90aac4 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -356,7 +356,7 @@ namespace OpenSim.Framework.Servers.HttpServer } catch (Exception e) { - m_log.Error(String.Format("[BASE HTTP SERVER]: OnRequest() failed: {0}", e.Message), e); + m_log.ErrorFormat("[BASE HTTP SERVER]: OnRequest() failed with {0}{1}", e.Message, e.StackTrace); } } @@ -551,11 +551,11 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e.Message), e); + m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); } catch (IOException e) { - m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.", e.Message), e); + m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message); } return; @@ -658,15 +658,15 @@ namespace OpenSim.Framework.Servers.HttpServer // // An alternative may be to turn off all response write exceptions on the HttpListener, but let's go // with the minimum first - m_log.Warn(String.Format("[BASE HTTP SERVER]: HandleRequest threw {0}.\nNOTE: this may be spurious on Linux", e.Message), e); + m_log.WarnFormat("[BASE HTTP SERVER]: HandleRequest threw {0}.\nNOTE: this may be spurious on Linux", e); } catch (IOException e) { - m_log.Error(String.Format("[BASE HTTP SERVER]: HandleRequest() threw {0}", e.Message), e); + m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}{1}", e.Message, e.StackTrace); } catch (Exception e) { - m_log.Error(String.Format("[BASE HTTP SERVER]: HandleRequest() threw {0}", e.Message), e); + m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}{1}", e.Message, e.StackTrace); SendHTML500(response); } finally @@ -925,11 +925,11 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e.Message), e); + m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); } catch (IOException e) { - m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}", e.Message), e); + m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message); } } return; @@ -962,11 +962,11 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e.Message), e); + m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); } catch (IOException e) { - m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}", e.Message), e); + m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message); } } } @@ -1077,12 +1077,12 @@ namespace OpenSim.Framework.Servers.HttpServer } catch (IOException e) { - m_log.Warn(String.Format("[BASE HTTP SERVER]: LLSD IOException {0}", e.Message), e); + m_log.WarnFormat("[BASE HTTP SERVER]: LLSD IOException {0}.", e); } catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.Warn(String.Format("[BASE HTTP SERVER]: LLSD issue {0}.\nNOTE: this may be spurious on Linux.", e.Message), e); + m_log.WarnFormat("[BASE HTTP SERVER]: LLSD issue {0}.\nNOTE: this may be spurious on Linux.", e); } } } @@ -1334,8 +1334,8 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException f) { // This has to be here to prevent a Linux/Mono crash - m_log.Warn( - String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", f.Message), f); + m_log.WarnFormat( + "[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", f); } } catch(Exception) @@ -1630,11 +1630,11 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e.Message), e); + m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); } catch (IOException e) { - m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}", e.Message), e); + m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message); } } } @@ -1671,7 +1671,7 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e.Message), e); + m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); } } } @@ -1707,7 +1707,7 @@ namespace OpenSim.Framework.Servers.HttpServer catch (SocketException e) { // This has to be here to prevent a Linux/Mono crash - m_log.Warn(String.Format("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e.Message), e); + m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); } } } @@ -1786,7 +1786,7 @@ namespace OpenSim.Framework.Servers.HttpServer public void httpServerException(object source, Exception exception) { - m_log.Error(String.Format("[BASE HTTP SERVER]: {0} had an exception: {1}", source.ToString(), exception.Message), exception); + m_log.ErrorFormat("[BASE HTTP SERVER]: {0} had an exception {1}", source.ToString(), exception.ToString()); /* if (HTTPDRunning)// && NotSocketErrors > 5) { From ab71779221d580410e8b1c07e94f89ca933f9855 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 27 Apr 2012 23:54:45 +0100 Subject: [PATCH 5/9] Revert "Revert "Implement bulk inventory update over CAPS (not recursive by design,"" This reverts commit a90b0e302c110068cec0ee7109e796d2d5fdab4d. Sorry, accidentally reverted this completely by mistake, reverting the revert. --- .../ClientStack/Linden/UDP/LLClientView.cs | 48 ++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 36ef28162b..ae5cbfff55 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -12296,7 +12296,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP ItemData.Add(ItemDataMap); } - llsd.Add("ItemData", ItemData); + llsd.Add("InventoryData", ItemData); eq.Enqueue(BuildEvent("RemoveInventoryItem", llsd), AgentId); @@ -12340,6 +12340,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP llsd), AgentId); } + private byte[] EncodeU32(uint val) + { + byte[] ret = BitConverter.GetBytes(val); + if (BitConverter.IsLittleEndian) + Array.Reverse(ret); + return ret; + } + public void SendBulkUpdateInventory(InventoryFolderBase[] folders, InventoryItemBase[] items) { IEventQueue eq = Scene.RequestModuleInterface(); @@ -12355,6 +12363,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OSDMap AgentDataMap = new OSDMap(1); AgentDataMap.Add("AgentID", OSD.FromUUID(AgentId)); AgentDataMap.Add("SessionID", OSD.FromUUID(SessionId)); + AgentDataMap.Add("TransactionID", OSD.FromUUID(UUID.Random())); OSDArray AgentData = new OSDArray(1); AgentData.Add(AgentDataMap); @@ -12382,10 +12391,47 @@ namespace OpenSim.Region.ClientStack.LindenUDP foreach (InventoryItemBase item in items) { OSDMap ItemDataMap = new OSDMap(); + + ItemDataMap.Add("ItemID", OSD.FromUUID(item.ID)); + ItemDataMap.Add("FolderID", OSD.FromUUID(item.Folder)); + + ItemDataMap.Add("CreatorID", OSD.FromUUID(item.CreatorIdAsUuid)); + ItemDataMap.Add("OwnerID", OSD.FromUUID(item.Owner)); + ItemDataMap.Add("GroupID", OSD.FromUUID(item.GroupID)); + ItemDataMap.Add("BaseMask", OSD.FromBinary(EncodeU32((uint)item.BasePermissions))); + ItemDataMap.Add("OwnerMask", OSD.FromBinary(EncodeU32((uint)item.CurrentPermissions))); + ItemDataMap.Add("GroupMask", OSD.FromBinary(EncodeU32((uint)item.GroupPermissions))); + ItemDataMap.Add("EveryoneMask", OSD.FromBinary(EncodeU32((uint)item.EveryOnePermissions))); + ItemDataMap.Add("NextOwnerMask", OSD.FromBinary(EncodeU32((uint)item.NextPermissions))); + ItemDataMap.Add("GroupOwned", OSD.FromBoolean(item.GroupOwned)); + ItemDataMap.Add("AssetID", OSD.FromUUID(item.AssetID)); + ItemDataMap.Add("Type", OSD.FromInteger(item.AssetType)); + ItemDataMap.Add("InvType", OSD.FromInteger(item.InvType)); + ItemDataMap.Add("Flags", OSD.FromBinary(EncodeU32((uint)item.Flags))); + ItemDataMap.Add("SaleType", OSD.FromInteger((byte)item.SaleType)); + ItemDataMap.Add("SalePrice", OSD.FromInteger(item.SalePrice)); + ItemDataMap.Add("Name", OSD.FromString(item.Name)); + ItemDataMap.Add("Description", OSD.FromString(item.Description)); + ItemDataMap.Add("CreationDate", OSD.FromInteger(item.CreationDate)); + + ItemDataMap.Add("CRC", OSD.FromBinary(EncodeU32( + Helpers.InventoryCRC(1000, 0, (sbyte)item.InvType, + (sbyte)item.AssetType, item.AssetID, + item.GroupID, 100, + item.Owner, item.CreatorIdAsUuid, + item.ID, item.Folder, + (uint)PermissionMask.All, 1, (uint)PermissionMask.All, (uint)PermissionMask.All, + (uint)PermissionMask.All) + ))); + ItemDataMap.Add("CallbackID", 0); + ItemData.Add(ItemDataMap); } llsd.Add("ItemData", ItemData); + + eq.Enqueue(BuildEvent("BulkUpdateInventory", + llsd), AgentId); } } } From 2bad430ed860987f82e9f074b2a467749d9fddc6 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Sat, 28 Apr 2012 00:08:04 +0100 Subject: [PATCH 6/9] Put scene object related console commands into new "Objects" help category rather than "Regions" --- OpenSim/Region/Application/OpenSim.cs | 8 +++---- .../Objects/Commands/ObjectCommandsModule.cs | 22 +++++++++++-------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 59b6b2197e..4ec64eeb55 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -225,7 +225,7 @@ namespace OpenSim /// private void RegisterConsoleCommands() { - m_console.Commands.AddCommand("Regions", false, "force update", + m_console.Commands.AddCommand("Objects", false, "force update", "force update", "Force the update of all objects on clients", HandleForceUpdate); @@ -306,7 +306,7 @@ namespace OpenSim + " If this is not given then the oar is saved to region.oar in the current directory.", SaveOar); - m_console.Commands.AddCommand("Regions", false, "edit scale", + m_console.Commands.AddCommand("Objects", false, "edit scale", "edit scale ", "Change the scale of a named prim", HandleEditScale); @@ -349,7 +349,7 @@ namespace OpenSim "show ratings", "Show rating data", HandleShow); - m_console.Commands.AddCommand("Regions", false, "backup", + m_console.Commands.AddCommand("Objects", false, "backup", "backup", "Persist currently unsaved object changes immediately instead of waiting for the normal persistence call.", RunCommand); @@ -410,7 +410,7 @@ namespace OpenSim "modules unload ", "Unload a module", HandleModules); - m_console.Commands.AddCommand("Regions", false, "kill uuid", + m_console.Commands.AddCommand("Objects", false, "kill uuid", "kill uuid ", "Kill an object by UUID", KillUUID); } diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs index 8da913954e..5e928f3e8f 100644 --- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs @@ -78,45 +78,49 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands m_scene = scene; m_console = MainConsole.Instance; - m_console.Commands.AddCommand("Regions", false, "delete object owner", + m_console.Commands.AddCommand("Objects", false, "delete object owner", "delete object owner ", "Delete a scene object by owner", HandleDeleteObject); - m_console.Commands.AddCommand("Regions", false, "delete object creator", + + m_console.Commands.AddCommand("Objects", false, "delete object creator", "delete object creator ", "Delete a scene object by creator", HandleDeleteObject); - m_console.Commands.AddCommand("Regions", false, "delete object uuid", + + m_console.Commands.AddCommand("Objects", false, "delete object uuid", "delete object uuid ", "Delete a scene object by uuid", HandleDeleteObject); - m_console.Commands.AddCommand("Regions", false, "delete object name", + + m_console.Commands.AddCommand("Objects", false, "delete object name", "delete object name ", "Delete a scene object by name", HandleDeleteObject); - m_console.Commands.AddCommand("Regions", false, "delete object outside", + + m_console.Commands.AddCommand("Objects", false, "delete object outside", "delete object outside", "Delete all scene objects outside region boundaries", HandleDeleteObject); m_console.Commands.AddCommand( - "Regions", + "Objects", false, "show object uuid", "show object uuid ", "Show details of a scene object with the given UUID", HandleShowObjectByUuid); m_console.Commands.AddCommand( - "Regions", + "Objects", false, "show object name", "show object name ", "Show details of scene objects with the given name", HandleShowObjectByName); m_console.Commands.AddCommand( - "Regions", + "Objects", false, "show part uuid", "show part uuid ", "Show details of a scene object parts with the given UUID", HandleShowPartByUuid); m_console.Commands.AddCommand( - "Regions", + "Objects", false, "show part name", "show part name ", From 133f05dc41ce3520c0069407106fef5a83b2e96e Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Sat, 28 Apr 2012 00:29:08 +0100 Subject: [PATCH 7/9] Add text about using double quotes to surround console command arguments containing spaces to "help" text. e.g. show object name "My long object name" --- OpenSim/Framework/Console/CommandConsole.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs index c5d6b78686..87bdacd2da 100644 --- a/OpenSim/Framework/Console/CommandConsole.cs +++ b/OpenSim/Framework/Console/CommandConsole.cs @@ -79,7 +79,11 @@ namespace OpenSim.Framework.Console public List fn; } - public const string GeneralHelpText = "For more information, type 'help ' where is one of the following categories:"; + public const string GeneralHelpText + = "To enter an argument that contains spaces, surround the argument with double quotes.\nFor example, show object name \"My long object name\"\n"; + + public const string ItemHelpText + = "For more information, type 'help ' where is one of the following:"; /// /// Commands organized by keyword in a tree @@ -108,7 +112,9 @@ namespace OpenSim.Framework.Console // General help if (helpParts.Count == 0) { + help.Add(""); // Will become a newline. help.Add(GeneralHelpText); + help.Add(ItemHelpText); help.AddRange(CollectModulesHelp(tree)); } else @@ -132,7 +138,7 @@ namespace OpenSim.Framework.Console // Check modules first to see if we just need to display a list of those commands if (TryCollectModuleHelp(originalHelpRequest, help)) { - help.Insert(0, GeneralHelpText); + help.Insert(0, ItemHelpText); return help; } From cd755fe5983b1960f771bf6f6bf3fa15b338182b Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Sat, 28 Apr 2012 00:31:11 +0100 Subject: [PATCH 8/9] Remove mono compiler warning. Adjust message log to error from info --- .../XmlRpcGroups/SimianGroupsServicesConnectorModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs index 130513d4c0..5d57f70733 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs @@ -1401,9 +1401,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { response = WebUtil.PostToService(m_groupsServerURI, requestArgs); } - catch (Exception e) + catch (Exception) { - m_log.InfoFormat("[SIMIAN GROUPS CONNECTOR] request failed {0}",CacheKey); + m_log.ErrorFormat("[SIMIAN GROUPS CONNECTOR]: request failed {0}", CacheKey); } // and cache the response From 838016625174ae2f56194a61d7139d0ed7aed8cc Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Sat, 28 Apr 2012 00:39:40 +0100 Subject: [PATCH 9/9] Comment out debug [ASYNC DELETER] messages for now. --- .../Framework/Scenes/AsyncSceneObjectGroupDeleter.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs index f678d07805..834464b2c8 100644 --- a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs +++ b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs @@ -117,7 +117,7 @@ namespace OpenSim.Region.Framework.Scenes private void InventoryRunDeleteTimer(object sender, ElapsedEventArgs e) { - m_log.Debug("[ASYNC DELETER]: Starting send to inventory loop"); +// m_log.Debug("[ASYNC DELETER]: Starting send to inventory loop"); // We must set appearance parameters in the en_US culture in order to avoid issues where values are saved // in a culture where decimal points are commas and then reloaded in a culture which just treats them as @@ -147,9 +147,9 @@ namespace OpenSim.Region.Framework.Scenes { x = m_inventoryDeletes.Dequeue(); - m_log.DebugFormat( - "[ASYNC DELETER]: Sending object to user's inventory, action {1}, count {2}, {0} item(s) remaining.", - left, x.action, x.objectGroups.Count); +// m_log.DebugFormat( +// "[ASYNC DELETER]: Sending object to user's inventory, action {1}, count {2}, {0} item(s) remaining.", +// left, x.action, x.objectGroups.Count); try { @@ -185,7 +185,7 @@ namespace OpenSim.Region.Framework.Scenes e.StackTrace); } - m_log.Debug("[ASYNC DELETER]: No objects left in inventory send queue."); +// m_log.Debug("[ASYNC DELETER]: No objects left in inventory send queue."); return false; }