diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 8b9b888499..aadcff6af0 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -53,7 +53,7 @@ namespace OpenSim.Region.Environment.Scenes #region Fields - public Dictionary ScenePresences; + internal Dictionary ScenePresences; // SceneObjects is not currently populated or used. //public Dictionary SceneObjects; public Dictionary Entities; diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index faa595f943..d017c50bcd 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -207,6 +207,7 @@ namespace OpenSim.Region.Environment.Scenes get { return m_innerScene.Entities; } set { m_innerScene.Entities = value; } } + public Dictionary m_restorePresences { get { return m_innerScene.RestorePresences; } @@ -3095,7 +3096,7 @@ namespace OpenSim.Region.Environment.Scenes } /// - /// Request a List of all m_scenePresences in this World + /// Request a List of all ScenePresences in this region /// /// public List GetScenePresences() @@ -3104,7 +3105,7 @@ namespace OpenSim.Region.Environment.Scenes } /// - /// Request a filtered list of m_scenePresences in this World + /// Request a filtered list of ScenePresences in this region /// /// /// @@ -3114,7 +3115,7 @@ namespace OpenSim.Region.Environment.Scenes } /// - /// Request a Avatar by UUID + /// Request a scene presence by UUID /// /// /// diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 96c919cce6..a2c16b69c6 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -1923,8 +1923,8 @@ namespace OpenSim.Region.ScriptEngine.Common if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero) { - - ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[InventorySelf()].PermsGranter]; + ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[InventorySelf()].PermsGranter); + if (presence != null) { if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0) @@ -1950,8 +1950,8 @@ namespace OpenSim.Region.ScriptEngine.Common if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero) { - - ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[InventorySelf()].PermsGranter]; + ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[InventorySelf()].PermsGranter); + if (presence != null) { if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0) @@ -2129,9 +2129,10 @@ namespace OpenSim.Region.ScriptEngine.Common if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION) != 0) { - if (World.m_innerScene.ScenePresences.ContainsKey(m_host.TaskInventory[invItemID].PermsGranter)) + ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter); + + if (presence != null) { - ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[invItemID].PermsGranter]; // Do NOT try to parse LLUUID, animations cannot be triggered by ID LLUUID animID=InventoryKey(anim, (int)AssetType.Animation); if (animID == LLUUID.Zero) @@ -2165,9 +2166,10 @@ namespace OpenSim.Region.ScriptEngine.Common if (animID == LLUUID.Zero) return; - if (World.m_innerScene.ScenePresences.ContainsKey(m_host.TaskInventory[invItemID].PermsGranter)) + ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter); + + if (presence != null) { - ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[invItemID].PermsGranter]; if (animID == LLUUID.Zero) presence.RemoveAnimation(anim); else @@ -2271,13 +2273,14 @@ namespace OpenSim.Region.ScriptEngine.Common } } - if (World.m_innerScene.ScenePresences.ContainsKey(agentID)) + ScenePresence presence = World.GetScenePresence(agentID); + + if (presence != null) { string ownerName=resolveName(m_host.ParentGroup.RootPart.OwnerID); if (ownerName == String.Empty) ownerName="(hippos)"; - ScenePresence presence = World.m_innerScene.ScenePresences[agentID]; if (!m_waitingForScriptAnswer) { m_host.TaskInventory[invItemID].PermsGranter=agentID; @@ -3711,10 +3714,13 @@ namespace OpenSim.Region.ScriptEngine.Common LLUUID key = new LLUUID(); if (LLUUID.TryParse(id,out key)) { - if (World.m_innerScene.ScenePresences.ContainsKey(key)) + ScenePresence presence = World.GetScenePresence(key); + + if (presence != null) { - return World.m_innerScene.ScenePresences[key].Firstname + " " + World.m_innerScene.ScenePresences[key].Lastname; + return presence.Name; } + if (World.GetSceneObjectPart(key) != null) { return World.GetSceneObjectPart(key).Name; @@ -3867,9 +3873,9 @@ namespace OpenSim.Region.ScriptEngine.Common LLUUID key = new LLUUID(); if (LLUUID.TryParse(id, out key)) - { - + { ScenePresence av = World.GetScenePresence(key); + if (av != null) { if (llAvatarOnSitTarget() == id) @@ -6162,10 +6168,11 @@ namespace OpenSim.Region.ScriptEngine.Common LLUUID key = new LLUUID(); if (LLUUID.TryParse(id, out key)) { - if (World.m_innerScene.ScenePresences.ContainsKey(key)) + ScenePresence av = World.GetScenePresence(key); + + if (av != null); { - ScenePresence av = World.m_innerScene.ScenePresences[key]; - foreach(object o in args.Data) + foreach (object o in args.Data) { switch(o.ToString()) {