diff options
-rw-r--r-- | OpenSim/Framework/ChildAgentDataUpdate.cs | 7 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 26 |
2 files changed, 31 insertions, 2 deletions
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index fe12874..abff44a 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs | |||
@@ -229,12 +229,14 @@ namespace OpenSim.Framework | |||
229 | 229 | ||
230 | public class ControllerData | 230 | public class ControllerData |
231 | { | 231 | { |
232 | public UUID ObjectID; | ||
232 | public UUID ItemID; | 233 | public UUID ItemID; |
233 | public uint IgnoreControls; | 234 | public uint IgnoreControls; |
234 | public uint EventControls; | 235 | public uint EventControls; |
235 | 236 | ||
236 | public ControllerData(UUID item, uint ignore, uint ev) | 237 | public ControllerData(UUID obj, UUID item, uint ignore, uint ev) |
237 | { | 238 | { |
239 | ObjectID = obj; | ||
238 | ItemID = item; | 240 | ItemID = item; |
239 | IgnoreControls = ignore; | 241 | IgnoreControls = ignore; |
240 | EventControls = ev; | 242 | EventControls = ev; |
@@ -248,6 +250,7 @@ namespace OpenSim.Framework | |||
248 | public OSDMap PackUpdateMessage() | 250 | public OSDMap PackUpdateMessage() |
249 | { | 251 | { |
250 | OSDMap controldata = new OSDMap(); | 252 | OSDMap controldata = new OSDMap(); |
253 | controldata["object"] = OSD.FromUUID(ObjectID); | ||
251 | controldata["item"] = OSD.FromUUID(ItemID); | 254 | controldata["item"] = OSD.FromUUID(ItemID); |
252 | controldata["ignore"] = OSD.FromInteger(IgnoreControls); | 255 | controldata["ignore"] = OSD.FromInteger(IgnoreControls); |
253 | controldata["event"] = OSD.FromInteger(EventControls); | 256 | controldata["event"] = OSD.FromInteger(EventControls); |
@@ -258,6 +261,8 @@ namespace OpenSim.Framework | |||
258 | 261 | ||
259 | public void UnpackUpdateMessage(OSDMap args) | 262 | public void UnpackUpdateMessage(OSDMap args) |
260 | { | 263 | { |
264 | if (args["object"] != null) | ||
265 | ObjectID = args["object"].AsUUID(); | ||
261 | if (args["item"] != null) | 266 | if (args["item"] != null) |
262 | ItemID = args["item"].AsUUID(); | 267 | ItemID = args["item"].AsUUID(); |
263 | if (args["ignore"] != null) | 268 | if (args["ignore"] != null) |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 80f21ce..b0147f2 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -62,6 +62,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
62 | 62 | ||
63 | struct ScriptControllers | 63 | struct ScriptControllers |
64 | { | 64 | { |
65 | public UUID objectID; | ||
65 | public UUID itemID; | 66 | public UUID itemID; |
66 | public ScriptControlled ignoreControls; | 67 | public ScriptControlled ignoreControls; |
67 | public ScriptControlled eventControls; | 68 | public ScriptControlled eventControls; |
@@ -1890,6 +1891,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1890 | if (ParentID != 0) | 1891 | if (ParentID != 0) |
1891 | { | 1892 | { |
1892 | SceneObjectPart part = ParentPart; | 1893 | SceneObjectPart part = ParentPart; |
1894 | UnRegisterSeatControls(part.ParentGroup.UUID); | ||
1895 | |||
1893 | TaskInventoryDictionary taskIDict = part.TaskInventory; | 1896 | TaskInventoryDictionary taskIDict = part.TaskInventory; |
1894 | if (taskIDict != null) | 1897 | if (taskIDict != null) |
1895 | { | 1898 | { |
@@ -3217,7 +3220,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3217 | 3220 | ||
3218 | foreach (ScriptControllers c in scriptedcontrols.Values) | 3221 | foreach (ScriptControllers c in scriptedcontrols.Values) |
3219 | { | 3222 | { |
3220 | controls[i++] = new ControllerData(c.itemID, (uint)c.ignoreControls, (uint)c.eventControls); | 3223 | controls[i++] = new ControllerData(c.objectID, c.itemID, (uint)c.ignoreControls, (uint)c.eventControls); |
3221 | } | 3224 | } |
3222 | cAgent.Controllers = controls; | 3225 | cAgent.Controllers = controls; |
3223 | } | 3226 | } |
@@ -3307,6 +3310,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3307 | foreach (ControllerData c in cAgent.Controllers) | 3310 | foreach (ControllerData c in cAgent.Controllers) |
3308 | { | 3311 | { |
3309 | ScriptControllers sc = new ScriptControllers(); | 3312 | ScriptControllers sc = new ScriptControllers(); |
3313 | sc.objectID = c.ObjectID; | ||
3310 | sc.itemID = c.ItemID; | 3314 | sc.itemID = c.ItemID; |
3311 | sc.ignoreControls = (ScriptControlled)c.IgnoreControls; | 3315 | sc.ignoreControls = (ScriptControlled)c.IgnoreControls; |
3312 | sc.eventControls = (ScriptControlled)c.EventControls; | 3316 | sc.eventControls = (ScriptControlled)c.EventControls; |
@@ -3702,10 +3706,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
3702 | 3706 | ||
3703 | public void RegisterControlEventsToScript(int controls, int accept, int pass_on, uint Obj_localID, UUID Script_item_UUID) | 3707 | public void RegisterControlEventsToScript(int controls, int accept, int pass_on, uint Obj_localID, UUID Script_item_UUID) |
3704 | { | 3708 | { |
3709 | SceneObjectPart p = m_scene.GetSceneObjectPart(Obj_localID); | ||
3710 | if (p == null) | ||
3711 | return; | ||
3712 | |||
3705 | ScriptControllers obj = new ScriptControllers(); | 3713 | ScriptControllers obj = new ScriptControllers(); |
3706 | obj.ignoreControls = ScriptControlled.CONTROL_ZERO; | 3714 | obj.ignoreControls = ScriptControlled.CONTROL_ZERO; |
3707 | obj.eventControls = ScriptControlled.CONTROL_ZERO; | 3715 | obj.eventControls = ScriptControlled.CONTROL_ZERO; |
3708 | 3716 | ||
3717 | obj.objectID = p.ParentGroup.UUID; | ||
3709 | obj.itemID = Script_item_UUID; | 3718 | obj.itemID = Script_item_UUID; |
3710 | if (pass_on == 0 && accept == 0) | 3719 | if (pass_on == 0 && accept == 0) |
3711 | { | 3720 | { |
@@ -3754,6 +3763,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
3754 | ControllingClient.SendTakeControls(int.MaxValue, false, false); | 3763 | ControllingClient.SendTakeControls(int.MaxValue, false, false); |
3755 | } | 3764 | } |
3756 | 3765 | ||
3766 | private void UnRegisterSeatControls(UUID obj) | ||
3767 | { | ||
3768 | List<UUID> takers = new List<UUID>(); | ||
3769 | |||
3770 | foreach (ScriptControllers c in scriptedcontrols.Values) | ||
3771 | { | ||
3772 | if (c.objectID == obj) | ||
3773 | takers.Add(c.itemID); | ||
3774 | } | ||
3775 | foreach (UUID t in takers) | ||
3776 | { | ||
3777 | UnRegisterControlEventsToScript(0, t); | ||
3778 | } | ||
3779 | } | ||
3780 | |||
3757 | public void UnRegisterControlEventsToScript(uint Obj_localID, UUID Script_item_UUID) | 3781 | public void UnRegisterControlEventsToScript(uint Obj_localID, UUID Script_item_UUID) |
3758 | { | 3782 | { |
3759 | ScriptControllers takecontrols; | 3783 | ScriptControllers takecontrols; |