From 1aa4dbdb3fd5c3c8382dad53d6b7c105fb7cec85 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 28 Nov 2016 04:29:57 +0000 Subject: increase HG mapsearch spargetti; add more flexibility on input uri formats. To find regions in memory for a grid the http format needs to be used, because aditional compares made by viewers --- .../CoreModules/World/WorldMap/MapSearchModule.cs | 156 ++++++++++----------- 1 file changed, 78 insertions(+), 78 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index 7370156..b1234fe 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs @@ -128,104 +128,104 @@ namespace OpenSim.Region.CoreModules.World.WorldMap m_Clients.Add(remoteClient.AgentId); } - try - { - OnMapNameRequest(remoteClient, mapName, flags); - } - finally - { - lock (m_Clients) - m_Clients.Remove(remoteClient.AgentId); - } + OnMapNameRequest(remoteClient, mapName, flags); } private void OnMapNameRequest(IClientAPI remoteClient, string mapName, uint flags) { Util.FireAndForget(x => { - List blocks = new List(); - if (mapName.Length < 3 || (mapName.EndsWith("#") && mapName.Length < 4)) + try { - // final block, closing the search result - AddFinalBlock(blocks,mapName); + List blocks = new List(); + if (mapName.Length < 3 || (mapName.EndsWith("#") && mapName.Length < 4)) + { + // final block, closing the search result + AddFinalBlock(blocks,mapName); - // flags are agent flags sent from the viewer. - // they have different values depending on different viewers, apparently - remoteClient.SendMapBlock(blocks, flags); - remoteClient.SendAlertMessage("Use a search string with at least 3 characters"); - return; - } + // flags are agent flags sent from the viewer. + // they have different values depending on different viewers, apparently + remoteClient.SendMapBlock(blocks, flags); + remoteClient.SendAlertMessage("Use a search string with at least 3 characters"); + return; + } - //m_log.DebugFormat("MAP NAME=({0})", mapName); + //m_log.DebugFormat("MAP NAME=({0})", mapName); - // Hack to get around the fact that ll V3 now drops the port from the - // map name. See https://jira.secondlife.com/browse/VWR-28570 - // - // Caller, use this magic form instead: - // secondlife://http|!!mygrid.com|8002|Region+Name/128/128 - // or url encode if possible. - // the hacks we do with this viewer... - // - bool needOriginalName = false; - string mapNameOrig = mapName; - if (mapName.Contains("|")) - { - mapName = mapName.Replace('|', ':'); - needOriginalName = true; - } - if (mapName.Contains("+")) - { - mapName = mapName.Replace('+', ' '); - needOriginalName = true; - } - if (mapName.Contains("!")) - { - mapName = mapName.Replace('!', '/'); - needOriginalName = true; - } - if (mapName.Contains(".")) - needOriginalName = true; + // Hack to get around the fact that ll V3 now drops the port from the + // map name. See https://jira.secondlife.com/browse/VWR-28570 + // + // Caller, use this magic form instead: + // secondlife://http|!!mygrid.com|8002|Region+Name/128/128 + // or url encode if possible. + // the hacks we do with this viewer... + // + bool needOriginalName = false; + string mapNameOrig = mapName; + if (mapName.Contains("|")) + { + mapName = mapName.Replace('|', ':'); + needOriginalName = true; + } + if (mapName.Contains("+")) + { + mapName = mapName.Replace('+', ' '); + needOriginalName = true; + } + if (mapName.Contains("!")) + { + mapName = mapName.Replace('!', '/'); + needOriginalName = true; + } + if (mapName.Contains(".")) + needOriginalName = true; - // try to fetch from GridServer - List regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20); - // if (regionInfos.Count == 0) - // remoteClient.SendAlertMessage("Hyperlink could not be established."); + // try to fetch from GridServer + List regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20); + // if (regionInfos.Count == 0) + // remoteClient.SendAlertMessage("Hyperlink could not be established."); - //m_log.DebugFormat("[MAPSEARCHMODULE]: search {0} returned {1} regions", mapName, regionInfos.Count); + //m_log.DebugFormat("[MAPSEARCHMODULE]: search {0} returned {1} regions", mapName, regionInfos.Count); - MapBlockData data; - if (regionInfos.Count > 0) - { - foreach (GridRegion info in regionInfos) + MapBlockData data; + if (regionInfos.Count > 0) { - data = new MapBlockData(); - data.Agents = 0; - data.Access = info.Access; - MapBlockData block = new MapBlockData(); - WorldMap.MapBlockFromGridRegion(block, info, flags); + foreach (GridRegion info in regionInfos) + { + data = new MapBlockData(); + data.Agents = 0; + data.Access = info.Access; + MapBlockData block = new MapBlockData(); + WorldMap.MapBlockFromGridRegion(block, info, flags); - if (flags == 2 && regionInfos.Count == 1 && needOriginalName) - block.Name = mapNameOrig; - blocks.Add(block); + if (flags == 2 && regionInfos.Count == 1 && needOriginalName) + block.Name = mapNameOrig; + blocks.Add(block); + } } - } - // final block, closing the search result - AddFinalBlock(blocks,mapNameOrig); + // final block, closing the search result + AddFinalBlock(blocks,mapNameOrig); - // flags are agent flags sent from the viewer. - // they have different values depending on different viewers, apparently - remoteClient.SendMapBlock(blocks, flags); + // flags are agent flags sent from the viewer. + // they have different values depending on different viewers, apparently + remoteClient.SendMapBlock(blocks, flags); - // send extra user messages for V3 - // because the UI is very confusing - // while we don't fix the hard-coded urls - if (flags == 2) + // send extra user messages for V3 + // because the UI is very confusing + // while we don't fix the hard-coded urls + if (flags == 2) + { + if (regionInfos.Count == 0) + remoteClient.SendAgentAlertMessage("No regions found with that name.", true); + // else if (regionInfos.Count == 1) + // remoteClient.SendAgentAlertMessage("Region found!", false); + } + } + finally { - if (regionInfos.Count == 0) - remoteClient.SendAgentAlertMessage("No regions found with that name.", true); -// else if (regionInfos.Count == 1) -// remoteClient.SendAgentAlertMessage("Region found!", false); + lock (m_Clients) + m_Clients.Remove(remoteClient.AgentId); } }); } -- cgit v1.1 From af3f2717fd1b92a0f5f6003a8ce03939b8c57b47 Mon Sep 17 00:00:00 2001 From: Mandarinka Tasty Date: Sun, 27 Nov 2016 22:50:11 +0100 Subject: The implementation of new flags = paramters for llGetObjectDetails - Part I Constant: integer OBJECT_CLICK_ACTION = 28; Constant: integer OBJECT_OMEGA = 29; Constant: integer OBJECT_PRIM_COUNT = 30; Signed-off-by: Mandarinka Tasty Signed-off-by: UbitUmarov --- .../Shared/Api/Implementation/LSL_Api.cs | 23 ++++++++++++++++++++++ .../Shared/Api/Runtime/LSL_Constants.cs | 3 +++ 2 files changed, 26 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 849d02d..cc36ad1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -13758,6 +13758,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case ScriptBaseClass.OBJECT_LAST_OWNER_ID: ret.Add(new LSL_Key(ScriptBaseClass.NULL_KEY)); break; + case ScriptBaseClass.OBJECT_CLICK_ACTION: + ret.Add(new LSL_Integer(0)); + break; + case ScriptBaseClass.OBJECT_OMEGA: + ret.Add(new LSL_Vector(Vector3.Zero)); + break; + case ScriptBaseClass.OBJECT_PRIM_COUNT: + LSL_List AttachmentsPrimList = new LSL_List(); + List Attachments; + Attachments = av.GetAttachments(); + foreach (SceneObjectGroup Attachment in Attachments) + AttachmentsPrimList.Add(new LSL_Integer(Attachment.PrimCount)); + ret.Add(new LSL_Integer(AttachmentsPrimList.Sum())); + break; default: // Invalid or unhandled constant. ret.Add(new LSL_Integer(ScriptBaseClass.OBJECT_UNKNOWN_DETAIL)); @@ -13930,6 +13944,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case ScriptBaseClass.OBJECT_LAST_OWNER_ID: ret.Add(new LSL_Key(obj.ParentGroup.LastOwnerID.ToString())); break; + case ScriptBaseClass.OBJECT_CLICK_ACTION: + ret.Add(new LSL_Integer(obj.ClickAction)); + break; + case ScriptBaseClass.OBJECT_OMEGA: + ret.Add(new LSL_Vector(obj.AngularVelocity)); + break; + case ScriptBaseClass.OBJECT_PRIM_COUNT: + ret.Add(new LSL_Integer(obj.ParentGroup.PrimCount)); + break; default: // Invalid or unhandled constant. ret.Add(new LSL_Integer(ScriptBaseClass.OBJECT_UNKNOWN_DETAIL)); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index cee66b2..a177310 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs @@ -636,6 +636,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public const int OBJECT_HOVER_HEIGHT = 25; public const int OBJECT_BODY_SHAPE_TYPE = 26; public const int OBJECT_LAST_OWNER_ID = 27; + public const int OBJECT_CLICK_ACTION = 28; + public const int OBJECT_OMEGA = 29; + public const int OBJECT_PRIM_COUNT = 30; // Pathfinding types public const int OPT_OTHER = -1; -- cgit v1.1 From 0bb959d8fda598b0f166ba5131a493c64147a317 Mon Sep 17 00:00:00 2001 From: Mandarinka Tasty Date: Mon, 28 Nov 2016 05:05:36 +0100 Subject: The implementation of new flags = parameters for llGetObjectDetails - Part II Constant: integer OBJECT_TOTAL_INVENTORY_COUNT = 31 Constant: integer OBJECT_GROUP_TAG = 33 Signed-off-by: Mandarinka Tasty Signed-off-by: UbitUmarov --- .../Shared/Api/Implementation/LSL_Api.cs | 25 ++++++++++++++++++++++ .../Shared/Api/Runtime/LSL_Constants.cs | 2 ++ 2 files changed, 27 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index cc36ad1..d90d5dd 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -13772,6 +13772,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api AttachmentsPrimList.Add(new LSL_Integer(Attachment.PrimCount)); ret.Add(new LSL_Integer(AttachmentsPrimList.Sum())); break; + case ScriptBaseClass.OBJECT_TOTAL_INVENTORY_COUNT: + LSL_List AttachmentsPrimsInventoryList = new LSL_List(); + foreach (SceneObjectGroup Attachment in av.GetAttachments()) + { + Attachment.ForEachPart(delegate(SceneObjectPart part) + { + AttachmentsPrimsInventoryList.Add(new LSL_Integer(part.Inventory.Count)); + }); + } + ret.Add(new LSL_Integer(AttachmentsPrimsInventoryList.Sum())); + break; + case ScriptBaseClass.OBJECT_GROUP_TAG: + ret.Add(new LSL_String(av.Grouptitle)); + break; default: // Invalid or unhandled constant. ret.Add(new LSL_Integer(ScriptBaseClass.OBJECT_UNKNOWN_DETAIL)); @@ -13953,6 +13967,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case ScriptBaseClass.OBJECT_PRIM_COUNT: ret.Add(new LSL_Integer(obj.ParentGroup.PrimCount)); break; + case ScriptBaseClass.OBJECT_TOTAL_INVENTORY_COUNT: + LSL_List ObjectPrimsInventoryList = new LSL_List(); + obj.ParentGroup.ForEachPart(delegate(SceneObjectPart part) + { + ObjectPrimsInventoryList.Add(new LSL_Integer(part.Inventory.Count)); + }); + ret.Add(ObjectPrimsInventoryList.Sum()); + break; + case ScriptBaseClass.OBJECT_GROUP_TAG: + ret.Add(new LSL_String(String.Empty)); + break; default: // Invalid or unhandled constant. ret.Add(new LSL_Integer(ScriptBaseClass.OBJECT_UNKNOWN_DETAIL)); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index a177310..17173a2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs @@ -639,6 +639,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public const int OBJECT_CLICK_ACTION = 28; public const int OBJECT_OMEGA = 29; public const int OBJECT_PRIM_COUNT = 30; + public const int OBJECT_TOTAL_INVENTORY_COUNT = 31; + public const int OBJECT_GROUP_TAG = 33; // Pathfinding types public const int OPT_OTHER = -1; -- cgit v1.1 From 9dd820765eaa51d7583abcf493e203f575036d5f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 28 Nov 2016 05:58:05 +0000 Subject: change last patch a bit --- .../Shared/Api/Implementation/LSL_Api.cs | 44 ++++++++++++---------- 1 file changed, 25 insertions(+), 19 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index d90d5dd..80bb461 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -13765,23 +13765,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ret.Add(new LSL_Vector(Vector3.Zero)); break; case ScriptBaseClass.OBJECT_PRIM_COUNT: - LSL_List AttachmentsPrimList = new LSL_List(); - List Attachments; - Attachments = av.GetAttachments(); - foreach (SceneObjectGroup Attachment in Attachments) - AttachmentsPrimList.Add(new LSL_Integer(Attachment.PrimCount)); - ret.Add(new LSL_Integer(AttachmentsPrimList.Sum())); + List Attachments = av.GetAttachments(); + int count = 0; + try + { + foreach (SceneObjectGroup Attachment in Attachments) + count += Attachment.PrimCount; + } catch { }; + ret.Add(new LSL_Integer(count)); break; case ScriptBaseClass.OBJECT_TOTAL_INVENTORY_COUNT: - LSL_List AttachmentsPrimsInventoryList = new LSL_List(); - foreach (SceneObjectGroup Attachment in av.GetAttachments()) + List invAttachments = av.GetAttachments(); + int invcount = 0; + try { - Attachment.ForEachPart(delegate(SceneObjectPart part) + foreach (SceneObjectGroup Attachment in invAttachments) { - AttachmentsPrimsInventoryList.Add(new LSL_Integer(part.Inventory.Count)); - }); - } - ret.Add(new LSL_Integer(AttachmentsPrimsInventoryList.Sum())); + SceneObjectPart[] parts = Attachment.Parts; + int nparts = parts.Count(); + for(int i = 0; i < nparts; i++) + invcount += parts[i].Inventory.Count; + } + } catch { }; + ret.Add(new LSL_Integer(invcount)); break; case ScriptBaseClass.OBJECT_GROUP_TAG: ret.Add(new LSL_String(av.Grouptitle)); @@ -13968,12 +13974,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ret.Add(new LSL_Integer(obj.ParentGroup.PrimCount)); break; case ScriptBaseClass.OBJECT_TOTAL_INVENTORY_COUNT: - LSL_List ObjectPrimsInventoryList = new LSL_List(); - obj.ParentGroup.ForEachPart(delegate(SceneObjectPart part) - { - ObjectPrimsInventoryList.Add(new LSL_Integer(part.Inventory.Count)); - }); - ret.Add(ObjectPrimsInventoryList.Sum()); + SceneObjectPart[] parts = obj.ParentGroup.Parts; + int nparts = parts.Count(); + int count = 0; + for(int i = 0; i < nparts; i++) + count += parts[i].Inventory.Count; + ret.Add(new LSL_Integer(count)); break; case ScriptBaseClass.OBJECT_GROUP_TAG: ret.Add(new LSL_String(String.Empty)); -- cgit v1.1