diff options
author | Teravus Ovares | 2008-04-27 22:15:38 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-04-27 22:15:38 +0000 |
commit | 54563d8dea86ca1e022f3aafa791908e8bcc4912 (patch) | |
tree | 2eab339160a5f89cb637c6554e6d56be594d2180 /OpenSim/Region/Environment | |
parent | * Single Attachments now work from inventory. You can attach from inventory ... (diff) | |
download | opensim-SC_OLD-54563d8dea86ca1e022f3aafa791908e8bcc4912.zip opensim-SC_OLD-54563d8dea86ca1e022f3aafa791908e8bcc4912.tar.gz opensim-SC_OLD-54563d8dea86ca1e022f3aafa791908e8bcc4912.tar.bz2 opensim-SC_OLD-54563d8dea86ca1e022f3aafa791908e8bcc4912.tar.xz |
* Patch from XenReborn to make remove-region work properly without needing to do a change-region first. Careful though. I still suggest you do a change-region first.
* Patch from Melanie to implement touch_end.
* Thanks XenReborn!. Thanks Melanie!
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/InnerScene.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs | 55 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneEvents.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneManager.cs | 15 |
5 files changed, 72 insertions, 14 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 104ae48..d00f601 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs | |||
@@ -324,8 +324,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
324 | // Calls attach with a Zero position | 324 | // Calls attach with a Zero position |
325 | AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, LLVector3.Zero); | 325 | AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, LLVector3.Zero); |
326 | } | 326 | } |
327 | public void RezSingleAttachment(IClientAPI remoteClient, LLUUID itemID, uint AttachmentPt, | 327 | public void RezSingleAttachment(IClientAPI remoteClient, LLUUID itemID, uint AttachmentPt,uint ItemFlags, uint NextOwnerMask) |
328 | uint ItemFlags, uint NextOwnerMask) | ||
329 | { | 328 | { |
330 | SceneObjectGroup objatt = m_parentScene.RezObject(remoteClient, itemID, LLVector3.Zero, LLVector3.Zero, LLUUID.Zero, (byte)1, true, | 329 | SceneObjectGroup objatt = m_parentScene.RezObject(remoteClient, itemID, LLVector3.Zero, LLVector3.Zero, LLUUID.Zero, (byte)1, true, |
331 | (uint)(PermissionMask.Copy | PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer), | 330 | (uint)(PermissionMask.Copy | PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer), |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index 5e0b8ba..71b2716 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs | |||
@@ -151,22 +151,57 @@ namespace OpenSim.Region.Environment.Scenes | |||
151 | if (ent is SceneObjectGroup) | 151 | if (ent is SceneObjectGroup) |
152 | { | 152 | { |
153 | SceneObjectGroup obj = ent as SceneObjectGroup; | 153 | SceneObjectGroup obj = ent as SceneObjectGroup; |
154 | if (obj != null) | ||
155 | { | ||
156 | // Is this prim part of the group | ||
157 | if (obj.HasChildPrim(localID)) | ||
158 | { | ||
159 | // Currently only grab/touch for the single prim | ||
160 | // the client handles rez correctly | ||
161 | obj.ObjectGrabHandler(localID, offsetPos, remoteClient); | ||
162 | |||
163 | SceneObjectPart part = obj.GetChildPart(localID); | ||
164 | |||
165 | // If the touched prim handles touches, deliver it | ||
166 | // If not, deliver to root prim | ||
167 | if ((part.ObjectFlags & (uint)LLObject.ObjectFlags.Touch) != 0) | ||
168 | EventManager.TriggerObjectGrab(part.LocalId, part.OffsetPosition, remoteClient); | ||
169 | else | ||
170 | EventManager.TriggerObjectGrab(obj.RootPart.LocalId, part.OffsetPosition, remoteClient); | ||
171 | |||
172 | return; | ||
173 | } | ||
174 | } | ||
175 | } | ||
176 | } | ||
177 | } | ||
178 | |||
179 | public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient) | ||
180 | { | ||
181 | |||
182 | List<EntityBase> EntitieList = GetEntities(); | ||
183 | |||
184 | foreach (EntityBase ent in EntitieList) | ||
185 | { | ||
186 | if (ent is SceneObjectGroup) | ||
187 | { | ||
188 | SceneObjectGroup obj = ent as SceneObjectGroup; | ||
154 | 189 | ||
155 | // Is this prim part of the group | 190 | // Is this prim part of the group |
156 | if (obj.HasChildPrim(localID)) | 191 | if (obj.HasChildPrim(localID)) |
157 | { | 192 | { |
158 | // Currently only grab/touch for the single prim | 193 | SceneObjectPart part=obj.GetChildPart(localID); |
159 | // the client handles rez correctly | 194 | if (part != null) |
160 | obj.ObjectGrabHandler(localID, offsetPos, remoteClient); | ||
161 | |||
162 | // trigger event, one for each prim part in the group | ||
163 | // so that a touch to a non-root prim in a group will still | ||
164 | // trigger a touch_start for a script in the root prim | ||
165 | foreach (SceneObjectPart part in obj.Children.Values) | ||
166 | { | 195 | { |
167 | EventManager.TriggerObjectGrab(part.LocalId, part.OffsetPosition, remoteClient); | 196 | // If the touched prim handles touches, deliver it |
197 | // If not, deliver to root prim | ||
198 | if ((part.ObjectFlags & (uint)LLObject.ObjectFlags.Touch) != 0) | ||
199 | EventManager.TriggerObjectDeGrab(part.LocalId, remoteClient); | ||
200 | else | ||
201 | EventManager.TriggerObjectDeGrab(obj.RootPart.LocalId, remoteClient); | ||
202 | |||
203 | return; | ||
168 | } | 204 | } |
169 | |||
170 | return; | 205 | return; |
171 | } | 206 | } |
172 | } | 207 | } |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index f94aec7..a517e69 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -1617,6 +1617,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1617 | client.OnMoveTaskItem += MoveTaskInventoryItem; | 1617 | client.OnMoveTaskItem += MoveTaskInventoryItem; |
1618 | 1618 | ||
1619 | client.OnGrabObject += ProcessObjectGrab; | 1619 | client.OnGrabObject += ProcessObjectGrab; |
1620 | client.OnDeGrabObject += ProcessObjectDeGrab; | ||
1620 | client.OnMoneyTransferRequest += ProcessMoneyTransferRequest; | 1621 | client.OnMoneyTransferRequest += ProcessMoneyTransferRequest; |
1621 | client.OnParcelBuy += ProcessParcelBuy; | 1622 | client.OnParcelBuy += ProcessParcelBuy; |
1622 | client.OnAvatarPickerRequest += ProcessAvatarPickerRequest; | 1623 | client.OnAvatarPickerRequest += ProcessAvatarPickerRequest; |
diff --git a/OpenSim/Region/Environment/Scenes/SceneEvents.cs b/OpenSim/Region/Environment/Scenes/SceneEvents.cs index 74554c3..769817e 100644 --- a/OpenSim/Region/Environment/Scenes/SceneEvents.cs +++ b/OpenSim/Region/Environment/Scenes/SceneEvents.cs | |||
@@ -83,10 +83,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
83 | public event OnShutdownDelegate OnShutdown; | 83 | public event OnShutdownDelegate OnShutdown; |
84 | 84 | ||
85 | public delegate void ObjectGrabDelegate(uint localID, LLVector3 offsetPos, IClientAPI remoteClient); | 85 | public delegate void ObjectGrabDelegate(uint localID, LLVector3 offsetPos, IClientAPI remoteClient); |
86 | public delegate void ObjectDeGrabDelegate(uint localID, IClientAPI remoteClient); | ||
86 | 87 | ||
87 | public delegate void OnPermissionErrorDelegate(LLUUID user, string reason); | 88 | public delegate void OnPermissionErrorDelegate(LLUUID user, string reason); |
88 | 89 | ||
89 | public event ObjectGrabDelegate OnObjectGrab; | 90 | public event ObjectGrabDelegate OnObjectGrab; |
91 | public event ObjectDeGrabDelegate OnObjectDeGrab; | ||
90 | 92 | ||
91 | public event OnPermissionErrorDelegate OnPermissionError; | 93 | public event OnPermissionErrorDelegate OnPermissionError; |
92 | 94 | ||
@@ -247,6 +249,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
247 | private OnParcelPrimCountAddDelegate handlerParcelPrimCountAdd = null; //OnParcelPrimCountAdd; | 249 | private OnParcelPrimCountAddDelegate handlerParcelPrimCountAdd = null; //OnParcelPrimCountAdd; |
248 | private OnShutdownDelegate handlerShutdown = null; //OnShutdown; | 250 | private OnShutdownDelegate handlerShutdown = null; //OnShutdown; |
249 | private ObjectGrabDelegate handlerObjectGrab = null; //OnObjectGrab; | 251 | private ObjectGrabDelegate handlerObjectGrab = null; //OnObjectGrab; |
252 | private ObjectDeGrabDelegate handlerObjectDeGrab = null; //OnObjectDeGrab; | ||
250 | private NewRezScript handlerRezScript = null; //OnRezScript; | 253 | private NewRezScript handlerRezScript = null; //OnRezScript; |
251 | private RemoveScript handlerRemoveScript = null; //OnRemoveScript; | 254 | private RemoveScript handlerRemoveScript = null; //OnRemoveScript; |
252 | private SceneGroupMoved handlerSceneGroupMove = null; //OnSceneGroupMove; | 255 | private SceneGroupMoved handlerSceneGroupMove = null; //OnSceneGroupMove; |
@@ -386,6 +389,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
386 | } | 389 | } |
387 | } | 390 | } |
388 | 391 | ||
392 | public void TriggerObjectDeGrab(uint localID, IClientAPI remoteClient) | ||
393 | { | ||
394 | handlerObjectDeGrab = OnObjectDeGrab; | ||
395 | if (handlerObjectDeGrab != null) | ||
396 | { | ||
397 | handlerObjectDeGrab(localID, remoteClient); | ||
398 | } | ||
399 | } | ||
400 | |||
389 | public void TriggerRezScript(uint localID, LLUUID itemID, string script) | 401 | public void TriggerRezScript(uint localID, LLUUID itemID, string script) |
390 | { | 402 | { |
391 | handlerRezScript = OnRezScript; | 403 | handlerRezScript = OnRezScript; |
diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs index 2dfea2a..4ded1a7 100644 --- a/OpenSim/Region/Environment/Scenes/SceneManager.cs +++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs | |||
@@ -268,15 +268,26 @@ namespace OpenSim.Region.Environment.Scenes | |||
268 | 268 | ||
269 | public bool TryGetScene(string regionName, out Scene scene) | 269 | public bool TryGetScene(string regionName, out Scene scene) |
270 | { | 270 | { |
271 | scene = null; | ||
272 | |||
271 | foreach (Scene mscene in m_localScenes) | 273 | foreach (Scene mscene in m_localScenes) |
272 | { | 274 | { |
273 | if (String.Compare(mscene.RegionInfo.RegionName, regionName, true) == 0) | 275 | Console.Write("Region tested: " + mscene.RegionInfo.RegionName+" With ID: "+mscene.RegionInfo.RegionID.ToString()); |
276 | |||
277 | |||
278 | bool b = String.Compare(mscene.RegionInfo.RegionName.Trim(), regionName.Trim(), true) == 0; | ||
279 | |||
280 | Console.WriteLine(" <==> Result: " + b.ToString()); | ||
281 | |||
282 | if (b) | ||
274 | { | 283 | { |
284 | |||
285 | Console.WriteLine("FOUND assigning region to out parameter"); | ||
275 | scene = mscene; | 286 | scene = mscene; |
276 | return true; | 287 | return true; |
277 | } | 288 | } |
278 | } | 289 | } |
279 | scene = null; | 290 | |
280 | return false; | 291 | return false; |
281 | } | 292 | } |
282 | 293 | ||