diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 68 |
1 files changed, 61 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 62ee574..8e860fb 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -159,6 +159,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
159 | 159 | ||
160 | public IXfer XferManager; | 160 | public IXfer XferManager; |
161 | 161 | ||
162 | protected ISnmpModule m_snmpService = null; | ||
163 | public ISnmpModule SnmpService | ||
164 | { | ||
165 | get | ||
166 | { | ||
167 | if (m_snmpService == null) | ||
168 | { | ||
169 | m_snmpService = RequestModuleInterface<ISnmpModule>(); | ||
170 | } | ||
171 | |||
172 | return m_snmpService; | ||
173 | } | ||
174 | } | ||
175 | |||
162 | protected IAssetService m_AssetService; | 176 | protected IAssetService m_AssetService; |
163 | protected IAuthorizationService m_AuthorizationService; | 177 | protected IAuthorizationService m_AuthorizationService; |
164 | 178 | ||
@@ -540,6 +554,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
540 | 554 | ||
541 | // Load region settings | 555 | // Load region settings |
542 | m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID); | 556 | m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID); |
557 | m_regInfo.WindlightSettings = m_storageManager.DataStore.LoadRegionWindlightSettings(m_regInfo.RegionID); | ||
558 | |||
543 | if (m_storageManager.EstateDataStore != null) | 559 | if (m_storageManager.EstateDataStore != null) |
544 | { | 560 | { |
545 | m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID); | 561 | m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID); |
@@ -598,7 +614,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
598 | m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); | 614 | m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); |
599 | // TODO: Change default to true once the feature is supported | 615 | // TODO: Change default to true once the feature is supported |
600 | m_usePreJump = startupConfig.GetBoolean("enableprejump", false); | 616 | m_usePreJump = startupConfig.GetBoolean("enableprejump", false); |
601 | 617 | m_usePreJump = true; // Above line fails!? | |
602 | m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys); | 618 | m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys); |
603 | if (RegionInfo.NonphysPrimMax > 0) | 619 | if (RegionInfo.NonphysPrimMax > 0) |
604 | { | 620 | { |
@@ -887,6 +903,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
887 | /// <param name="seconds">float indicating duration before restart.</param> | 903 | /// <param name="seconds">float indicating duration before restart.</param> |
888 | public virtual void Restart(float seconds) | 904 | public virtual void Restart(float seconds) |
889 | { | 905 | { |
906 | Restart(seconds, true); | ||
907 | } | ||
908 | |||
909 | /// <summary> | ||
910 | /// Given float seconds, this will restart the region. showDialog will optionally alert the users. | ||
911 | /// </summary> | ||
912 | /// <param name="seconds">float indicating duration before restart.</param> | ||
913 | public virtual void Restart(float seconds, bool showDialog) | ||
914 | { | ||
890 | // notifications are done in 15 second increments | 915 | // notifications are done in 15 second increments |
891 | // so .. if the number of seconds is less then 15 seconds, it's not really a restart request | 916 | // so .. if the number of seconds is less then 15 seconds, it's not really a restart request |
892 | // It's a 'Cancel restart' request. | 917 | // It's a 'Cancel restart' request. |
@@ -907,8 +932,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
907 | m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed); | 932 | m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed); |
908 | m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes"); | 933 | m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes"); |
909 | m_restartTimer.Start(); | 934 | m_restartTimer.Start(); |
910 | m_dialogModule.SendNotificationToUsersInRegion( | 935 | if (showDialog) |
936 | { | ||
937 | m_dialogModule.SendNotificationToUsersInRegion( | ||
911 | UUID.Random(), String.Empty, RegionInfo.RegionName + String.Format(": Restarting in {0} Minutes", (int)(seconds / 60.0))); | 938 | UUID.Random(), String.Empty, RegionInfo.RegionName + String.Format(": Restarting in {0} Minutes", (int)(seconds / 60.0))); |
939 | } | ||
912 | } | 940 | } |
913 | } | 941 | } |
914 | 942 | ||
@@ -1190,16 +1218,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
1190 | // Check if any objects have reached their targets | 1218 | // Check if any objects have reached their targets |
1191 | CheckAtTargets(); | 1219 | CheckAtTargets(); |
1192 | 1220 | ||
1193 | // Update SceneObjectGroups that have scheduled themselves for updates | ||
1194 | // Objects queue their updates onto all scene presences | ||
1195 | if (m_frame % m_update_objects == 0) | ||
1196 | m_sceneGraph.UpdateObjectGroups(); | ||
1197 | |||
1198 | // Run through all ScenePresences looking for updates | 1221 | // Run through all ScenePresences looking for updates |
1199 | // Presence updates and queued object updates for each presence are sent to clients | 1222 | // Presence updates and queued object updates for each presence are sent to clients |
1200 | if (m_frame % m_update_presences == 0) | 1223 | if (m_frame % m_update_presences == 0) |
1201 | m_sceneGraph.UpdatePresences(); | 1224 | m_sceneGraph.UpdatePresences(); |
1202 | 1225 | ||
1226 | // Update SceneObjectGroups that have scheduled themselves for updates | ||
1227 | // Objects queue their updates onto all scene presences | ||
1228 | if (m_frame % m_update_objects == 0) | ||
1229 | m_sceneGraph.UpdateObjectGroups(); | ||
1230 | |||
1203 | int tmpPhysicsMS2 = Util.EnvironmentTickCount(); | 1231 | int tmpPhysicsMS2 = Util.EnvironmentTickCount(); |
1204 | if ((m_frame % m_update_physics == 0) && m_physics_enabled) | 1232 | if ((m_frame % m_update_physics == 0) && m_physics_enabled) |
1205 | m_sceneGraph.UpdatePreparePhysics(); | 1233 | m_sceneGraph.UpdatePreparePhysics(); |
@@ -1512,6 +1540,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
1512 | m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); | 1540 | m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); |
1513 | } | 1541 | } |
1514 | 1542 | ||
1543 | public void StoreWindlightProfile(RegionMeta7WindlightData wl) | ||
1544 | { | ||
1545 | m_regInfo.WindlightSettings = wl; | ||
1546 | m_storageManager.DataStore.StoreRegionWindlightSettings(wl); | ||
1547 | m_eventManager.TriggerOnSaveNewWindlightProfile(); | ||
1548 | } | ||
1549 | |||
1550 | public void LoadWindlightProfile() | ||
1551 | { | ||
1552 | m_regInfo.WindlightSettings = m_storageManager.DataStore.LoadRegionWindlightSettings(RegionInfo.RegionID); | ||
1553 | m_eventManager.TriggerOnSaveNewWindlightProfile(); | ||
1554 | } | ||
1555 | |||
1515 | /// <summary> | 1556 | /// <summary> |
1516 | /// Loads the World heightmap | 1557 | /// Loads the World heightmap |
1517 | /// </summary> | 1558 | /// </summary> |
@@ -3488,6 +3529,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3488 | 3529 | ||
3489 | CapsModule.AddCapsHandler(agent.AgentID); | 3530 | CapsModule.AddCapsHandler(agent.AgentID); |
3490 | 3531 | ||
3532 | if ((teleportFlags & ((uint)TeleportFlags.ViaLandmark | (uint)TeleportFlags.ViaLocation | (uint)TeleportFlags.ViaLandmark | (uint)TeleportFlags.Default)) != 0) | ||
3533 | System.Threading.Thread.Sleep(2000); | ||
3534 | |||
3491 | if (!agent.child) | 3535 | if (!agent.child) |
3492 | { | 3536 | { |
3493 | if (TestBorderCross(agent.startpos,Cardinals.E)) | 3537 | if (TestBorderCross(agent.startpos,Cardinals.E)) |
@@ -3546,6 +3590,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3546 | } | 3590 | } |
3547 | } | 3591 | } |
3548 | // Honor parcel landing type and position. | 3592 | // Honor parcel landing type and position. |
3593 | /* | ||
3549 | ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); | 3594 | ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); |
3550 | if (land != null) | 3595 | if (land != null) |
3551 | { | 3596 | { |
@@ -3554,6 +3599,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3554 | agent.startpos = land.LandData.UserLocation; | 3599 | agent.startpos = land.LandData.UserLocation; |
3555 | } | 3600 | } |
3556 | } | 3601 | } |
3602 | */// This is now handled properly in ScenePresence.MakeRootAgent | ||
3557 | } | 3603 | } |
3558 | 3604 | ||
3559 | m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); | 3605 | m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); |
@@ -4369,6 +4415,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
4369 | } | 4415 | } |
4370 | 4416 | ||
4371 | /// <summary> | 4417 | /// <summary> |
4418 | /// Cheaply return the number of avatars in a region (without fetching a list object) | ||
4419 | /// </summary> | ||
4420 | public int GetRootAgentCount() | ||
4421 | { | ||
4422 | return m_sceneGraph.GetRootAgentCount(); | ||
4423 | } | ||
4424 | |||
4425 | /// <summary> | ||
4372 | /// Return a list of all ScenePresences in this region. This returns child agents as well as root agents. | 4426 | /// Return a list of all ScenePresences in this region. This returns child agents as well as root agents. |
4373 | /// This list is a new object, so it can be iterated over without locking. | 4427 | /// This list is a new object, so it can be iterated over without locking. |
4374 | /// </summary> | 4428 | /// </summary> |