Merge branch 'master' into careminster
Conflicts: OpenSim/Region/Application/OpenSimBase.cs OpenSim/Region/Framework/Scenes/Scene.csavinationmerge
commit
2190a62366
|
@ -508,8 +508,7 @@ namespace OpenSim
|
|||
scene.SnmpService.LinkUp(scene);
|
||||
}
|
||||
|
||||
scene.StartTimer();
|
||||
scene.StartTimerWatchdog();
|
||||
scene.Start();
|
||||
|
||||
scene.StartScripts();
|
||||
|
||||
|
|
|
@ -598,12 +598,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
|||
"[TERRAIN]: Could not save terrain from {0} to {1}. Valid file extensions are {2}",
|
||||
m_scene.RegionInfo.RegionName, filename, m_supportedFileExtensions);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[TERRAIN]: Could not save terrain from {0} to {1}. {2} {3} {4} {5} {6} {7}",
|
||||
m_scene.RegionInfo.RegionName, filename, fileWidth, fileHeight, fileStartX, fileStartY, offsetX, offsetY);
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// m_log.ErrorFormat(
|
||||
// "[TERRAIN]: Could not save terrain from {0} to {1}. {2} {3} {4} {5} {6} {7}",
|
||||
// m_scene.RegionInfo.RegionName, filename, fileWidth, fileHeight, fileStartX, fileStartY, offsetX, offsetY);
|
||||
// }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -125,7 +125,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
|||
|
||||
// XXX: For some reason, we store all animations and use them with upper case names, but in LSL animations
|
||||
// are referenced with lower case names!
|
||||
UUID animID = DefaultAvatarAnimations.GetDefaultAnimation(name);
|
||||
UUID animID = DefaultAvatarAnimations.GetDefaultAnimation(name.ToUpper());
|
||||
if (animID == UUID.Zero)
|
||||
return;
|
||||
|
||||
|
|
|
@ -215,14 +215,12 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
/// </summary>
|
||||
private bool m_cleaningTemps = false;
|
||||
|
||||
private Object m_heartbeatLock = new Object();
|
||||
// private Object m_heartbeatLock = new Object();
|
||||
|
||||
// TODO: Possibly stop other classes being able to manipulate this directly.
|
||||
private SceneGraph m_sceneGraph;
|
||||
private volatile int m_bordersLocked;
|
||||
// private int m_RestartTimerCounter;
|
||||
private readonly Timer m_restartTimer = new Timer(15000); // Wait before firing
|
||||
// private int m_incrementsof15seconds;
|
||||
private volatile bool m_backingup;
|
||||
private Dictionary<UUID, ReturnInfo> m_returns = new Dictionary<UUID, ReturnInfo>();
|
||||
private Dictionary<UUID, SceneObjectGroup> m_groupsWithTargets = new Dictionary<UUID, SceneObjectGroup>();
|
||||
|
@ -230,16 +228,34 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
private bool m_physics_enabled = true;
|
||||
private bool m_scripts_enabled = true;
|
||||
private string m_defaultScriptEngine;
|
||||
private int m_LastLogin;
|
||||
private Thread HeartbeatThread = null;
|
||||
private volatile bool shuttingdown;
|
||||
|
||||
private int m_lastUpdate;
|
||||
/// <summary>
|
||||
/// Tick at which the last login occurred.
|
||||
/// </summary>
|
||||
private int m_LastLogin;
|
||||
|
||||
private int m_lastIncoming;
|
||||
private int m_lastOutgoing;
|
||||
private bool m_firstHeartbeat = true;
|
||||
private int m_hbRestarts = 0;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Thread that runs the scene loop.
|
||||
/// </summary>
|
||||
private Thread m_heartbeatThread;
|
||||
|
||||
/// <summary>
|
||||
/// True if these scene is in the process of shutting down or is shutdown.
|
||||
/// </summary>
|
||||
public bool ShuttingDown
|
||||
{
|
||||
get { return m_shuttingDown; }
|
||||
}
|
||||
private volatile bool m_shuttingDown;
|
||||
|
||||
// private int m_lastUpdate;
|
||||
private bool m_firstHeartbeat = true;
|
||||
|
||||
private UpdatePrioritizationSchemes m_priorityScheme = UpdatePrioritizationSchemes.Time;
|
||||
private bool m_reprioritizationEnabled = true;
|
||||
private double m_reprioritizationInterval = 5000.0;
|
||||
|
@ -577,7 +593,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
m_EstateDataService = estateDataService;
|
||||
m_regionHandle = m_regInfo.RegionHandle;
|
||||
m_regionName = m_regInfo.RegionName;
|
||||
m_lastUpdate = Util.EnvironmentTickCount();
|
||||
m_lastIncoming = 0;
|
||||
m_lastOutgoing = 0;
|
||||
|
||||
|
@ -834,18 +849,13 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
m_permissions = new ScenePermissions(this);
|
||||
|
||||
m_lastUpdate = Util.EnvironmentTickCount();
|
||||
// m_lastUpdate = Util.EnvironmentTickCount();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Startup / Close Methods
|
||||
|
||||
public bool ShuttingDown
|
||||
{
|
||||
get { return shuttingdown; }
|
||||
}
|
||||
|
||||
/// <value>
|
||||
/// The scene graph for this scene
|
||||
/// </value>
|
||||
|
@ -1107,6 +1117,12 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
m_physics_enabled = enablePhysics;
|
||||
}
|
||||
|
||||
// if (options.ContainsKey("collisions"))
|
||||
// {
|
||||
// // TODO: Implement. If false, should stop objects colliding, though possibly should still allow
|
||||
// // the avatar themselves to collide with the ground.
|
||||
// }
|
||||
|
||||
if (options.ContainsKey("teleport"))
|
||||
{
|
||||
bool enableTeleportDebugging;
|
||||
|
@ -1158,8 +1174,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
ForEachScenePresence(delegate(ScenePresence avatar) { avatar.ControllingClient.Close(); });
|
||||
|
||||
// Stop updating the scene objects and agents.
|
||||
//m_heartbeatTimer.Close();
|
||||
shuttingdown = true;
|
||||
m_shuttingDown = true;
|
||||
|
||||
m_log.Debug("[SCENE]: Persisting changed objects");
|
||||
EventManager.TriggerSceneShuttingDown(this);
|
||||
|
@ -1183,16 +1198,16 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Start the timer which triggers regular scene updates
|
||||
/// Start the scene
|
||||
/// </summary>
|
||||
public void StartTimer()
|
||||
public void Start()
|
||||
{
|
||||
// m_log.DebugFormat("[SCENE]: Starting Heartbeat timer for {0}", RegionInfo.RegionName);
|
||||
|
||||
//m_heartbeatTimer.Enabled = true;
|
||||
//m_heartbeatTimer.Interval = (int)(m_timespan * 1000);
|
||||
//m_heartbeatTimer.Elapsed += new ElapsedEventHandler(Heartbeat);
|
||||
if (HeartbeatThread != null)
|
||||
if (m_heartbeatThread != null)
|
||||
{
|
||||
m_hbRestarts++;
|
||||
if(m_hbRestarts > 10)
|
||||
|
@ -1208,13 +1223,13 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
//proc.WaitForExit();
|
||||
//Thread.Sleep(1000);
|
||||
//Environment.Exit(1);
|
||||
HeartbeatThread.Abort();
|
||||
Watchdog.AbortThread(HeartbeatThread.ManagedThreadId);
|
||||
HeartbeatThread = null;
|
||||
m_heartbeatThread.Abort();
|
||||
Watchdog.AbortThread(m_heartbeatThread.ManagedThreadId);
|
||||
m_heartbeatThread = null;
|
||||
}
|
||||
m_lastUpdate = Util.EnvironmentTickCount();
|
||||
// m_lastUpdate = Util.EnvironmentTickCount();
|
||||
|
||||
HeartbeatThread
|
||||
m_heartbeatThread
|
||||
= Watchdog.StartThread(
|
||||
Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, false);
|
||||
}
|
||||
|
@ -1245,30 +1260,32 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
/// </summary>
|
||||
private void Heartbeat()
|
||||
{
|
||||
if (!Monitor.TryEnter(m_heartbeatLock))
|
||||
{
|
||||
Watchdog.RemoveThread();
|
||||
return;
|
||||
}
|
||||
// if (!Monitor.TryEnter(m_heartbeatLock))
|
||||
// {
|
||||
// Watchdog.RemoveThread();
|
||||
// return;
|
||||
// }
|
||||
|
||||
try
|
||||
{
|
||||
m_eventManager.TriggerOnRegionStarted(this);
|
||||
// try
|
||||
// {
|
||||
|
||||
// The first frame can take a very long time due to physics actors being added on startup. Therefore,
|
||||
// don't turn on the watchdog alarm for this thread until the second frame, in order to prevent false
|
||||
// alarms for scenes with many objects.
|
||||
Update(1);
|
||||
Watchdog.GetCurrentThreadInfo().AlarmIfTimeout = true;
|
||||
m_eventManager.TriggerOnRegionStarted(this);
|
||||
|
||||
while (!shuttingdown)
|
||||
Update(-1);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Monitor.Pulse(m_heartbeatLock);
|
||||
Monitor.Exit(m_heartbeatLock);
|
||||
}
|
||||
// The first frame can take a very long time due to physics actors being added on startup. Therefore,
|
||||
// don't turn on the watchdog alarm for this thread until the second frame, in order to prevent false
|
||||
// alarms for scenes with many objects.
|
||||
Update(1);
|
||||
Watchdog.GetCurrentThreadInfo().AlarmIfTimeout = true;
|
||||
Update(-1);
|
||||
|
||||
// m_lastUpdate = Util.EnvironmentTickCount();
|
||||
// m_firstHeartbeat = false;
|
||||
// }
|
||||
// finally
|
||||
// {
|
||||
// Monitor.Pulse(m_heartbeatLock);
|
||||
// Monitor.Exit(m_heartbeatLock);
|
||||
// }
|
||||
|
||||
Watchdog.RemoveThread();
|
||||
}
|
||||
|
@ -1287,7 +1304,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
List<Vector3> coarseLocations;
|
||||
List<UUID> avatarUUIDs;
|
||||
|
||||
while (!shuttingdown && (endFrame == null || Frame < endFrame))
|
||||
while (!m_shuttingDown && (endFrame == null || Frame < endFrame))
|
||||
{
|
||||
maintc = Util.EnvironmentTickCount();
|
||||
++Frame;
|
||||
|
@ -1463,15 +1480,11 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
maintc = Util.EnvironmentTickCountSubtract(m_lastFrameTick, maintc);
|
||||
maintc = (int)(MinFrameTime * 1000) - maintc;
|
||||
|
||||
m_lastUpdate = Util.EnvironmentTickCount();
|
||||
m_firstHeartbeat = false;
|
||||
|
||||
if (maintc > 0)
|
||||
Thread.Sleep(maintc);
|
||||
|
||||
m_lastUpdate = Util.EnvironmentTickCount();
|
||||
m_firstHeartbeat = false;
|
||||
|
||||
// Optionally warn if a frame takes double the amount of time that it should.
|
||||
if (DebugUpdates
|
||||
&& Util.EnvironmentTickCountSubtract(
|
||||
|
@ -2662,7 +2675,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|| (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0;
|
||||
|
||||
CheckHeartbeat();
|
||||
ScenePresence presence;
|
||||
|
||||
ScenePresence sp = GetScenePresence(client.AgentId);
|
||||
|
||||
|
@ -3253,7 +3265,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
public override void RemoveClient(UUID agentID, bool closeChildAgents)
|
||||
{
|
||||
CheckHeartbeat();
|
||||
// CheckHeartbeat();
|
||||
bool isChildAgent = false;
|
||||
ScenePresence avatar = GetScenePresence(agentID);
|
||||
if (avatar != null)
|
||||
|
@ -4700,7 +4712,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
int health=1; // Start at 1, means we're up
|
||||
|
||||
if (Util.EnvironmentTickCountSubtract(m_lastUpdate) < 1000)
|
||||
if ((Util.EnvironmentTickCountSubtract(m_lastFrameTick)) < 1000)
|
||||
{
|
||||
health+=1;
|
||||
flags |= 1;
|
||||
|
@ -4737,6 +4749,8 @@ Environment.Exit(1);
|
|||
//
|
||||
if (Util.EnvironmentTickCountSubtract(m_LastLogin) < 240000)
|
||||
health++;
|
||||
else
|
||||
return health;
|
||||
|
||||
return health;
|
||||
}
|
||||
|
@ -4929,8 +4943,8 @@ Environment.Exit(1);
|
|||
if (m_firstHeartbeat)
|
||||
return;
|
||||
|
||||
if (Util.EnvironmentTickCountSubtract(m_lastUpdate) > 5000)
|
||||
StartTimer();
|
||||
if ((Util.EnvironmentTickCountSubtract(m_lastFrameTick)) > 5000)
|
||||
Start();
|
||||
}
|
||||
|
||||
public override ISceneObject DeserializeObject(string representation)
|
||||
|
|
|
@ -70,8 +70,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
|||
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
//m_log.Info("[RegionReady] Initialising");
|
||||
|
||||
m_config = config.Configs["RegionReady"];
|
||||
if (m_config != null)
|
||||
{
|
||||
|
@ -84,9 +82,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
|||
m_uri = m_config.GetString("alert_uri",string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
// if (!m_enabled)
|
||||
// m_log.Info("[RegionReady] disabled.");
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
|
@ -113,7 +108,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
|||
{
|
||||
scene.LoginLock = true;
|
||||
scene.LoginsDisabled = true;
|
||||
m_log.InfoFormat("[RegionReady]: Logins disabled for {0}",m_scene.RegionInfo.RegionName);
|
||||
m_log.InfoFormat("[RegionReady]: Region {0} - logins disabled during initialization.",m_scene.RegionInfo.RegionName);
|
||||
|
||||
if(m_uri != string.Empty)
|
||||
{
|
||||
|
@ -167,7 +162,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
|||
|
||||
void OnEmptyScriptCompileQueue(int numScriptsFailed, string message)
|
||||
{
|
||||
m_log.InfoFormat("[RegionReady]: Script compile queue empty!");
|
||||
m_log.DebugFormat("[RegionReady]: Script compile queue empty!");
|
||||
|
||||
if (m_firstEmptyCompileQueue || m_oarFileLoading)
|
||||
{
|
||||
|
@ -194,7 +189,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
|||
c.SenderUUID = UUID.Zero;
|
||||
c.Scene = m_scene;
|
||||
|
||||
m_log.InfoFormat("[RegionReady]: Region \"{0}\" is ready: \"{1}\" on channel {2}",
|
||||
m_log.DebugFormat("[RegionReady]: Region \"{0}\" is ready: \"{1}\" on channel {2}",
|
||||
m_scene.RegionInfo.RegionName, c.Message, m_channelNotify);
|
||||
|
||||
m_scene.EventManager.TriggerOnChatBroadcast(this, c);
|
||||
|
@ -210,7 +205,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
|||
{
|
||||
m_lastOarLoadedOk = true;
|
||||
} else {
|
||||
m_log.InfoFormat("[RegionReady]: Oar file load errors: {0}", message);
|
||||
m_log.WarnFormat("[RegionReady]: Oar file load errors: {0}", message);
|
||||
m_lastOarLoadedOk = false;
|
||||
}
|
||||
}
|
||||
|
@ -233,7 +228,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
|||
// m_log.InfoFormat("[RegionReady]: Logins enabled for {0}, Oar {1}",
|
||||
// m_scene.RegionInfo.RegionName, m_oarFileLoading.ToString());
|
||||
|
||||
m_log.InfoFormat("[RegionReady]: Logins enabled for {0}", m_scene.RegionInfo.RegionName);
|
||||
m_log.InfoFormat("[RegionReady]: Initialization complete - logins enabled for {0}", m_scene.RegionInfo.RegionName);
|
||||
|
||||
if ( m_uri != string.Empty )
|
||||
{
|
||||
|
|
|
@ -73,17 +73,19 @@ namespace OpenSim.Server.Handlers.Login
|
|||
|
||||
if (requestData != null)
|
||||
{
|
||||
foreach (string key in requestData.Keys)
|
||||
{
|
||||
object value = requestData[key];
|
||||
Console.WriteLine("{0}:{1}", key, value);
|
||||
if (value is ArrayList)
|
||||
{
|
||||
ICollection col = value as ICollection;
|
||||
foreach (object item in col)
|
||||
Console.WriteLine(" {0}", item);
|
||||
}
|
||||
}
|
||||
// Debug code to show exactly what login parameters the viewer is sending us.
|
||||
// TODO: Extract into a method that can be generally applied if one doesn't already exist.
|
||||
// foreach (string key in requestData.Keys)
|
||||
// {
|
||||
// object value = requestData[key];
|
||||
// Console.WriteLine("{0}:{1}", key, value);
|
||||
// if (value is ArrayList)
|
||||
// {
|
||||
// ICollection col = value as ICollection;
|
||||
// foreach (object item in col)
|
||||
// Console.WriteLine(" {0}", item);
|
||||
// }
|
||||
// }
|
||||
|
||||
if (requestData.ContainsKey("first") && requestData["first"] != null &&
|
||||
requestData.ContainsKey("last") && requestData["last"] != null && (
|
||||
|
|
Loading…
Reference in New Issue