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