diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/InnerScene.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/InnerScene.cs | 198 |
1 files changed, 91 insertions, 107 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index da286ad..3889741 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs | |||
@@ -46,36 +46,33 @@ namespace OpenSim.Region.Environment.Scenes | |||
46 | 46 | ||
47 | #region Events | 47 | #region Events |
48 | 48 | ||
49 | private PhysicsCrash handlerPhysicsCrash; | ||
49 | public event PhysicsCrash UnRecoverableError; | 50 | public event PhysicsCrash UnRecoverableError; |
50 | private PhysicsCrash handlerPhysicsCrash = null; | ||
51 | 51 | ||
52 | #endregion | 52 | #endregion |
53 | 53 | ||
54 | #region Fields | 54 | #region Fields |
55 | 55 | ||
56 | public Dictionary<LLUUID, ScenePresence> ScenePresences; | ||
57 | // SceneObjects is not currently populated or used. | 56 | // SceneObjects is not currently populated or used. |
58 | //public Dictionary<LLUUID, SceneObjectGroup> SceneObjects; | 57 | //public Dictionary<LLUUID, SceneObjectGroup> SceneObjects; |
58 | public PhysicsScene _PhyScene; | ||
59 | public Dictionary<LLUUID, EntityBase> Entities; | 59 | public Dictionary<LLUUID, EntityBase> Entities; |
60 | public Dictionary<LLUUID, ScenePresence> RestorePresences; | 60 | protected int m_activeScripts; |
61 | 61 | protected int m_numChildAgents; | |
62 | public BasicQuadTreeNode QuadTree; | 62 | protected int m_numPrim; |
63 | 63 | protected int m_numRootAgents; | |
64 | protected RegionInfo m_regInfo; | ||
65 | protected Scene m_parentScene; | 64 | protected Scene m_parentScene; |
66 | protected PermissionManager PermissionsMngr; | 65 | protected int m_physicalPrim; |
67 | protected List<EntityBase> m_updateList = new List<EntityBase>(); | 66 | protected RegionInfo m_regInfo; |
68 | protected int m_numRootAgents = 0; | ||
69 | protected int m_numPrim = 0; | ||
70 | protected int m_numChildAgents = 0; | ||
71 | protected int m_physicalPrim = 0; | ||
72 | 67 | ||
73 | protected int m_activeScripts = 0; | 68 | protected int m_scriptLPS; |
74 | protected int m_scriptLPS = 0; | ||
75 | 69 | ||
76 | internal object m_syncRoot = new object(); | 70 | internal object m_syncRoot = new object(); |
77 | 71 | protected List<EntityBase> m_updateList = new List<EntityBase>(); | |
78 | public PhysicsScene _PhyScene; | 72 | protected PermissionManager PermissionsMngr; |
73 | public BasicQuadTreeNode QuadTree; | ||
74 | public Dictionary<LLUUID, ScenePresence> RestorePresences; | ||
75 | public Dictionary<LLUUID, ScenePresence> ScenePresences; | ||
79 | 76 | ||
80 | #endregion | 77 | #endregion |
81 | 78 | ||
@@ -84,7 +81,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
84 | m_parentScene = parent; | 81 | m_parentScene = parent; |
85 | m_regInfo = regInfo; | 82 | m_regInfo = regInfo; |
86 | PermissionsMngr = permissionsMngr; | 83 | PermissionsMngr = permissionsMngr; |
87 | QuadTree = new BasicQuadTreeNode(null, "/0/", 0, 0, (short)Constants.RegionSize, (short)Constants.RegionSize); | 84 | QuadTree = new BasicQuadTreeNode(null, "/0/", 0, 0, (short) Constants.RegionSize, (short) Constants.RegionSize); |
88 | QuadTree.Subdivide(); | 85 | QuadTree.Subdivide(); |
89 | QuadTree.Subdivide(); | 86 | QuadTree.Subdivide(); |
90 | } | 87 | } |
@@ -162,7 +159,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
162 | { | 159 | { |
163 | lock (m_syncRoot) | 160 | lock (m_syncRoot) |
164 | { | 161 | { |
165 | return _PhyScene.Simulate((float)elapsed); | 162 | return _PhyScene.Simulate((float) elapsed); |
166 | } | 163 | } |
167 | } | 164 | } |
168 | 165 | ||
@@ -187,7 +184,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
187 | foreach (SceneObjectPart part in sceneObject.Children.Values) | 184 | foreach (SceneObjectPart part in sceneObject.Children.Values) |
188 | { | 185 | { |
189 | part.LocalId = m_parentScene.PrimIDAllocate(); | 186 | part.LocalId = m_parentScene.PrimIDAllocate(); |
190 | |||
191 | } | 187 | } |
192 | sceneObject.UpdateParentIDs(); | 188 | sceneObject.UpdateParentIDs(); |
193 | AddEntity(sceneObject); | 189 | AddEntity(sceneObject); |
@@ -233,7 +229,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
233 | for (int i = 0; i < m_updateList.Count; i++) | 229 | for (int i = 0; i < m_updateList.Count; i++) |
234 | { | 230 | { |
235 | EntityBase entity = m_updateList[i]; | 231 | EntityBase entity = m_updateList[i]; |
236 | 232 | ||
237 | // Don't abort the whole update if one entity happens to give us an exception. | 233 | // Don't abort the whole update if one entity happens to give us an exception. |
238 | try | 234 | try |
239 | { | 235 | { |
@@ -249,7 +245,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
249 | } | 245 | } |
250 | catch (Exception e) | 246 | catch (Exception e) |
251 | { | 247 | { |
252 | m_log.ErrorFormat("[INNER SCENE]: Failed to update {0}, - {1}", entity.Name, e);//entity.m_uuid | 248 | m_log.ErrorFormat("[INNER SCENE]: Failed to update {0}, - {1}", entity.Name, e); //entity.m_uuid |
253 | } | 249 | } |
254 | } | 250 | } |
255 | m_updateList.Clear(); | 251 | m_updateList.Clear(); |
@@ -284,15 +280,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
284 | { | 280 | { |
285 | if (obj is SceneObjectGroup) | 281 | if (obj is SceneObjectGroup) |
286 | { | 282 | { |
287 | if (((SceneObjectGroup)obj).LocalId == localID) | 283 | if ((obj).LocalId == localID) |
288 | { | 284 | { |
289 | m_parentScene.RemoveEntity((SceneObjectGroup)obj); | 285 | m_parentScene.RemoveEntity((SceneObjectGroup) obj); |
290 | m_numPrim--; | 286 | m_numPrim--; |
291 | return; | 287 | return; |
292 | } | 288 | } |
293 | } | 289 | } |
294 | } | 290 | } |
295 | } | 291 | } |
292 | |||
296 | public void DetachObject(uint objectLocalID, IClientAPI remoteClient) | 293 | public void DetachObject(uint objectLocalID, IClientAPI remoteClient) |
297 | { | 294 | { |
298 | List<EntityBase> EntityList = GetEntities(); | 295 | List<EntityBase> EntityList = GetEntities(); |
@@ -301,29 +298,25 @@ namespace OpenSim.Region.Environment.Scenes | |||
301 | { | 298 | { |
302 | if (obj is SceneObjectGroup) | 299 | if (obj is SceneObjectGroup) |
303 | { | 300 | { |
304 | if (((SceneObjectGroup)obj).LocalId == objectLocalID) | 301 | if ((obj).LocalId == objectLocalID) |
305 | { | 302 | { |
306 | SceneObjectGroup group = (SceneObjectGroup)obj; | 303 | SceneObjectGroup group = (SceneObjectGroup) obj; |
307 | 304 | ||
308 | //group.DetachToGround(); | 305 | //group.DetachToGround(); |
309 | DetachSingleAttachmentToInv(group.GetFromAssetID(),remoteClient); | 306 | DetachSingleAttachmentToInv(group.GetFromAssetID(), remoteClient); |
310 | } | 307 | } |
311 | } | 308 | } |
312 | } | 309 | } |
313 | |||
314 | } | 310 | } |
315 | 311 | ||
316 | public void HandleUndo(IClientAPI remoteClient, LLUUID primId) | 312 | public void HandleUndo(IClientAPI remoteClient, LLUUID primId) |
317 | { | 313 | { |
318 | if (primId != LLUUID.Zero) | 314 | if (primId != LLUUID.Zero) |
319 | { | 315 | { |
320 | SceneObjectPart part = m_parentScene.GetSceneObjectPart(primId); | 316 | SceneObjectPart part = m_parentScene.GetSceneObjectPart(primId); |
321 | if (part != null) | 317 | if (part != null) |
322 | part.Undo(); | 318 | part.Undo(); |
323 | |||
324 | } | 319 | } |
325 | |||
326 | |||
327 | } | 320 | } |
328 | 321 | ||
329 | /// <summary> | 322 | /// <summary> |
@@ -338,27 +331,29 @@ namespace OpenSim.Region.Environment.Scenes | |||
338 | // Calls attach with a Zero position | 331 | // Calls attach with a Zero position |
339 | AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, LLVector3.Zero); | 332 | AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, LLVector3.Zero); |
340 | } | 333 | } |
341 | public void RezSingleAttachment(IClientAPI remoteClient, LLUUID itemID, uint AttachmentPt,uint ItemFlags, uint NextOwnerMask) | 334 | |
335 | public void RezSingleAttachment(IClientAPI remoteClient, LLUUID itemID, uint AttachmentPt, uint ItemFlags, uint NextOwnerMask) | ||
342 | { | 336 | { |
343 | SceneObjectGroup objatt = m_parentScene.RezObject(remoteClient, itemID, LLVector3.Zero, LLVector3.Zero, LLUUID.Zero, (byte)1, true, | 337 | SceneObjectGroup objatt = m_parentScene.RezObject(remoteClient, itemID, LLVector3.Zero, LLVector3.Zero, LLUUID.Zero, 1, true, |
344 | (uint)(PermissionMask.Copy | PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer), | 338 | (uint) |
345 | (uint)(PermissionMask.Copy | PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer), | 339 | (PermissionMask.Copy | PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer), |
346 | (uint)(PermissionMask.Copy | PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer), | 340 | (uint) |
347 | ItemFlags, false, false, remoteClient.AgentId, true); | 341 | (PermissionMask.Copy | PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer), |
342 | (uint) | ||
343 | (PermissionMask.Copy | PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer), | ||
344 | ItemFlags, false, false, remoteClient.AgentId, true); | ||
348 | 345 | ||
349 | if (objatt != null) | 346 | if (objatt != null) |
350 | { | 347 | { |
351 | AttachObject(remoteClient,objatt.LocalId,AttachmentPt,new LLQuaternion(0,0,0,1),objatt.AbsolutePosition); | 348 | AttachObject(remoteClient, objatt.LocalId, AttachmentPt, new LLQuaternion(0, 0, 0, 1), objatt.AbsolutePosition); |
352 | objatt.ScheduleGroupForFullUpdate(); | 349 | objatt.ScheduleGroupForFullUpdate(); |
353 | } | 350 | } |
354 | |||
355 | } | 351 | } |
356 | 352 | ||
357 | // What makes this method odd and unique is it tries to detach using an LLUUID.... Yay for standards. | 353 | // What makes this method odd and unique is it tries to detach using an LLUUID.... Yay for standards. |
358 | // To LocalId or LLUUID, *THAT* is the question. How now Brown LLUUID?? | 354 | // To LocalId or LLUUID, *THAT* is the question. How now Brown LLUUID?? |
359 | public void DetachSingleAttachmentToInv(LLUUID itemID, IClientAPI remoteClient) | 355 | public void DetachSingleAttachmentToInv(LLUUID itemID, IClientAPI remoteClient) |
360 | { | 356 | { |
361 | |||
362 | if (itemID == LLUUID.Zero) // If this happened, someone made a mistake.... | 357 | if (itemID == LLUUID.Zero) // If this happened, someone made a mistake.... |
363 | return; | 358 | return; |
364 | 359 | ||
@@ -368,17 +363,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
368 | { | 363 | { |
369 | if (obj is SceneObjectGroup) | 364 | if (obj is SceneObjectGroup) |
370 | { | 365 | { |
371 | if (((SceneObjectGroup)obj).GetFromAssetID() == itemID) | 366 | if (((SceneObjectGroup) obj).GetFromAssetID() == itemID) |
372 | { | 367 | { |
373 | SceneObjectGroup group = (SceneObjectGroup)obj; | 368 | SceneObjectGroup group = (SceneObjectGroup) obj; |
374 | group.DetachToInventoryPrep(); | 369 | group.DetachToInventoryPrep(); |
375 | m_log.Debug("[DETACH]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString()); | 370 | m_log.Debug("[DETACH]: Saving attachpoint: " + ((uint) group.GetAttachmentPoint())); |
376 | m_parentScene.updateKnownAsset(remoteClient, group, group.GetFromAssetID(),group.OwnerID); | 371 | m_parentScene.updateKnownAsset(remoteClient, group, group.GetFromAssetID(), group.OwnerID); |
377 | m_parentScene.DeleteSceneObjectGroup(group); | 372 | m_parentScene.DeleteSceneObjectGroup(group); |
378 | } | 373 | } |
379 | } | 374 | } |
380 | } | 375 | } |
381 | |||
382 | } | 376 | } |
383 | 377 | ||
384 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot, LLVector3 attachPos) | 378 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot, LLVector3 attachPos) |
@@ -388,39 +382,34 @@ namespace OpenSim.Region.Environment.Scenes | |||
388 | { | 382 | { |
389 | if (obj is SceneObjectGroup) | 383 | if (obj is SceneObjectGroup) |
390 | { | 384 | { |
391 | if (((SceneObjectGroup)obj).LocalId == objectLocalID) | 385 | if ((obj).LocalId == objectLocalID) |
392 | { | 386 | { |
393 | SceneObjectGroup group = (SceneObjectGroup)obj; | 387 | SceneObjectGroup group = (SceneObjectGroup) obj; |
394 | 388 | ||
395 | // If the attachment point isn't the same as the one previously used | 389 | // If the attachment point isn't the same as the one previously used |
396 | // set it's offset position = 0 so that it appears on the attachment point | 390 | // set it's offset position = 0 so that it appears on the attachment point |
397 | // and not in a weird location somewhere unknown. | 391 | // and not in a weird location somewhere unknown. |
398 | if (AttachmentPt != 0 && AttachmentPt != (uint)group.GetAttachmentPoint()) | 392 | if (AttachmentPt != 0 && AttachmentPt != group.GetAttachmentPoint()) |
399 | { | 393 | { |
400 | |||
401 | attachPos = LLVector3.Zero; | 394 | attachPos = LLVector3.Zero; |
402 | } | 395 | } |
403 | 396 | ||
404 | // AttachmentPt 0 means the client chose to 'wear' the attachment. | 397 | // AttachmentPt 0 means the client chose to 'wear' the attachment. |
405 | if (AttachmentPt == 0) | 398 | if (AttachmentPt == 0) |
406 | { | 399 | { |
407 | |||
408 | // Check object for stored attachment point | 400 | // Check object for stored attachment point |
409 | AttachmentPt = (uint)group.GetAttachmentPoint(); | 401 | AttachmentPt = group.GetAttachmentPoint(); |
410 | |||
411 | |||
412 | } | 402 | } |
413 | 403 | ||
414 | // if we still didn't find a suitable attachment point....... | 404 | // if we still didn't find a suitable attachment point....... |
415 | if (AttachmentPt == 0) | 405 | if (AttachmentPt == 0) |
416 | { | 406 | { |
417 | // Stick it on left hand with Zero Offset from the attachment point. | 407 | // Stick it on left hand with Zero Offset from the attachment point. |
418 | AttachmentPt = (uint)AttachmentPoint.LeftHand; | 408 | AttachmentPt = (uint) AttachmentPoint.LeftHand; |
419 | attachPos = LLVector3.Zero; | 409 | attachPos = LLVector3.Zero; |
420 | } | 410 | } |
421 | m_log.Debug("[ATTACH]: Using attachpoint: " + AttachmentPt.ToString()); | 411 | m_log.Debug("[ATTACH]: Using attachpoint: " + AttachmentPt); |
422 | 412 | ||
423 | |||
424 | 413 | ||
425 | // Saves and gets assetID | 414 | // Saves and gets assetID |
426 | if (group.GetFromAssetID() == LLUUID.Zero) | 415 | if (group.GetFromAssetID() == LLUUID.Zero) |
@@ -431,16 +420,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
431 | group.SetFromAssetID(newAssetID); | 420 | group.SetFromAssetID(newAssetID); |
432 | } | 421 | } |
433 | group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos); | 422 | group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos); |
434 | |||
435 | } | 423 | } |
436 | |||
437 | } | 424 | } |
438 | } | 425 | } |
439 | |||
440 | } | 426 | } |
427 | |||
441 | // Use the above method. | 428 | // Use the above method. |
442 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot, | 429 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot, |
443 | bool deadMethod) | 430 | bool deadMethod) |
444 | { | 431 | { |
445 | Console.WriteLine("Attaching object " + objectLocalID + " to " + AttachmentPt); | 432 | Console.WriteLine("Attaching object " + objectLocalID + " to " + AttachmentPt); |
446 | SceneObjectPart p = GetSceneObjectPart(objectLocalID); | 433 | SceneObjectPart p = GetSceneObjectPart(objectLocalID); |
@@ -489,14 +476,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
489 | objupdate.ObjectData[0].ParentID = 0; | 476 | objupdate.ObjectData[0].ParentID = 0; |
490 | objupdate.ObjectData[0].OwnerID = LLUUID.Zero; | 477 | objupdate.ObjectData[0].OwnerID = LLUUID.Zero; |
491 | objupdate.ObjectData[0].Scale = new LLVector3(1, 1, 1); | 478 | objupdate.ObjectData[0].Scale = new LLVector3(1, 1, 1); |
492 | objupdate.ObjectData[0].PCode = (byte)PCode.Avatar; | 479 | objupdate.ObjectData[0].PCode = (byte) PCode.Avatar; |
493 | objupdate.ObjectData[0].TextureEntry = ScenePresence.DefaultTexture; | 480 | objupdate.ObjectData[0].TextureEntry = ScenePresence.DefaultTexture; |
494 | 481 | ||
495 | objupdate.ObjectData[0].ID = av.LocalId; | 482 | objupdate.ObjectData[0].ID = av.LocalId; |
496 | objupdate.ObjectData[0].FullID = remoteClient.AgentId; | 483 | objupdate.ObjectData[0].FullID = remoteClient.AgentId; |
497 | objupdate.ObjectData[0].ParentID = 0; | 484 | objupdate.ObjectData[0].ParentID = 0; |
498 | objupdate.ObjectData[0].NameValue = | 485 | objupdate.ObjectData[0].NameValue = |
499 | Helpers.StringToField("FirstName STRING RW SV " + av.Firstname + "\nLastName STRING RW SV " + av.Lastname); | 486 | Helpers.StringToField("FirstName STRING RW SV " + av.Firstname + "\nLastName STRING RW SV " + av.Lastname); |
500 | LLVector3 pos2 = av.AbsolutePosition; | 487 | LLVector3 pos2 = av.AbsolutePosition; |
501 | // new LLVector3((float) Pos.X, (float) Pos.Y, (float) Pos.Z); | 488 | // new LLVector3((float) Pos.X, (float) Pos.Y, (float) Pos.Z); |
502 | byte[] pb = pos2.GetBytes(); | 489 | byte[] pb = pos2.GetBytes(); |
@@ -529,7 +516,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
529 | 516 | ||
530 | objupdate.ObjectData[1].TextureEntry = primData.TextureEntry; | 517 | objupdate.ObjectData[1].TextureEntry = primData.TextureEntry; |
531 | objupdate.ObjectData[1].PCode = primData.PCode; | 518 | objupdate.ObjectData[1].PCode = primData.PCode; |
532 | objupdate.ObjectData[1].State = (byte)(((byte)AttachmentPt) << 4); | 519 | objupdate.ObjectData[1].State = (byte) (((byte) AttachmentPt) << 4); |
533 | objupdate.ObjectData[1].PathBegin = primData.PathBegin; | 520 | objupdate.ObjectData[1].PathBegin = primData.PathBegin; |
534 | objupdate.ObjectData[1].PathEnd = primData.PathEnd; | 521 | objupdate.ObjectData[1].PathEnd = primData.PathEnd; |
535 | objupdate.ObjectData[1].PathScaleX = primData.PathScaleX; | 522 | objupdate.ObjectData[1].PathScaleX = primData.PathScaleX; |
@@ -566,8 +553,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
566 | //objupdate.ObjectData[1].ClickAction = clickAction; | 553 | //objupdate.ObjectData[1].ClickAction = clickAction; |
567 | objupdate.ObjectData[1].Radius = 20; | 554 | objupdate.ObjectData[1].Radius = 20; |
568 | objupdate.ObjectData[1].NameValue = | 555 | objupdate.ObjectData[1].NameValue = |
569 | Helpers.StringToField("AttachItemID STRING RW SV " + p.UUID); | 556 | Helpers.StringToField("AttachItemID STRING RW SV " + p.UUID); |
570 | LLVector3 pos = new LLVector3((float)0.0, (float)0.0, (float)0.0); | 557 | LLVector3 pos = new LLVector3((float) 0.0, (float) 0.0, (float) 0.0); |
571 | 558 | ||
572 | pb = pos.GetBytes(); | 559 | pb = pos.GetBytes(); |
573 | Array.Copy(pb, 0, objupdate.ObjectData[1].ObjectData, 0, pb.Length); | 560 | Array.Copy(pb, 0, objupdate.ObjectData[1].ObjectData, 0, pb.Length); |
@@ -738,6 +725,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
738 | m_scriptLPS = 0; | 725 | m_scriptLPS = 0; |
739 | return returnval; | 726 | return returnval; |
740 | } | 727 | } |
728 | |||
741 | #endregion | 729 | #endregion |
742 | 730 | ||
743 | #region Get Methods | 731 | #region Get Methods |
@@ -765,7 +753,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
765 | 753 | ||
766 | return result; | 754 | return result; |
767 | } | 755 | } |
768 | 756 | ||
769 | /// <summary> | 757 | /// <summary> |
770 | /// Get the controlling client for the given avatar, if there is one. | 758 | /// Get the controlling client for the given avatar, if there is one. |
771 | /// | 759 | /// |
@@ -779,12 +767,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
779 | public IClientAPI GetControllingClient(LLUUID agentId) | 767 | public IClientAPI GetControllingClient(LLUUID agentId) |
780 | { | 768 | { |
781 | ScenePresence presence = GetScenePresence(agentId); | 769 | ScenePresence presence = GetScenePresence(agentId); |
782 | 770 | ||
783 | if (presence != null) | 771 | if (presence != null) |
784 | { | 772 | { |
785 | return presence.ControllingClient; | 773 | return presence.ControllingClient; |
786 | } | 774 | } |
787 | 775 | ||
788 | return null; | 776 | return null; |
789 | } | 777 | } |
790 | 778 | ||
@@ -819,7 +807,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
819 | { | 807 | { |
820 | return ScenePresences[agentID]; | 808 | return ScenePresences[agentID]; |
821 | } | 809 | } |
822 | 810 | ||
823 | return null; | 811 | return null; |
824 | } | 812 | } |
825 | 813 | ||
@@ -831,8 +819,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
831 | { | 819 | { |
832 | if (ent is SceneObjectGroup) | 820 | if (ent is SceneObjectGroup) |
833 | { | 821 | { |
834 | if (((SceneObjectGroup)ent).HasChildPrim(localID)) | 822 | if (((SceneObjectGroup) ent).HasChildPrim(localID)) |
835 | return (SceneObjectGroup)ent; | 823 | return (SceneObjectGroup) ent; |
836 | } | 824 | } |
837 | } | 825 | } |
838 | return null; | 826 | return null; |
@@ -846,8 +834,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
846 | { | 834 | { |
847 | if (ent is SceneObjectGroup) | 835 | if (ent is SceneObjectGroup) |
848 | { | 836 | { |
849 | if (((SceneObjectGroup)ent).HasChildPrim(fullID)) | 837 | if (((SceneObjectGroup) ent).HasChildPrim(fullID)) |
850 | return (SceneObjectGroup)ent; | 838 | return (SceneObjectGroup) ent; |
851 | } | 839 | } |
852 | } | 840 | } |
853 | return null; | 841 | return null; |
@@ -862,7 +850,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
862 | { | 850 | { |
863 | if (ent is SceneObjectGroup) | 851 | if (ent is SceneObjectGroup) |
864 | { | 852 | { |
865 | SceneObjectGroup reportingG = (SceneObjectGroup)ent; | 853 | SceneObjectGroup reportingG = (SceneObjectGroup) ent; |
866 | EntityIntersection result = reportingG.TestIntersection(hray, frontFacesOnly, faceCenters); | 854 | EntityIntersection result = reportingG.TestIntersection(hray, frontFacesOnly, faceCenters); |
867 | if (result.HitTF) | 855 | if (result.HitTF) |
868 | { | 856 | { |
@@ -902,13 +890,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
902 | { | 890 | { |
903 | if (!presence.IsChildAgent) | 891 | if (!presence.IsChildAgent) |
904 | { | 892 | { |
905 | avatar = presence; | 893 | avatar = presence; |
906 | return true; | 894 | return true; |
907 | } | 895 | } |
908 | else | 896 | else |
909 | { | 897 | { |
910 | m_log.WarnFormat( | 898 | m_log.WarnFormat( |
911 | "[INNER SCENE]: Requested avatar {0} could not be found in scene {1} since it is only registered as a child agent!", | 899 | "[INNER SCENE]: Requested avatar {0} could not be found in scene {1} since it is only registered as a child agent!", |
912 | avatarId, m_parentScene.RegionInfo.RegionName); | 900 | avatarId, m_parentScene.RegionInfo.RegionName); |
913 | } | 901 | } |
914 | } | 902 | } |
@@ -987,8 +975,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
987 | 975 | ||
988 | if (presence.IsChildAgent && m_parentScene.m_seeIntoRegionFromNeighbor) | 976 | if (presence.IsChildAgent && m_parentScene.m_seeIntoRegionFromNeighbor) |
989 | { | 977 | { |
990 | LLVector3 oLoc = ((SceneObjectGroup)ent).AbsolutePosition; | 978 | LLVector3 oLoc = (ent).AbsolutePosition; |
991 | float distResult = (float)Util.GetDistanceTo(presence.AbsolutePosition, oLoc); | 979 | float distResult = (float) Util.GetDistanceTo(presence.AbsolutePosition, oLoc); |
992 | 980 | ||
993 | //m_log.Info("[DISTANCE]: " + distResult.ToString()); | 981 | //m_log.Info("[DISTANCE]: " + distResult.ToString()); |
994 | 982 | ||
@@ -996,13 +984,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
996 | { | 984 | { |
997 | // Send Only if we don't already know about it. | 985 | // Send Only if we don't already know about it. |
998 | // KnownPrim also makes the prim known when called. | 986 | // KnownPrim also makes the prim known when called. |
999 | if (!presence.KnownPrim(((SceneObjectGroup)ent).UUID)) | 987 | if (!presence.KnownPrim((ent).UUID)) |
1000 | ((SceneObjectGroup)ent).ScheduleFullUpdateToAvatar(presence); | 988 | ((SceneObjectGroup) ent).ScheduleFullUpdateToAvatar(presence); |
1001 | } | 989 | } |
1002 | } | 990 | } |
1003 | else | 991 | else |
1004 | { | 992 | { |
1005 | ((SceneObjectGroup)ent).ScheduleFullUpdateToAvatar(presence); | 993 | ((SceneObjectGroup) ent).ScheduleFullUpdateToAvatar(presence); |
1006 | } | 994 | } |
1007 | } | 995 | } |
1008 | } | 996 | } |
@@ -1037,6 +1025,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1037 | } | 1025 | } |
1038 | } | 1026 | } |
1039 | } | 1027 | } |
1028 | |||
1040 | public void UpdatePrimGroupScale(uint localID, LLVector3 scale, IClientAPI remoteClient) | 1029 | public void UpdatePrimGroupScale(uint localID, LLVector3 scale, IClientAPI remoteClient) |
1041 | { | 1030 | { |
1042 | SceneObjectGroup group = GetGroupByPrim(localID); | 1031 | SceneObjectGroup group = GetGroupByPrim(localID); |
@@ -1151,13 +1140,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
1151 | SceneObjectGroup group = GetGroupByPrim(localID); | 1140 | SceneObjectGroup group = GetGroupByPrim(localID); |
1152 | if (group != null) | 1141 | if (group != null) |
1153 | { | 1142 | { |
1154 | |||
1155 | LLVector3 oldPos = group.AbsolutePosition; | 1143 | LLVector3 oldPos = group.AbsolutePosition; |
1156 | if (group.RootPart.m_IsAttachment) | 1144 | if (group.RootPart.m_IsAttachment) |
1157 | { | 1145 | { |
1158 | group.UpdateGroupPosition(pos); | 1146 | group.UpdateGroupPosition(pos); |
1159 | } | 1147 | } |
1160 | else | 1148 | else |
1161 | { | 1149 | { |
1162 | if (!PermissionsMngr.CanObjectEntry(remoteClient.AgentId, oldPos, pos) && !group.RootPart.m_IsAttachment) | 1150 | if (!PermissionsMngr.CanObjectEntry(remoteClient.AgentId, oldPos, pos) && !group.RootPart.m_IsAttachment) |
1163 | { | 1151 | { |
@@ -1203,7 +1191,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1203 | { | 1191 | { |
1204 | if (PermissionsMngr.CanEditObject(remoteClient.AgentId, group.UUID)) | 1192 | if (PermissionsMngr.CanEditObject(remoteClient.AgentId, group.UUID)) |
1205 | { | 1193 | { |
1206 | group.UpdatePrimFlags(localID, (ushort)packet.Type, true, packet.ToBytes()); | 1194 | group.UpdatePrimFlags(localID, (ushort) packet.Type, true, packet.ToBytes()); |
1207 | } | 1195 | } |
1208 | } | 1196 | } |
1209 | } | 1197 | } |
@@ -1213,7 +1201,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1213 | SceneObjectGroup group = GetGroupByPrim(objectID); | 1201 | SceneObjectGroup group = GetGroupByPrim(objectID); |
1214 | if (group != null) | 1202 | if (group != null) |
1215 | { | 1203 | { |
1216 | if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))// && PermissionsMngr.) | 1204 | if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID)) // && PermissionsMngr.) |
1217 | { | 1205 | { |
1218 | group.GrabMovement(offset, pos, remoteClient); | 1206 | group.GrabMovement(offset, pos, remoteClient); |
1219 | } | 1207 | } |
@@ -1304,9 +1292,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
1304 | { | 1292 | { |
1305 | if (ent is SceneObjectGroup) | 1293 | if (ent is SceneObjectGroup) |
1306 | { | 1294 | { |
1307 | if (((SceneObjectGroup)ent).LocalId == parentPrim) | 1295 | if ((ent).LocalId == parentPrim) |
1308 | { | 1296 | { |
1309 | parenPrim = (SceneObjectGroup)ent; | 1297 | parenPrim = (SceneObjectGroup) ent; |
1310 | break; | 1298 | break; |
1311 | } | 1299 | } |
1312 | } | 1300 | } |
@@ -1321,9 +1309,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
1321 | { | 1309 | { |
1322 | if (ent is SceneObjectGroup) | 1310 | if (ent is SceneObjectGroup) |
1323 | { | 1311 | { |
1324 | if (((SceneObjectGroup)ent).LocalId == childPrims[i]) | 1312 | if ((ent).LocalId == childPrims[i]) |
1325 | { | 1313 | { |
1326 | children.Add((SceneObjectGroup)ent); | 1314 | children.Add((SceneObjectGroup) ent); |
1327 | } | 1315 | } |
1328 | } | 1316 | } |
1329 | } | 1317 | } |
@@ -1334,7 +1322,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1334 | { | 1322 | { |
1335 | parenPrim.LinkToGroup(sceneObj); | 1323 | parenPrim.LinkToGroup(sceneObj); |
1336 | } | 1324 | } |
1337 | 1325 | ||
1338 | // We need to explicitly resend the newly link prim's object properties since no other actions | 1326 | // We need to explicitly resend the newly link prim's object properties since no other actions |
1339 | // occur on link to invoke this elsewhere (such as object selection) | 1327 | // occur on link to invoke this elsewhere (such as object selection) |
1340 | parenPrim.GetProperties(client); | 1328 | parenPrim.GetProperties(client); |
@@ -1360,19 +1348,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
1360 | { | 1348 | { |
1361 | if (ent is SceneObjectGroup) | 1349 | if (ent is SceneObjectGroup) |
1362 | { | 1350 | { |
1363 | SceneObjectGroup obj = (SceneObjectGroup)ent; | 1351 | SceneObjectGroup obj = (SceneObjectGroup) ent; |
1364 | sceneObjects.Add(obj.LocalId, obj); | 1352 | sceneObjects.Add(obj.LocalId, obj); |
1365 | |||
1366 | } | 1353 | } |
1367 | } | 1354 | } |
1368 | 1355 | ||
1369 | // Find the root prim among the prim ids we've been given | 1356 | // Find the root prim among the prim ids we've been given |
1370 | for (int i = 0; i < primIds.Count; i++) | 1357 | for (int i = 0; i < primIds.Count; i++) |
1371 | { | 1358 | { |
1372 | |||
1373 | if (sceneObjects.ContainsKey(primIds[i])) | 1359 | if (sceneObjects.ContainsKey(primIds[i])) |
1374 | { | 1360 | { |
1375 | |||
1376 | parenPrim = sceneObjects[primIds[i]]; | 1361 | parenPrim = sceneObjects[primIds[i]]; |
1377 | primIds.RemoveAt(i); | 1362 | primIds.RemoveAt(i); |
1378 | break; | 1363 | break; |
@@ -1402,14 +1387,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
1402 | grp.DelinkFromGroup(primIds[i]); | 1387 | grp.DelinkFromGroup(primIds[i]); |
1403 | delinkedSomething = true; | 1388 | delinkedSomething = true; |
1404 | } | 1389 | } |
1405 | |||
1406 | } | 1390 | } |
1407 | } | 1391 | } |
1408 | if (!delinkedSomething) | 1392 | if (!delinkedSomething) |
1409 | { | 1393 | { |
1410 | m_log.InfoFormat("[SCENE]: " + | 1394 | m_log.InfoFormat("[SCENE]: " + |
1411 | "DelinkObjects(): Could not find a root prim out of {0} as given to a delink request!", | 1395 | "DelinkObjects(): Could not find a root prim out of {0} as given to a delink request!", |
1412 | primIds); | 1396 | primIds); |
1413 | } | 1397 | } |
1414 | } | 1398 | } |
1415 | } | 1399 | } |
@@ -1425,7 +1409,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1425 | { | 1409 | { |
1426 | if (ent is SceneObjectGroup) | 1410 | if (ent is SceneObjectGroup) |
1427 | { | 1411 | { |
1428 | foreach (KeyValuePair<LLUUID, SceneObjectPart> subent in ((SceneObjectGroup)ent).Children) | 1412 | foreach (KeyValuePair<LLUUID, SceneObjectPart> subent in ((SceneObjectGroup) ent).Children) |
1429 | { | 1413 | { |
1430 | if (subent.Value.LocalId == localID) | 1414 | if (subent.Value.LocalId == localID) |
1431 | { | 1415 | { |
@@ -1435,7 +1419,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1435 | } | 1419 | } |
1436 | } | 1420 | } |
1437 | } | 1421 | } |
1438 | 1422 | ||
1439 | //Protip: In my day, we didn't call them searchable objects, we called them limited point-to-point joints | 1423 | //Protip: In my day, we didn't call them searchable objects, we called them limited point-to-point joints |
1440 | //aka ObjectFlags.JointWheel = IncludeInSearch | 1424 | //aka ObjectFlags.JointWheel = IncludeInSearch |
1441 | 1425 | ||
@@ -1467,7 +1451,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1467 | public void DuplicateObject(uint originalPrim, LLVector3 offset, uint flags, LLUUID AgentID, LLUUID GroupID) | 1451 | public void DuplicateObject(uint originalPrim, LLVector3 offset, uint flags, LLUUID AgentID, LLUUID GroupID) |
1468 | { | 1452 | { |
1469 | m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID); | 1453 | m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID); |
1470 | 1454 | ||
1471 | List<EntityBase> EntityList = GetEntities(); | 1455 | List<EntityBase> EntityList = GetEntities(); |
1472 | 1456 | ||
1473 | SceneObjectGroup originPrim = null; | 1457 | SceneObjectGroup originPrim = null; |
@@ -1475,9 +1459,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
1475 | { | 1459 | { |
1476 | if (ent is SceneObjectGroup) | 1460 | if (ent is SceneObjectGroup) |
1477 | { | 1461 | { |
1478 | if (((SceneObjectGroup)ent).LocalId == originalPrim) | 1462 | if ((ent).LocalId == originalPrim) |
1479 | { | 1463 | { |
1480 | originPrim = (SceneObjectGroup)ent; | 1464 | originPrim = (SceneObjectGroup) ent; |
1481 | break; | 1465 | break; |
1482 | } | 1466 | } |
1483 | } | 1467 | } |
@@ -1526,4 +1510,4 @@ namespace OpenSim.Region.Environment.Scenes | |||
1526 | 1510 | ||
1527 | #endregion | 1511 | #endregion |
1528 | } | 1512 | } |
1529 | } | 1513 | } \ No newline at end of file |