diff options
author | Justin Clarke Casey | 2008-05-13 18:25:15 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-05-13 18:25:15 +0000 |
commit | 3025dafa9221f51e4f290b0419c48e914dcf5a32 (patch) | |
tree | 90e2f8cfa3e6ccf8c1afc9bf988354987f301860 /OpenSim/Region/ScriptEngine/Common | |
parent | *Fixed compile error on last commit (diff) | |
download | opensim-SC-3025dafa9221f51e4f290b0419c48e914dcf5a32.zip opensim-SC-3025dafa9221f51e4f290b0419c48e914dcf5a32.tar.gz opensim-SC-3025dafa9221f51e4f290b0419c48e914dcf5a32.tar.bz2 opensim-SC-3025dafa9221f51e4f290b0419c48e914dcf5a32.tar.xz |
* Refactor: Stop exposing the inner scene's ScenePresence dictionary directly to the world
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 96c919c..a2c16b6 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 | |||
1923 | 1923 | ||
1924 | if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero) | 1924 | if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero) |
1925 | { | 1925 | { |
1926 | 1926 | ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[InventorySelf()].PermsGranter); | |
1927 | ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[InventorySelf()].PermsGranter]; | 1927 | |
1928 | if (presence != null) | 1928 | if (presence != null) |
1929 | { | 1929 | { |
1930 | if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0) | 1930 | if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0) |
@@ -1950,8 +1950,8 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1950 | 1950 | ||
1951 | if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero) | 1951 | if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero) |
1952 | { | 1952 | { |
1953 | 1953 | ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[InventorySelf()].PermsGranter); | |
1954 | ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[InventorySelf()].PermsGranter]; | 1954 | |
1955 | if (presence != null) | 1955 | if (presence != null) |
1956 | { | 1956 | { |
1957 | if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0) | 1957 | if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0) |
@@ -2129,9 +2129,10 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2129 | 2129 | ||
2130 | if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION) != 0) | 2130 | if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TRIGGER_ANIMATION) != 0) |
2131 | { | 2131 | { |
2132 | if (World.m_innerScene.ScenePresences.ContainsKey(m_host.TaskInventory[invItemID].PermsGranter)) | 2132 | ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter); |
2133 | |||
2134 | if (presence != null) | ||
2133 | { | 2135 | { |
2134 | ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[invItemID].PermsGranter]; | ||
2135 | // Do NOT try to parse LLUUID, animations cannot be triggered by ID | 2136 | // Do NOT try to parse LLUUID, animations cannot be triggered by ID |
2136 | LLUUID animID=InventoryKey(anim, (int)AssetType.Animation); | 2137 | LLUUID animID=InventoryKey(anim, (int)AssetType.Animation); |
2137 | if (animID == LLUUID.Zero) | 2138 | if (animID == LLUUID.Zero) |
@@ -2165,9 +2166,10 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2165 | if (animID == LLUUID.Zero) | 2166 | if (animID == LLUUID.Zero) |
2166 | return; | 2167 | return; |
2167 | 2168 | ||
2168 | if (World.m_innerScene.ScenePresences.ContainsKey(m_host.TaskInventory[invItemID].PermsGranter)) | 2169 | ScenePresence presence = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter); |
2170 | |||
2171 | if (presence != null) | ||
2169 | { | 2172 | { |
2170 | ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[invItemID].PermsGranter]; | ||
2171 | if (animID == LLUUID.Zero) | 2173 | if (animID == LLUUID.Zero) |
2172 | presence.RemoveAnimation(anim); | 2174 | presence.RemoveAnimation(anim); |
2173 | else | 2175 | else |
@@ -2271,13 +2273,14 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2271 | } | 2273 | } |
2272 | } | 2274 | } |
2273 | 2275 | ||
2274 | if (World.m_innerScene.ScenePresences.ContainsKey(agentID)) | 2276 | ScenePresence presence = World.GetScenePresence(agentID); |
2277 | |||
2278 | if (presence != null) | ||
2275 | { | 2279 | { |
2276 | string ownerName=resolveName(m_host.ParentGroup.RootPart.OwnerID); | 2280 | string ownerName=resolveName(m_host.ParentGroup.RootPart.OwnerID); |
2277 | if (ownerName == String.Empty) | 2281 | if (ownerName == String.Empty) |
2278 | ownerName="(hippos)"; | 2282 | ownerName="(hippos)"; |
2279 | 2283 | ||
2280 | ScenePresence presence = World.m_innerScene.ScenePresences[agentID]; | ||
2281 | if (!m_waitingForScriptAnswer) | 2284 | if (!m_waitingForScriptAnswer) |
2282 | { | 2285 | { |
2283 | m_host.TaskInventory[invItemID].PermsGranter=agentID; | 2286 | m_host.TaskInventory[invItemID].PermsGranter=agentID; |
@@ -3711,10 +3714,13 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3711 | LLUUID key = new LLUUID(); | 3714 | LLUUID key = new LLUUID(); |
3712 | if (LLUUID.TryParse(id,out key)) | 3715 | if (LLUUID.TryParse(id,out key)) |
3713 | { | 3716 | { |
3714 | if (World.m_innerScene.ScenePresences.ContainsKey(key)) | 3717 | ScenePresence presence = World.GetScenePresence(key); |
3718 | |||
3719 | if (presence != null) | ||
3715 | { | 3720 | { |
3716 | return World.m_innerScene.ScenePresences[key].Firstname + " " + World.m_innerScene.ScenePresences[key].Lastname; | 3721 | return presence.Name; |
3717 | } | 3722 | } |
3723 | |||
3718 | if (World.GetSceneObjectPart(key) != null) | 3724 | if (World.GetSceneObjectPart(key) != null) |
3719 | { | 3725 | { |
3720 | return World.GetSceneObjectPart(key).Name; | 3726 | return World.GetSceneObjectPart(key).Name; |
@@ -3867,9 +3873,9 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3867 | 3873 | ||
3868 | LLUUID key = new LLUUID(); | 3874 | LLUUID key = new LLUUID(); |
3869 | if (LLUUID.TryParse(id, out key)) | 3875 | if (LLUUID.TryParse(id, out key)) |
3870 | { | 3876 | { |
3871 | |||
3872 | ScenePresence av = World.GetScenePresence(key); | 3877 | ScenePresence av = World.GetScenePresence(key); |
3878 | |||
3873 | if (av != null) | 3879 | if (av != null) |
3874 | { | 3880 | { |
3875 | if (llAvatarOnSitTarget() == id) | 3881 | if (llAvatarOnSitTarget() == id) |
@@ -6162,10 +6168,11 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
6162 | LLUUID key = new LLUUID(); | 6168 | LLUUID key = new LLUUID(); |
6163 | if (LLUUID.TryParse(id, out key)) | 6169 | if (LLUUID.TryParse(id, out key)) |
6164 | { | 6170 | { |
6165 | if (World.m_innerScene.ScenePresences.ContainsKey(key)) | 6171 | ScenePresence av = World.GetScenePresence(key); |
6172 | |||
6173 | if (av != null); | ||
6166 | { | 6174 | { |
6167 | ScenePresence av = World.m_innerScene.ScenePresences[key]; | 6175 | foreach (object o in args.Data) |
6168 | foreach(object o in args.Data) | ||
6169 | { | 6176 | { |
6170 | switch(o.ToString()) | 6177 | switch(o.ToString()) |
6171 | { | 6178 | { |