diff options
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/IWorldComm.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 25 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 239 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneBase.cs | 71 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 24 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 175 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SimStatsReporter.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | 3 |
10 files changed, 267 insertions, 289 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IWorldComm.cs b/OpenSim/Region/Framework/Interfaces/IWorldComm.cs index dafbf30..e8e375e 100644 --- a/OpenSim/Region/Framework/Interfaces/IWorldComm.cs +++ b/OpenSim/Region/Framework/Interfaces/IWorldComm.cs | |||
@@ -50,6 +50,11 @@ namespace OpenSim.Region.Framework.Interfaces | |||
50 | public interface IWorldComm | 50 | public interface IWorldComm |
51 | { | 51 | { |
52 | /// <summary> | 52 | /// <summary> |
53 | /// Total number of listeners | ||
54 | /// </summary> | ||
55 | int ListenerCount { get; } | ||
56 | |||
57 | /// <summary> | ||
53 | /// Create a listen event callback with the specified filters. | 58 | /// Create a listen event callback with the specified filters. |
54 | /// The parameters localID,itemID are needed to uniquely identify | 59 | /// The parameters localID,itemID are needed to uniquely identify |
55 | /// the script during 'peek' time. Parameter hostID is needed to | 60 | /// the script during 'peek' time. Parameter hostID is needed to |
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..68c05f8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -619,7 +619,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
619 | 619 | ||
620 | #endregion Region Settings | 620 | #endregion Region Settings |
621 | 621 | ||
622 | MainConsole.Instance.Commands.AddCommand("region", false, "reload estate", | 622 | MainConsole.Instance.Commands.AddCommand("Estates", false, "reload estate", |
623 | "reload estate", | 623 | "reload estate", |
624 | "Reload the estate data", HandleReloadEstate); | 624 | "Reload the estate data", HandleReloadEstate); |
625 | 625 | ||
@@ -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/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index da3b4dd..1e80f73 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs | |||
@@ -474,6 +474,63 @@ namespace OpenSim.Region.Framework.Scenes | |||
474 | /// <summary> | 474 | /// <summary> |
475 | /// Call this from a region module to add a command to the OpenSim console. | 475 | /// Call this from a region module to add a command to the OpenSim console. |
476 | /// </summary> | 476 | /// </summary> |
477 | /// <param name="mod"> | ||
478 | /// The use of IRegionModuleBase is a cheap trick to get a different method signature, | ||
479 | /// though all new modules should be using interfaces descended from IRegionModuleBase anyway. | ||
480 | /// </param> | ||
481 | /// <param name="category"> | ||
482 | /// Category of the command. This is the section under which it will appear when the user asks for help | ||
483 | /// </param> | ||
484 | /// <param name="command"></param> | ||
485 | /// <param name="shorthelp"></param> | ||
486 | /// <param name="longhelp"></param> | ||
487 | /// <param name="callback"></param> | ||
488 | public void AddCommand( | ||
489 | string category, object mod, string command, string shorthelp, string longhelp, CommandDelegate callback) | ||
490 | { | ||
491 | AddCommand(category, mod, command, shorthelp, longhelp, string.Empty, callback); | ||
492 | } | ||
493 | |||
494 | /// <summary> | ||
495 | /// Call this from a region module to add a command to the OpenSim console. | ||
496 | /// </summary> | ||
497 | /// <param name="mod"></param> | ||
498 | /// <param name="command"></param> | ||
499 | /// <param name="shorthelp"></param> | ||
500 | /// <param name="longhelp"></param> | ||
501 | /// <param name="descriptivehelp"></param> | ||
502 | /// <param name="callback"></param> | ||
503 | public void AddCommand(object mod, string command, string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback) | ||
504 | { | ||
505 | string moduleName = ""; | ||
506 | |||
507 | if (mod != null) | ||
508 | { | ||
509 | if (mod is IRegionModule) | ||
510 | { | ||
511 | IRegionModule module = (IRegionModule)mod; | ||
512 | moduleName = module.Name; | ||
513 | } | ||
514 | else if (mod is IRegionModuleBase) | ||
515 | { | ||
516 | IRegionModuleBase module = (IRegionModuleBase)mod; | ||
517 | moduleName = module.Name; | ||
518 | } | ||
519 | else | ||
520 | { | ||
521 | throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase"); | ||
522 | } | ||
523 | } | ||
524 | |||
525 | AddCommand(moduleName, mod, command, shorthelp, longhelp, descriptivehelp, callback); | ||
526 | } | ||
527 | |||
528 | /// <summary> | ||
529 | /// Call this from a region module to add a command to the OpenSim console. | ||
530 | /// </summary> | ||
531 | /// <param name="category"> | ||
532 | /// Category of the command. This is the section under which it will appear when the user asks for help | ||
533 | /// </param> | ||
477 | /// <param name="mod"></param> | 534 | /// <param name="mod"></param> |
478 | /// <param name="command"></param> | 535 | /// <param name="command"></param> |
479 | /// <param name="shorthelp"></param> | 536 | /// <param name="shorthelp"></param> |
@@ -481,12 +538,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
481 | /// <param name="descriptivehelp"></param> | 538 | /// <param name="descriptivehelp"></param> |
482 | /// <param name="callback"></param> | 539 | /// <param name="callback"></param> |
483 | public void AddCommand( | 540 | public void AddCommand( |
484 | object mod, string command, string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback) | 541 | string category, object mod, string command, |
542 | string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback) | ||
485 | { | 543 | { |
486 | if (MainConsole.Instance == null) | 544 | if (MainConsole.Instance == null) |
487 | return; | 545 | return; |
488 | 546 | ||
489 | string modulename = String.Empty; | ||
490 | bool shared = false; | 547 | bool shared = false; |
491 | 548 | ||
492 | if (mod != null) | 549 | if (mod != null) |
@@ -494,20 +551,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
494 | if (mod is IRegionModule) | 551 | if (mod is IRegionModule) |
495 | { | 552 | { |
496 | IRegionModule module = (IRegionModule)mod; | 553 | IRegionModule module = (IRegionModule)mod; |
497 | modulename = module.Name; | ||
498 | shared = module.IsSharedModule; | 554 | shared = module.IsSharedModule; |
499 | } | 555 | } |
500 | else if (mod is IRegionModuleBase) | 556 | else if (mod is IRegionModuleBase) |
501 | { | 557 | { |
502 | IRegionModuleBase module = (IRegionModuleBase)mod; | ||
503 | modulename = module.Name; | ||
504 | shared = mod is ISharedRegionModule; | 558 | shared = mod is ISharedRegionModule; |
505 | } | 559 | } |
506 | else throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase"); | 560 | else |
561 | { | ||
562 | throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase"); | ||
563 | } | ||
507 | } | 564 | } |
508 | 565 | ||
509 | MainConsole.Instance.Commands.AddCommand( | 566 | MainConsole.Instance.Commands.AddCommand( |
510 | modulename, shared, command, shorthelp, longhelp, descriptivehelp, callback); | 567 | category, shared, command, shorthelp, longhelp, descriptivehelp, callback); |
511 | } | 568 | } |
512 | 569 | ||
513 | public virtual ISceneObject DeserializeObject(string representation) | 570 | public virtual ISceneObject DeserializeObject(string representation) |
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/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index a3206015..3cd4a10 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -230,27 +230,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
230 | if (sp.IsChildAgent) | 230 | if (sp.IsChildAgent) |
231 | continue; | 231 | continue; |
232 | 232 | ||
233 | if (sp.ParentID != 0) | 233 | coarseLocations.Add(sp.AbsolutePosition); |
234 | { | 234 | |
235 | // sitting avatar | 235 | avatarUUIDs.Add(sp.UUID); |
236 | SceneObjectPart sop = m_parentScene.GetSceneObjectPart(sp.ParentID); | ||
237 | if (sop != null) | ||
238 | { | ||
239 | coarseLocations.Add(sop.AbsolutePosition + sp.OffsetPosition); | ||
240 | avatarUUIDs.Add(sp.UUID); | ||
241 | } | ||
242 | else | ||
243 | { | ||
244 | // we can't find the parent.. ! arg! | ||
245 | coarseLocations.Add(sp.AbsolutePosition); | ||
246 | avatarUUIDs.Add(sp.UUID); | ||
247 | } | ||
248 | } | ||
249 | else | ||
250 | { | ||
251 | coarseLocations.Add(sp.AbsolutePosition); | ||
252 | avatarUUIDs.Add(sp.UUID); | ||
253 | } | ||
254 | } | 236 | } |
255 | } | 237 | } |
256 | 238 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 4ba04c1..6622495 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..c4aaebe 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 | 387 | ||
419 | public float DrawDistance | 388 | public bool AllowMovement { get; set; } |
420 | { | ||
421 | get { return m_DrawDistance; } | ||
422 | private set { m_DrawDistance = value; } | ||
423 | } | ||
424 | |||
425 | protected bool m_allowMovement = true; | ||
426 | |||
427 | public bool AllowMovement | ||
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 |
@@ -502,7 +438,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
502 | { | 438 | { |
503 | get | 439 | get |
504 | { | 440 | { |
505 | if (PhysicsActor != null && m_parentID == 0) | 441 | if (PhysicsActor != null) |
506 | { | 442 | { |
507 | m_pos = PhysicsActor.Position; | 443 | m_pos = PhysicsActor.Position; |
508 | 444 | ||
@@ -525,12 +461,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
525 | // in the sim unless the avatar is on a sit target. While | 461 | // in the sim unless the avatar is on a sit target. While |
526 | // on a sit target, m_pos will contain the desired offset | 462 | // on a sit target, m_pos will contain the desired offset |
527 | // without the parent rotation applied. | 463 | // without the parent rotation applied. |
528 | if (ParentID != 0) | 464 | SceneObjectPart sitPart = ParentPart; |
529 | { | 465 | |
530 | SceneObjectPart part = ParentPart; | 466 | if (sitPart != null) |
531 | return part.AbsolutePosition + (m_pos * part.GetWorldRotation()); | 467 | return sitPart.AbsolutePosition + (m_pos * sitPart.GetWorldRotation()); |
532 | } | ||
533 | } | 468 | } |
469 | |||
534 | return m_pos; | 470 | return m_pos; |
535 | } | 471 | } |
536 | set | 472 | set |
@@ -547,7 +483,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
547 | } | 483 | } |
548 | } | 484 | } |
549 | 485 | ||
550 | // Don't update while sitting | 486 | // Don't update while sitting. The PhysicsActor above is null whilst sitting. |
551 | if (ParentID == 0) | 487 | if (ParentID == 0) |
552 | { | 488 | { |
553 | m_pos = value; | 489 | m_pos = value; |
@@ -574,6 +510,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
574 | // There is no offset position when not seated | 510 | // There is no offset position when not seated |
575 | if (ParentID == 0) | 511 | if (ParentID == 0) |
576 | return; | 512 | return; |
513 | |||
577 | m_pos = value; | 514 | m_pos = value; |
578 | } | 515 | } |
579 | } | 516 | } |
@@ -632,12 +569,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
632 | 569 | ||
633 | public bool IsChildAgent { get; set; } | 570 | public bool IsChildAgent { get; set; } |
634 | 571 | ||
635 | public uint ParentID | 572 | /// <summary> |
636 | { | 573 | /// If the avatar is sitting, the local ID of the prim that it's sitting on. If not sitting then zero. |
637 | get { return m_parentID; } | 574 | /// </summary> |
638 | set { m_parentID = value; } | 575 | public uint ParentID { get; set; } |
639 | } | ||
640 | private uint m_parentID; | ||
641 | 576 | ||
642 | public UUID ParentUUID | 577 | public UUID ParentUUID |
643 | { | 578 | { |
@@ -646,12 +581,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
646 | } | 581 | } |
647 | private UUID m_parentUUID = UUID.Zero; | 582 | private UUID m_parentUUID = UUID.Zero; |
648 | 583 | ||
649 | public SceneObjectPart ParentPart | 584 | /// <summary> |
650 | { | 585 | /// If the avatar is sitting, the prim that it's sitting on. If not sitting then null. |
651 | get { return m_parentPart; } | 586 | /// </summary> |
652 | set { m_parentPart = value; } | 587 | /// <remarks> |
653 | } | 588 | /// If you use this property then you must take a reference since another thread could set it to null. |
654 | private SceneObjectPart m_parentPart = null; | 589 | /// </remarks> |
590 | public SceneObjectPart ParentPart { get; set; } | ||
655 | 591 | ||
656 | public float Health | 592 | public float Health |
657 | { | 593 | { |
@@ -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; |
@@ -2349,23 +2285,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
2349 | // "[SCENE PRESENCE]: Sitting {0} at position {1} ({2} + {3}) on part {4} {5} without sit target", | 2285 | // "[SCENE PRESENCE]: Sitting {0} at position {1} ({2} + {3}) on part {4} {5} without sit target", |
2350 | // Name, part.AbsolutePosition, m_pos, ParentPosition, part.Name, part.LocalId); | 2286 | // Name, part.AbsolutePosition, m_pos, ParentPosition, part.Name, part.LocalId); |
2351 | } | 2287 | } |
2352 | } | ||
2353 | else | ||
2354 | { | ||
2355 | return; | ||
2356 | } | ||
2357 | |||
2358 | ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID); | ||
2359 | if (ParentPart == null) | ||
2360 | return; | ||
2361 | 2288 | ||
2362 | ParentID = m_requestedSitTargetID; | 2289 | ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID); |
2290 | ParentID = m_requestedSitTargetID; | ||
2363 | 2291 | ||
2364 | Velocity = Vector3.Zero; | 2292 | Velocity = Vector3.Zero; |
2365 | RemoveFromPhysicalScene(); | 2293 | RemoveFromPhysicalScene(); |
2366 | 2294 | ||
2367 | Animator.TrySetMovementAnimation(sitAnimation); | 2295 | Animator.TrySetMovementAnimation(sitAnimation); |
2368 | SendAvatarDataToAllAgents(); | 2296 | SendAvatarDataToAllAgents(); |
2297 | } | ||
2369 | } | 2298 | } |
2370 | 2299 | ||
2371 | public void HandleAgentSitOnGround() | 2300 | public void HandleAgentSitOnGround() |
@@ -3161,7 +3090,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3161 | cAgent.Center = CameraPosition; | 3090 | cAgent.Center = CameraPosition; |
3162 | cAgent.AtAxis = CameraAtAxis; | 3091 | cAgent.AtAxis = CameraAtAxis; |
3163 | cAgent.LeftAxis = CameraLeftAxis; | 3092 | cAgent.LeftAxis = CameraLeftAxis; |
3164 | cAgent.UpAxis = m_CameraUpAxis; | 3093 | cAgent.UpAxis = CameraUpAxis; |
3165 | 3094 | ||
3166 | cAgent.Far = DrawDistance; | 3095 | cAgent.Far = DrawDistance; |
3167 | 3096 | ||
@@ -3250,7 +3179,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3250 | CameraPosition = cAgent.Center; | 3179 | CameraPosition = cAgent.Center; |
3251 | CameraAtAxis = cAgent.AtAxis; | 3180 | CameraAtAxis = cAgent.AtAxis; |
3252 | CameraLeftAxis = cAgent.LeftAxis; | 3181 | CameraLeftAxis = cAgent.LeftAxis; |
3253 | m_CameraUpAxis = cAgent.UpAxis; | 3182 | CameraUpAxis = cAgent.UpAxis; |
3254 | ParentUUID = cAgent.ParentPart; | 3183 | ParentUUID = cAgent.ParentPart; |
3255 | m_prevSitOffset = cAgent.SitOffset; | 3184 | m_prevSitOffset = cAgent.SitOffset; |
3256 | 3185 | ||
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)); |