Merge branch 'avination' into careminster
Conflicts: OpenSim/Region/Framework/Scenes/Scene.csavinationmerge
commit
dd416298f1
|
@ -153,6 +153,9 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
||||||
|
|
||||||
public void SendProfileToClient(IClientAPI client, RegionLightShareData wl)
|
public void SendProfileToClient(IClientAPI client, RegionLightShareData wl)
|
||||||
{
|
{
|
||||||
|
if (client == null)
|
||||||
|
return;
|
||||||
|
|
||||||
if (m_enableWindlight)
|
if (m_enableWindlight)
|
||||||
{
|
{
|
||||||
if (m_scene.RegionInfo.WindlightSettings.valid)
|
if (m_scene.RegionInfo.WindlightSettings.valid)
|
||||||
|
|
|
@ -361,6 +361,22 @@ namespace OpenSim.Region.OptionalModules.Scripting.ScriptModuleComms
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get all registered constants
|
||||||
|
/// </summary>
|
||||||
|
public Dictionary<string, object> GetConstants()
|
||||||
|
{
|
||||||
|
Dictionary<string, object> ret = new Dictionary<string, object>();
|
||||||
|
|
||||||
|
lock (m_constants)
|
||||||
|
{
|
||||||
|
foreach (KeyValuePair<string, object> kvp in m_constants)
|
||||||
|
ret[kvp.Key] = kvp.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using System.Collections.Generic;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
|
|
||||||
namespace OpenSim.Region.Framework.Interfaces
|
namespace OpenSim.Region.Framework.Interfaces
|
||||||
|
@ -131,6 +132,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
/// <param name="cname">Name of constant</param>
|
/// <param name="cname">Name of constant</param>
|
||||||
/// <returns>Value of constant or null if none found.</returns>
|
/// <returns>Value of constant or null if none found.</returns>
|
||||||
object LookupModConstant(string cname);
|
object LookupModConstant(string cname);
|
||||||
|
Dictionary<string, object> GetConstants();
|
||||||
|
|
||||||
// For use ONLY by the script API
|
// For use ONLY by the script API
|
||||||
void RaiseEvent(UUID script, string id, string module, string command, string key);
|
void RaiseEvent(UUID script, string id, string module, string command, string key);
|
||||||
|
|
|
@ -2947,6 +2947,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
foreach (Action<Scene> d in handler.GetInvocationList())
|
foreach (Action<Scene> d in handler.GetInvocationList())
|
||||||
{
|
{
|
||||||
|
m_log.InfoFormat("[EVENT MANAGER]: TriggerSceneShuttingDown invoque {0}", d.Method.Name.ToString());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
d(s);
|
d(s);
|
||||||
|
@ -2959,6 +2960,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_log.Info("[EVENT MANAGER]: TriggerSceneShuttingDown done");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TriggerOnRegionStarted(Scene scene)
|
public void TriggerOnRegionStarted(Scene scene)
|
||||||
|
|
|
@ -1335,9 +1335,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// Stop all client threads.
|
// Stop all client threads.
|
||||||
ForEachScenePresence(delegate(ScenePresence avatar) { avatar.ControllingClient.Close(); });
|
ForEachScenePresence(delegate(ScenePresence avatar) { avatar.ControllingClient.Close(); });
|
||||||
|
|
||||||
m_log.Debug("[SCENE]: Persisting changed objects");
|
m_log.Debug("[SCENE]: TriggerSceneShuttingDown");
|
||||||
EventManager.TriggerSceneShuttingDown(this);
|
EventManager.TriggerSceneShuttingDown(this);
|
||||||
|
|
||||||
|
m_log.Debug("[SCENE]: Persisting changed objects");
|
||||||
|
|
||||||
EntityBase[] entities = GetEntities();
|
EntityBase[] entities = GetEntities();
|
||||||
foreach (EntityBase entity in entities)
|
foreach (EntityBase entity in entities)
|
||||||
{
|
{
|
||||||
|
@ -1347,6 +1349,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_log.Debug("[SCENE]: Graph close");
|
||||||
m_sceneGraph.Close();
|
m_sceneGraph.Close();
|
||||||
|
|
||||||
if (!GridService.DeregisterRegion(RegionInfo.RegionID))
|
if (!GridService.DeregisterRegion(RegionInfo.RegionID))
|
||||||
|
@ -1359,6 +1362,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// attempt to reference a null or disposed physics scene.
|
// attempt to reference a null or disposed physics scene.
|
||||||
if (PhysicsScene != null)
|
if (PhysicsScene != null)
|
||||||
{
|
{
|
||||||
|
m_log.Debug("[SCENE]: Dispose Physics");
|
||||||
PhysicsScene phys = PhysicsScene;
|
PhysicsScene phys = PhysicsScene;
|
||||||
// remove the physics engine from both Scene and SceneGraph
|
// remove the physics engine from both Scene and SceneGraph
|
||||||
PhysicsScene = null;
|
PhysicsScene = null;
|
||||||
|
@ -1401,6 +1405,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
// m_lastUpdate = Util.EnvironmentTickCount();
|
// m_lastUpdate = Util.EnvironmentTickCount();
|
||||||
|
|
||||||
|
// m_sceneGraph.PreparePhysicsSimulation();
|
||||||
|
|
||||||
|
|
||||||
m_heartbeatThread
|
m_heartbeatThread
|
||||||
= Watchdog.StartThread(
|
= Watchdog.StartThread(
|
||||||
Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, false);
|
Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, false);
|
||||||
|
|
|
@ -813,7 +813,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
actor.Orientation = GetWorldRotation();
|
actor.Orientation = GetWorldRotation();
|
||||||
|
|
||||||
// Tell the physics engines that this prim changed.
|
// Tell the physics engines that this prim changed.
|
||||||
if (ParentGroup.Scene != null)
|
if (ParentGroup.Scene != null && ParentGroup.Scene.PhysicsScene != null)
|
||||||
ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor);
|
ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1057,25 +1057,22 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
mesh.RefCount++;
|
mesh.RefCount++;
|
||||||
return mesh;
|
return mesh;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// try to find a identical mesh on meshs recently released
|
// try to find a identical mesh on meshs recently released
|
||||||
lock (m_uniqueReleasedMeshes)
|
lock (m_uniqueReleasedMeshes)
|
||||||
{
|
|
||||||
m_uniqueReleasedMeshes.TryGetValue(key, out mesh);
|
|
||||||
if (mesh != null)
|
|
||||||
{
|
{
|
||||||
m_uniqueReleasedMeshes.Remove(key);
|
m_uniqueReleasedMeshes.TryGetValue(key, out mesh);
|
||||||
lock (m_uniqueMeshes)
|
if (mesh != null)
|
||||||
{
|
{
|
||||||
|
m_uniqueReleasedMeshes.Remove(key);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
m_uniqueMeshes.Add(key, mesh);
|
m_uniqueMeshes.Add(key, mesh);
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
|
mesh.RefCount = 1;
|
||||||
|
return mesh;
|
||||||
}
|
}
|
||||||
mesh.RefCount = 1;
|
|
||||||
return mesh;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -1108,25 +1105,22 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
mesh.RefCount++;
|
mesh.RefCount++;
|
||||||
return mesh;
|
return mesh;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// try to find a identical mesh on meshs recently released
|
// try to find a identical mesh on meshs recently released
|
||||||
lock (m_uniqueReleasedMeshes)
|
lock (m_uniqueReleasedMeshes)
|
||||||
{
|
|
||||||
m_uniqueReleasedMeshes.TryGetValue(key, out mesh);
|
|
||||||
if (mesh != null)
|
|
||||||
{
|
{
|
||||||
m_uniqueReleasedMeshes.Remove(key);
|
m_uniqueReleasedMeshes.TryGetValue(key, out mesh);
|
||||||
lock (m_uniqueMeshes)
|
if (mesh != null)
|
||||||
{
|
{
|
||||||
|
m_uniqueReleasedMeshes.Remove(key);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
m_uniqueMeshes.Add(key, mesh);
|
m_uniqueMeshes.Add(key, mesh);
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
|
mesh.RefCount = 1;
|
||||||
|
return mesh;
|
||||||
}
|
}
|
||||||
mesh.RefCount = 1;
|
|
||||||
return mesh;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -914,8 +914,9 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
if (repData.pbs.SculptTexture != repData.assetID)
|
if (repData.pbs.SculptTexture != repData.assetID)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
repData.pbs.SculptData = new byte[asset.Data.Length];
|
// repData.pbs.SculptData = new byte[asset.Data.Length];
|
||||||
asset.Data.CopyTo(repData.pbs.SculptData,0);
|
// asset.Data.CopyTo(repData.pbs.SculptData,0);
|
||||||
|
repData.pbs.SculptData = asset.Data;
|
||||||
repData.meshState = MeshState.AssetOK;
|
repData.meshState = MeshState.AssetOK;
|
||||||
m_worker.AssetLoaded(repData);
|
m_worker.AssetLoaded(repData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1108,6 +1108,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
ODEPhysRepData repData = _parent_scene.m_meshWorker.NewActorPhysRep(this, _pbs, _size, m_shapetype);
|
ODEPhysRepData repData = _parent_scene.m_meshWorker.NewActorPhysRep(this, _pbs, _size, m_shapetype);
|
||||||
|
|
||||||
primVolume = repData.volume;
|
primVolume = repData.volume;
|
||||||
|
m_OBB = repData.OBB;
|
||||||
|
m_OBBOffset = repData.OBBOffset;
|
||||||
|
|
||||||
UpdatePrimBodyData();
|
UpdatePrimBodyData();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1689,11 +1689,10 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public override float Simulate(float timeStep)
|
public override float Simulate(float timeStep)
|
||||||
{
|
{
|
||||||
|
|
||||||
DateTime now = DateTime.UtcNow;
|
DateTime now = DateTime.UtcNow;
|
||||||
TimeSpan timedif = now - m_lastframe;
|
TimeSpan timedif = now - m_lastframe;
|
||||||
m_lastframe = now;
|
|
||||||
timeStep = (float)timedif.TotalSeconds;
|
timeStep = (float)timedif.TotalSeconds;
|
||||||
|
m_lastframe = now;
|
||||||
|
|
||||||
// acumulate time so we can reduce error
|
// acumulate time so we can reduce error
|
||||||
step_time += timeStep;
|
step_time += timeStep;
|
||||||
|
@ -1704,6 +1703,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
if (framecount < 0)
|
if (framecount < 0)
|
||||||
framecount = 0;
|
framecount = 0;
|
||||||
|
|
||||||
|
|
||||||
framecount++;
|
framecount++;
|
||||||
|
|
||||||
int curphysiteractions;
|
int curphysiteractions;
|
||||||
|
@ -1714,9 +1714,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
else
|
else
|
||||||
curphysiteractions = m_physicsiterations;
|
curphysiteractions = m_physicsiterations;
|
||||||
|
|
||||||
int nodeframes = 0;
|
|
||||||
|
|
||||||
// checkThread();
|
// checkThread();
|
||||||
|
int nodeframes = 0;
|
||||||
|
|
||||||
lock (SimulationLock)
|
lock (SimulationLock)
|
||||||
lock(OdeLock)
|
lock(OdeLock)
|
||||||
|
@ -1733,7 +1732,11 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
|
|
||||||
d.WorldSetQuickStepNumIterations(world, curphysiteractions);
|
d.WorldSetQuickStepNumIterations(world, curphysiteractions);
|
||||||
|
|
||||||
while (step_time > HalfOdeStep && nodeframes < 10) //limit number of steps so we don't say here for ever
|
int loopstartMS = Util.EnvironmentTickCount();
|
||||||
|
int looptimeMS = 0;
|
||||||
|
|
||||||
|
|
||||||
|
while (step_time > HalfOdeStep)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -1742,9 +1745,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
|
|
||||||
if (ChangesQueue.Count > 0)
|
if (ChangesQueue.Count > 0)
|
||||||
{
|
{
|
||||||
int ttmpstart = Util.EnvironmentTickCount();
|
int changestartMS = Util.EnvironmentTickCount();
|
||||||
int ttmp;
|
int ttmp;
|
||||||
|
|
||||||
while (ChangesQueue.Dequeue(out item))
|
while (ChangesQueue.Dequeue(out item))
|
||||||
{
|
{
|
||||||
if (item.actor != null)
|
if (item.actor != null)
|
||||||
|
@ -1762,7 +1764,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
item.actor.Name, item.what.ToString());
|
item.actor.Name, item.what.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ttmp = Util.EnvironmentTickCountSubtract(ttmpstart);
|
ttmp = Util.EnvironmentTickCountSubtract(changestartMS);
|
||||||
if (ttmp > 20)
|
if (ttmp > 20)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1873,9 +1875,12 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
// ode.dunlock(world);
|
// ode.dunlock(world);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
step_time -= ODE_STEPSIZE;
|
step_time -= ODE_STEPSIZE;
|
||||||
nodeframes++;
|
nodeframes++;
|
||||||
|
|
||||||
|
looptimeMS = Util.EnvironmentTickCountSubtract(loopstartMS);
|
||||||
|
if (looptimeMS > 100)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
lock (_badCharacter)
|
lock (_badCharacter)
|
||||||
|
@ -1963,7 +1968,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
|
|
||||||
// think time dilation as to do with dinamic step size that we dont' have
|
// think time dilation as to do with dinamic step size that we dont' have
|
||||||
// even so tell something to world
|
// even so tell something to world
|
||||||
if (nodeframes < 10) // we did the requested loops
|
if (looptimeMS < 100) // we did the requested loops
|
||||||
m_timeDilation = 1.0f;
|
m_timeDilation = 1.0f;
|
||||||
else if (step_time > 0)
|
else if (step_time > 0)
|
||||||
{
|
{
|
||||||
|
@ -1972,6 +1977,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
m_timeDilation = 1;
|
m_timeDilation = 1;
|
||||||
if (step_time > m_SkipFramesAtms)
|
if (step_time > m_SkipFramesAtms)
|
||||||
step_time = 0;
|
step_time = 0;
|
||||||
|
m_lastframe = DateTime.UtcNow; // skip also the time lost
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2344,7 +2350,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
IntPtr HeightmapData = d.GeomHeightfieldDataCreate();
|
IntPtr HeightmapData = d.GeomUbitTerrainDataCreate();
|
||||||
|
|
||||||
const int wrap = 0;
|
const int wrap = 0;
|
||||||
float thickness = hfmin;
|
float thickness = hfmin;
|
||||||
|
|
|
@ -153,9 +153,9 @@ namespace OpenSim.Services.Connectors
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_log.WarnFormat(
|
// m_log.WarnFormat(
|
||||||
"[NEIGHBOUR SERVICE CONNCTOR]: Unable to send HelloNeighbour from {0} to {1}. Exception {2}{3}",
|
// "[NEIGHBOUR SERVICE CONNCTOR]: Unable to send HelloNeighbour from {0} to {1}. Exception {2}{3}",
|
||||||
thisRegion.RegionName, region.RegionName, e.Message, e.StackTrace);
|
// thisRegion.RegionName, region.RegionName, e.Message, e.StackTrace);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue