From 05520d676ccee950c94d1f8c079afaaaabdb6a49 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Thu, 5 Aug 2010 18:45:17 +0200
Subject: Revert "Enforce a 0.2 second sleep on llDie() before the command is
executed - this should get rid of ghost prims (which are much rarer, but
still occuring)"
This reverts commit 85fd2def9ce04d68d838439e7931b8358db84ebd.
The sleep helps in only one case: static prims rezzed by script.
In other cases (physical prims, bullets) it's harmful.
---
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index d61715e..bc47fa1 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -1173,12 +1173,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public virtual void llDie()
{
m_host.AddScriptLPS(1);
- if (!m_host.IsAttachment)
- {
- //Enforce a sleep here to avoid ghost prims
- llSleep(0.2d);
- throw new SelfDeleteException();
- }
+ if (!m_host.IsAttachment) throw new SelfDeleteException();
}
public LSL_Float llGround(LSL_Vector offset)
--
cgit v1.1
From 8bdbcda2b70ede033c38a604af573554dd2776ad Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Thu, 5 Aug 2010 18:50:17 +0200
Subject: We already have a record of killed prims. It just wasn't used by the
new JHurlicane code anymore. Use it to prevent sending updates after kills.
---
OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 9 +++++++++
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 9 +++++++++
2 files changed, 18 insertions(+)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 4ab719d..0b8b95b 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -3514,6 +3514,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
EntityUpdate update;
while (updatesThisCall < maxUpdates && m_entityUpdates.TryDequeue(out update))
{
+ // If we have sent a kill packet for this object
+ // drop any updates on the floor
+ if (update.Entity is SceneObjectPart)
+ {
+ SceneObjectPart part = (SceneObjectPart)update.Entity;
+ if (m_killRecord.Contains(part.ParentGroup.RootPart.LocalId))
+ continue;
+ }
+
++updatesThisCall;
#region UpdateFlags to packet type conversion
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 032fbe8..67cb7cc 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -3043,6 +3043,15 @@ namespace OpenSim.Region.Framework.Scenes
UUID ownerID = _ownerID;
UUID objectID = UUID;
UUID parentID = GetRootPartUUID();
+
+ if (ParentGroup.IsAttachment && ParentGroup.RootPart.Shape.State > 30)
+ {
+ // Use the avatar as the parent for HUDs, since the prims
+ // are not sent to other avatars
+ objectID = _ownerID;
+ parentID = _ownerID;
+ }
+
UUID soundID = UUID.Zero;
Vector3 position = AbsolutePosition; // region local
ulong regionHandle = m_parentGroup.Scene.RegionInfo.RegionHandle;
--
cgit v1.1
From d8f9b98c4ab700efcf4016b605461053c3b50fba Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Thu, 5 Aug 2010 22:50:09 +0200
Subject: Prevent hammering the grid services with llRequestAgentData requests.
Cache the user information permanently, and the online status for 20 seconds.
Also cache negatives.
---
.../Shared/Api/Implementation/LSL_Api.cs | 55 +++++++++++++++++++---
1 file changed, 48 insertions(+), 7 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index bc47fa1..ad7d650 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -69,6 +69,14 @@ using System.Reflection;
namespace OpenSim.Region.ScriptEngine.Shared.Api
{
+ // MUST be a ref type
+ public class UserInfoCacheEntry
+ {
+ public int time;
+ public UserAccount account;
+ public PresenceInfo pinfo;
+ }
+
///
/// Contains all LSL ll-functions. This class will be in Default AppDomain.
///
@@ -93,6 +101,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
protected int m_scriptConsoleChannel = 0;
protected bool m_scriptConsoleChannelEnabled = false;
protected IUrlModule m_UrlModule = null;
+ protected Dictionary m_userInfoCache =
+ new Dictionary();
public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID)
{
@@ -4244,16 +4254,47 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1);
UUID uuid = (UUID)id;
+ PresenceInfo pinfo = null;
+ UserAccount account;
- UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, uuid);
- if (account == null)
- return UUID.Zero.ToString();
+ UserInfoCacheEntry ce;
+ if (!m_userInfoCache.TryGetValue(uuid, out ce))
+ {
+ account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, uuid);
+ if (account == null)
+ {
+ m_userInfoCache[uuid] = null; // Cache negative
+ return UUID.Zero.ToString();
+ }
- PresenceInfo pinfo = null;
- PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() });
- if (pinfos != null && pinfos.Length > 0)
- pinfo = pinfos[0];
+ PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() });
+ if (pinfos != null && pinfos.Length > 0)
+ pinfo = pinfos[0];
+
+ ce = new UserInfoCacheEntry();
+ ce.time = Util.EnvironmentTickCount();
+ ce.account = account;
+ ce.pinfo = pinfo;
+ }
+ else
+ {
+ if (ce == null)
+ return UUID.Zero.ToString();
+
+ account = ce.account;
+ pinfo = ce.pinfo;
+ }
+
+ if (Util.EnvironmentTickCount() < ce.time || (Util.EnvironmentTickCount() - ce.time) >= 20000)
+ {
+ PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() });
+ if (pinfos != null && pinfos.Length > 0)
+ pinfo = pinfos[0];
+
+ ce.time = Util.EnvironmentTickCount();
+ ce.pinfo = pinfo;
+ }
string reply = String.Empty;
--
cgit v1.1
From 7368992ee9bbf1aeb5034715e693c82d8ddd4b97 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Thu, 5 Aug 2010 23:48:55 +0200
Subject: Actually cache positives
---
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 1 +
1 file changed, 1 insertion(+)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index ad7d650..0f38261 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4276,6 +4276,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
ce.time = Util.EnvironmentTickCount();
ce.account = account;
ce.pinfo = pinfo;
+ m_userInfoCache[uuid] = ce;
}
else
{
--
cgit v1.1
From d7fe9f7b44311df517a8755dd6cf5603b380c3b8 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Fri, 6 Aug 2010 00:02:38 +0200
Subject: Prevent users from becoming stuck online. This affects only 0.7
---
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 ++
1 file changed, 2 insertions(+)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 0f38261..236458c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4292,6 +4292,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() });
if (pinfos != null && pinfos.Length > 0)
pinfo = pinfos[0];
+ else
+ pinfo = null;
ce.time = Util.EnvironmentTickCount();
ce.pinfo = pinfo;
--
cgit v1.1