diff options
author | lbsa71 | 2007-10-30 09:05:31 +0000 |
---|---|---|
committer | lbsa71 | 2007-10-30 09:05:31 +0000 |
commit | 67e12b95ea7b68f4904a7484d77ecfd787d16d0c (patch) | |
tree | 20b00d24c8a7617017960432ec044852e3ad5fa9 /OpenSim/Region/Environment/Scenes | |
parent | * Deleted .user file (diff) | |
download | opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.zip opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.gz opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.bz2 opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.xz |
* Optimized usings
* Shortened type references
* Removed redundant 'this' qualifier
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
14 files changed, 228 insertions, 256 deletions
diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs index 767a740..b8bae57 100644 --- a/OpenSim/Region/Environment/Scenes/EntityBase.cs +++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs | |||
@@ -146,4 +146,4 @@ namespace OpenSim.Region.Environment.Scenes | |||
146 | 146 | ||
147 | public abstract void SetText(string text, Vector3 color, double alpha); | 147 | public abstract void SetText(string text, Vector3 color, double alpha); |
148 | } | 148 | } |
149 | } | 149 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Environment/Scenes/IScenePresenceBody.cs b/OpenSim/Region/Environment/Scenes/IScenePresenceBody.cs index 14a1c7e..0f3bca1 100644 --- a/OpenSim/Region/Environment/Scenes/IScenePresenceBody.cs +++ b/OpenSim/Region/Environment/Scenes/IScenePresenceBody.cs | |||
@@ -29,7 +29,6 @@ | |||
29 | using libsecondlife; | 29 | using libsecondlife; |
30 | using libsecondlife.Packets; | 30 | using libsecondlife.Packets; |
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Framework.Interfaces; | ||
33 | 32 | ||
34 | namespace OpenSim.Region.Environment.Scenes | 33 | namespace OpenSim.Region.Environment.Scenes |
35 | { | 34 | { |
@@ -40,4 +39,4 @@ namespace OpenSim.Region.Environment.Scenes | |||
40 | void SendOurAppearance(IClientAPI OurClient); | 39 | void SendOurAppearance(IClientAPI OurClient); |
41 | void SendAppearanceToOtherAgent(ScenePresence avatarInfo); | 40 | void SendAppearanceToOtherAgent(ScenePresence avatarInfo); |
42 | } | 41 | } |
43 | } | 42 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 68591d4..a0c9a50 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -29,9 +29,8 @@ | |||
29 | using Axiom.Math; | 29 | using Axiom.Math; |
30 | using libsecondlife; | 30 | using libsecondlife; |
31 | using libsecondlife.Packets; | 31 | using libsecondlife.Packets; |
32 | using OpenSim.Framework.Communications.Cache; | ||
33 | using OpenSim.Framework.Interfaces; | ||
34 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Framework.Communications.Cache; | ||
35 | using OpenSim.Region.Physics.Manager; | 34 | using OpenSim.Region.Physics.Manager; |
36 | 35 | ||
37 | namespace OpenSim.Region.Environment.Scenes | 36 | namespace OpenSim.Region.Environment.Scenes |
@@ -45,7 +44,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
45 | { | 44 | { |
46 | ScenePresence avatar; | 45 | ScenePresence avatar; |
47 | 46 | ||
48 | if ( TryGetAvatar( avatarId, out avatar )) | 47 | if (TryGetAvatar(avatarId, out avatar)) |
49 | { | 48 | { |
50 | AddInventoryItem(avatar.ControllingClient, item); | 49 | AddInventoryItem(avatar.ControllingClient, item); |
51 | } | 50 | } |
@@ -392,7 +391,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
392 | remoteClient.SendInventoryItemUpdate(item); | 391 | remoteClient.SendInventoryItemUpdate(item); |
393 | } | 392 | } |
394 | 393 | ||
395 | DeleteSceneObjectGroup((SceneObjectGroup)selectedEnt); | 394 | DeleteSceneObjectGroup((SceneObjectGroup) selectedEnt); |
396 | } | 395 | } |
397 | } | 396 | } |
398 | } | 397 | } |
@@ -471,4 +470,4 @@ namespace OpenSim.Region.Environment.Scenes | |||
471 | } | 470 | } |
472 | } | 471 | } |
473 | } | 472 | } |
474 | } | 473 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index 3a35e21..69bd310 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs | |||
@@ -28,9 +28,8 @@ | |||
28 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using libsecondlife; | 29 | using libsecondlife; |
30 | using libsecondlife.Packets; | 30 | using libsecondlife.Packets; |
31 | using OpenSim.Framework.Console; | ||
32 | using OpenSim.Framework.Interfaces; | ||
33 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Framework.Console; | ||
34 | 33 | ||
35 | namespace OpenSim.Region.Environment.Scenes | 34 | namespace OpenSim.Region.Environment.Scenes |
36 | { | 35 | { |
@@ -73,12 +72,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
73 | { | 72 | { |
74 | ChatFromViewerArgs args = new ChatFromViewerArgs(); | 73 | ChatFromViewerArgs args = new ChatFromViewerArgs(); |
75 | 74 | ||
76 | args.Message = OpenSim.Framework.Util.FieldToString(message); | 75 | args.Message = Util.FieldToString(message); |
77 | args.Channel = channel; | 76 | args.Channel = channel; |
78 | args.Type = (ChatTypeEnum)type; | 77 | args.Type = (ChatTypeEnum) type; |
79 | args.Position = fromPos; | 78 | args.Position = fromPos; |
80 | 79 | ||
81 | ScenePresence user = this.GetScenePresence(fromAgentID); | 80 | ScenePresence user = GetScenePresence(fromAgentID); |
82 | if (user != null) | 81 | if (user != null) |
83 | args.Sender = user.ControllingClient; | 82 | args.Sender = user.ControllingClient; |
84 | else | 83 | else |
@@ -488,10 +487,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
488 | 487 | ||
489 | public void StartAnimation(LLUUID animID, int seq, LLUUID agentId) | 488 | public void StartAnimation(LLUUID animID, int seq, LLUUID agentId) |
490 | { | 489 | { |
491 | Broadcast(delegate(IClientAPI client) | 490 | Broadcast(delegate(IClientAPI client) { client.SendAnimation(animID, seq, agentId); }); |
492 | { | ||
493 | client.SendAnimation(animID, seq, agentId); | ||
494 | }); | ||
495 | } | 491 | } |
496 | 492 | ||
497 | public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) | 493 | public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) |
@@ -503,14 +499,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
503 | if (ent is SceneObjectGroup) | 499 | if (ent is SceneObjectGroup) |
504 | { | 500 | { |
505 | SceneObjectGroup obj = ent as SceneObjectGroup; | 501 | SceneObjectGroup obj = ent as SceneObjectGroup; |
506 | 502 | ||
507 | if( obj.HasChildPrim( localID ) ) | 503 | if (obj.HasChildPrim(localID)) |
508 | { | 504 | { |
509 | obj.ObjectGrabHandler(localID, offsetPos, remoteClient); | 505 | obj.ObjectGrabHandler(localID, offsetPos, remoteClient); |
510 | return; | 506 | return; |
511 | } | 507 | } |
512 | } | 508 | } |
513 | } | 509 | } |
514 | } | 510 | } |
515 | } | 511 | } |
516 | } | 512 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index b54c25b..db4d230 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -26,9 +26,9 @@ | |||
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using System; | 28 | using System; |
29 | using System.Net; | ||
30 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
31 | using System.IO; | 30 | using System.IO; |
31 | using System.Net; | ||
32 | using System.Threading; | 32 | using System.Threading; |
33 | using System.Timers; | 33 | using System.Timers; |
34 | using System.Xml; | 34 | using System.Xml; |
@@ -38,17 +38,16 @@ using OpenSim.Framework; | |||
38 | using OpenSim.Framework.Communications; | 38 | using OpenSim.Framework.Communications; |
39 | using OpenSim.Framework.Communications.Cache; | 39 | using OpenSim.Framework.Communications.Cache; |
40 | using OpenSim.Framework.Console; | 40 | using OpenSim.Framework.Console; |
41 | using OpenSim.Framework.Interfaces; | ||
42 | using OpenSim.Framework.Servers; | 41 | using OpenSim.Framework.Servers; |
43 | using OpenSim.Region.Capabilities; | 42 | using OpenSim.Region.Capabilities; |
44 | using OpenSim.Region.Environment.Interfaces; | 43 | using OpenSim.Region.Environment.Interfaces; |
45 | using OpenSim.Region.Environment.LandManagement; | 44 | using OpenSim.Region.Environment.LandManagement; |
45 | using OpenSim.Region.Environment.Modules; | ||
46 | using OpenSim.Region.Environment.Scenes.Scripting; | 46 | using OpenSim.Region.Environment.Scenes.Scripting; |
47 | using OpenSim.Region.Environment.Types; | 47 | using OpenSim.Region.Environment.Types; |
48 | using OpenSim.Region.Physics.Manager; | 48 | using OpenSim.Region.Physics.Manager; |
49 | using OpenSim.Region.Terrain; | 49 | using OpenSim.Region.Terrain; |
50 | using Timer = System.Timers.Timer; | 50 | using Timer=System.Timers.Timer; |
51 | using OpenSim.Region.Environment.Modules; | ||
52 | 51 | ||
53 | namespace OpenSim.Region.Environment.Scenes | 52 | namespace OpenSim.Region.Environment.Scenes |
54 | { | 53 | { |
@@ -130,6 +129,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
130 | private readonly EstateManager m_estateManager; | 129 | private readonly EstateManager m_estateManager; |
131 | 130 | ||
132 | private PhysicsScene phyScene; | 131 | private PhysicsScene phyScene; |
132 | |||
133 | public PhysicsScene PhysScene | 133 | public PhysicsScene PhysScene |
134 | { | 134 | { |
135 | set { phyScene = value; } | 135 | set { phyScene = value; } |
@@ -199,7 +199,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
199 | m_sceneObjects = new Dictionary<LLUUID, SceneObjectGroup>(); | 199 | m_sceneObjects = new Dictionary<LLUUID, SceneObjectGroup>(); |
200 | 200 | ||
201 | MainLog.Instance.Verbose("Creating LandMap"); | 201 | MainLog.Instance.Verbose("Creating LandMap"); |
202 | Terrain = new TerrainEngine((int)RegionInfo.RegionLocX, (int)RegionInfo.RegionLocY); | 202 | Terrain = new TerrainEngine((int) RegionInfo.RegionLocX, (int) RegionInfo.RegionLocY); |
203 | 203 | ||
204 | ScenePresence.LoadAnims(); | 204 | ScenePresence.LoadAnims(); |
205 | 205 | ||
@@ -233,7 +233,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
233 | public void StartTimer() | 233 | public void StartTimer() |
234 | { | 234 | { |
235 | m_heartbeatTimer.Enabled = true; | 235 | m_heartbeatTimer.Enabled = true; |
236 | m_heartbeatTimer.Interval = (int)(m_timespan * 1000); | 236 | m_heartbeatTimer.Interval = (int) (m_timespan*1000); |
237 | m_heartbeatTimer.Elapsed += new ElapsedEventHandler(Heartbeat); | 237 | m_heartbeatTimer.Elapsed += new ElapsedEventHandler(Heartbeat); |
238 | } | 238 | } |
239 | 239 | ||
@@ -267,33 +267,33 @@ namespace OpenSim.Region.Environment.Scenes | |||
267 | if (m_frame == Int32.MaxValue) | 267 | if (m_frame == Int32.MaxValue) |
268 | m_frame = 0; | 268 | m_frame = 0; |
269 | 269 | ||
270 | if (m_frame % m_update_physics == 0) | 270 | if (m_frame%m_update_physics == 0) |
271 | UpdatePreparePhysics(); | 271 | UpdatePreparePhysics(); |
272 | 272 | ||
273 | if (m_frame % m_update_entitymovement == 0) | 273 | if (m_frame%m_update_entitymovement == 0) |
274 | UpdateEntityMovement(); | 274 | UpdateEntityMovement(); |
275 | 275 | ||
276 | if (m_frame % m_update_physics == 0) | 276 | if (m_frame%m_update_physics == 0) |
277 | UpdatePhysics( | 277 | UpdatePhysics( |
278 | Math.Max(SinceLastFrame.TotalSeconds, m_timespan) | 278 | Math.Max(SinceLastFrame.TotalSeconds, m_timespan) |
279 | ); | 279 | ); |
280 | 280 | ||
281 | if (m_frame % m_update_entities == 0) | 281 | if (m_frame%m_update_entities == 0) |
282 | UpdateEntities(); | 282 | UpdateEntities(); |
283 | 283 | ||
284 | if (m_frame % m_update_events == 0) | 284 | if (m_frame%m_update_events == 0) |
285 | UpdateEvents(); | 285 | UpdateEvents(); |
286 | 286 | ||
287 | if (m_frame % m_update_backup == 0) | 287 | if (m_frame%m_update_backup == 0) |
288 | UpdateStorageBackup(); | 288 | UpdateStorageBackup(); |
289 | 289 | ||
290 | if (m_frame % m_update_terrain == 0) | 290 | if (m_frame%m_update_terrain == 0) |
291 | UpdateTerrain(); | 291 | UpdateTerrain(); |
292 | 292 | ||
293 | if (m_frame % m_update_land == 0) | 293 | if (m_frame%m_update_land == 0) |
294 | UpdateLand(); | 294 | UpdateLand(); |
295 | 295 | ||
296 | if (m_frame % m_update_avatars == 0) | 296 | if (m_frame%m_update_avatars == 0) |
297 | UpdateInWorldTime(); | 297 | UpdateInWorldTime(); |
298 | } | 298 | } |
299 | catch (NotImplementedException) | 299 | catch (NotImplementedException) |
@@ -308,7 +308,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
308 | { | 308 | { |
309 | updateLock.ReleaseMutex(); | 309 | updateLock.ReleaseMutex(); |
310 | 310 | ||
311 | m_timedilation = m_timespan / (float)SinceLastFrame.TotalSeconds; | 311 | m_timedilation = m_timespan/(float) SinceLastFrame.TotalSeconds; |
312 | m_lastupdate = DateTime.Now; | 312 | m_lastupdate = DateTime.Now; |
313 | } | 313 | } |
314 | } | 314 | } |
@@ -369,24 +369,23 @@ namespace OpenSim.Region.Environment.Scenes | |||
369 | phyScene.SetTerrain(Terrain.GetHeights1D()); | 369 | phyScene.SetTerrain(Terrain.GetHeights1D()); |
370 | } | 370 | } |
371 | 371 | ||
372 | storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(),RegionInfo.RegionID); | 372 | storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID); |
373 | 373 | ||
374 | float[] terData = Terrain.GetHeights1D(); | 374 | float[] terData = Terrain.GetHeights1D(); |
375 | 375 | ||
376 | Broadcast(delegate(IClientAPI client) | 376 | Broadcast(delegate(IClientAPI client) |
377 | { | 377 | { |
378 | for (int x = 0; x < 16; x++) | 378 | for (int x = 0; x < 16; x++) |
379 | { | 379 | { |
380 | for (int y = 0; y < 16; y++) | 380 | for (int y = 0; y < 16; y++) |
381 | { | 381 | { |
382 | if (Terrain.Tainted(x * 16, y * 16)) | 382 | if (Terrain.Tainted(x*16, y*16)) |
383 | { | 383 | { |
384 | client.SendLayerData(x, y, terData); | 384 | client.SendLayerData(x, y, terData); |
385 | } | 385 | } |
386 | } | 386 | } |
387 | } | 387 | } |
388 | }); | 388 | }); |
389 | |||
390 | 389 | ||
391 | 390 | ||
392 | Terrain.ResetTaint(); | 391 | Terrain.ResetTaint(); |
@@ -418,7 +417,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
418 | { | 417 | { |
419 | lock (m_syncRoot) | 418 | lock (m_syncRoot) |
420 | { | 419 | { |
421 | phyScene.Simulate((float)elapsed); | 420 | phyScene.Simulate((float) elapsed); |
422 | } | 421 | } |
423 | } | 422 | } |
424 | 423 | ||
@@ -438,11 +437,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
438 | /// <returns></returns> | 437 | /// <returns></returns> |
439 | internal void Broadcast(Action<IClientAPI> whatToDo) | 438 | internal void Broadcast(Action<IClientAPI> whatToDo) |
440 | { | 439 | { |
441 | ForEachScenePresence(delegate(ScenePresence presence) | 440 | ForEachScenePresence(delegate(ScenePresence presence) { whatToDo(presence.ControllingClient); }); |
442 | { | ||
443 | whatToDo(presence.ControllingClient); | ||
444 | }); | ||
445 | } | 441 | } |
442 | |||
446 | /// <summary> | 443 | /// <summary> |
447 | /// | 444 | /// |
448 | /// </summary> | 445 | /// </summary> |
@@ -473,7 +470,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
473 | MainLog.Instance.Verbose("TERRAIN", "No default terrain. Generating a new terrain."); | 470 | MainLog.Instance.Verbose("TERRAIN", "No default terrain. Generating a new terrain."); |
474 | Terrain.HillsGenerator(); | 471 | Terrain.HillsGenerator(); |
475 | 472 | ||
476 | storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(),RegionInfo.RegionID); | 473 | storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID); |
477 | } | 474 | } |
478 | else | 475 | else |
479 | { | 476 | { |
@@ -484,7 +481,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
484 | } | 481 | } |
485 | catch | 482 | catch |
486 | { | 483 | { |
487 | MainLog.Instance.Verbose("TERRAIN", "No terrain found in database or default. Generating a new terrain."); | 484 | MainLog.Instance.Verbose("TERRAIN", |
485 | "No terrain found in database or default. Generating a new terrain."); | ||
488 | Terrain.HillsGenerator(); | 486 | Terrain.HillsGenerator(); |
489 | } | 487 | } |
490 | storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID); | 488 | storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID); |
@@ -535,7 +533,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
535 | { | 533 | { |
536 | AddEntityFromStorage(prim); | 534 | AddEntityFromStorage(prim); |
537 | SceneObjectPart rootPart = prim.GetChildPart(prim.UUID); | 535 | SceneObjectPart rootPart = prim.GetChildPart(prim.UUID); |
538 | if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0) | 536 | if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) |
539 | rootPart.PhysActor = phyScene.AddPrimShape( | 537 | rootPart.PhysActor = phyScene.AddPrimShape( |
540 | rootPart.Name, | 538 | rootPart.Name, |
541 | rootPart.Shape, | 539 | rootPart.Shape, |
@@ -581,17 +579,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
581 | // if grass or tree, make phantom | 579 | // if grass or tree, make phantom |
582 | if ((rootPart.Shape.PCode == 95) || (rootPart.Shape.PCode == 255)) | 580 | if ((rootPart.Shape.PCode == 95) || (rootPart.Shape.PCode == 255)) |
583 | { | 581 | { |
584 | rootPart.ObjectFlags += (uint)LLObject.ObjectFlags.Phantom; | 582 | rootPart.ObjectFlags += (uint) LLObject.ObjectFlags.Phantom; |
585 | } | 583 | } |
586 | // if not phantom, add to physics | 584 | // if not phantom, add to physics |
587 | if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0) | 585 | if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) |
588 | rootPart.PhysActor = | 586 | rootPart.PhysActor = |
589 | phyScene.AddPrimShape( | 587 | phyScene.AddPrimShape( |
590 | rootPart.Name, | 588 | rootPart.Name, |
591 | rootPart.Shape, | 589 | rootPart.Shape, |
592 | new PhysicsVector(pos.X, pos.Y, pos.Z), | 590 | new PhysicsVector(pos.X, pos.Y, pos.Z), |
593 | new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z), | 591 | new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z), |
594 | new Quaternion()); | 592 | new Quaternion()); |
595 | } | 593 | } |
596 | } | 594 | } |
597 | 595 | ||
@@ -601,9 +599,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
601 | { | 599 | { |
602 | if (obj is SceneObjectGroup) | 600 | if (obj is SceneObjectGroup) |
603 | { | 601 | { |
604 | if (((SceneObjectGroup)obj).LocalId == localID) | 602 | if (((SceneObjectGroup) obj).LocalId == localID) |
605 | { | 603 | { |
606 | RemoveEntity((SceneObjectGroup)obj); | 604 | RemoveEntity((SceneObjectGroup) obj); |
607 | return; | 605 | return; |
608 | } | 606 | } |
609 | } | 607 | } |
@@ -657,7 +655,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
657 | int primCount = 0; | 655 | int primCount = 0; |
658 | if ((fileName.StartsWith("http:")) | (File.Exists(fileName))) | 656 | if ((fileName.StartsWith("http:")) | (File.Exists(fileName))) |
659 | { | 657 | { |
660 | |||
661 | XmlTextReader reader = new XmlTextReader(fileName); | 658 | XmlTextReader reader = new XmlTextReader(fileName); |
662 | reader.WhitespaceHandling = WhitespaceHandling.None; | 659 | reader.WhitespaceHandling = WhitespaceHandling.None; |
663 | doc.Load(reader); | 660 | doc.Load(reader); |
@@ -672,7 +669,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
672 | AddEntity(obj); | 669 | AddEntity(obj); |
673 | 670 | ||
674 | SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); | 671 | SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); |
675 | if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0) | 672 | if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) |
676 | rootPart.PhysActor = phyScene.AddPrimShape( | 673 | rootPart.PhysActor = phyScene.AddPrimShape( |
677 | rootPart.Name, | 674 | rootPart.Name, |
678 | rootPart.Shape, | 675 | rootPart.Shape, |
@@ -700,7 +697,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
700 | { | 697 | { |
701 | if (ent is SceneObjectGroup) | 698 | if (ent is SceneObjectGroup) |
702 | { | 699 | { |
703 | stream.WriteLine(((SceneObjectGroup)ent).ToXmlString()); | 700 | stream.WriteLine(((SceneObjectGroup) ent).ToXmlString()); |
704 | primCount++; | 701 | primCount++; |
705 | } | 702 | } |
706 | } | 703 | } |
@@ -737,7 +734,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
737 | AddEntityFromStorage(obj); | 734 | AddEntityFromStorage(obj); |
738 | 735 | ||
739 | SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); | 736 | SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); |
740 | if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0) | 737 | if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) |
741 | rootPart.PhysActor = phyScene.AddPrimShape( | 738 | rootPart.PhysActor = phyScene.AddPrimShape( |
742 | rootPart.Name, | 739 | rootPart.Name, |
743 | rootPart.Shape, | 740 | rootPart.Shape, |
@@ -758,7 +755,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
758 | { | 755 | { |
759 | if (ent is SceneObjectGroup) | 756 | if (ent is SceneObjectGroup) |
760 | { | 757 | { |
761 | stream.WriteLine(((SceneObjectGroup)ent).ToXmlString2()); | 758 | stream.WriteLine(((SceneObjectGroup) ent).ToXmlString2()); |
762 | primCount++; | 759 | primCount++; |
763 | } | 760 | } |
764 | } | 761 | } |
@@ -857,7 +854,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
857 | byte[] visualParams; | 854 | byte[] visualParams; |
858 | AvatarWearable[] wearables; | 855 | AvatarWearable[] wearables; |
859 | 856 | ||
860 | if( m_AvatarFactory == null || !m_AvatarFactory.TryGetIntialAvatarAppearance( client.AgentId, out wearables, out visualParams)) | 857 | if (m_AvatarFactory == null || |
858 | !m_AvatarFactory.TryGetIntialAvatarAppearance(client.AgentId, out wearables, out visualParams)) | ||
861 | { | 859 | { |
862 | AvatarFactoryModule.GetDefaultAvatarAppearance(out wearables, out visualParams); | 860 | AvatarFactoryModule.GetDefaultAvatarAppearance(out wearables, out visualParams); |
863 | } | 861 | } |
@@ -916,16 +914,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
916 | 914 | ||
917 | ScenePresence avatar = GetScenePresence(agentID); | 915 | ScenePresence avatar = GetScenePresence(agentID); |
918 | 916 | ||
919 | Broadcast(delegate(IClientAPI client) | 917 | Broadcast(delegate(IClientAPI client) { client.SendKillObject(avatar.RegionHandle, avatar.LocalId); }); |
920 | { | ||
921 | client.SendKillObject(avatar.RegionHandle, avatar.LocalId); | ||
922 | }); | ||
923 | 918 | ||
924 | ForEachScenePresence( | 919 | ForEachScenePresence( |
925 | delegate(ScenePresence presence) | 920 | delegate(ScenePresence presence) { presence.CoarseLocationChange(); }); |
926 | { | ||
927 | presence.CoarseLocationChange(); | ||
928 | }); | ||
929 | 921 | ||
930 | lock (m_scenePresences) | 922 | lock (m_scenePresences) |
931 | { | 923 | { |
@@ -965,10 +957,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
965 | 957 | ||
966 | public List<ScenePresence> GetAvatars() | 958 | public List<ScenePresence> GetAvatars() |
967 | { | 959 | { |
968 | List<ScenePresence> result = GetScenePresences(delegate(ScenePresence scenePresence) | 960 | List<ScenePresence> result = |
969 | { | 961 | GetScenePresences(delegate(ScenePresence scenePresence) { return !scenePresence.IsChildAgent; }); |
970 | return !scenePresence.IsChildAgent; | ||
971 | }); | ||
972 | 962 | ||
973 | return result; | 963 | return result; |
974 | } | 964 | } |
@@ -1046,18 +1036,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
1046 | 1036 | ||
1047 | public void SendKillObject(uint localID) | 1037 | public void SendKillObject(uint localID) |
1048 | { | 1038 | { |
1049 | Broadcast(delegate(IClientAPI client) | 1039 | Broadcast(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, localID); }); |
1050 | { | ||
1051 | client.SendKillObject(m_regionHandle, localID); | ||
1052 | }); | ||
1053 | } | 1040 | } |
1054 | 1041 | ||
1055 | public void NotifyMyCoarseLocationChange() | 1042 | public void NotifyMyCoarseLocationChange() |
1056 | { | 1043 | { |
1057 | ForEachScenePresence(delegate(ScenePresence presence) | 1044 | ForEachScenePresence(delegate(ScenePresence presence) { presence.CoarseLocationChange(); }); |
1058 | { | ||
1059 | presence.CoarseLocationChange(); | ||
1060 | }); | ||
1061 | } | 1045 | } |
1062 | 1046 | ||
1063 | public void SendAllSceneObjectsToClient(ScenePresence presence) | 1047 | public void SendAllSceneObjectsToClient(ScenePresence presence) |
@@ -1067,7 +1051,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1067 | if (ent is SceneObjectGroup) | 1051 | if (ent is SceneObjectGroup) |
1068 | { | 1052 | { |
1069 | // ((SceneObjectGroup)ent).SendFullUpdateToClient(client); | 1053 | // ((SceneObjectGroup)ent).SendFullUpdateToClient(client); |
1070 | ((SceneObjectGroup)ent).ScheduleFullUpdateToAvatar(presence); | 1054 | ((SceneObjectGroup) ent).ScheduleFullUpdateToAvatar(presence); |
1071 | } | 1055 | } |
1072 | } | 1056 | } |
1073 | } | 1057 | } |
@@ -1137,11 +1121,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
1137 | } | 1121 | } |
1138 | } | 1122 | } |
1139 | 1123 | ||
1140 | delegate void InformClientOfNeighbourDelegate(IClientAPI remoteClient, AgentCircuitData a, ulong regionHandle, IPEndPoint endPoint); | 1124 | private delegate void InformClientOfNeighbourDelegate( |
1125 | IClientAPI remoteClient, AgentCircuitData a, ulong regionHandle, IPEndPoint endPoint); | ||
1141 | 1126 | ||
1142 | private void InformClientOfNeighbourCompleted(IAsyncResult iar) | 1127 | private void InformClientOfNeighbourCompleted(IAsyncResult iar) |
1143 | { | 1128 | { |
1144 | InformClientOfNeighbourDelegate icon = (InformClientOfNeighbourDelegate)iar.AsyncState; | 1129 | InformClientOfNeighbourDelegate icon = (InformClientOfNeighbourDelegate) iar.AsyncState; |
1145 | 1130 | ||
1146 | 1131 | ||
1147 | icon.EndInvoke(iar); | 1132 | icon.EndInvoke(iar); |
@@ -1157,7 +1142,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1157 | /// <param name="a"></param> | 1142 | /// <param name="a"></param> |
1158 | /// <param name="regionHandle"></param> | 1143 | /// <param name="regionHandle"></param> |
1159 | /// <param name="endPoint"></param> | 1144 | /// <param name="endPoint"></param> |
1160 | private void InformClientOfNeighbourAsync(IClientAPI remoteClient, AgentCircuitData a, ulong regionHandle, IPEndPoint endPoint) | 1145 | private void InformClientOfNeighbourAsync(IClientAPI remoteClient, AgentCircuitData a, ulong regionHandle, |
1146 | IPEndPoint endPoint) | ||
1161 | { | 1147 | { |
1162 | MainLog.Instance.Notice("INTERGRID", "Starting to inform client about neighbours"); | 1148 | MainLog.Instance.Notice("INTERGRID", "Starting to inform client about neighbours"); |
1163 | bool regionAccepted = commsManager.InterRegion.InformRegionOfChildAgent(regionHandle, a); | 1149 | bool regionAccepted = commsManager.InterRegion.InformRegionOfChildAgent(regionHandle, a); |
@@ -1172,7 +1158,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1172 | /// </summary> | 1158 | /// </summary> |
1173 | public void InformClientOfNeighbours(IClientAPI remoteClient) | 1159 | public void InformClientOfNeighbours(IClientAPI remoteClient) |
1174 | { | 1160 | { |
1175 | List<SimpleRegionInfo> neighbours = commsManager.GridService.RequestNeighbours(m_regInfo.RegionLocX, m_regInfo.RegionLocY); | 1161 | List<SimpleRegionInfo> neighbours = |
1162 | commsManager.GridService.RequestNeighbours(m_regInfo.RegionLocX, m_regInfo.RegionLocY); | ||
1176 | if (neighbours != null) | 1163 | if (neighbours != null) |
1177 | { | 1164 | { |
1178 | for (int i = 0; i < neighbours.Count; i++) | 1165 | for (int i = 0; i < neighbours.Count; i++) |
@@ -1185,9 +1172,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1185 | 1172 | ||
1186 | InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; | 1173 | InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; |
1187 | d.BeginInvoke(remoteClient, agent, neighbours[i].RegionHandle, neighbours[i].ExternalEndPoint, | 1174 | d.BeginInvoke(remoteClient, agent, neighbours[i].RegionHandle, neighbours[i].ExternalEndPoint, |
1188 | InformClientOfNeighbourCompleted, | 1175 | InformClientOfNeighbourCompleted, |
1189 | d); | 1176 | d); |
1190 | |||
1191 | } | 1177 | } |
1192 | } | 1178 | } |
1193 | } | 1179 | } |
@@ -1289,17 +1275,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
1289 | 1275 | ||
1290 | public void RegisterModuleInterface<M>(M mod) | 1276 | public void RegisterModuleInterface<M>(M mod) |
1291 | { | 1277 | { |
1292 | if (!ModuleInterfaces.ContainsKey(typeof(M))) | 1278 | if (!ModuleInterfaces.ContainsKey(typeof (M))) |
1293 | { | 1279 | { |
1294 | ModuleInterfaces.Add(typeof(M), mod); | 1280 | ModuleInterfaces.Add(typeof (M), mod); |
1295 | } | 1281 | } |
1296 | } | 1282 | } |
1297 | 1283 | ||
1298 | public T RequestModuleInterface<T>() | 1284 | public T RequestModuleInterface<T>() |
1299 | { | 1285 | { |
1300 | if (ModuleInterfaces.ContainsKey(typeof(T))) | 1286 | if (ModuleInterfaces.ContainsKey(typeof (T))) |
1301 | { | 1287 | { |
1302 | return (T)ModuleInterfaces[typeof(T)]; | 1288 | return (T) ModuleInterfaces[typeof (T)]; |
1303 | } | 1289 | } |
1304 | else | 1290 | else |
1305 | { | 1291 | { |
@@ -1317,7 +1303,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1317 | { | 1303 | { |
1318 | if (m_scenePresences.ContainsKey(avatarID)) | 1304 | if (m_scenePresences.ContainsKey(avatarID)) |
1319 | { | 1305 | { |
1320 | m_scenePresences[avatarID].ControllingClient.SendLoadURL(objectname, objectID, ownerID, groupOwned, message, url); | 1306 | m_scenePresences[avatarID].ControllingClient.SendLoadURL(objectname, objectID, ownerID, groupOwned, |
1307 | message, url); | ||
1321 | } | 1308 | } |
1322 | } | 1309 | } |
1323 | 1310 | ||
@@ -1388,7 +1375,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1388 | { | 1375 | { |
1389 | if (ent is SceneObjectGroup) | 1376 | if (ent is SceneObjectGroup) |
1390 | { | 1377 | { |
1391 | ((SceneObjectGroup)ent).ScheduleGroupForFullUpdate(); | 1378 | ((SceneObjectGroup) ent).ScheduleGroupForFullUpdate(); |
1392 | } | 1379 | } |
1393 | } | 1380 | } |
1394 | } | 1381 | } |
@@ -1400,7 +1387,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1400 | { | 1387 | { |
1401 | if (ent is SceneObjectGroup) | 1388 | if (ent is SceneObjectGroup) |
1402 | { | 1389 | { |
1403 | SceneObjectPart part = ((SceneObjectGroup)ent).GetChildPart(((SceneObjectGroup)ent).UUID); | 1390 | SceneObjectPart part = ((SceneObjectGroup) ent).GetChildPart(((SceneObjectGroup) ent).UUID); |
1404 | if (part != null) | 1391 | if (part != null) |
1405 | { | 1392 | { |
1406 | if (part.Name == cmmdparams[0]) | 1393 | if (part.Name == cmmdparams[0]) |
@@ -1429,14 +1416,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
1429 | foreach (ScenePresence scenePrescence in GetAvatars()) | 1416 | foreach (ScenePresence scenePrescence in GetAvatars()) |
1430 | { | 1417 | { |
1431 | MainLog.Instance.Error( | 1418 | MainLog.Instance.Error( |
1432 | String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}{6,-16}", | 1419 | String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}{6,-16}", |
1433 | scenePrescence.Firstname, | 1420 | scenePrescence.Firstname, |
1434 | scenePrescence.Lastname, | 1421 | scenePrescence.Lastname, |
1435 | scenePrescence.UUID, | 1422 | scenePrescence.UUID, |
1436 | scenePrescence.ControllingClient.AgentId, | 1423 | scenePrescence.ControllingClient.AgentId, |
1437 | "Unknown", | 1424 | "Unknown", |
1438 | "Unknown", | 1425 | "Unknown", |
1439 | RegionInfo.RegionName)); | 1426 | RegionInfo.RegionName)); |
1440 | } | 1427 | } |
1441 | break; | 1428 | break; |
1442 | case "modules": | 1429 | case "modules": |
@@ -1482,10 +1469,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
1482 | { | 1469 | { |
1483 | if (ent is SceneObjectGroup) | 1470 | if (ent is SceneObjectGroup) |
1484 | { | 1471 | { |
1485 | hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID); | 1472 | hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID); |
1486 | if (hasPrim != false) | 1473 | if (hasPrim != false) |
1487 | { | 1474 | { |
1488 | return ((SceneObjectGroup)ent).GetPartsFullID(localID); | 1475 | return ((SceneObjectGroup) ent).GetPartsFullID(localID); |
1489 | } | 1476 | } |
1490 | } | 1477 | } |
1491 | } | 1478 | } |
@@ -1499,10 +1486,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
1499 | { | 1486 | { |
1500 | if (ent is SceneObjectGroup) | 1487 | if (ent is SceneObjectGroup) |
1501 | { | 1488 | { |
1502 | hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID); | 1489 | hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID); |
1503 | if (hasPrim != false) | 1490 | if (hasPrim != false) |
1504 | { | 1491 | { |
1505 | return ((SceneObjectGroup)ent).GetChildPart(localID); | 1492 | return ((SceneObjectGroup) ent).GetChildPart(localID); |
1506 | } | 1493 | } |
1507 | } | 1494 | } |
1508 | } | 1495 | } |
@@ -1516,10 +1503,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
1516 | { | 1503 | { |
1517 | if (ent is SceneObjectGroup) | 1504 | if (ent is SceneObjectGroup) |
1518 | { | 1505 | { |
1519 | hasPrim = ((SceneObjectGroup)ent).HasChildPrim(fullID); | 1506 | hasPrim = ((SceneObjectGroup) ent).HasChildPrim(fullID); |
1520 | if (hasPrim != false) | 1507 | if (hasPrim != false) |
1521 | { | 1508 | { |
1522 | return ((SceneObjectGroup)ent).GetChildPart(fullID); | 1509 | return ((SceneObjectGroup) ent).GetChildPart(fullID); |
1523 | } | 1510 | } |
1524 | } | 1511 | } |
1525 | } | 1512 | } |
@@ -1569,12 +1556,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
1569 | return false; | 1556 | return false; |
1570 | } | 1557 | } |
1571 | 1558 | ||
1572 | internal void ForEachClient( Action<IClientAPI> action ) | 1559 | internal void ForEachClient(Action<IClientAPI> action) |
1573 | { | 1560 | { |
1574 | foreach (ScenePresence presence in m_scenePresences.Values ) | 1561 | foreach (ScenePresence presence in m_scenePresences.Values) |
1575 | { | 1562 | { |
1576 | action(presence.ControllingClient); | 1563 | action(presence.ControllingClient); |
1577 | } | 1564 | } |
1578 | } | 1565 | } |
1579 | } | 1566 | } |
1580 | } | 1567 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs index 0072d4e..4ad9d65 100644 --- a/OpenSim/Region/Environment/Scenes/SceneBase.cs +++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs | |||
@@ -28,10 +28,9 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using libsecondlife; | 30 | using libsecondlife; |
31 | using OpenSim.Framework; | ||
31 | using OpenSim.Framework.Communications.Cache; | 32 | using OpenSim.Framework.Communications.Cache; |
32 | using OpenSim.Framework.Console; | 33 | using OpenSim.Framework.Console; |
33 | using OpenSim.Framework.Interfaces; | ||
34 | using OpenSim.Framework; | ||
35 | using OpenSim.Region.Terrain; | 34 | using OpenSim.Region.Terrain; |
36 | 35 | ||
37 | namespace OpenSim.Region.Environment.Scenes | 36 | namespace OpenSim.Region.Environment.Scenes |
@@ -39,6 +38,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
39 | public abstract class SceneBase : IScene | 38 | public abstract class SceneBase : IScene |
40 | { | 39 | { |
41 | private readonly ClientManager m_clientManager = new ClientManager(); | 40 | private readonly ClientManager m_clientManager = new ClientManager(); |
41 | |||
42 | public ClientManager ClientManager | 42 | public ClientManager ClientManager |
43 | { | 43 | { |
44 | get { return m_clientManager; } | 44 | get { return m_clientManager; } |
diff --git a/OpenSim/Region/Environment/Scenes/SceneEvents.cs b/OpenSim/Region/Environment/Scenes/SceneEvents.cs index ea47713..493afd1 100644 --- a/OpenSim/Region/Environment/Scenes/SceneEvents.cs +++ b/OpenSim/Region/Environment/Scenes/SceneEvents.cs | |||
@@ -27,9 +27,8 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | using libsecondlife; | 29 | using libsecondlife; |
30 | using OpenSim.Framework.Interfaces; | ||
31 | using OpenSim.Region.Environment.Interfaces; | ||
32 | using OpenSim.Framework; | 30 | using OpenSim.Framework; |
31 | using OpenSim.Region.Environment.Interfaces; | ||
33 | 32 | ||
34 | namespace OpenSim.Region.Environment.Scenes | 33 | namespace OpenSim.Region.Environment.Scenes |
35 | { | 34 | { |
@@ -207,4 +206,4 @@ namespace OpenSim.Region.Environment.Scenes | |||
207 | } | 206 | } |
208 | } | 207 | } |
209 | } | 208 | } |
210 | } | 209 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs index a315d02..75e2a41 100644 --- a/OpenSim/Region/Environment/Scenes/SceneManager.cs +++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs | |||
@@ -28,9 +28,9 @@ | |||
28 | 28 | ||
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using OpenSim.Framework.Console; | ||
32 | using OpenSim.Framework; | ||
33 | using libsecondlife; | 31 | using libsecondlife; |
32 | using OpenSim.Framework; | ||
33 | using OpenSim.Framework.Console; | ||
34 | 34 | ||
35 | namespace OpenSim.Region.Environment.Scenes | 35 | namespace OpenSim.Region.Environment.Scenes |
36 | { | 36 | { |
@@ -152,10 +152,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
152 | 152 | ||
153 | public void SendGeneralMessage(string msg) | 153 | public void SendGeneralMessage(string msg) |
154 | { | 154 | { |
155 | ForEachCurrentScene(delegate(Scene scene) | 155 | ForEachCurrentScene(delegate(Scene scene) { scene.SendGeneralAlert(msg); }); |
156 | { | ||
157 | scene.SendGeneralAlert(msg); | ||
158 | }); | ||
159 | } | 156 | } |
160 | 157 | ||
161 | public bool TrySetCurrentScene(string regionName) | 158 | public bool TrySetCurrentScene(string regionName) |
@@ -185,23 +182,24 @@ namespace OpenSim.Region.Environment.Scenes | |||
185 | public void SetDebugPacketOnCurrentScene(LogBase log, int newDebug) | 182 | public void SetDebugPacketOnCurrentScene(LogBase log, int newDebug) |
186 | { | 183 | { |
187 | ForEachCurrentScene(delegate(Scene scene) | 184 | ForEachCurrentScene(delegate(Scene scene) |
188 | { | ||
189 | foreach (EntityBase entity in scene.Entities.Values) | ||
190 | { | ||
191 | if (entity is ScenePresence) | ||
192 | { | ||
193 | ScenePresence scenePrescence = entity as ScenePresence; | ||
194 | if (!scenePrescence.IsChildAgent) | ||
195 | { | 185 | { |
196 | log.Error(String.Format("Packet debug for {0} {1} set to {2}", | 186 | foreach (EntityBase entity in scene.Entities.Values) |
197 | scenePrescence.Firstname, scenePrescence.Lastname, | 187 | { |
198 | newDebug)); | 188 | if (entity is ScenePresence) |
199 | 189 | { | |
200 | scenePrescence.ControllingClient.SetDebug(newDebug); | 190 | ScenePresence scenePrescence = entity as ScenePresence; |
201 | } | 191 | if (!scenePrescence.IsChildAgent) |
202 | } | 192 | { |
203 | } | 193 | log.Error(String.Format("Packet debug for {0} {1} set to {2}", |
204 | }); | 194 | scenePrescence.Firstname, |
195 | scenePrescence.Lastname, | ||
196 | newDebug)); | ||
197 | |||
198 | scenePrescence.ControllingClient.SetDebug(newDebug); | ||
199 | } | ||
200 | } | ||
201 | } | ||
202 | }); | ||
205 | } | 203 | } |
206 | 204 | ||
207 | public List<ScenePresence> GetCurrentSceneAvatars() | 205 | public List<ScenePresence> GetCurrentSceneAvatars() |
@@ -209,19 +207,19 @@ namespace OpenSim.Region.Environment.Scenes | |||
209 | List<ScenePresence> avatars = new List<ScenePresence>(); | 207 | List<ScenePresence> avatars = new List<ScenePresence>(); |
210 | 208 | ||
211 | ForEachCurrentScene(delegate(Scene scene) | 209 | ForEachCurrentScene(delegate(Scene scene) |
212 | { | ||
213 | foreach (EntityBase entity in scene.Entities.Values) | ||
214 | { | ||
215 | if (entity is ScenePresence) | ||
216 | { | ||
217 | ScenePresence scenePrescence = entity as ScenePresence; | ||
218 | if (!scenePrescence.IsChildAgent) | ||
219 | { | 210 | { |
220 | avatars.Add(scenePrescence); | 211 | foreach (EntityBase entity in scene.Entities.Values) |
221 | } | 212 | { |
222 | } | 213 | if (entity is ScenePresence) |
223 | } | 214 | { |
224 | }); | 215 | ScenePresence scenePrescence = entity as ScenePresence; |
216 | if (!scenePrescence.IsChildAgent) | ||
217 | { | ||
218 | avatars.Add(scenePrescence); | ||
219 | } | ||
220 | } | ||
221 | } | ||
222 | }); | ||
225 | 223 | ||
226 | return avatars; | 224 | return avatars; |
227 | } | 225 | } |
@@ -242,11 +240,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
242 | public void SetCurrentSceneTimePhase(int timePhase) | 240 | public void SetCurrentSceneTimePhase(int timePhase) |
243 | { | 241 | { |
244 | ForEachCurrentScene(delegate(Scene scene) | 242 | ForEachCurrentScene(delegate(Scene scene) |
245 | { | 243 | { |
246 | scene.SetTimePhase( | 244 | scene.SetTimePhase( |
247 | timePhase) | 245 | timePhase) |
248 | ; | 246 | ; |
249 | }); | 247 | }); |
250 | } | 248 | } |
251 | 249 | ||
252 | 250 | ||
@@ -260,11 +258,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
260 | ForEachCurrentScene(delegate(Scene scene) { scene.HandleEditCommand(cmdparams); }); | 258 | ForEachCurrentScene(delegate(Scene scene) { scene.HandleEditCommand(cmdparams); }); |
261 | } | 259 | } |
262 | 260 | ||
263 | public bool TryGetAvatar( LLUUID avatarId, out ScenePresence avatar ) | 261 | public bool TryGetAvatar(LLUUID avatarId, out ScenePresence avatar) |
264 | { | 262 | { |
265 | foreach (Scene scene in m_localScenes) | 263 | foreach (Scene scene in m_localScenes) |
266 | { | 264 | { |
267 | if( scene.TryGetAvatar( avatarId, out avatar )) | 265 | if (scene.TryGetAvatar(avatarId, out avatar)) |
268 | { | 266 | { |
269 | return true; | 267 | return true; |
270 | } | 268 | } |
@@ -311,9 +309,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
311 | return false; | 309 | return false; |
312 | } | 310 | } |
313 | 311 | ||
314 | public void ForEachScene(Action<Scene> action ) | 312 | public void ForEachScene(Action<Scene> action) |
315 | { | 313 | { |
316 | m_localScenes.ForEach( action ); | 314 | m_localScenes.ForEach(action); |
317 | } | 315 | } |
318 | } | 316 | } |
319 | } | 317 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 4603902..4d439b2 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -34,7 +34,6 @@ using System.Xml; | |||
34 | using Axiom.Math; | 34 | using Axiom.Math; |
35 | using libsecondlife; | 35 | using libsecondlife; |
36 | using libsecondlife.Packets; | 36 | using libsecondlife.Packets; |
37 | using OpenSim.Framework.Interfaces; | ||
38 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
39 | using OpenSim.Region.Environment.Interfaces; | 38 | using OpenSim.Region.Environment.Interfaces; |
40 | using OpenSim.Region.Physics.Manager; | 39 | using OpenSim.Region.Physics.Manager; |
@@ -270,7 +269,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
270 | StringReader sr = new StringReader(xmlData); | 269 | StringReader sr = new StringReader(xmlData); |
271 | XmlTextReader reader = new XmlTextReader(sr); | 270 | XmlTextReader reader = new XmlTextReader(sr); |
272 | reader.Read(); | 271 | reader.Read(); |
273 | 272 | ||
274 | reader.ReadStartElement("SceneObjectGroup"); | 273 | reader.ReadStartElement("SceneObjectGroup"); |
275 | m_rootPart = SceneObjectPart.FromXml(reader); | 274 | m_rootPart = SceneObjectPart.FromXml(reader); |
276 | 275 | ||
@@ -285,14 +284,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
285 | if (reader.Name == "SceneObjectPart") | 284 | if (reader.Name == "SceneObjectPart") |
286 | { | 285 | { |
287 | SceneObjectPart Part = SceneObjectPart.FromXml(reader); | 286 | SceneObjectPart Part = SceneObjectPart.FromXml(reader); |
288 | AddPart(Part); | 287 | AddPart(Part); |
289 | } | 288 | } |
290 | break; | 289 | break; |
291 | case XmlNodeType.EndElement: | 290 | case XmlNodeType.EndElement: |
292 | reader.Read(); | 291 | reader.Read(); |
293 | break; | 292 | break; |
294 | } | 293 | } |
295 | more = !reader.EOF; | 294 | more = !reader.EOF; |
296 | } | 295 | } |
297 | reader.Close(); | 296 | reader.Close(); |
298 | sr.Close(); | 297 | sr.Close(); |
@@ -424,13 +423,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
424 | PrimitiveBaseShape pbs = dupe.RootPart.Shape; | 423 | PrimitiveBaseShape pbs = dupe.RootPart.Shape; |
425 | 424 | ||
426 | dupe.RootPart.PhysActor = m_scene.PhysScene.AddPrimShape( | 425 | dupe.RootPart.PhysActor = m_scene.PhysScene.AddPrimShape( |
427 | dupe.RootPart.Name, | 426 | dupe.RootPart.Name, |
428 | pbs, | 427 | pbs, |
429 | new PhysicsVector(dupe.RootPart.AbsolutePosition.X, dupe.RootPart.AbsolutePosition.Y, dupe.RootPart.AbsolutePosition.Z), | 428 | new PhysicsVector(dupe.RootPart.AbsolutePosition.X, dupe.RootPart.AbsolutePosition.Y, |
430 | new PhysicsVector(dupe.RootPart.Scale.X, dupe.RootPart.Scale.Y, dupe.RootPart.Scale.Z), | 429 | dupe.RootPart.AbsolutePosition.Z), |
431 | new Axiom.Math.Quaternion(dupe.RootPart.RotationOffset.W, dupe.RootPart.RotationOffset.X, | 430 | new PhysicsVector(dupe.RootPart.Scale.X, dupe.RootPart.Scale.Y, dupe.RootPart.Scale.Z), |
432 | dupe.RootPart.RotationOffset.Y, dupe.RootPart.RotationOffset.Z)); | 431 | new Quaternion(dupe.RootPart.RotationOffset.W, dupe.RootPart.RotationOffset.X, |
433 | 432 | dupe.RootPart.RotationOffset.Y, dupe.RootPart.RotationOffset.Z)); | |
434 | } | 433 | } |
435 | 434 | ||
436 | List<SceneObjectPart> partList = new List<SceneObjectPart>(m_parts.Values); | 435 | List<SceneObjectPart> partList = new List<SceneObjectPart>(m_parts.Values); |
@@ -951,14 +950,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
951 | } | 950 | } |
952 | if (m_rootPart.PhysActor != null) | 951 | if (m_rootPart.PhysActor != null) |
953 | { | 952 | { |
954 | this.m_scene.PhysScene.RemovePrim(m_rootPart.PhysActor); | 953 | m_scene.PhysScene.RemovePrim(m_rootPart.PhysActor); |
955 | m_rootPart.PhysActor = m_scene.PhysScene.AddPrimShape( | 954 | m_rootPart.PhysActor = m_scene.PhysScene.AddPrimShape( |
956 | m_rootPart.Name, | 955 | m_rootPart.Name, |
957 | m_rootPart.Shape, | 956 | m_rootPart.Shape, |
958 | new PhysicsVector(m_rootPart.AbsolutePosition.X, m_rootPart.AbsolutePosition.Y, m_rootPart.AbsolutePosition.Z), | 957 | new PhysicsVector(m_rootPart.AbsolutePosition.X, m_rootPart.AbsolutePosition.Y, |
959 | new PhysicsVector(m_rootPart.Scale.X, m_rootPart.Scale.Y, m_rootPart.Scale.Z), | 958 | m_rootPart.AbsolutePosition.Z), |
960 | new Axiom.Math.Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, | 959 | new PhysicsVector(m_rootPart.Scale.X, m_rootPart.Scale.Y, m_rootPart.Scale.Z), |
961 | m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z)); | 960 | new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, |
961 | m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z)); | ||
962 | } | 962 | } |
963 | } | 963 | } |
964 | 964 | ||
@@ -1001,7 +1001,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1001 | AbsolutePosition = pos; | 1001 | AbsolutePosition = pos; |
1002 | ScheduleGroupForTerseUpdate(); | 1002 | ScheduleGroupForTerseUpdate(); |
1003 | 1003 | ||
1004 | m_scene.EventManager.TriggerGroupMove(this.UUID, pos); | 1004 | m_scene.EventManager.TriggerGroupMove(UUID, pos); |
1005 | } | 1005 | } |
1006 | 1006 | ||
1007 | /// <summary> | 1007 | /// <summary> |
@@ -1350,7 +1350,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1350 | 1350 | ||
1351 | public virtual void OnGrabGroup(LLVector3 offsetPos, IClientAPI remoteClient) | 1351 | public virtual void OnGrabGroup(LLVector3 offsetPos, IClientAPI remoteClient) |
1352 | { | 1352 | { |
1353 | m_scene.EventManager.TriggerGroupGrab(this.UUID, offsetPos, remoteClient.AgentId); | 1353 | m_scene.EventManager.TriggerGroupGrab(UUID, offsetPos, remoteClient.AgentId); |
1354 | } | 1354 | } |
1355 | 1355 | ||
1356 | public void DeleteGroup() | 1356 | public void DeleteGroup() |
@@ -1377,4 +1377,4 @@ namespace OpenSim.Region.Environment.Scenes | |||
1377 | Text = text; | 1377 | Text = text; |
1378 | } | 1378 | } |
1379 | } | 1379 | } |
1380 | } | 1380 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 3e104e3..387f573 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -33,12 +33,10 @@ using System.Xml.Serialization; | |||
33 | using Axiom.Math; | 33 | using Axiom.Math; |
34 | using libsecondlife; | 34 | using libsecondlife; |
35 | using libsecondlife.Packets; | 35 | using libsecondlife.Packets; |
36 | using OpenSim.Framework.Interfaces; | ||
37 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
38 | using OpenSim.Region.Environment.Interfaces; | 37 | using OpenSim.Region.Environment.Interfaces; |
39 | using OpenSim.Region.Environment.Scenes.Scripting; | 38 | using OpenSim.Region.Environment.Scenes.Scripting; |
40 | using OpenSim.Region.Physics.Manager; | 39 | using OpenSim.Region.Physics.Manager; |
41 | using OpenSim.Region.Environment.Types; | ||
42 | 40 | ||
43 | namespace OpenSim.Region.Environment.Scenes | 41 | namespace OpenSim.Region.Environment.Scenes |
44 | { | 42 | { |
@@ -49,8 +47,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
49 | private string m_inventoryFileName = ""; | 47 | private string m_inventoryFileName = ""; |
50 | private LLUUID m_folderID = LLUUID.Zero; | 48 | private LLUUID m_folderID = LLUUID.Zero; |
51 | 49 | ||
52 | [XmlIgnore] | 50 | [XmlIgnore] public PhysicsActor PhysActor = null; |
53 | public PhysicsActor PhysActor = null; | ||
54 | 51 | ||
55 | protected Dictionary<LLUUID, TaskInventoryItem> TaskInventory = new Dictionary<LLUUID, TaskInventoryItem>(); | 52 | protected Dictionary<LLUUID, TaskInventoryItem> TaskInventory = new Dictionary<LLUUID, TaskInventoryItem>(); |
56 | 53 | ||
@@ -68,10 +65,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
68 | 65 | ||
69 | protected byte[] m_particleSystem = new byte[0]; | 66 | protected byte[] m_particleSystem = new byte[0]; |
70 | 67 | ||
71 | [XmlIgnore] | 68 | [XmlIgnore] public uint TimeStampFull = 0; |
72 | public uint TimeStampFull = 0; | 69 | [XmlIgnore] public uint TimeStampTerse = 0; |
73 | [XmlIgnore] | ||
74 | public uint TimeStampTerse = 0; | ||
75 | 70 | ||
76 | protected SceneObjectGroup m_parentGroup; | 71 | protected SceneObjectGroup m_parentGroup; |
77 | 72 | ||
@@ -124,7 +119,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
124 | set { m_name = value; } | 119 | set { m_name = value; } |
125 | } | 120 | } |
126 | 121 | ||
127 | protected LLObject.ObjectFlags m_flags =0; | 122 | protected LLObject.ObjectFlags m_flags = 0; |
128 | 123 | ||
129 | public uint ObjectFlags | 124 | public uint ObjectFlags |
130 | { | 125 | { |
@@ -132,7 +127,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
132 | set { m_flags = (LLObject.ObjectFlags) value; } | 127 | set { m_flags = (LLObject.ObjectFlags) value; } |
133 | } | 128 | } |
134 | 129 | ||
135 | protected LLObject.MaterialType m_material =0; | 130 | protected LLObject.MaterialType m_material = 0; |
136 | 131 | ||
137 | public byte Material | 132 | public byte Material |
138 | { | 133 | { |
@@ -712,7 +707,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
712 | List<ScenePresence> avatars = m_parentGroup.GetScenePresences(); | 707 | List<ScenePresence> avatars = m_parentGroup.GetScenePresences(); |
713 | for (int i = 0; i < avatars.Count; i++) | 708 | for (int i = 0; i < avatars.Count; i++) |
714 | { | 709 | { |
715 | avatars[i].QueuePartForUpdate(this); | 710 | avatars[i].QueuePartForUpdate(this); |
716 | } | 711 | } |
717 | } | 712 | } |
718 | 713 | ||
@@ -774,13 +769,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
774 | List<ScenePresence> avatars = m_parentGroup.GetScenePresences(); | 769 | List<ScenePresence> avatars = m_parentGroup.GetScenePresences(); |
775 | for (int i = 0; i < avatars.Count; i++) | 770 | for (int i = 0; i < avatars.Count; i++) |
776 | { | 771 | { |
777 | avatars[i].QueuePartForUpdate(this); | 772 | avatars[i].QueuePartForUpdate(this); |
778 | } | 773 | } |
779 | } | 774 | } |
780 | 775 | ||
781 | public void AddTerseUpdateToAvatar(ScenePresence presence) | 776 | public void AddTerseUpdateToAvatar(ScenePresence presence) |
782 | { | 777 | { |
783 | presence.QueuePartForUpdate(this); | 778 | presence.QueuePartForUpdate(this); |
784 | } | 779 | } |
785 | 780 | ||
786 | /// <summary> | 781 | /// <summary> |
@@ -927,4 +922,4 @@ namespace OpenSim.Region.Environment.Scenes | |||
927 | } | 922 | } |
928 | } | 923 | } |
929 | } | 924 | } |
930 | } | 925 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.Animations.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.Animations.cs index 8ed4e87..f43a9fc 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.Animations.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.Animations.cs | |||
@@ -45,7 +45,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
45 | public void LoadAnims() | 45 | public void LoadAnims() |
46 | { | 46 | { |
47 | //OpenSim.Framework.Console.MainLog.Instance.Verbose("Avatar.cs:LoadAnims() - Loading avatar animations"); | 47 | //OpenSim.Framework.Console.MainLog.Instance.Verbose("Avatar.cs:LoadAnims() - Loading avatar animations"); |
48 | using( XmlTextReader reader = new XmlTextReader("data/avataranimations.xml") ) | 48 | using (XmlTextReader reader = new XmlTextReader("data/avataranimations.xml")) |
49 | { | 49 | { |
50 | XmlDocument doc = new XmlDocument(); | 50 | XmlDocument doc = new XmlDocument(); |
51 | doc.Load(reader); | 51 | doc.Load(reader); |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 6ed50b7..527eb22 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -30,11 +30,10 @@ using System.Collections.Generic; | |||
30 | using Axiom.Math; | 30 | using Axiom.Math; |
31 | using libsecondlife; | 31 | using libsecondlife; |
32 | using libsecondlife.Packets; | 32 | using libsecondlife.Packets; |
33 | using OpenSim.Framework.Console; | ||
34 | using OpenSim.Framework.Interfaces; | ||
35 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
36 | using OpenSim.Region.Physics.Manager; | 34 | using OpenSim.Framework.Console; |
37 | using OpenSim.Region.Environment.Types; | 35 | using OpenSim.Region.Environment.Types; |
36 | using OpenSim.Region.Physics.Manager; | ||
38 | 37 | ||
39 | namespace OpenSim.Region.Environment.Scenes | 38 | namespace OpenSim.Region.Environment.Scenes |
40 | { | 39 | { |
@@ -116,18 +115,21 @@ namespace OpenSim.Region.Environment.Scenes | |||
116 | } | 115 | } |
117 | 116 | ||
118 | private readonly ulong m_regionHandle; | 117 | private readonly ulong m_regionHandle; |
118 | |||
119 | public ulong RegionHandle | 119 | public ulong RegionHandle |
120 | { | 120 | { |
121 | get { return m_regionHandle; } | 121 | get { return m_regionHandle; } |
122 | } | 122 | } |
123 | 123 | ||
124 | private readonly string m_firstname; | 124 | private readonly string m_firstname; |
125 | |||
125 | public string Firstname | 126 | public string Firstname |
126 | { | 127 | { |
127 | get { return m_firstname; } | 128 | get { return m_firstname; } |
128 | } | 129 | } |
129 | 130 | ||
130 | private readonly string m_lastname; | 131 | private readonly string m_lastname; |
132 | |||
131 | public string Lastname | 133 | public string Lastname |
132 | { | 134 | { |
133 | get { return m_lastname; } | 135 | get { return m_lastname; } |
@@ -210,6 +212,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
210 | } | 212 | } |
211 | 213 | ||
212 | private bool m_isChildAgent = true; | 214 | private bool m_isChildAgent = true; |
215 | |||
213 | public bool IsChildAgent | 216 | public bool IsChildAgent |
214 | { | 217 | { |
215 | get { return m_isChildAgent; } | 218 | get { return m_isChildAgent; } |
@@ -217,6 +220,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
217 | } | 220 | } |
218 | 221 | ||
219 | private uint m_parentID = 0; | 222 | private uint m_parentID = 0; |
223 | |||
220 | public uint ParentID | 224 | public uint ParentID |
221 | { | 225 | { |
222 | get { return m_parentID; } | 226 | get { return m_parentID; } |
@@ -227,7 +231,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
227 | 231 | ||
228 | #region Constructor(s) | 232 | #region Constructor(s) |
229 | 233 | ||
230 | public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams, AvatarWearable[] wearables) | 234 | public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams, |
235 | AvatarWearable[] wearables) | ||
231 | { | 236 | { |
232 | m_scene = world; | 237 | m_scene = world; |
233 | m_uuid = client.AgentId; | 238 | m_uuid = client.AgentId; |
@@ -309,24 +314,24 @@ namespace OpenSim.Region.Environment.Scenes | |||
309 | if (update.LastFullUpdateTime < part.TimeStampFull) | 314 | if (update.LastFullUpdateTime < part.TimeStampFull) |
310 | { | 315 | { |
311 | //need to do a full update | 316 | //need to do a full update |
312 | part.SendFullUpdate(this.ControllingClient); | 317 | part.SendFullUpdate(ControllingClient); |
313 | update.LastFullUpdateTime = (uint)Util.UnixTimeSinceEpoch(); | 318 | update.LastFullUpdateTime = (uint) Util.UnixTimeSinceEpoch(); |
314 | updateCount++; | 319 | updateCount++; |
315 | } | 320 | } |
316 | else if (update.LastTerseUpdateTime < part.TimeStampTerse) | 321 | else if (update.LastTerseUpdateTime < part.TimeStampTerse) |
317 | { | 322 | { |
318 | part.SendTerseUpdate(this.ControllingClient); | 323 | part.SendTerseUpdate(ControllingClient); |
319 | update.LastTerseUpdateTime = (uint)Util.UnixTimeSinceEpoch(); | 324 | update.LastTerseUpdateTime = (uint) Util.UnixTimeSinceEpoch(); |
320 | updateCount++; | 325 | updateCount++; |
321 | } | 326 | } |
322 | } | 327 | } |
323 | else | 328 | else |
324 | { | 329 | { |
325 | //never been sent to client before so do full update | 330 | //never been sent to client before so do full update |
326 | part.SendFullUpdate(this.ControllingClient); | 331 | part.SendFullUpdate(ControllingClient); |
327 | ScenePartUpdate update = new ScenePartUpdate(); | 332 | ScenePartUpdate update = new ScenePartUpdate(); |
328 | update.FullID = part.UUID; | 333 | update.FullID = part.UUID; |
329 | update.LastFullUpdateTime = (uint)Util.UnixTimeSinceEpoch(); | 334 | update.LastFullUpdateTime = (uint) Util.UnixTimeSinceEpoch(); |
330 | m_updateTimes.Add(part.UUID, update); | 335 | m_updateTimes.Add(part.UUID, update); |
331 | updateCount++; | 336 | updateCount++; |
332 | } | 337 | } |
@@ -339,7 +344,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
339 | } | 344 | } |
340 | } | 345 | } |
341 | 346 | ||
342 | |||
343 | #region Status Methods | 347 | #region Status Methods |
344 | 348 | ||
345 | public void MakeRootAgent(LLVector3 pos, bool isFlying) | 349 | public void MakeRootAgent(LLVector3 pos, bool isFlying) |
@@ -368,10 +372,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
368 | 372 | ||
369 | private void RemoveFromPhysicalScene() | 373 | private void RemoveFromPhysicalScene() |
370 | { | 374 | { |
371 | if (this.PhysicsActor != null) | 375 | if (PhysicsActor != null) |
372 | { | 376 | { |
373 | m_scene.PhysScene.RemoveAvatar(this.PhysicsActor); | 377 | m_scene.PhysScene.RemoveAvatar(PhysicsActor); |
374 | this.PhysicsActor = null; | 378 | PhysicsActor = null; |
375 | } | 379 | } |
376 | } | 380 | } |
377 | 381 | ||
@@ -432,7 +436,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
432 | m_isChildAgent = false; | 436 | m_isChildAgent = false; |
433 | 437 | ||
434 | //this.m_scene.SendAllSceneObjectsToClient(this.ControllingClient); | 438 | //this.m_scene.SendAllSceneObjectsToClient(this.ControllingClient); |
435 | this.MakeRootAgent(this.AbsolutePosition, false); | 439 | MakeRootAgent(AbsolutePosition, false); |
436 | } | 440 | } |
437 | } | 441 | } |
438 | 442 | ||
@@ -457,13 +461,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
457 | Vector3 agent_control_v3 = new Vector3(0, 0, 0); | 461 | Vector3 agent_control_v3 = new Vector3(0, 0, 0); |
458 | Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z); | 462 | Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z); |
459 | bool oldflying = PhysicsActor.Flying; | 463 | bool oldflying = PhysicsActor.Flying; |
460 | PhysicsActor.Flying = ((flags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0); | 464 | PhysicsActor.Flying = ((flags & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0); |
461 | if (PhysicsActor.Flying != oldflying) | 465 | if (PhysicsActor.Flying != oldflying) |
462 | { | 466 | { |
463 | update_movementflag = true; | 467 | update_movementflag = true; |
464 | } | 468 | } |
465 | 469 | ||
466 | if ((flags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_STAND_UP) != 0) | 470 | if ((flags & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_STAND_UP) != 0) |
467 | { | 471 | { |
468 | StandUp(); | 472 | StandUp(); |
469 | update_movementflag = true; | 473 | update_movementflag = true; |
@@ -477,23 +481,23 @@ namespace OpenSim.Region.Environment.Scenes | |||
477 | 481 | ||
478 | if (m_parentID == 0) | 482 | if (m_parentID == 0) |
479 | { | 483 | { |
480 | foreach (Dir_ControlFlags DCF in Enum.GetValues(typeof(Dir_ControlFlags))) | 484 | foreach (Dir_ControlFlags DCF in Enum.GetValues(typeof (Dir_ControlFlags))) |
481 | { | 485 | { |
482 | if ((flags & (uint)DCF) != 0) | 486 | if ((flags & (uint) DCF) != 0) |
483 | { | 487 | { |
484 | DCFlagKeyPressed = true; | 488 | DCFlagKeyPressed = true; |
485 | agent_control_v3 += Dir_Vectors[i]; | 489 | agent_control_v3 += Dir_Vectors[i]; |
486 | if ((m_movementflag & (uint)DCF) == 0) | 490 | if ((m_movementflag & (uint) DCF) == 0) |
487 | { | 491 | { |
488 | m_movementflag += (byte)(uint)DCF; | 492 | m_movementflag += (byte) (uint) DCF; |
489 | update_movementflag = true; | 493 | update_movementflag = true; |
490 | } | 494 | } |
491 | } | 495 | } |
492 | else | 496 | else |
493 | { | 497 | { |
494 | if ((m_movementflag & (uint)DCF) != 0) | 498 | if ((m_movementflag & (uint) DCF) != 0) |
495 | { | 499 | { |
496 | m_movementflag -= (byte)(uint)DCF; | 500 | m_movementflag -= (byte) (uint) DCF; |
497 | update_movementflag = true; | 501 | update_movementflag = true; |
498 | } | 502 | } |
499 | } | 503 | } |
@@ -580,10 +584,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
580 | } | 584 | } |
581 | 585 | ||
582 | NewForce newVelocity = new NewForce(); | 586 | NewForce newVelocity = new NewForce(); |
583 | Vector3 direc = rotation * vec; | 587 | Vector3 direc = rotation*vec; |
584 | direc.Normalize(); | 588 | direc.Normalize(); |
585 | 589 | ||
586 | direc = direc * ((0.03f) * 128f); | 590 | direc = direc*((0.03f)*128f); |
587 | if (m_physicsActor.Flying) | 591 | if (m_physicsActor.Flying) |
588 | direc *= 4; | 592 | direc *= 4; |
589 | 593 | ||
@@ -692,8 +696,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
692 | } | 696 | } |
693 | 697 | ||
694 | 698 | ||
695 | |||
696 | |||
697 | /// <summary> | 699 | /// <summary> |
698 | /// | 700 | /// |
699 | /// </summary> | 701 | /// </summary> |
@@ -701,7 +703,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
701 | public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar) | 703 | public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar) |
702 | { | 704 | { |
703 | remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, | 705 | remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, |
704 | LocalId, AbsolutePosition, m_textureEntry.ToBytes(), m_parentID); | 706 | LocalId, AbsolutePosition, m_textureEntry.ToBytes(), |
707 | m_parentID); | ||
705 | } | 708 | } |
706 | 709 | ||
707 | public void SendFullUpdateToAllClients() | 710 | public void SendFullUpdateToAllClients() |
@@ -784,7 +787,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
784 | public void SendAppearanceToOtherAgent(ScenePresence avatarInfo) | 787 | public void SendAppearanceToOtherAgent(ScenePresence avatarInfo) |
785 | { | 788 | { |
786 | avatarInfo.m_controllingClient.SendAppearance(m_controllingClient.AgentId, m_visualParams, | 789 | avatarInfo.m_controllingClient.SendAppearance(m_controllingClient.AgentId, m_visualParams, |
787 | m_textureEntry.ToBytes()); | 790 | m_textureEntry.ToBytes()); |
788 | } | 791 | } |
789 | 792 | ||
790 | /// <summary> | 793 | /// <summary> |
@@ -798,10 +801,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
798 | AnimationSeq = seq; | 801 | AnimationSeq = seq; |
799 | LLUUID sourceAgentId = m_controllingClient.AgentId; | 802 | LLUUID sourceAgentId = m_controllingClient.AgentId; |
800 | 803 | ||
801 | m_scene.Broadcast(delegate(IClientAPI client) | 804 | m_scene.Broadcast(delegate(IClientAPI client) { client.SendAnimation(animID, seq, sourceAgentId); }); |
802 | { | ||
803 | client.SendAnimation(animID, seq, sourceAgentId); | ||
804 | }); | ||
805 | } | 805 | } |
806 | 806 | ||
807 | /// <summary> | 807 | /// <summary> |
@@ -842,9 +842,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
842 | LLVector3 vel = Velocity; | 842 | LLVector3 vel = Velocity; |
843 | 843 | ||
844 | float timeStep = 0.1f; | 844 | float timeStep = 0.1f; |
845 | pos2.X = pos2.X + (vel.X * timeStep); | 845 | pos2.X = pos2.X + (vel.X*timeStep); |
846 | pos2.Y = pos2.Y + (vel.Y * timeStep); | 846 | pos2.Y = pos2.Y + (vel.Y*timeStep); |
847 | pos2.Z = pos2.Z + (vel.Z * timeStep); | 847 | pos2.Z = pos2.Z + (vel.Z*timeStep); |
848 | 848 | ||
849 | if ((pos2.X < 0) || (pos2.X > 256)) | 849 | if ((pos2.X < 0) || (pos2.X > 256)) |
850 | { | 850 | { |
@@ -889,7 +889,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
889 | } | 889 | } |
890 | 890 | ||
891 | LLVector3 vel = m_velocity; | 891 | LLVector3 vel = m_velocity; |
892 | ulong neighbourHandle = Helpers.UIntsToLong((uint)(neighbourx * 256), (uint)(neighboury * 256)); | 892 | ulong neighbourHandle = Helpers.UIntsToLong((uint) (neighbourx*256), (uint) (neighboury*256)); |
893 | RegionInfo neighbourRegion = m_scene.RequestNeighbouringRegionInfo(neighbourHandle); | 893 | RegionInfo neighbourRegion = m_scene.RequestNeighbouringRegionInfo(neighbourHandle); |
894 | if (neighbourRegion != null) | 894 | if (neighbourRegion != null) |
895 | { | 895 | { |
@@ -901,7 +901,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
901 | AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); | 901 | AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); |
902 | string capsPath = Util.GetCapsURL(m_controllingClient.AgentId); | 902 | string capsPath = Util.GetCapsURL(m_controllingClient.AgentId); |
903 | m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, | 903 | m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, |
904 | capsPath); | 904 | capsPath); |
905 | MakeChildAgent(); | 905 | MakeChildAgent(); |
906 | m_scene.SendKillObject(m_localId); | 906 | m_scene.SendKillObject(m_localId); |
907 | m_scene.NotifyMyCoarseLocationChange(); | 907 | m_scene.NotifyMyCoarseLocationChange(); |
@@ -980,7 +980,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
980 | LastFullUpdateTime = 0; | 980 | LastFullUpdateTime = 0; |
981 | LastTerseUpdateTime = 0; | 981 | LastTerseUpdateTime = 0; |
982 | } | 982 | } |
983 | |||
984 | } | 983 | } |
985 | 984 | ||
986 | 985 | ||
@@ -997,7 +996,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
997 | new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, | 996 | new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, |
998 | AbsolutePosition.Z); | 997 | AbsolutePosition.Z); |
999 | 998 | ||
1000 | m_physicsActor = scene.AddAvatar(this.Firstname + "." + this.Lastname, pVec); | 999 | m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec); |
1001 | } | 1000 | } |
1002 | 1001 | ||
1003 | internal void Close() | 1002 | internal void Close() |
@@ -1008,7 +1007,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1008 | public void SetWearable(int wearableId, AvatarWearable wearable) | 1007 | public void SetWearable(int wearableId, AvatarWearable wearable) |
1009 | { | 1008 | { |
1010 | m_wearables[wearableId] = wearable; | 1009 | m_wearables[wearableId] = wearable; |
1011 | SendOurAppearance( m_controllingClient ); | 1010 | SendOurAppearance(m_controllingClient); |
1012 | } | 1011 | } |
1013 | } | 1012 | } |
1014 | } | 1013 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs b/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs index 01c1d65..cb000c4 100644 --- a/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs +++ b/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs | |||
@@ -43,4 +43,4 @@ namespace OpenSim.Region.Environment.Scenes.Scripting | |||
43 | LLVector3 AbsolutePosition { get; } | 43 | LLVector3 AbsolutePosition { get; } |
44 | void SetText(string text, Vector3 color, double alpha); | 44 | void SetText(string text, Vector3 color, double alpha); |
45 | } | 45 | } |
46 | } | 46 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs b/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs index 2fb3e78..c1bf72b 100644 --- a/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs +++ b/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs | |||
@@ -85,4 +85,4 @@ namespace OpenSim.Region.Environment.Scenes.Scripting | |||
85 | Console.WriteLine("Tried to SetText [{0}] on NullScriptHost", text); | 85 | Console.WriteLine("Tried to SetText [{0}] on NullScriptHost", text); |
86 | } | 86 | } |
87 | } | 87 | } |
88 | } | 88 | } \ No newline at end of file |