From 98f29a47c0ad63fa20d4e3fa64971d0d0a5e959c Mon Sep 17 00:00:00 2001 From: Marck Date: Tue, 2 Nov 2010 20:00:14 +0100 Subject: [PATCH 1/4] Do not include hyperlinks in a random region search during a login. Before a random region is chosen, available fallback regions are used for the login. --- .../Services/LLLoginService/LLLoginService.cs | 40 ++++++++++++++----- prebuild.xml | 1 + 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index a06476e9cb..fcfdd1d6d9 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -28,6 +28,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Linq; using System.Net; using System.Reflection; using System.Text.RegularExpressions; @@ -427,12 +428,9 @@ namespace OpenSim.Services.LLLoginService { m_log.WarnFormat("[LLOGIN SERVICE]: User {0} {1} does not have a valid home and this grid does not have default locations. Attempting to find random region", account.FirstName, account.LastName); - defaults = m_GridService.GetRegionsByName(scopeID, "", 1); - if (defaults != null && defaults.Count > 0) - { - region = defaults[0]; + region = FindAlternativeRegion(scopeID); + if (region != null) where = "safe"; - } } } @@ -459,12 +457,9 @@ namespace OpenSim.Services.LLLoginService else { m_log.Info("[LLOGIN SERVICE]: Last Region Not Found Attempting to find random region"); - defaults = m_GridService.GetRegionsByName(scopeID, "", 1); - if (defaults != null && defaults.Count > 0) - { - region = defaults[0]; + region = FindAlternativeRegion(scopeID); + if (region != null) where = "safe"; - } } } @@ -564,6 +559,31 @@ 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); + if (regions != null && regions.Count > 0) + { + hyperlinks = m_GridService.GetHyperlinks(scopeID); + IEnumerable availableRegions = regions.Except(hyperlinks); + if (availableRegions.Count() > 0) + return availableRegions.ElementAt(0); + } + // No fallbacks, try to find an arbitrary region that is not a hyperlink + // maxNumber is fixed for now; maybe use some search pattern with increasing maxSize here? + regions = m_GridService.GetRegionsByName(scopeID, "", 10); + if (regions != null && regions.Count > 0) + { + if (hyperlinks == null) + hyperlinks = m_GridService.GetHyperlinks(scopeID); + IEnumerable availableRegions = regions.Except(hyperlinks); + if (availableRegions.Count() > 0) + return availableRegions.ElementAt(0); + } + return null; + } + private GridRegion FindForeignRegion(string domainName, uint port, string regionName, out GridRegion gatekeeper) { gatekeeper = new GridRegion(); diff --git a/prebuild.xml b/prebuild.xml index e77d5c1fd2..ac003d9a17 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -1214,6 +1214,7 @@ ../../../bin/ + From 390c3a3b6fa62e05c7b90908ac7ef0e40f545048 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 16 Nov 2010 22:26:07 +0100 Subject: [PATCH 2/4] Prevent leftover attachments from clogging up the pipes --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index bfc1bd60e7..db69093f83 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3759,9 +3759,12 @@ namespace OpenSim.Region.Framework.Scenes { if (grp.HasGroupChanged) // Resizer scripts? { - grp.DetachToInventoryPrep(); + grp.RootPart.IsAttachment = false; + grp.AbsolutePosition = grp.RootPart.AttachedPos; +// grp.DetachToInventoryPrep(); attachmentsModule.UpdateKnownItem(ControllingClient, grp, grp.GetFromItemID(), grp.OwnerID); + grp.RootPart.IsAttachment = true; } } } From 393c9c9046595b104a4c3a3671974af33cf902ce Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 17 Nov 2010 01:45:47 +0000 Subject: [PATCH 3/4] Add osUnixTimeToTimestamp() This allows an input unix time to be converted to an llGetTimeStamp() format. Thanks Thomax. --- .../Shared/Api/Implementation/OSSL_Api.cs | 18 +++++++++++++++++- .../Shared/Api/Interface/IOSSL_Api.cs | 1 + .../Shared/Api/Runtime/OSSL_Stub.cs | 13 ++++++++++++- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index e6a323eebc..fc92f23a62 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -2298,5 +2298,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api }); return result; } + + /// + /// Convert a unix time to a llGetTimestamp() like string + /// + /// + /// + public LSL_String osUnixTimeToTimestamp(long time) + { + CheckThreatLevel(ThreatLevel.VeryLow, "osUnixTimeToTimestamp"); + long baseTicks = 621355968000000000; + long tickResolution = 10000000; + long epochTicks = (time * tickResolution) + baseTicks; + DateTime date = new DateTime(epochTicks); + + return date.ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ"); + } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index c9a24f613b..10d61caeff 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -184,5 +184,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces LSL_List osGetAvatarList(); + LSL_String osUnixTimeToTimestamp(long time); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 370bf1d4e6..f3142e65f0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -678,26 +678,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { return m_OSSL_Functions.osGetSimulatorMemory(); } + public void osKickAvatar(string FirstName,string SurName,string alert) { m_OSSL_Functions.osKickAvatar(FirstName, SurName, alert); } + public void osSetSpeed(string UUID, float SpeedModifier) { m_OSSL_Functions.osSetSpeed(UUID, SpeedModifier); } + public void osCauseDamage(string avatar, double damage) { m_OSSL_Functions.osCauseDamage(avatar, damage); } + public void osCauseHealing(string avatar, double healing) { m_OSSL_Functions.osCauseHealing(avatar, healing); } + public LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules) { return m_OSSL_Functions.osGetPrimitiveParams(prim, rules); } + public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules) { m_OSSL_Functions.osSetPrimitiveParams(prim, rules); @@ -717,5 +723,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { return m_OSSL_Functions.osGetAvatarList(); } + + public LSL_String osUnixTimeToTimestamp(long time) + { + return m_OSSL_Functions.osUnixTimeToTimestamp(time); + } } -} +} \ No newline at end of file From 43c270b5367a7bdc8f685213488fb4f3437ab89b Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 17 Nov 2010 17:54:32 +0100 Subject: [PATCH 4/4] Fix gesture and viewer preview sounds not playing --- .../ClientStack/LindenUDP/LLClientView.cs | 5 +++-- .../CoreModules/World/Sound/SoundModule.cs | 20 ++++++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 8d85d1a34f..7851c4d5ad 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -6016,8 +6016,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP SoundTrigger handlerSoundTrigger = OnSoundTrigger; if (handlerSoundTrigger != null) { - handlerSoundTrigger(soundTriggerPacket.SoundData.SoundID, soundTriggerPacket.SoundData.OwnerID, - soundTriggerPacket.SoundData.ObjectID, soundTriggerPacket.SoundData.ParentID, + // UUIDS are sent as zeroes by the client, substitute agent's id + handlerSoundTrigger(soundTriggerPacket.SoundData.SoundID, AgentId, + AgentId, AgentId, soundTriggerPacket.SoundData.Gain, soundTriggerPacket.SoundData.Position, soundTriggerPacket.SoundData.Handle, 0); diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs index abd28c87a9..8df44feb8c 100644 --- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs +++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs @@ -106,14 +106,20 @@ namespace OpenSim.Region.CoreModules.World.Sound { SceneObjectPart part = m_scene.GetSceneObjectPart(objectID); if (part == null) - return; - - SceneObjectGroup grp = part.ParentGroup; - - if (grp.IsAttachment && grp.GetAttachmentPoint() > 30) { - objectID = ownerID; - parentID = ownerID; + ScenePresence sp; + if (!m_scene.TryGetScenePresence(objectID, out sp)) + return; + } + else + { + SceneObjectGroup grp = part.ParentGroup; + + if (grp.IsAttachment && grp.GetAttachmentPoint() > 30) + { + objectID = ownerID; + parentID = ownerID; + } } m_scene.ForEachScenePresence(delegate(ScenePresence sp)