aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs25
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs237
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs114
-rw-r--r--OpenSim/Region/Framework/Scenes/SimStatsReporter.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs3
7 files changed, 167 insertions, 226 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 9fcd5fe..605ee32 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -142,8 +142,11 @@ namespace OpenSim.Region.Framework.Scenes
142 public event OnPermissionErrorDelegate OnPermissionError; 142 public event OnPermissionErrorDelegate OnPermissionError;
143 143
144 /// <summary> 144 /// <summary>
145 /// Fired when a new script is created. 145 /// Fired when a script is run.
146 /// </summary> 146 /// </summary>
147 /// <remarks>
148 /// Occurs after OnNewScript.
149 /// </remarks>
147 public event NewRezScript OnRezScript; 150 public event NewRezScript OnRezScript;
148 public delegate void NewRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource); 151 public delegate void NewRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource);
149 152
@@ -191,10 +194,16 @@ namespace OpenSim.Region.Framework.Scenes
191 194
192 public event ClientClosed OnClientClosed; 195 public event ClientClosed OnClientClosed;
193 196
194 // Fired when a script is created
195 // The indication that a new script exists in this region.
196 public delegate void NewScript(UUID clientID, SceneObjectPart part, UUID itemID); 197 public delegate void NewScript(UUID clientID, SceneObjectPart part, UUID itemID);
198
199 /// <summary>
200 /// Fired when a script is created.
201 /// </summary>
202 /// <remarks>
203 /// Occurs before OnRezScript
204 /// </remarks>
197 public event NewScript OnNewScript; 205 public event NewScript OnNewScript;
206
198 public virtual void TriggerNewScript(UUID clientID, SceneObjectPart part, UUID itemID) 207 public virtual void TriggerNewScript(UUID clientID, SceneObjectPart part, UUID itemID)
199 { 208 {
200 NewScript handlerNewScript = OnNewScript; 209 NewScript handlerNewScript = OnNewScript;
@@ -216,10 +225,16 @@ namespace OpenSim.Region.Framework.Scenes
216 } 225 }
217 } 226 }
218 227
219 //TriggerUpdateScript: triggered after Scene receives client's upload of updated script and stores it as asset
220 // An indication that the script has changed.
221 public delegate void UpdateScript(UUID clientID, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID); 228 public delegate void UpdateScript(UUID clientID, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID);
229
230 /// <summary>
231 /// An indication that the script has changed.
232 /// </summary>
233 /// <remarks>
234 /// Triggered after the scene receives a client's upload of an updated script and has stored it in an asset.
235 /// </remarks>
222 public event UpdateScript OnUpdateScript; 236 public event UpdateScript OnUpdateScript;
237
223 public virtual void TriggerUpdateScript(UUID clientId, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID) 238 public virtual void TriggerUpdateScript(UUID clientId, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID)
224 { 239 {
225 UpdateScript handlerUpdateScript = OnUpdateScript; 240 UpdateScript handlerUpdateScript = OnUpdateScript;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 5d27d86..d016887 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -651,101 +651,104 @@ namespace OpenSim.Region.Framework.Scenes
651 651
652 #region Region Config 652 #region Region Config
653 653
654 // Region config overrides global config
655 //
654 try 656 try
655 { 657 {
656 // Region config overrides global config 658 if (m_config.Configs["Startup"] != null)
657 // 659 {
658 IConfig startupConfig = m_config.Configs["Startup"]; 660 IConfig startupConfig = m_config.Configs["Startup"];
659 661
660 m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance); 662 m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance);
661 m_useBackup = startupConfig.GetBoolean("UseSceneBackup", m_useBackup); 663 m_useBackup = startupConfig.GetBoolean("UseSceneBackup", m_useBackup);
662 if (!m_useBackup) 664 if (!m_useBackup)
663 m_log.InfoFormat("[SCENE]: Backup has been disabled for {0}", RegionInfo.RegionName); 665 m_log.InfoFormat("[SCENE]: Backup has been disabled for {0}", RegionInfo.RegionName);
664 666
665 //Animation states 667 //Animation states
666 m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); 668 m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false);
667 669
668 PhysicalPrims = startupConfig.GetBoolean("physical_prim", true); 670 PhysicalPrims = startupConfig.GetBoolean("physical_prim", true);
669 CollidablePrims = startupConfig.GetBoolean("collidable_prim", true); 671 CollidablePrims = startupConfig.GetBoolean("collidable_prim", true);
670 672
671 m_maxNonphys = startupConfig.GetFloat("NonphysicalPrimMax", m_maxNonphys); 673 m_maxNonphys = startupConfig.GetFloat("NonphysicalPrimMax", m_maxNonphys);
672 if (RegionInfo.NonphysPrimMax > 0) 674 if (RegionInfo.NonphysPrimMax > 0)
673 { 675 {
674 m_maxNonphys = RegionInfo.NonphysPrimMax; 676 m_maxNonphys = RegionInfo.NonphysPrimMax;
675 } 677 }
676 678
677 m_maxPhys = startupConfig.GetFloat("PhysicalPrimMax", m_maxPhys); 679 m_maxPhys = startupConfig.GetFloat("PhysicalPrimMax", m_maxPhys);
678 680
679 if (RegionInfo.PhysPrimMax > 0) 681 if (RegionInfo.PhysPrimMax > 0)
680 { 682 {
681 m_maxPhys = RegionInfo.PhysPrimMax; 683 m_maxPhys = RegionInfo.PhysPrimMax;
682 } 684 }
683 685
684 // Here, if clamping is requested in either global or 686 // Here, if clamping is requested in either global or
685 // local config, it will be used 687 // local config, it will be used
686 // 688 //
687 m_clampPrimSize = startupConfig.GetBoolean("ClampPrimSize", m_clampPrimSize); 689 m_clampPrimSize = startupConfig.GetBoolean("ClampPrimSize", m_clampPrimSize);
688 if (RegionInfo.ClampPrimSize) 690 if (RegionInfo.ClampPrimSize)
689 { 691 {
690 m_clampPrimSize = true; 692 m_clampPrimSize = true;
691 } 693 }
692 694
693 m_trustBinaries = startupConfig.GetBoolean("TrustBinaries", m_trustBinaries); 695 m_trustBinaries = startupConfig.GetBoolean("TrustBinaries", m_trustBinaries);
694 m_allowScriptCrossings = startupConfig.GetBoolean("AllowScriptCrossing", m_allowScriptCrossings); 696 m_allowScriptCrossings = startupConfig.GetBoolean("AllowScriptCrossing", m_allowScriptCrossings);
695 m_dontPersistBefore = 697 m_dontPersistBefore =
696 startupConfig.GetLong("MinimumTimeBeforePersistenceConsidered", DEFAULT_MIN_TIME_FOR_PERSISTENCE); 698 startupConfig.GetLong("MinimumTimeBeforePersistenceConsidered", DEFAULT_MIN_TIME_FOR_PERSISTENCE);
697 m_dontPersistBefore *= 10000000; 699 m_dontPersistBefore *= 10000000;
698 m_persistAfter = 700 m_persistAfter =
699 startupConfig.GetLong("MaximumTimeBeforePersistenceConsidered", DEFAULT_MAX_TIME_FOR_PERSISTENCE); 701 startupConfig.GetLong("MaximumTimeBeforePersistenceConsidered", DEFAULT_MAX_TIME_FOR_PERSISTENCE);
700 m_persistAfter *= 10000000; 702 m_persistAfter *= 10000000;
701 703
702 m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "XEngine"); 704 m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "XEngine");
703 m_log.InfoFormat("[SCENE]: Default script engine {0}", m_defaultScriptEngine); 705 m_log.InfoFormat("[SCENE]: Default script engine {0}", m_defaultScriptEngine);
704 706
705 IConfig packetConfig = m_config.Configs["PacketPool"]; 707 IConfig packetConfig = m_config.Configs["PacketPool"];
706 if (packetConfig != null) 708 if (packetConfig != null)
707 { 709 {
708 PacketPool.Instance.RecyclePackets = packetConfig.GetBoolean("RecyclePackets", true); 710 PacketPool.Instance.RecyclePackets = packetConfig.GetBoolean("RecyclePackets", true);
709 PacketPool.Instance.RecycleDataBlocks = packetConfig.GetBoolean("RecycleDataBlocks", true); 711 PacketPool.Instance.RecycleDataBlocks = packetConfig.GetBoolean("RecycleDataBlocks", true);
710 } 712 }
711 713
712 m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); 714 m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl);
713 m_seeIntoBannedRegion = startupConfig.GetBoolean("SeeIntoBannedRegion", m_seeIntoBannedRegion); 715 m_seeIntoBannedRegion = startupConfig.GetBoolean("SeeIntoBannedRegion", m_seeIntoBannedRegion);
714 CombineRegions = startupConfig.GetBoolean("CombineContiguousRegions", false); 716 CombineRegions = startupConfig.GetBoolean("CombineContiguousRegions", false);
715 717
716 m_generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", true); 718 m_generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", true);
717 if (m_generateMaptiles) 719 if (m_generateMaptiles)
718 {
719 int maptileRefresh = startupConfig.GetInt("MaptileRefresh", 0);
720 if (maptileRefresh != 0)
721 { 720 {
722 m_mapGenerationTimer.Interval = maptileRefresh * 1000; 721 int maptileRefresh = startupConfig.GetInt("MaptileRefresh", 0);
723 m_mapGenerationTimer.Elapsed += RegenerateMaptileAndReregister; 722 if (maptileRefresh != 0)
724 m_mapGenerationTimer.AutoReset = true; 723 {
725 m_mapGenerationTimer.Start(); 724 m_mapGenerationTimer.Interval = maptileRefresh * 1000;
725 m_mapGenerationTimer.Elapsed += RegenerateMaptileAndReregister;
726 m_mapGenerationTimer.AutoReset = true;
727 m_mapGenerationTimer.Start();
728 }
726 } 729 }
727 } 730 else
728 else
729 {
730 string tile = startupConfig.GetString("MaptileStaticUUID", UUID.Zero.ToString());
731 UUID tileID;
732
733 if (UUID.TryParse(tile, out tileID))
734 { 731 {
735 RegionInfo.RegionSettings.TerrainImageID = tileID; 732 string tile = startupConfig.GetString("MaptileStaticUUID", UUID.Zero.ToString());
733 UUID tileID;
734
735 if (UUID.TryParse(tile, out tileID))
736 {
737 RegionInfo.RegionSettings.TerrainImageID = tileID;
738 }
736 } 739 }
737 }
738 740
739 MinFrameTime = startupConfig.GetFloat( "MinFrameTime", MinFrameTime); 741 MinFrameTime = startupConfig.GetFloat( "MinFrameTime", MinFrameTime);
740 m_update_backup = startupConfig.GetInt( "UpdateStorageEveryNFrames", m_update_backup); 742 m_update_backup = startupConfig.GetInt( "UpdateStorageEveryNFrames", m_update_backup);
741 m_update_coarse_locations = startupConfig.GetInt( "UpdateCoarseLocationsEveryNFrames", m_update_coarse_locations); 743 m_update_coarse_locations = startupConfig.GetInt( "UpdateCoarseLocationsEveryNFrames", m_update_coarse_locations);
742 m_update_entitymovement = startupConfig.GetInt( "UpdateEntityMovementEveryNFrames", m_update_entitymovement); 744 m_update_entitymovement = startupConfig.GetInt( "UpdateEntityMovementEveryNFrames", m_update_entitymovement);
743 m_update_events = startupConfig.GetInt( "UpdateEventsEveryNFrames", m_update_events); 745 m_update_events = startupConfig.GetInt( "UpdateEventsEveryNFrames", m_update_events);
744 m_update_objects = startupConfig.GetInt( "UpdateObjectsEveryNFrames", m_update_objects); 746 m_update_objects = startupConfig.GetInt( "UpdateObjectsEveryNFrames", m_update_objects);
745 m_update_physics = startupConfig.GetInt( "UpdatePhysicsEveryNFrames", m_update_physics); 747 m_update_physics = startupConfig.GetInt( "UpdatePhysicsEveryNFrames", m_update_physics);
746 m_update_presences = startupConfig.GetInt( "UpdateAgentsEveryNFrames", m_update_presences); 748 m_update_presences = startupConfig.GetInt( "UpdateAgentsEveryNFrames", m_update_presences);
747 m_update_terrain = startupConfig.GetInt( "UpdateTerrainEveryNFrames", m_update_terrain); 749 m_update_terrain = startupConfig.GetInt( "UpdateTerrainEveryNFrames", m_update_terrain);
748 m_update_temp_cleaning = startupConfig.GetInt( "UpdateTempCleaningEveryNFrames", m_update_temp_cleaning); 750 m_update_temp_cleaning = startupConfig.GetInt( "UpdateTempCleaningEveryNFrames", m_update_temp_cleaning);
751 }
749 } 752 }
750 catch (Exception e) 753 catch (Exception e)
751 { 754 {
@@ -756,37 +759,34 @@ namespace OpenSim.Region.Framework.Scenes
756 759
757 #region Interest Management 760 #region Interest Management
758 761
759 if (m_config != null) 762 IConfig interestConfig = m_config.Configs["InterestManagement"];
763 if (interestConfig != null)
760 { 764 {
761 IConfig interestConfig = m_config.Configs["InterestManagement"]; 765 string update_prioritization_scheme = interestConfig.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower();
762 if (interestConfig != null)
763 {
764 string update_prioritization_scheme = interestConfig.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower();
765
766 try
767 {
768 m_priorityScheme = (UpdatePrioritizationSchemes)Enum.Parse(typeof(UpdatePrioritizationSchemes), update_prioritization_scheme, true);
769 }
770 catch (Exception)
771 {
772 m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time");
773 m_priorityScheme = UpdatePrioritizationSchemes.Time;
774 }
775 766
776 m_reprioritizationEnabled = interestConfig.GetBoolean("ReprioritizationEnabled", true); 767 try
777 m_reprioritizationInterval = interestConfig.GetDouble("ReprioritizationInterval", 5000.0); 768 {
778 m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0); 769 m_priorityScheme = (UpdatePrioritizationSchemes)Enum.Parse(typeof(UpdatePrioritizationSchemes), update_prioritization_scheme, true);
779 m_childReprioritizationDistance = interestConfig.GetDouble("ChildReprioritizationDistance", 20.0);
780 } 770 }
771 catch (Exception)
772 {
773 m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time");
774 m_priorityScheme = UpdatePrioritizationSchemes.Time;
775 }
776
777 m_reprioritizationEnabled = interestConfig.GetBoolean("ReprioritizationEnabled", true);
778 m_reprioritizationInterval = interestConfig.GetDouble("ReprioritizationInterval", 5000.0);
779 m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0);
780 m_childReprioritizationDistance = interestConfig.GetDouble("ChildReprioritizationDistance", 20.0);
781 } 781 }
782 782
783 m_log.InfoFormat("[SCENE]: Using the {0} prioritization scheme", m_priorityScheme); 783 m_log.DebugFormat("[SCENE]: Using the {0} prioritization scheme", m_priorityScheme);
784 784
785 #endregion Interest Management 785 #endregion Interest Management
786 786
787 StatsReporter = new SimStatsReporter(this); 787 StatsReporter = new SimStatsReporter(this);
788 StatsReporter.OnSendStatsResult += SendSimStatsPackets; 788 StatsReporter.OnSendStatsResult += SendSimStatsPackets;
789 StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats; 789 StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats;
790 } 790 }
791 791
792 /// <summary> 792 /// <summary>
@@ -1102,6 +1102,8 @@ namespace OpenSim.Region.Framework.Scenes
1102 { 1102 {
1103 m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName); 1103 m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName);
1104 1104
1105 StatsReporter.Close();
1106
1105 m_restartTimer.Stop(); 1107 m_restartTimer.Stop();
1106 m_restartTimer.Close(); 1108 m_restartTimer.Close();
1107 1109
@@ -1181,7 +1183,7 @@ namespace OpenSim.Region.Framework.Scenes
1181 1183
1182 HeartbeatThread 1184 HeartbeatThread
1183 = Watchdog.StartThread( 1185 = Watchdog.StartThread(
1184 Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false); 1186 Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, false);
1185 } 1187 }
1186 1188
1187 /// <summary> 1189 /// <summary>
@@ -1219,6 +1221,13 @@ namespace OpenSim.Region.Framework.Scenes
1219 try 1221 try
1220 { 1222 {
1221 m_eventManager.TriggerOnRegionStarted(this); 1223 m_eventManager.TriggerOnRegionStarted(this);
1224
1225 // The first frame can take a very long time due to physics actors being added on startup. Therefore,
1226 // don't turn on the watchdog alarm for this thread until the second frame, in order to prevent false
1227 // alarms for scenes with many objects.
1228 Update();
1229 Watchdog.GetCurrentThreadInfo().AlarmIfTimeout = true;
1230
1222 while (!shuttingdown) 1231 while (!shuttingdown)
1223 Update(); 1232 Update();
1224 } 1233 }
@@ -1244,7 +1253,7 @@ namespace OpenSim.Region.Framework.Scenes
1244 1253
1245 ++Frame; 1254 ++Frame;
1246 1255
1247// m_log.DebugFormat("[SCENE]: Processing frame {0}", Frame); 1256// m_log.DebugFormat("[SCENE]: Processing frame {0} in {1}", Frame, RegionInfo.RegionName);
1248 1257
1249 try 1258 try
1250 { 1259 {
@@ -1406,26 +1415,10 @@ namespace OpenSim.Region.Framework.Scenes
1406 { 1415 {
1407 throw; 1416 throw;
1408 } 1417 }
1409 catch (AccessViolationException e)
1410 {
1411 m_log.ErrorFormat(
1412 "[REGION]: Failed on region {0} with exception {1}{2}",
1413 RegionInfo.RegionName, e.Message, e.StackTrace);
1414 }
1415 //catch (NullReferenceException e)
1416 //{
1417 // m_log.Error("[REGION]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName);
1418 //}
1419 catch (InvalidOperationException e)
1420 {
1421 m_log.ErrorFormat(
1422 "[REGION]: Failed on region {0} with exception {1}{2}",
1423 RegionInfo.RegionName, e.Message, e.StackTrace);
1424 }
1425 catch (Exception e) 1418 catch (Exception e)
1426 { 1419 {
1427 m_log.ErrorFormat( 1420 m_log.ErrorFormat(
1428 "[REGION]: Failed on region {0} with exception {1}{2}", 1421 "[SCENE]: Failed on region {0} with exception {1}{2}",
1429 RegionInfo.RegionName, e.Message, e.StackTrace); 1422 RegionInfo.RegionName, e.Message, e.StackTrace);
1430 } 1423 }
1431 1424
@@ -1467,7 +1460,6 @@ namespace OpenSim.Region.Framework.Scenes
1467 entry.checkAtTargets(); 1460 entry.checkAtTargets();
1468 } 1461 }
1469 1462
1470
1471 /// <summary> 1463 /// <summary>
1472 /// Send out simstats data to all clients 1464 /// Send out simstats data to all clients
1473 /// </summary> 1465 /// </summary>
@@ -4342,16 +4334,11 @@ namespace OpenSim.Region.Framework.Scenes
4342 public bool PipeEventsForScript(uint localID) 4334 public bool PipeEventsForScript(uint localID)
4343 { 4335 {
4344 SceneObjectPart part = GetSceneObjectPart(localID); 4336 SceneObjectPart part = GetSceneObjectPart(localID);
4337
4345 if (part != null) 4338 if (part != null)
4346 { 4339 {
4347 // Changed so that child prims of attachments return ScriptDanger for their parent, so that
4348 // their scripts will actually run.
4349 // -- Leaf, Tue Aug 12 14:17:05 EDT 2008
4350 SceneObjectPart parent = part.ParentGroup.RootPart; 4340 SceneObjectPart parent = part.ParentGroup.RootPart;
4351 if (part.ParentGroup.IsAttachment) 4341 return ScriptDanger(parent, parent.GetWorldPosition());
4352 return ScriptDanger(parent, parent.GetWorldPosition());
4353 else
4354 return ScriptDanger(part, part.GetWorldPosition());
4355 } 4342 }
4356 else 4343 else
4357 { 4344 {
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index 65ffe92..b806d91 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -156,8 +156,8 @@ namespace OpenSim.Region.Framework.Scenes
156 // that the region position is cached or performance will degrade 156 // that the region position is cached or performance will degrade
157 Utils.LongToUInts(regionHandle, out x, out y); 157 Utils.LongToUInts(regionHandle, out x, out y);
158 GridRegion dest = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); 158 GridRegion dest = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
159 bool v = true; 159// bool v = true;
160 if (! simulatorList.Contains(dest.ServerURI)) 160 if (!simulatorList.Contains(dest.ServerURI))
161 { 161 {
162 // we havent seen this simulator before, add it to the list 162 // we havent seen this simulator before, add it to the list
163 // and send it an update 163 // and send it an update
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 8dd2c76..cce606a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1691,8 +1691,6 @@ namespace OpenSim.Region.Framework.Scenes
1691 if (userExposed) 1691 if (userExposed)
1692 dupe.UUID = UUID.Random(); 1692 dupe.UUID = UUID.Random();
1693 1693
1694 // The PhysActor cannot be valid on a copy because the copy is not in the scene yet.
1695 // Null it, the caller has to create a new one once the object is added to a scene
1696 dupe.PhysActor = null; 1694 dupe.PhysActor = null;
1697 1695
1698 dupe.OwnerID = AgentID; 1696 dupe.OwnerID = AgentID;
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 8a7c06a..4190cf6 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -349,13 +349,7 @@ namespace OpenSim.Region.Framework.Scenes
349 /// </summary> 349 /// </summary>
350 protected Vector3 m_lastCameraPosition; 350 protected Vector3 m_lastCameraPosition;
351 351
352 protected Vector3 m_CameraPosition; 352 public Vector3 CameraPosition { get; set; }
353
354 public Vector3 CameraPosition
355 {
356 get { return m_CameraPosition; }
357 private set { m_CameraPosition = value; }
358 }
359 353
360 public Quaternion CameraRotation 354 public Quaternion CameraRotation
361 { 355 {
@@ -365,28 +359,9 @@ namespace OpenSim.Region.Framework.Scenes
365 // Use these three vectors to figure out what the agent is looking at 359 // Use these three vectors to figure out what the agent is looking at
366 // Convert it to a Matrix and/or Quaternion 360 // Convert it to a Matrix and/or Quaternion
367 // 361 //
368 protected Vector3 m_CameraAtAxis; 362 public Vector3 CameraAtAxis { get; set; }
369 protected Vector3 m_CameraLeftAxis; 363 public Vector3 CameraLeftAxis { get; set; }
370 protected Vector3 m_CameraUpAxis; 364 public Vector3 CameraUpAxis { get; set; }
371
372 public Vector3 CameraAtAxis
373 {
374 get { return m_CameraAtAxis; }
375 private set { m_CameraAtAxis = value; }
376 }
377
378
379 public Vector3 CameraLeftAxis
380 {
381 get { return m_CameraLeftAxis; }
382 private set { m_CameraLeftAxis = value; }
383 }
384
385 public Vector3 CameraUpAxis
386 {
387 get { return m_CameraUpAxis; }
388 private set { m_CameraUpAxis = value; }
389 }
390 365
391 public Vector3 Lookat 366 public Vector3 Lookat
392 { 367 {
@@ -402,33 +377,15 @@ namespace OpenSim.Region.Framework.Scenes
402 } 377 }
403 #endregion 378 #endregion
404 379
405 public readonly string Firstname; 380 public string Firstname { get; private set; }
406 public readonly string Lastname; 381 public string Lastname { get; private set; }
407 382
408 private string m_grouptitle; 383 public string Grouptitle { get; set; }
409
410 public string Grouptitle
411 {
412 get { return m_grouptitle; }
413 set { m_grouptitle = value; }
414 }
415 384
416 // Agent's Draw distance. 385 // Agent's Draw distance.
417 protected float m_DrawDistance; 386 public float DrawDistance { get; set; }
418
419 public float DrawDistance
420 {
421 get { return m_DrawDistance; }
422 private set { m_DrawDistance = value; }
423 }
424
425 protected bool m_allowMovement = true;
426 387
427 public bool AllowMovement 388 public bool AllowMovement { get; set; }
428 {
429 get { return m_allowMovement; }
430 set { m_allowMovement = value; }
431 }
432 389
433 private bool m_setAlwaysRun; 390 private bool m_setAlwaysRun;
434 391
@@ -455,13 +412,7 @@ namespace OpenSim.Region.Framework.Scenes
455 } 412 }
456 } 413 }
457 414
458 private byte m_state; 415 public byte State { get; set; }
459
460 public byte State
461 {
462 get { return m_state; }
463 set { m_state = value; }
464 }
465 416
466 private AgentManager.ControlFlags m_AgentControlFlags; 417 private AgentManager.ControlFlags m_AgentControlFlags;
467 418
@@ -471,29 +422,14 @@ namespace OpenSim.Region.Framework.Scenes
471 set { m_AgentControlFlags = (AgentManager.ControlFlags)value; } 422 set { m_AgentControlFlags = (AgentManager.ControlFlags)value; }
472 } 423 }
473 424
474 /// <summary> 425 public IClientAPI ControllingClient { get; set; }
475 /// This works out to be the ClientView object associated with this avatar, or it's client connection manager
476 /// </summary>
477 private IClientAPI m_controllingClient;
478
479 public IClientAPI ControllingClient
480 {
481 get { return m_controllingClient; }
482 private set { m_controllingClient = value; }
483 }
484 426
485 public IClientCore ClientView 427 public IClientCore ClientView
486 { 428 {
487 get { return (IClientCore) m_controllingClient; } 429 get { return (IClientCore)ControllingClient; }
488 } 430 }
489 431
490 protected Vector3 m_parentPosition; 432 public Vector3 ParentPosition { get; set; }
491
492 public Vector3 ParentPosition
493 {
494 get { return m_parentPosition; }
495 set { m_parentPosition = value; }
496 }
497 433
498 /// <summary> 434 /// <summary>
499 /// Position of this avatar relative to the region the avatar is in 435 /// Position of this avatar relative to the region the avatar is in
@@ -760,7 +696,7 @@ namespace OpenSim.Region.Framework.Scenes
760 IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type) 696 IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type)
761 { 697 {
762 AttachmentsSyncLock = new Object(); 698 AttachmentsSyncLock = new Object();
763 699 AllowMovement = true;
764 IsChildAgent = true; 700 IsChildAgent = true;
765 m_sendCourseLocationsMethod = SendCoarseLocationsDefault; 701 m_sendCourseLocationsMethod = SendCoarseLocationsDefault;
766 Animator = new ScenePresenceAnimator(this); 702 Animator = new ScenePresenceAnimator(this);
@@ -839,17 +775,17 @@ namespace OpenSim.Region.Framework.Scenes
839 private Vector3[] GetWalkDirectionVectors() 775 private Vector3[] GetWalkDirectionVectors()
840 { 776 {
841 Vector3[] vector = new Vector3[11]; 777 Vector3[] vector = new Vector3[11];
842 vector[0] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD 778 vector[0] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD
843 vector[1] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK 779 vector[1] = new Vector3(-CameraUpAxis.Z, 0f, CameraAtAxis.Z); //BACK
844 vector[2] = Vector3.UnitY; //LEFT 780 vector[2] = Vector3.UnitY; //LEFT
845 vector[3] = -Vector3.UnitY; //RIGHT 781 vector[3] = -Vector3.UnitY; //RIGHT
846 vector[4] = new Vector3(m_CameraAtAxis.Z, 0f, m_CameraUpAxis.Z); //UP 782 vector[4] = new Vector3(CameraAtAxis.Z, 0f, CameraUpAxis.Z); //UP
847 vector[5] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN 783 vector[5] = new Vector3(-CameraAtAxis.Z, 0f, -CameraUpAxis.Z); //DOWN
848 vector[6] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD_NUDGE 784 vector[6] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD_NUDGE
849 vector[7] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK_NUDGE 785 vector[7] = new Vector3(-CameraUpAxis.Z, 0f, CameraAtAxis.Z); //BACK_NUDGE
850 vector[8] = Vector3.UnitY; //LEFT_NUDGE 786 vector[8] = Vector3.UnitY; //LEFT_NUDGE
851 vector[9] = -Vector3.UnitY; //RIGHT_NUDGE 787 vector[9] = -Vector3.UnitY; //RIGHT_NUDGE
852 vector[10] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN_NUDGE 788 vector[10] = new Vector3(-CameraAtAxis.Z, 0f, -CameraUpAxis.Z); //DOWN_NUDGE
853 return vector; 789 return vector;
854 } 790 }
855 791
@@ -1381,7 +1317,7 @@ namespace OpenSim.Region.Framework.Scenes
1381 // Convert it to a Matrix and/or Quaternion 1317 // Convert it to a Matrix and/or Quaternion
1382 CameraAtAxis = agentData.CameraAtAxis; 1318 CameraAtAxis = agentData.CameraAtAxis;
1383 CameraLeftAxis = agentData.CameraLeftAxis; 1319 CameraLeftAxis = agentData.CameraLeftAxis;
1384 m_CameraUpAxis = agentData.CameraUpAxis; 1320 CameraUpAxis = agentData.CameraUpAxis;
1385 1321
1386 // The Agent's Draw distance setting 1322 // The Agent's Draw distance setting
1387 // When we get to the point of re-computing neighbors everytime this 1323 // When we get to the point of re-computing neighbors everytime this
@@ -1393,7 +1329,7 @@ namespace OpenSim.Region.Framework.Scenes
1393 // Check if Client has camera in 'follow cam' or 'build' mode. 1329 // Check if Client has camera in 'follow cam' or 'build' mode.
1394 Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation); 1330 Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation);
1395 1331
1396 m_followCamAuto = ((m_CameraUpAxis.Z > 0.959f && m_CameraUpAxis.Z < 0.98f) 1332 m_followCamAuto = ((CameraUpAxis.Z > 0.959f && CameraUpAxis.Z < 0.98f)
1397 && (Math.Abs(camdif.X) < 0.4f && Math.Abs(camdif.Y) < 0.4f)) ? true : false; 1333 && (Math.Abs(camdif.X) < 0.4f && Math.Abs(camdif.Y) < 0.4f)) ? true : false;
1398 1334
1399 m_mouseLook = (flags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0; 1335 m_mouseLook = (flags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0;
@@ -3161,7 +3097,7 @@ namespace OpenSim.Region.Framework.Scenes
3161 cAgent.Center = CameraPosition; 3097 cAgent.Center = CameraPosition;
3162 cAgent.AtAxis = CameraAtAxis; 3098 cAgent.AtAxis = CameraAtAxis;
3163 cAgent.LeftAxis = CameraLeftAxis; 3099 cAgent.LeftAxis = CameraLeftAxis;
3164 cAgent.UpAxis = m_CameraUpAxis; 3100 cAgent.UpAxis = CameraUpAxis;
3165 3101
3166 cAgent.Far = DrawDistance; 3102 cAgent.Far = DrawDistance;
3167 3103
@@ -3250,7 +3186,7 @@ namespace OpenSim.Region.Framework.Scenes
3250 CameraPosition = cAgent.Center; 3186 CameraPosition = cAgent.Center;
3251 CameraAtAxis = cAgent.AtAxis; 3187 CameraAtAxis = cAgent.AtAxis;
3252 CameraLeftAxis = cAgent.LeftAxis; 3188 CameraLeftAxis = cAgent.LeftAxis;
3253 m_CameraUpAxis = cAgent.UpAxis; 3189 CameraUpAxis = cAgent.UpAxis;
3254 ParentUUID = cAgent.ParentPart; 3190 ParentUUID = cAgent.ParentPart;
3255 m_prevSitOffset = cAgent.SitOffset; 3191 m_prevSitOffset = cAgent.SitOffset;
3256 3192
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index 35cd025..5c56264 100644
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -178,13 +178,19 @@ namespace OpenSim.Region.Framework.Scenes
178 m_objectCapacity = scene.RegionInfo.ObjectCapacity; 178 m_objectCapacity = scene.RegionInfo.ObjectCapacity;
179 m_report.AutoReset = true; 179 m_report.AutoReset = true;
180 m_report.Interval = statsUpdatesEveryMS; 180 m_report.Interval = statsUpdatesEveryMS;
181 m_report.Elapsed += new ElapsedEventHandler(statsHeartBeat); 181 m_report.Elapsed += statsHeartBeat;
182 m_report.Enabled = true; 182 m_report.Enabled = true;
183 183
184 if (StatsManager.SimExtraStats != null) 184 if (StatsManager.SimExtraStats != null)
185 OnSendStatsResult += StatsManager.SimExtraStats.ReceiveClassicSimStatsPacket; 185 OnSendStatsResult += StatsManager.SimExtraStats.ReceiveClassicSimStatsPacket;
186 } 186 }
187 187
188 public void Close()
189 {
190 m_report.Elapsed -= statsHeartBeat;
191 m_report.Close();
192 }
193
188 public void SetUpdateMS(int ms) 194 public void SetUpdateMS(int ms)
189 { 195 {
190 statsUpdatesEveryMS = ms; 196 statsUpdatesEveryMS = ms;
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index e4b607d..e16903c 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -65,8 +65,7 @@ namespace OpenSim.Region.Framework.Tests
65 65
66 // Create an object embedded inside the first 66 // Create an object embedded inside the first
67 UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000"); 67 UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000");
68 TaskInventoryItem taskSceneObjectItem 68 TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID);
69 = TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID);
70 69
71 TaskInventoryItem addedItem = sop1.Inventory.GetInventoryItem(taskSceneObjectItemId); 70 TaskInventoryItem addedItem = sop1.Inventory.GetInventoryItem(taskSceneObjectItemId);
72 Assert.That(addedItem.ItemID, Is.EqualTo(taskSceneObjectItemId)); 71 Assert.That(addedItem.ItemID, Is.EqualTo(taskSceneObjectItemId));