diff options
author | Melanie | 2012-11-04 22:37:28 +0000 |
---|---|---|
committer | Melanie | 2012-11-04 22:37:28 +0000 |
commit | dd416298f1da71b801c789367a4408f5c2728df1 (patch) | |
tree | 9aa8ed8419dd536fe2f326755ad3468289818ffc /OpenSim/Region | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Add a method to query all registered script constants to allow non-XEngine (diff) | |
download | opensim-SC-dd416298f1da71b801c789367a4408f5c2728df1.zip opensim-SC-dd416298f1da71b801c789367a4408f5c2728df1.tar.gz opensim-SC-dd416298f1da71b801c789367a4408f5c2728df1.tar.bz2 opensim-SC-dd416298f1da71b801c789367a4408f5c2728df1.tar.xz |
Merge branch 'avination' into careminster
Conflicts:
OpenSim/Region/Framework/Scenes/Scene.cs
Diffstat (limited to 'OpenSim/Region')
10 files changed, 68 insertions, 35 deletions
diff --git a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs index f49641f..f524490 100644 --- a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs +++ b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs | |||
@@ -153,6 +153,9 @@ namespace OpenSim.Region.CoreModules.World.LightShare | |||
153 | 153 | ||
154 | public void SendProfileToClient(IClientAPI client, RegionLightShareData wl) | 154 | public void SendProfileToClient(IClientAPI client, RegionLightShareData wl) |
155 | { | 155 | { |
156 | if (client == null) | ||
157 | return; | ||
158 | |||
156 | if (m_enableWindlight) | 159 | if (m_enableWindlight) |
157 | { | 160 | { |
158 | if (m_scene.RegionInfo.WindlightSettings.valid) | 161 | if (m_scene.RegionInfo.WindlightSettings.valid) |
diff --git a/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs b/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs index 98396ff..dc54c3f 100644 --- a/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs | |||
@@ -361,6 +361,22 @@ namespace OpenSim.Region.OptionalModules.Scripting.ScriptModuleComms | |||
361 | return null; | 361 | return null; |
362 | } | 362 | } |
363 | 363 | ||
364 | /// <summary> | ||
365 | /// Get all registered constants | ||
366 | /// </summary> | ||
367 | public Dictionary<string, object> GetConstants() | ||
368 | { | ||
369 | Dictionary<string, object> ret = new Dictionary<string, object>(); | ||
370 | |||
371 | lock (m_constants) | ||
372 | { | ||
373 | foreach (KeyValuePair<string, object> kvp in m_constants) | ||
374 | ret[kvp.Key] = kvp.Value; | ||
375 | } | ||
376 | |||
377 | return ret; | ||
378 | } | ||
379 | |||
364 | #endregion | 380 | #endregion |
365 | 381 | ||
366 | } | 382 | } |
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs b/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs index 93930ce..70ff954 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Reflection; | 29 | using System.Reflection; |
30 | using System.Collections.Generic; | ||
30 | using OpenMetaverse; | 31 | using OpenMetaverse; |
31 | 32 | ||
32 | namespace OpenSim.Region.Framework.Interfaces | 33 | namespace OpenSim.Region.Framework.Interfaces |
@@ -131,6 +132,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
131 | /// <param name="cname">Name of constant</param> | 132 | /// <param name="cname">Name of constant</param> |
132 | /// <returns>Value of constant or null if none found.</returns> | 133 | /// <returns>Value of constant or null if none found.</returns> |
133 | object LookupModConstant(string cname); | 134 | object LookupModConstant(string cname); |
135 | Dictionary<string, object> GetConstants(); | ||
134 | 136 | ||
135 | // For use ONLY by the script API | 137 | // For use ONLY by the script API |
136 | void RaiseEvent(UUID script, string id, string module, string command, string key); | 138 | void RaiseEvent(UUID script, string id, string module, string command, string key); |
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index e2414eb..8691b91 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -2947,6 +2947,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2947 | { | 2947 | { |
2948 | foreach (Action<Scene> d in handler.GetInvocationList()) | 2948 | foreach (Action<Scene> d in handler.GetInvocationList()) |
2949 | { | 2949 | { |
2950 | m_log.InfoFormat("[EVENT MANAGER]: TriggerSceneShuttingDown invoque {0}", d.Method.Name.ToString()); | ||
2950 | try | 2951 | try |
2951 | { | 2952 | { |
2952 | d(s); | 2953 | d(s); |
@@ -2959,6 +2960,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2959 | } | 2960 | } |
2960 | } | 2961 | } |
2961 | } | 2962 | } |
2963 | m_log.Info("[EVENT MANAGER]: TriggerSceneShuttingDown done"); | ||
2962 | } | 2964 | } |
2963 | 2965 | ||
2964 | public void TriggerOnRegionStarted(Scene scene) | 2966 | public void TriggerOnRegionStarted(Scene scene) |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 4282b46..2543333 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1335,9 +1335,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1335 | // Stop all client threads. | 1335 | // Stop all client threads. |
1336 | ForEachScenePresence(delegate(ScenePresence avatar) { avatar.ControllingClient.Close(); }); | 1336 | ForEachScenePresence(delegate(ScenePresence avatar) { avatar.ControllingClient.Close(); }); |
1337 | 1337 | ||
1338 | m_log.Debug("[SCENE]: Persisting changed objects"); | 1338 | m_log.Debug("[SCENE]: TriggerSceneShuttingDown"); |
1339 | EventManager.TriggerSceneShuttingDown(this); | 1339 | EventManager.TriggerSceneShuttingDown(this); |
1340 | 1340 | ||
1341 | m_log.Debug("[SCENE]: Persisting changed objects"); | ||
1342 | |||
1341 | EntityBase[] entities = GetEntities(); | 1343 | EntityBase[] entities = GetEntities(); |
1342 | foreach (EntityBase entity in entities) | 1344 | foreach (EntityBase entity in entities) |
1343 | { | 1345 | { |
@@ -1347,6 +1349,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1347 | } | 1349 | } |
1348 | } | 1350 | } |
1349 | 1351 | ||
1352 | m_log.Debug("[SCENE]: Graph close"); | ||
1350 | m_sceneGraph.Close(); | 1353 | m_sceneGraph.Close(); |
1351 | 1354 | ||
1352 | if (!GridService.DeregisterRegion(RegionInfo.RegionID)) | 1355 | if (!GridService.DeregisterRegion(RegionInfo.RegionID)) |
@@ -1359,6 +1362,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1359 | // attempt to reference a null or disposed physics scene. | 1362 | // attempt to reference a null or disposed physics scene. |
1360 | if (PhysicsScene != null) | 1363 | if (PhysicsScene != null) |
1361 | { | 1364 | { |
1365 | m_log.Debug("[SCENE]: Dispose Physics"); | ||
1362 | PhysicsScene phys = PhysicsScene; | 1366 | PhysicsScene phys = PhysicsScene; |
1363 | // remove the physics engine from both Scene and SceneGraph | 1367 | // remove the physics engine from both Scene and SceneGraph |
1364 | PhysicsScene = null; | 1368 | PhysicsScene = null; |
@@ -1401,6 +1405,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1401 | } | 1405 | } |
1402 | // m_lastUpdate = Util.EnvironmentTickCount(); | 1406 | // m_lastUpdate = Util.EnvironmentTickCount(); |
1403 | 1407 | ||
1408 | // m_sceneGraph.PreparePhysicsSimulation(); | ||
1409 | |||
1410 | |||
1404 | m_heartbeatThread | 1411 | m_heartbeatThread |
1405 | = Watchdog.StartThread( | 1412 | = Watchdog.StartThread( |
1406 | Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, false); | 1413 | Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, false); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 5714fdd..2191cfa 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -813,7 +813,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
813 | actor.Orientation = GetWorldRotation(); | 813 | actor.Orientation = GetWorldRotation(); |
814 | 814 | ||
815 | // Tell the physics engines that this prim changed. | 815 | // Tell the physics engines that this prim changed. |
816 | if (ParentGroup.Scene != null) | 816 | if (ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene != null) |
817 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); | 817 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); |
818 | } | 818 | } |
819 | 819 | ||
diff --git a/OpenSim/Region/Physics/UbitMeshing/Meshmerizer.cs b/OpenSim/Region/Physics/UbitMeshing/Meshmerizer.cs index 29fdda4..6e1a105 100644 --- a/OpenSim/Region/Physics/UbitMeshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/UbitMeshing/Meshmerizer.cs | |||
@@ -1057,25 +1057,22 @@ namespace OpenSim.Region.Physics.Meshing | |||
1057 | mesh.RefCount++; | 1057 | mesh.RefCount++; |
1058 | return mesh; | 1058 | return mesh; |
1059 | } | 1059 | } |
1060 | } | ||
1061 | 1060 | ||
1062 | // try to find a identical mesh on meshs recently released | 1061 | // try to find a identical mesh on meshs recently released |
1063 | lock (m_uniqueReleasedMeshes) | 1062 | lock (m_uniqueReleasedMeshes) |
1064 | { | ||
1065 | m_uniqueReleasedMeshes.TryGetValue(key, out mesh); | ||
1066 | if (mesh != null) | ||
1067 | { | 1063 | { |
1068 | m_uniqueReleasedMeshes.Remove(key); | 1064 | m_uniqueReleasedMeshes.TryGetValue(key, out mesh); |
1069 | lock (m_uniqueMeshes) | 1065 | if (mesh != null) |
1070 | { | 1066 | { |
1067 | m_uniqueReleasedMeshes.Remove(key); | ||
1071 | try | 1068 | try |
1072 | { | 1069 | { |
1073 | m_uniqueMeshes.Add(key, mesh); | 1070 | m_uniqueMeshes.Add(key, mesh); |
1074 | } | 1071 | } |
1075 | catch { } | 1072 | catch { } |
1073 | mesh.RefCount = 1; | ||
1074 | return mesh; | ||
1076 | } | 1075 | } |
1077 | mesh.RefCount = 1; | ||
1078 | return mesh; | ||
1079 | } | 1076 | } |
1080 | } | 1077 | } |
1081 | return null; | 1078 | return null; |
@@ -1108,25 +1105,22 @@ namespace OpenSim.Region.Physics.Meshing | |||
1108 | mesh.RefCount++; | 1105 | mesh.RefCount++; |
1109 | return mesh; | 1106 | return mesh; |
1110 | } | 1107 | } |
1111 | } | ||
1112 | 1108 | ||
1113 | // try to find a identical mesh on meshs recently released | 1109 | // try to find a identical mesh on meshs recently released |
1114 | lock (m_uniqueReleasedMeshes) | 1110 | lock (m_uniqueReleasedMeshes) |
1115 | { | ||
1116 | m_uniqueReleasedMeshes.TryGetValue(key, out mesh); | ||
1117 | if (mesh != null) | ||
1118 | { | 1111 | { |
1119 | m_uniqueReleasedMeshes.Remove(key); | 1112 | m_uniqueReleasedMeshes.TryGetValue(key, out mesh); |
1120 | lock (m_uniqueMeshes) | 1113 | if (mesh != null) |
1121 | { | 1114 | { |
1115 | m_uniqueReleasedMeshes.Remove(key); | ||
1122 | try | 1116 | try |
1123 | { | 1117 | { |
1124 | m_uniqueMeshes.Add(key, mesh); | 1118 | m_uniqueMeshes.Add(key, mesh); |
1125 | } | 1119 | } |
1126 | catch { } | 1120 | catch { } |
1121 | mesh.RefCount = 1; | ||
1122 | return mesh; | ||
1127 | } | 1123 | } |
1128 | mesh.RefCount = 1; | ||
1129 | return mesh; | ||
1130 | } | 1124 | } |
1131 | } | 1125 | } |
1132 | 1126 | ||
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs index 73dd2fd..5030cec 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEMeshWorker.cs | |||
@@ -914,8 +914,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
914 | if (repData.pbs.SculptTexture != repData.assetID) | 914 | if (repData.pbs.SculptTexture != repData.assetID) |
915 | return; | 915 | return; |
916 | 916 | ||
917 | repData.pbs.SculptData = new byte[asset.Data.Length]; | 917 | // repData.pbs.SculptData = new byte[asset.Data.Length]; |
918 | asset.Data.CopyTo(repData.pbs.SculptData,0); | 918 | // asset.Data.CopyTo(repData.pbs.SculptData,0); |
919 | repData.pbs.SculptData = asset.Data; | ||
919 | repData.meshState = MeshState.AssetOK; | 920 | repData.meshState = MeshState.AssetOK; |
920 | m_worker.AssetLoaded(repData); | 921 | m_worker.AssetLoaded(repData); |
921 | } | 922 | } |
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs index ce67cc4..76e42d4 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | |||
@@ -1108,6 +1108,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1108 | ODEPhysRepData repData = _parent_scene.m_meshWorker.NewActorPhysRep(this, _pbs, _size, m_shapetype); | 1108 | ODEPhysRepData repData = _parent_scene.m_meshWorker.NewActorPhysRep(this, _pbs, _size, m_shapetype); |
1109 | 1109 | ||
1110 | primVolume = repData.volume; | 1110 | primVolume = repData.volume; |
1111 | m_OBB = repData.OBB; | ||
1112 | m_OBBOffset = repData.OBBOffset; | ||
1111 | 1113 | ||
1112 | UpdatePrimBodyData(); | 1114 | UpdatePrimBodyData(); |
1113 | } | 1115 | } |
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs index b98f177..54bc29f 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | |||
@@ -1689,11 +1689,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1689 | /// <returns></returns> | 1689 | /// <returns></returns> |
1690 | public override float Simulate(float timeStep) | 1690 | public override float Simulate(float timeStep) |
1691 | { | 1691 | { |
1692 | |||
1693 | DateTime now = DateTime.UtcNow; | 1692 | DateTime now = DateTime.UtcNow; |
1694 | TimeSpan timedif = now - m_lastframe; | 1693 | TimeSpan timedif = now - m_lastframe; |
1695 | m_lastframe = now; | ||
1696 | timeStep = (float)timedif.TotalSeconds; | 1694 | timeStep = (float)timedif.TotalSeconds; |
1695 | m_lastframe = now; | ||
1697 | 1696 | ||
1698 | // acumulate time so we can reduce error | 1697 | // acumulate time so we can reduce error |
1699 | step_time += timeStep; | 1698 | step_time += timeStep; |
@@ -1704,6 +1703,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1704 | if (framecount < 0) | 1703 | if (framecount < 0) |
1705 | framecount = 0; | 1704 | framecount = 0; |
1706 | 1705 | ||
1706 | |||
1707 | framecount++; | 1707 | framecount++; |
1708 | 1708 | ||
1709 | int curphysiteractions; | 1709 | int curphysiteractions; |
@@ -1714,9 +1714,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1714 | else | 1714 | else |
1715 | curphysiteractions = m_physicsiterations; | 1715 | curphysiteractions = m_physicsiterations; |
1716 | 1716 | ||
1717 | int nodeframes = 0; | ||
1718 | |||
1719 | // checkThread(); | 1717 | // checkThread(); |
1718 | int nodeframes = 0; | ||
1720 | 1719 | ||
1721 | lock (SimulationLock) | 1720 | lock (SimulationLock) |
1722 | lock(OdeLock) | 1721 | lock(OdeLock) |
@@ -1733,7 +1732,11 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1733 | 1732 | ||
1734 | d.WorldSetQuickStepNumIterations(world, curphysiteractions); | 1733 | d.WorldSetQuickStepNumIterations(world, curphysiteractions); |
1735 | 1734 | ||
1736 | while (step_time > HalfOdeStep && nodeframes < 10) //limit number of steps so we don't say here for ever | 1735 | int loopstartMS = Util.EnvironmentTickCount(); |
1736 | int looptimeMS = 0; | ||
1737 | |||
1738 | |||
1739 | while (step_time > HalfOdeStep) | ||
1737 | { | 1740 | { |
1738 | try | 1741 | try |
1739 | { | 1742 | { |
@@ -1742,9 +1745,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1742 | 1745 | ||
1743 | if (ChangesQueue.Count > 0) | 1746 | if (ChangesQueue.Count > 0) |
1744 | { | 1747 | { |
1745 | int ttmpstart = Util.EnvironmentTickCount(); | 1748 | int changestartMS = Util.EnvironmentTickCount(); |
1746 | int ttmp; | 1749 | int ttmp; |
1747 | |||
1748 | while (ChangesQueue.Dequeue(out item)) | 1750 | while (ChangesQueue.Dequeue(out item)) |
1749 | { | 1751 | { |
1750 | if (item.actor != null) | 1752 | if (item.actor != null) |
@@ -1762,7 +1764,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1762 | item.actor.Name, item.what.ToString()); | 1764 | item.actor.Name, item.what.ToString()); |
1763 | } | 1765 | } |
1764 | } | 1766 | } |
1765 | ttmp = Util.EnvironmentTickCountSubtract(ttmpstart); | 1767 | ttmp = Util.EnvironmentTickCountSubtract(changestartMS); |
1766 | if (ttmp > 20) | 1768 | if (ttmp > 20) |
1767 | break; | 1769 | break; |
1768 | } | 1770 | } |
@@ -1873,9 +1875,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1873 | // ode.dunlock(world); | 1875 | // ode.dunlock(world); |
1874 | } | 1876 | } |
1875 | 1877 | ||
1876 | |||
1877 | step_time -= ODE_STEPSIZE; | 1878 | step_time -= ODE_STEPSIZE; |
1878 | nodeframes++; | 1879 | nodeframes++; |
1880 | |||
1881 | looptimeMS = Util.EnvironmentTickCountSubtract(loopstartMS); | ||
1882 | if (looptimeMS > 100) | ||
1883 | break; | ||
1879 | } | 1884 | } |
1880 | 1885 | ||
1881 | lock (_badCharacter) | 1886 | lock (_badCharacter) |
@@ -1963,7 +1968,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1963 | 1968 | ||
1964 | // think time dilation as to do with dinamic step size that we dont' have | 1969 | // think time dilation as to do with dinamic step size that we dont' have |
1965 | // even so tell something to world | 1970 | // even so tell something to world |
1966 | if (nodeframes < 10) // we did the requested loops | 1971 | if (looptimeMS < 100) // we did the requested loops |
1967 | m_timeDilation = 1.0f; | 1972 | m_timeDilation = 1.0f; |
1968 | else if (step_time > 0) | 1973 | else if (step_time > 0) |
1969 | { | 1974 | { |
@@ -1972,6 +1977,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1972 | m_timeDilation = 1; | 1977 | m_timeDilation = 1; |
1973 | if (step_time > m_SkipFramesAtms) | 1978 | if (step_time > m_SkipFramesAtms) |
1974 | step_time = 0; | 1979 | step_time = 0; |
1980 | m_lastframe = DateTime.UtcNow; // skip also the time lost | ||
1975 | } | 1981 | } |
1976 | } | 1982 | } |
1977 | 1983 | ||
@@ -2344,7 +2350,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2344 | } | 2350 | } |
2345 | } | 2351 | } |
2346 | } | 2352 | } |
2347 | IntPtr HeightmapData = d.GeomHeightfieldDataCreate(); | 2353 | IntPtr HeightmapData = d.GeomUbitTerrainDataCreate(); |
2348 | 2354 | ||
2349 | const int wrap = 0; | 2355 | const int wrap = 0; |
2350 | float thickness = hfmin; | 2356 | float thickness = hfmin; |