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/Scene.cs | |
parent | * Deleted .user file (diff) | |
download | opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.zip opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.gz opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.bz2 opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.xz |
* Optimized usings
* Shortened type references
* Removed redundant 'this' qualifier
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 197 |
1 files changed, 92 insertions, 105 deletions
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 |