aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common
diff options
context:
space:
mode:
authorTeravus Ovares2008-05-07 18:23:46 +0000
committerTeravus Ovares2008-05-07 18:23:46 +0000
commitab5556055e6104d3e5c18faf7f6f9e44b518839f (patch)
tree470dfe3c97a2cae75e85853a898f59a8d96548bd /OpenSim/Region/ScriptEngine/Common
parentwhile I'm not convinced this is causing my current run away (diff)
downloadopensim-SC_OLD-ab5556055e6104d3e5c18faf7f6f9e44b518839f.zip
opensim-SC_OLD-ab5556055e6104d3e5c18faf7f6f9e44b518839f.tar.gz
opensim-SC_OLD-ab5556055e6104d3e5c18faf7f6f9e44b518839f.tar.bz2
opensim-SC_OLD-ab5556055e6104d3e5c18faf7f6f9e44b518839f.tar.xz
* Theoretically, everything is in place for scripted take controls... Theoretically.
* I've still got to test, it's still theoretical code :D. Good thing it isn't enabled by default!
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs36
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs2
3 files changed, 35 insertions, 7 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index e8e4f80..1f23d00 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -1936,25 +1936,53 @@ namespace OpenSim.Region.ScriptEngine.Common
1936 1936
1937 public void llTakeControls(int controls, int accept, int pass_on) 1937 public void llTakeControls(int controls, int accept, int pass_on)
1938 { 1938 {
1939 if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
1940 {
1941 return;
1942 }
1943
1939 if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero) 1944 if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero)
1940 { 1945 {
1941 1946
1942 ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[InventorySelf()].PermsGranter]; 1947 ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[InventorySelf()].PermsGranter];
1943 if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0) 1948 if (presence != null)
1944 { 1949 {
1945 presence.SendMovementEventsToScript(controls, accept, pass_on, m_localID, m_itemID); 1950 if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0)
1951 {
1952 presence.RegisterControlEventsToScript(controls, accept, pass_on, m_localID, m_itemID);
1946 1953
1954 }
1947 } 1955 }
1948 } 1956 }
1949 1957
1950 m_host.AddScriptLPS(1); 1958 m_host.AddScriptLPS(1);
1951 NotImplemented("llTakeControls"); 1959 //NotImplemented("llTakeControls");
1952 } 1960 }
1953 1961
1954 public void llReleaseControls() 1962 public void llReleaseControls()
1955 { 1963 {
1956 m_host.AddScriptLPS(1); 1964 m_host.AddScriptLPS(1);
1957 NotImplemented("llReleaseControls"); 1965
1966 if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
1967 {
1968 return;
1969 }
1970
1971 if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero)
1972 {
1973
1974 ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[InventorySelf()].PermsGranter];
1975 if (presence != null)
1976 {
1977 if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0)
1978 {
1979 // Unregister controls from Presence
1980 presence.UnRegisterControlEventsToScript(m_localID, m_itemID);
1981 // Remove Take Control permission.
1982 m_host.TaskInventory[InventorySelf()].PermsMask &= ~BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS;
1983 }
1984 }
1985 }
1958 } 1986 }
1959 1987
1960 public void llAttachToAvatar(int attachment) 1988 public void llAttachToAvatar(int attachment)
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs
index 77a4048..f8f38a1 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs
@@ -225,9 +225,9 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
225 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "no_sensor", EventQueueManager.llDetectNull); 225 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "no_sensor", EventQueueManager.llDetectNull);
226 } 226 }
227 227
228 public void control(uint localID, LLUUID itemID) 228 public void control(uint localID, LLUUID itemID, LLUUID agentID, uint held, uint change)
229 { 229 {
230 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "control", EventQueueManager.llDetectNull); 230 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "control", EventQueueManager.llDetectNull, new object[] { new LSL_Types.LSLString(agentID.ToString()), new LSL_Types.LSLInteger(held), new LSL_Types.LSLInteger(change)});
231 } 231 }
232 232
233 public void email(uint localID, LLUUID itemID) 233 public void email(uint localID, LLUUID itemID)
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs
index 1edd3bd..be42539 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs
@@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.Common
54 void on_rez(uint localID, LLUUID itemID); 54 void on_rez(uint localID, LLUUID itemID);
55 void sensor(uint localID, LLUUID itemID); 55 void sensor(uint localID, LLUUID itemID);
56 void no_sensor(uint localID, LLUUID itemID); 56 void no_sensor(uint localID, LLUUID itemID);
57 void control(uint localID, LLUUID itemID); 57 void control(uint localID, LLUUID itemID, LLUUID agentID, uint held, uint change);
58 void money(uint LocalID, LLUUID agentID, int amount); 58 void money(uint LocalID, LLUUID agentID, int amount);
59 void email(uint localID, LLUUID itemID); 59 void email(uint localID, LLUUID itemID);
60 void at_target(uint localID, uint handle, LLVector3 targetpos, LLVector3 atpos); 60 void at_target(uint localID, uint handle, LLVector3 targetpos, LLVector3 atpos);