From f6e166cd0bfc868fe17fb003390872ae70190177 Mon Sep 17 00:00:00 2001 From: TBG Renfold Date: Tue, 9 Oct 2012 14:56:25 +0100 Subject: Now using region flags for llRequestSimulatorData DATA_SIM_POS. If the region is not classed a hypergrid region, then the region secret is checked to make sure that it is a valid UUID. Just a temporary fix at this time. --- .../Shared/Api/Implementation/LSL_Api.cs | 25 +++++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 7620df3..6b08b00 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -56,6 +56,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo; using PrimType = OpenSim.Region.Framework.Scenes.PrimType; using AssetLandmark = OpenSim.Framework.AssetLandmark; +using RegionFlags = OpenSim.Framework.RegionFlags; using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger; @@ -9327,12 +9328,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ScriptSleep(1000); return UUID.Zero.ToString(); } - if (m_ScriptEngine.World.RegionInfo.RegionName != simulator) + + RegionFlags regionFlags = (RegionFlags)m_ScriptEngine.World.GridService.GetRegionFlags(info.ScopeID, info.RegionID); + if ((regionFlags & RegionFlags.Hyperlink) != 0) { - //Hypergrid Region co-ordinates uint rx = 0, ry = 0; + //Hypergrid Region co-ordinates Utils.LongToUInts(Convert.ToUInt64(info.RegionSecret), out rx, out ry); - reply = new LSL_Vector( rx, ry, @@ -9340,11 +9342,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else { - //Local-cooridnates - reply = new LSL_Vector( - info.RegionLocX, - info.RegionLocY, - 0).ToString(); + UUID regionSecret = UUID.Zero; + if (UUID.TryParse(info.RegionSecret, out regionSecret)) + { + if (regionSecret != UUID.Zero) + { + //Local co-oridnates + reply = new LSL_Vector( + info.RegionLocX, + info.RegionLocY, + 0).ToString(); + } + } } break; case ScriptBaseClass.DATA_SIM_STATUS: -- cgit v1.1 From 330b976a62b3153dadfb1acdaa99b60a9084453d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 13 Oct 2012 01:03:09 +0100 Subject: Improve on TBG Renfold's fix to llRequestSimulatorData DATA_SIM_POS by only performing HG regionflags service check if the region secret is not empty. An empty RegionSecret is never HG, whilst a non-empty one may be HG or being genuinely used as a RegionSecret. --- .../Shared/Api/Implementation/LSL_Api.cs | 44 ++++++++++++---------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6b08b00..1e8dec8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -9314,11 +9314,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api GridRegion info; - if (m_ScriptEngine.World.RegionInfo.RegionName == simulator) //Det data for this simulator? - - info = new GridRegion(m_ScriptEngine.World.RegionInfo); + if (World.RegionInfo.RegionName == simulator) + info = new GridRegion(World.RegionInfo); else - info = m_ScriptEngine.World.GridService.GetRegionByName(m_ScriptEngine.World.RegionInfo.ScopeID, simulator); + info = World.GridService.GetRegionByName(m_ScriptEngine.World.RegionInfo.ScopeID, simulator); switch (data) { @@ -9329,12 +9328,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return UUID.Zero.ToString(); } - RegionFlags regionFlags = (RegionFlags)m_ScriptEngine.World.GridService.GetRegionFlags(info.ScopeID, info.RegionID); - if ((regionFlags & RegionFlags.Hyperlink) != 0) + bool isHypergridRegion = false; + + if (World.RegionInfo.RegionName != simulator && info.RegionSecret != "") + { + // Hypergrid is currently placing real destination region co-ords into RegionSecret. + // But other code can also use this field for a genuine RegionSecret! Therefore, if + // anything is present we need to disambiguate. + // + // FIXME: Hypergrid should be storing this data in a different field. + RegionFlags regionFlags + = (RegionFlags)m_ScriptEngine.World.GridService.GetRegionFlags( + info.ScopeID, info.RegionID); + isHypergridRegion = (regionFlags & RegionFlags.Hyperlink) != 0; + } + + if (isHypergridRegion) { uint rx = 0, ry = 0; - //Hypergrid Region co-ordinates Utils.LongToUInts(Convert.ToUInt64(info.RegionSecret), out rx, out ry); + reply = new LSL_Vector( rx, ry, @@ -9342,18 +9355,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else { - UUID regionSecret = UUID.Zero; - if (UUID.TryParse(info.RegionSecret, out regionSecret)) - { - if (regionSecret != UUID.Zero) - { - //Local co-oridnates - reply = new LSL_Vector( - info.RegionLocX, - info.RegionLocY, - 0).ToString(); - } - } + // Local grid co-oridnates + reply = new LSL_Vector( + info.RegionLocX, + info.RegionLocY, + 0).ToString(); } break; case ScriptBaseClass.DATA_SIM_STATUS: -- cgit v1.1 From dc460579fd94b2017e334e71ffd20d94a3dec425 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 13 Oct 2012 01:47:10 +0100 Subject: minor: Fix and elaborate on log information printed when an unrecognized estate method is received from the client. --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 2db8df2..0d4f09d 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -9063,7 +9063,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP } #endregion - switch (Utils.BytesToString(messagePacket.MethodData.Method)) + string method = Utils.BytesToString(messagePacket.MethodData.Method); + + switch (method) { case "getinfo": if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false)) @@ -9379,7 +9381,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP return true; default: - m_log.Error("EstateOwnerMessage: Unknown method requested\n" + messagePacket); + m_log.WarnFormat( + "[LLCLIENTVIEW]: EstateOwnerMessage: Unknown method {0} requested for {1} in {2}", + method, Name, Scene.Name); + + for (int i = 0; i < messagePacket.ParamList.Length; i++) + { + EstateOwnerMessagePacket.ParamListBlock block = messagePacket.ParamList[i]; + string data = (string)Utils.BytesToString(block.Parameter); + m_log.DebugFormat("[LLCLIENTVIEW]: Param {0}={1}", i, data); + } + return true; } -- cgit v1.1 From 8c2564c05cbf277bef85bba62313f5d5493a4a81 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 16 Oct 2012 00:40:28 +0100 Subject: minor: Comment out the region console caps message for now. --- OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs index 36af55f..17c7270 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs @@ -107,7 +107,7 @@ namespace OpenSim.Region.ClientStack.Linden UUID capID = UUID.Random(); - m_log.DebugFormat("[REGION CONSOLE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); +// m_log.DebugFormat("[REGION CONSOLE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); caps.RegisterHandler( "SimConsoleAsync", new ConsoleHandler("/CAPS/" + capID + "/", "SimConsoleAsync", agentID, this, m_scene)); -- cgit v1.1 From 3ac6a423f7748bf9d5da0d1bd8fc62652ed8e151 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 16 Oct 2012 00:54:25 +0100 Subject: minor: comment out "Registered seed capability" message for "Received SEED caps request" message for now. I think this is more useful right now since it tells us if the viewer requested a seed caps at all in various scenarios (such as when teleporting to a new region). --- .../Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 185f9ce..cc69645 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs @@ -163,8 +163,8 @@ namespace OpenSim.Region.ClientStack.Linden m_HostCapsObj.RegisterHandler( "SEED", new RestStreamHandler("POST", capsBase + m_requestPath, SeedCapRequest, "SEED", null)); - m_log.DebugFormat( - "[CAPS]: Registered seed capability {0} for {1}", capsBase + m_requestPath, m_HostCapsObj.AgentID); +// m_log.DebugFormat( +// "[CAPS]: Registered seed capability {0} for {1}", capsBase + m_requestPath, m_HostCapsObj.AgentID); //m_capsHandlers["MapLayer"] = // new LLSDStreamhandler("POST", @@ -254,11 +254,12 @@ namespace OpenSim.Region.ClientStack.Linden public string SeedCapRequest(string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { -// m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName); + m_log.DebugFormat( + "[CAPS]: Received SEED caps request in {0} for agent {1}", m_regionName, m_HostCapsObj.AgentID); if (!m_Scene.CheckClient(m_HostCapsObj.AgentID, httpRequest.RemoteIPEndPoint)) { - m_log.DebugFormat( + m_log.WarnFormat( "[CAPS]: Unauthorized CAPS client {0} from {1}", m_HostCapsObj.AgentID, httpRequest.RemoteIPEndPoint); -- cgit v1.1 From d469bde849f53a4c80b301051599390e916ce08a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 16 Oct 2012 01:20:41 +0100 Subject: minor: Add/correct some doc messages associated with entity teleport. I believe UseCircuitCode is sent on EnableSimulator EQ message, rather than EstablishAgentCommunication At least with LL 3.3.4, EstablishAgentCommunication appears unnecessary in the teleport context - viewer still requests it though possibly only after TeleportFinish(). However, we will continue to send it. --- .../CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 7 ++++++- OpenSim/Region/Framework/Scenes/Scene.cs | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 617a350..90fe430 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -486,6 +486,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer if (sp.ParentID != (uint)0) sp.StandUp(); + // At least on LL 3.3.4, this is not strictly necessary - a teleport will succeed without sending this to + // the viewer. However, it might mean that the viewer does not see the black teleport screen (untested). sp.ControllingClient.SendTeleportStart(teleportFlags); // the avatar.Close below will clear the child region list. We need this below for (possibly) @@ -561,8 +563,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // So let's wait Thread.Sleep(200); + // At least on LL 3.3.4 for teleports between different regions on the same simulator this appears + // unnecessary - teleport will succeed and SEED caps will be requested without it (though possibly + // only on TeleportFinish). This is untested for region teleport between different simulators + // though this probably also works. m_eqModule.EstablishAgentCommunication(sp.UUID, endPoint, capsPath); - } else { diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index fe549bc..5f45529 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4144,8 +4144,9 @@ namespace OpenSim.Region.Framework.Scenes return false; } - // We have to wait until the viewer contacts this region after receiving EAC. - // That calls AddNewClient, which finally creates the ScenePresence + // We have to wait until the viewer contacts this region + // after receiving the EnableSimulator HTTP Event Queue message. This triggers the viewer to send + // a UseCircuitCode packet which in turn calls AddNewClient which finally creates the ScenePresence. ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID); if (childAgentUpdate != null) -- cgit v1.1 From 0eb457442d87315810fd8280458ca8c0c3e97d23 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 16 Oct 2012 01:31:38 +0100 Subject: minor: Add missing newlines and spacing to help for "debug eq" console command --- .../ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index 0dd0904..47cb049 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs @@ -111,10 +111,10 @@ namespace OpenSim.Region.ClientStack.Linden false, "debug eq", "debug eq [0|1|2]", - "Turn on event queue debugging" - + "<= 0 - turns off all event queue logging" - + ">= 1 - turns on outgoing event logging" - + ">= 2 - turns on poll notification", + "Turn on event queue debugging\n" + + " <= 0 - turns off all event queue logging\n" + + " >= 1 - turns on outgoing event logging\n" + + " >= 2 - turns on poll notification", HandleDebugEq); } else -- cgit v1.1 From ab0294f0109416da0546e25797e7747b23071d33 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 16 Oct 2012 01:33:35 +0100 Subject: Add missing category paremeter to llGiveInventoryList grid IM construction. This was a regression from 16c9c1df Sat Oct 6 02:34:49 2012 +0100. Should resolve http://opensimulator.org/mantis/view.php?id=6360 --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 1e8dec8..ac74bf8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -6459,7 +6459,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api GridInstantMessage msg = new GridInstantMessage(World, m_host.OwnerID, m_host.Name, destID, (byte)InstantMessageDialog.TaskInventoryOffered, - false, string.Format("'{0}'"), + false, string.Format("'{0}'", category), // We won't go so far as to add a SLURL, but this is the format used by LL as of 2012-10-06 // false, string.Format("'{0}' ( http://slurl.com/secondlife/{1}/{2}/{3}/{4} )", category, World.Name, (int)pos.X, (int)pos.Y, (int)pos.Z), folderID, false, pos, -- cgit v1.1 From 8459b98f68d4c9c473e1d5e9f74bfba2aa5f50b8 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 16 Oct 2012 01:39:39 +0100 Subject: minor: Comment out log message on every FRIENDS SIM CONNECTOR request for now. --- OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs index 3fd0c53..e235733 100644 --- a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs +++ b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs @@ -153,7 +153,7 @@ namespace OpenSim.Services.Connectors.Friends if (!region.ServerURI.EndsWith("/")) path = "/" + path; string uri = region.ServerURI + path; - m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: calling {0}", uri); +// m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: calling {0}", uri); try { -- cgit v1.1