diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rwxr-xr-x | OpenSim/Region/Framework/Scenes/Scene.cs | 67 |
1 files changed, 29 insertions, 38 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 7668a87..073d11f 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -170,8 +170,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
170 | } | 170 | } |
171 | private bool m_scripts_enabled; | 171 | private bool m_scripts_enabled; |
172 | 172 | ||
173 | public SynchronizeSceneHandler SynchronizeScene; | ||
174 | |||
175 | public bool ClampNegativeZ | 173 | public bool ClampNegativeZ |
176 | { | 174 | { |
177 | get { return m_clampNegativeZ; } | 175 | get { return m_clampNegativeZ; } |
@@ -277,6 +275,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
277 | get { return m_maxRegionViewDistance; } | 275 | get { return m_maxRegionViewDistance; } |
278 | } | 276 | } |
279 | 277 | ||
278 | protected float m_minRegionViewDistance = 96f; | ||
279 | public float MinRegionViewDistance | ||
280 | { | ||
281 | get { return m_minRegionViewDistance; } | ||
282 | } | ||
283 | |||
280 | private List<string> m_AllowedViewers = new List<string>(); | 284 | private List<string> m_AllowedViewers = new List<string>(); |
281 | private List<string> m_BannedViewers = new List<string>(); | 285 | private List<string> m_BannedViewers = new List<string>(); |
282 | 286 | ||
@@ -922,6 +926,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
922 | m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance", m_defaultDrawDistance); | 926 | m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance", m_defaultDrawDistance); |
923 | m_maxDrawDistance = startupConfig.GetFloat("MaxDrawDistance", m_maxDrawDistance); | 927 | m_maxDrawDistance = startupConfig.GetFloat("MaxDrawDistance", m_maxDrawDistance); |
924 | m_maxRegionViewDistance = startupConfig.GetFloat("MaxRegionsViewDistance", m_maxRegionViewDistance); | 928 | m_maxRegionViewDistance = startupConfig.GetFloat("MaxRegionsViewDistance", m_maxRegionViewDistance); |
929 | m_minRegionViewDistance = startupConfig.GetFloat("MinRegionsViewDistance", m_minRegionViewDistance); | ||
925 | 930 | ||
926 | // old versions compatibility | 931 | // old versions compatibility |
927 | LegacySitOffsets = startupConfig.GetBoolean("LegacySitOffsets", LegacySitOffsets); | 932 | LegacySitOffsets = startupConfig.GetBoolean("LegacySitOffsets", LegacySitOffsets); |
@@ -932,6 +937,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
932 | if (m_maxRegionViewDistance > m_maxDrawDistance) | 937 | if (m_maxRegionViewDistance > m_maxDrawDistance) |
933 | m_maxRegionViewDistance = m_maxDrawDistance; | 938 | m_maxRegionViewDistance = m_maxDrawDistance; |
934 | 939 | ||
940 | if(m_minRegionViewDistance < 96f) | ||
941 | m_minRegionViewDistance = 96f; | ||
942 | if(m_minRegionViewDistance > m_maxRegionViewDistance) | ||
943 | m_minRegionViewDistance = m_maxRegionViewDistance; | ||
944 | |||
935 | UseBackup = startupConfig.GetBoolean("UseSceneBackup", UseBackup); | 945 | UseBackup = startupConfig.GetBoolean("UseSceneBackup", UseBackup); |
936 | if (!UseBackup) | 946 | if (!UseBackup) |
937 | m_log.InfoFormat("[SCENE]: Backup has been disabled for {0}", RegionInfo.RegionName); | 947 | m_log.InfoFormat("[SCENE]: Backup has been disabled for {0}", RegionInfo.RegionName); |
@@ -1006,11 +1016,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1006 | m_useTrashOnDelete = startupConfig.GetBoolean("UseTrashOnDelete",m_useTrashOnDelete); | 1016 | m_useTrashOnDelete = startupConfig.GetBoolean("UseTrashOnDelete",m_useTrashOnDelete); |
1007 | m_trustBinaries = startupConfig.GetBoolean("TrustBinaries", m_trustBinaries); | 1017 | m_trustBinaries = startupConfig.GetBoolean("TrustBinaries", m_trustBinaries); |
1008 | m_allowScriptCrossings = startupConfig.GetBoolean("AllowScriptCrossing", m_allowScriptCrossings); | 1018 | m_allowScriptCrossings = startupConfig.GetBoolean("AllowScriptCrossing", m_allowScriptCrossings); |
1009 | m_dontPersistBefore = | 1019 | m_dontPersistBefore = startupConfig.GetLong("MinimumTimeBeforePersistenceConsidered", DEFAULT_MIN_TIME_FOR_PERSISTENCE); |
1010 | startupConfig.GetLong("MinimumTimeBeforePersistenceConsidered", DEFAULT_MIN_TIME_FOR_PERSISTENCE); | ||
1011 | m_dontPersistBefore *= 10000000; | 1020 | m_dontPersistBefore *= 10000000; |
1012 | m_persistAfter = | 1021 | m_persistAfter = startupConfig.GetLong("MaximumTimeBeforePersistenceConsidered", DEFAULT_MAX_TIME_FOR_PERSISTENCE); |
1013 | startupConfig.GetLong("MaximumTimeBeforePersistenceConsidered", DEFAULT_MAX_TIME_FOR_PERSISTENCE); | ||
1014 | m_persistAfter *= 10000000; | 1022 | m_persistAfter *= 10000000; |
1015 | 1023 | ||
1016 | m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "XEngine"); | 1024 | m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "XEngine"); |
@@ -1290,7 +1298,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1290 | { | 1298 | { |
1291 | if (RegionInfo.RegionHandle != otherRegion.RegionHandle) | 1299 | if (RegionInfo.RegionHandle != otherRegion.RegionHandle) |
1292 | { | 1300 | { |
1293 | |||
1294 | if (isNeighborRegion(otherRegion)) | 1301 | if (isNeighborRegion(otherRegion)) |
1295 | { | 1302 | { |
1296 | // Let the grid service module know, so this can be cached | 1303 | // Let the grid service module know, so this can be cached |
@@ -1300,9 +1307,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1300 | { | 1307 | { |
1301 | ForEachRootScenePresence(delegate(ScenePresence agent) | 1308 | ForEachRootScenePresence(delegate(ScenePresence agent) |
1302 | { | 1309 | { |
1303 | //agent.ControllingClient.new | ||
1304 | //this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo()); | ||
1305 | |||
1306 | List<ulong> old = new List<ulong>(); | 1310 | List<ulong> old = new List<ulong>(); |
1307 | old.Add(otherRegion.RegionHandle); | 1311 | old.Add(otherRegion.RegionHandle); |
1308 | agent.DropOldNeighbours(old); | 1312 | agent.DropOldNeighbours(old); |
@@ -1328,7 +1332,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1328 | 1332 | ||
1329 | public bool isNeighborRegion(GridRegion otherRegion) | 1333 | public bool isNeighborRegion(GridRegion otherRegion) |
1330 | { | 1334 | { |
1331 | int tmp = otherRegion.RegionLocX - (int)RegionInfo.WorldLocX; ; | 1335 | int tmp = otherRegion.RegionLocX - (int)RegionInfo.WorldLocX; |
1332 | 1336 | ||
1333 | if (tmp < -otherRegion.RegionSizeX && tmp > RegionInfo.RegionSizeX) | 1337 | if (tmp < -otherRegion.RegionSizeX && tmp > RegionInfo.RegionSizeX) |
1334 | return false; | 1338 | return false; |
@@ -1695,9 +1699,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1695 | { | 1699 | { |
1696 | if (PhysicsEnabled) | 1700 | if (PhysicsEnabled) |
1697 | physicsFPS = m_sceneGraph.UpdatePhysics(FrameTime); | 1701 | physicsFPS = m_sceneGraph.UpdatePhysics(FrameTime); |
1698 | |||
1699 | if (SynchronizeScene != null) | ||
1700 | SynchronizeScene(this); | ||
1701 | } | 1702 | } |
1702 | 1703 | ||
1703 | tmpMS2 = Util.GetTimeStampMS(); | 1704 | tmpMS2 = Util.GetTimeStampMS(); |
@@ -1775,30 +1776,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1775 | 1776 | ||
1776 | // Region ready should always be set | 1777 | // Region ready should always be set |
1777 | Ready = true; | 1778 | Ready = true; |
1778 | |||
1779 | |||
1780 | IConfig restartConfig = m_config.Configs["RestartModule"]; | ||
1781 | if (restartConfig != null) | ||
1782 | { | ||
1783 | string markerPath = restartConfig.GetString("MarkerPath", String.Empty); | ||
1784 | |||
1785 | if (markerPath != String.Empty) | ||
1786 | { | ||
1787 | string path = Path.Combine(markerPath, RegionInfo.RegionID.ToString() + ".ready"); | ||
1788 | try | ||
1789 | { | ||
1790 | string pidstring = System.Diagnostics.Process.GetCurrentProcess().Id.ToString(); | ||
1791 | FileStream fs = File.Create(path); | ||
1792 | System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); | ||
1793 | Byte[] buf = enc.GetBytes(pidstring); | ||
1794 | fs.Write(buf, 0, buf.Length); | ||
1795 | fs.Close(); | ||
1796 | } | ||
1797 | catch (Exception) | ||
1798 | { | ||
1799 | } | ||
1800 | } | ||
1801 | } | ||
1802 | } | 1779 | } |
1803 | else | 1780 | else |
1804 | { | 1781 | { |
@@ -4818,6 +4795,20 @@ Label_GroupsDone: | |||
4818 | return true; | 4795 | return true; |
4819 | } | 4796 | } |
4820 | 4797 | ||
4798 | |||
4799 | /// <summary> | ||
4800 | /// Tries to teleport agent within region. | ||
4801 | /// </summary> | ||
4802 | /// <param name="remoteClient"></param> | ||
4803 | /// <param name="position"></param> | ||
4804 | /// <param name="lookAt"></param> | ||
4805 | /// <param name="teleportFlags"></param> | ||
4806 | public void RequestLocalTeleport(ScenePresence sp, Vector3 position, Vector3 vel, | ||
4807 | Vector3 lookat, int flags) | ||
4808 | { | ||
4809 | sp.LocalTeleport(position, vel, lookat, flags); | ||
4810 | } | ||
4811 | |||
4821 | /// <summary> | 4812 | /// <summary> |
4822 | /// Tries to teleport agent to another region. | 4813 | /// Tries to teleport agent to another region. |
4823 | /// </summary> | 4814 | /// </summary> |