mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
* 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!
This commit is contained in:
@@ -1936,25 +1936,53 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
public void llTakeControls(int controls, int accept, int pass_on)
|
||||
{
|
||||
if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero)
|
||||
{
|
||||
|
||||
ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[InventorySelf()].PermsGranter];
|
||||
if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0)
|
||||
if (presence != null)
|
||||
{
|
||||
presence.SendMovementEventsToScript(controls, accept, pass_on, m_localID, m_itemID);
|
||||
if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0)
|
||||
{
|
||||
presence.RegisterControlEventsToScript(controls, accept, pass_on, m_localID, m_itemID);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_host.AddScriptLPS(1);
|
||||
NotImplemented("llTakeControls");
|
||||
//NotImplemented("llTakeControls");
|
||||
}
|
||||
|
||||
public void llReleaseControls()
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
NotImplemented("llReleaseControls");
|
||||
|
||||
if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_host.TaskInventory[InventorySelf()].PermsGranter != LLUUID.Zero)
|
||||
{
|
||||
|
||||
ScenePresence presence = World.m_innerScene.ScenePresences[m_host.TaskInventory[InventorySelf()].PermsGranter];
|
||||
if (presence != null)
|
||||
{
|
||||
if ((m_host.TaskInventory[InventorySelf()].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS) != 0)
|
||||
{
|
||||
// Unregister controls from Presence
|
||||
presence.UnRegisterControlEventsToScript(m_localID, m_itemID);
|
||||
// Remove Take Control permission.
|
||||
m_host.TaskInventory[InventorySelf()].PermsMask &= ~BuiltIn_Commands_BaseClass.PERMISSION_TAKE_CONTROLS;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void llAttachToAvatar(int attachment)
|
||||
|
||||
@@ -225,9 +225,9 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||
myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "no_sensor", EventQueueManager.llDetectNull);
|
||||
}
|
||||
|
||||
public void control(uint localID, LLUUID itemID)
|
||||
public void control(uint localID, LLUUID itemID, LLUUID agentID, uint held, uint change)
|
||||
{
|
||||
myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "control", EventQueueManager.llDetectNull);
|
||||
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)});
|
||||
}
|
||||
|
||||
public void email(uint localID, LLUUID itemID)
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
void on_rez(uint localID, LLUUID itemID);
|
||||
void sensor(uint localID, LLUUID itemID);
|
||||
void no_sensor(uint localID, LLUUID itemID);
|
||||
void control(uint localID, LLUUID itemID);
|
||||
void control(uint localID, LLUUID itemID, LLUUID agentID, uint held, uint change);
|
||||
void money(uint LocalID, LLUUID agentID, int amount);
|
||||
void email(uint localID, LLUUID itemID);
|
||||
void at_target(uint localID, uint handle, LLVector3 targetpos, LLVector3 atpos);
|
||||
|
||||
Reference in New Issue
Block a user