Merge branch 'master' of /home/opensim/var/repo/opensim

integration
BlueWall 2012-07-19 09:19:26 -04:00
commit cbcd7ed6d2
15 changed files with 237 additions and 180 deletions

View File

@ -66,6 +66,11 @@ namespace OpenSim.Framework
IConfigSource Config { get; } IConfigSource Config { get; }
/// <summary>
/// Are logins enabled on this simulator?
/// </summary>
bool LoginsEnabled { get; set; }
float TimeDilation { get; } float TimeDilation { get; }
bool AllowScriptCrossings { get; } bool AllowScriptCrossings { get; }

View File

@ -137,13 +137,15 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
foreach (Scene scene in m_Scenes) foreach (Scene scene in m_Scenes)
{ {
// m_log.DebugFormat( // m_log.DebugFormat(
// "[INSTANT MESSAGE]: Looking for root agent {0} in {1}", // "[INSTANT MESSAGE]: Looking for root agent {0} in {1}",
// toAgentID.ToString(), scene.RegionInfo.RegionName); // toAgentID.ToString(), scene.RegionInfo.RegionName);
ScenePresence sp = scene.GetScenePresence(toAgentID); ScenePresence sp = scene.GetScenePresence(toAgentID);
if (sp != null && !sp.IsChildAgent) if (sp != null && !sp.IsChildAgent)
{ {
// Local message // Local message
// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID); m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", sp.Name, toAgentID);
sp.ControllingClient.SendInstantMessage(im); sp.ControllingClient.SendInstantMessage(im);
// Message sent // Message sent
@ -155,13 +157,15 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
// try child avatar second // try child avatar second
foreach (Scene scene in m_Scenes) foreach (Scene scene in m_Scenes)
{ {
// m_log.DebugFormat( m_log.DebugFormat(
// "[INSTANT MESSAGE]: Looking for child of {0} in {1}", toAgentID, scene.RegionInfo.RegionName); "[INSTANT MESSAGE]: Looking for child of {0} in {1}", toAgentID, scene.RegionInfo.RegionName);
ScenePresence sp = scene.GetScenePresence(toAgentID); ScenePresence sp = scene.GetScenePresence(toAgentID);
if (sp != null) if (sp != null)
{ {
// Local message // Local message
// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", user.Name, toAgentID); m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", sp.Name, toAgentID);
sp.ControllingClient.SendInstantMessage(im); sp.ControllingClient.SendInstantMessage(im);
// Message sent // Message sent
@ -170,10 +174,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
} }
} }
// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID); m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID);
SendGridInstantMessageViaXMLRPC(im, result);
return; SendGridInstantMessageViaXMLRPC(im, result);
} }
private void HandleUndeliveredMessage(GridInstantMessage im, MessageResultNotification result) private void HandleUndeliveredMessage(GridInstantMessage im, MessageResultNotification result)

View File

@ -297,7 +297,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
}); });
} }
} }
else if (im.dialog == (byte) InstantMessageDialog.InventoryDeclined) else if (
im.dialog == (byte)InstantMessageDialog.InventoryDeclined
|| im.dialog == (byte)InstantMessageDialog.TaskInventoryDeclined)
{ {
// Here, the recipient is local and we can assume that the // Here, the recipient is local and we can assume that the
// inventory is loaded. Courtesy of the above bulk update, // inventory is loaded. Courtesy of the above bulk update,

View File

@ -146,10 +146,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
lock (m_scenes) lock (m_scenes)
m_scenes[scene.RegionInfo.RegionID] = scene; m_scenes[scene.RegionInfo.RegionID] = scene;
scene.EventManager.OnLoginsEnabled += OnLoginsEnabled; scene.EventManager.OnRegionReady += s => UploadMapTile(s);
} }
///<summary> ///<summary>
/// ///
///</summary> ///</summary>
@ -163,21 +162,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
} }
#endregion ISharedRegionModule #endregion ISharedRegionModule
void OnLoginsEnabled(string regionName)
{
Scene scene = null;
foreach (Scene s in m_scenes.Values)
if (s.RegionInfo.RegionName == regionName)
{
scene = s;
break;
}
if (scene != null)
UploadMapTile(scene);
}
///<summary> ///<summary>
/// ///
///</summary> ///</summary>

View File

@ -129,18 +129,18 @@ namespace OpenSim.Region.CoreModules.World
switch (cmd[1]) switch (cmd[1])
{ {
case "enable": case "enable":
scene.LoginsDisabled = false; scene.LoginsEnabled = true;
MainConsole.Instance.Output(String.Format("Logins are enabled for region {0}", scene.RegionInfo.RegionName)); MainConsole.Instance.Output(String.Format("Logins are enabled for region {0}", scene.RegionInfo.RegionName));
break; break;
case "disable": case "disable":
scene.LoginsDisabled = true; scene.LoginsEnabled = false;
MainConsole.Instance.Output(String.Format("Logins are disabled for region {0}", scene.RegionInfo.RegionName)); MainConsole.Instance.Output(String.Format("Logins are disabled for region {0}", scene.RegionInfo.RegionName));
break; break;
case "status": case "status":
if (scene.LoginsDisabled) if (scene.LoginsEnabled)
MainConsole.Instance.Output(String.Format("Login in {0} are disabled", scene.RegionInfo.RegionName));
else
MainConsole.Instance.Output(String.Format("Login in {0} are enabled", scene.RegionInfo.RegionName)); MainConsole.Instance.Output(String.Format("Login in {0} are enabled", scene.RegionInfo.RegionName));
else
MainConsole.Instance.Output(String.Format("Login in {0} are disabled", scene.RegionInfo.RegionName));
break; break;
default: default:
MainConsole.Instance.Output("Syntax: login enable|disable|status"); MainConsole.Instance.Output("Syntax: login enable|disable|status");

View File

@ -25,14 +25,23 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
using System; using System;
using OpenSim.Framework;
namespace OpenSim.Region.Framework.Interfaces namespace OpenSim.Region.Framework.Interfaces
{ {
public interface IRegionReadyModule public interface IRegionReadyModule
{ {
void OarLoadingAlert(string msg); void OarLoadingAlert(string msg);
/// <summary>
/// Trigger region ready status manually.
/// </summary>
/// <remarks>
/// This should be called by the scene if the IRegionReadyModule has set Scene.LoginLock == true
/// </remarks>
/// <param name='scene'></param>
void TriggerRegionReady(IScene scene);
} }
} }

View File

@ -496,15 +496,25 @@ namespace OpenSim.Region.Framework.Scenes
public delegate void RegionHeartbeatEnd(Scene scene); public delegate void RegionHeartbeatEnd(Scene scene);
public event RegionHeartbeatEnd OnRegionHeartbeatEnd; public event RegionHeartbeatEnd OnRegionHeartbeatEnd;
public delegate void LoginsEnabled(string regionName);
/// <summary> /// <summary>
/// This should only fire in all circumstances if the RegionReady module is active. /// Fired when logins to a region are enabled or disabled.
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// TODO: Fire this even when the RegionReady module is not active. ///
/// </remarks> /// </remarks>
public event LoginsEnabled OnLoginsEnabled; /// Fired
public event RegionLoginsStatusChange OnRegionLoginsStatusChange;
public delegate void RegionLoginsStatusChange(IScene scene);
/// <summary>
/// Fired when a region is considered ready for use.
/// </summary>
/// <remarks>
/// A region is considered ready when startup operations such as loading of scripts already on the region
/// have been completed.
/// </remarks>
public event RegionReady OnRegionReady;
public delegate void RegionReady(IScene scene);
public delegate void PrimsLoaded(Scene s); public delegate void PrimsLoaded(Scene s);
public event PrimsLoaded OnPrimsLoaded; public event PrimsLoaded OnPrimsLoaded;
@ -2477,21 +2487,42 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public void TriggerLoginsEnabled (string regionName) public void TriggerRegionLoginsStatusChange(IScene scene)
{ {
LoginsEnabled handler = OnLoginsEnabled; RegionLoginsStatusChange handler = OnRegionLoginsStatusChange;
if ( handler != null) if (handler != null)
{ {
foreach (LoginsEnabled d in handler.GetInvocationList()) foreach (RegionLoginsStatusChange d in handler.GetInvocationList())
{ {
try try
{ {
d(regionName); d(scene);
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[EVENT MANAGER]: Delegate for LoginsEnabled failed - continuing {0} - {1}", m_log.ErrorFormat("[EVENT MANAGER]: Delegate for OnRegionLoginsStatusChange failed - continuing {0} - {1}",
e.Message, e.StackTrace);
}
}
}
}
public void TriggerRegionReady(IScene scene)
{
RegionReady handler = OnRegionReady;
if (handler != null)
{
foreach (RegionReady d in handler.GetInvocationList())
{
try
{
d(scene);
}
catch (Exception e)
{
m_log.ErrorFormat("[EVENT MANAGER]: Delegate for OnRegionReady failed - continuing {0} - {1}",
e.Message, e.StackTrace); e.Message, e.StackTrace);
} }
} }

View File

@ -128,9 +128,10 @@ namespace OpenSim.Region.Framework.Scenes
// root agents when ACL denies access to root agent // root agents when ACL denies access to root agent
public bool m_strictAccessControl = true; public bool m_strictAccessControl = true;
public int MaxUndoCount = 5; public int MaxUndoCount = 5;
// Using this for RegionReady module to prevent LoginsDisabled from changing under our feet; // Using this for RegionReady module to prevent LoginsDisabled from changing under our feet;
public bool LoginLock = false; public bool LoginLock = false;
public bool LoginsDisabled = true;
public bool StartDisabled = false; public bool StartDisabled = false;
public bool LoadingPrims; public bool LoadingPrims;
public IXfer XferManager; public IXfer XferManager;
@ -702,6 +703,8 @@ namespace OpenSim.Region.Framework.Scenes
{ {
IConfig startupConfig = m_config.Configs["Startup"]; IConfig startupConfig = m_config.Configs["Startup"];
StartDisabled = startupConfig.GetBoolean("StartDisabled", false);
m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance", m_defaultDrawDistance); m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance", m_defaultDrawDistance);
m_useBackup = startupConfig.GetBoolean("UseSceneBackup", m_useBackup); m_useBackup = startupConfig.GetBoolean("UseSceneBackup", m_useBackup);
if (!m_useBackup) if (!m_useBackup)
@ -1476,7 +1479,7 @@ namespace OpenSim.Region.Framework.Scenes
// landMS = Util.EnvironmentTickCountSubtract(ldMS); // landMS = Util.EnvironmentTickCountSubtract(ldMS);
//} //}
if (LoginsDisabled && Frame == 20) if (!LoginsEnabled && Frame == 20)
{ {
// m_log.DebugFormat("{0} {1} {2}", LoginsDisabled, m_sceneGraph.GetActiveScriptsCount(), LoginLock); // m_log.DebugFormat("{0} {1} {2}", LoginsDisabled, m_sceneGraph.GetActiveScriptsCount(), LoginLock);
@ -1484,31 +1487,34 @@ namespace OpenSim.Region.Framework.Scenes
// this is a rare case where we know we have just went through a long cycle of heap // this is a rare case where we know we have just went through a long cycle of heap
// allocations, and there is no more work to be done until someone logs in // allocations, and there is no more work to be done until someone logs in
GC.Collect(); GC.Collect();
IConfig startupConfig = m_config.Configs["Startup"]; if (!LoginLock)
if (startupConfig == null || !startupConfig.GetBoolean("StartDisabled", false)) {
if (!StartDisabled)
{
m_log.InfoFormat("[REGION]: Enabling logins for {0}", RegionInfo.RegionName);
LoginsEnabled = true;
}
m_sceneGridService.InformNeighborsThatRegionisUp(
RequestModuleInterface<INeighbourService>(), RegionInfo);
// Region ready should always be triggered whether logins are immediately enabled or not.
EventManager.TriggerRegionReady(this);
}
else
{ {
// This handles a case of a region having no scripts for the RegionReady module // This handles a case of a region having no scripts for the RegionReady module
if (m_sceneGraph.GetActiveScriptsCount() == 0) if (m_sceneGraph.GetActiveScriptsCount() == 0)
{ {
// need to be able to tell these have changed in RegionReady // In this case, we leave it to the IRegionReadyModule to enable logins
LoginLock = false;
EventManager.TriggerLoginsEnabled(RegionInfo.RegionName); // LoginLock can currently only be set by a region module implementation.
// If somehow this hasn't been done then the quickest way to bugfix is to see the
// NullReferenceException
IRegionReadyModule rrm = RequestModuleInterface<IRegionReadyModule>();
rrm.TriggerRegionReady(this);
} }
// For RegionReady lockouts
if (!LoginLock)
{
m_log.InfoFormat("[REGION]: Enabling logins for {0}", RegionInfo.RegionName);
LoginsDisabled = false;
}
m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo);
}
else
{
StartDisabled = true;
LoginsDisabled = true;
} }
} }
} }
@ -3317,24 +3323,30 @@ namespace OpenSim.Region.Framework.Scenes
if (AgentTransactionsModule != null) if (AgentTransactionsModule != null)
AgentTransactionsModule.RemoveAgentAssetTransactions(agentID); AgentTransactionsModule.RemoveAgentAssetTransactions(agentID);
avatar.Close();
m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode); m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode);
} }
catch (Exception e) catch (Exception e)
{ {
m_log.Error( m_log.Error(
string.Format("[SCENE]: Exception removing {0} from {1}, ", avatar.Name, RegionInfo.RegionName), e); string.Format("[SCENE]: Exception removing {0} from {1}. Cleaning up. Exception ", avatar.Name, Name), e);
} }
finally finally
{ {
// Always clean these structures up so that any failure above doesn't cause them to remain in the try
// scene with possibly bad effects (e.g. continually timing out on unacked packets and triggering {
// the same cleanup exception continually. // Always clean these structures up so that any failure above doesn't cause them to remain in the
// TODO: This should probably extend to the whole method, but we don't want to also catch the NRE // scene with possibly bad effects (e.g. continually timing out on unacked packets and triggering
// since this would hide the underlying failure and other associated problems. // the same cleanup exception continually.
m_sceneGraph.RemoveScenePresence(agentID); m_sceneGraph.RemoveScenePresence(agentID);
m_clientManager.Remove(agentID); m_clientManager.Remove(agentID);
avatar.Close();
}
catch (Exception e)
{
m_log.Error(
string.Format("[SCENE]: Exception in final clean up of {0} in {1}. Exception ", avatar.Name, Name), e);
}
} }
//m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false)); //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false));
@ -3448,7 +3460,7 @@ namespace OpenSim.Region.Framework.Scenes
agent.startpos agent.startpos
); );
if (LoginsDisabled) if (!LoginsEnabled)
{ {
reason = "Logins Disabled"; reason = "Logins Disabled";
return false; return false;

View File

@ -106,6 +106,24 @@ namespace OpenSim.Region.Framework.Scenes
protected readonly ClientManager m_clientManager = new ClientManager(); protected readonly ClientManager m_clientManager = new ClientManager();
public bool LoginsEnabled
{
get
{
return m_loginsEnabled;
}
set
{
if (m_loginsEnabled != value)
{
m_loginsEnabled = value;
EventManager.TriggerRegionLoginsStatusChange(this);
}
}
}
private bool m_loginsEnabled;
public float TimeDilation public float TimeDilation
{ {
get { return 1.0f; } get { return 1.0f; }

View File

@ -100,7 +100,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
m_log.WarnFormat( m_log.WarnFormat(
"[SCENE COMMUNICATION SERVICE]: Region {0} failed to inform neighbour at {1}-{2} that it is up.", "[SCENE COMMUNICATION SERVICE]: Region {0} failed to inform neighbour at {1}-{2} that it is up.",
x / Constants.RegionSize, y / Constants.RegionSize); m_scene.Name, x / Constants.RegionSize, y / Constants.RegionSize);
} }
} }

View File

@ -301,7 +301,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
sp.AbsolutePosition = preTeleportPosition; sp.AbsolutePosition = preTeleportPosition;
// Make sceneB refuse CreateAgent // Make sceneB refuse CreateAgent
sceneB.LoginsDisabled = true; sceneB.LoginsEnabled = false;
sceneA.RequestTeleportLocation( sceneA.RequestTeleportLocation(
sp.ControllingClient, sp.ControllingClient,

View File

@ -31,16 +31,14 @@ using System.Reflection;
using System.Net; using System.Net;
using System.IO; using System.IO;
using System.Text; using System.Text;
using log4net; using log4net;
using Nini.Config; using Nini.Config;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.StructuredData; using OpenMetaverse.StructuredData;
using OpenSim.Services.Interfaces;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces;
namespace OpenSim.Region.OptionalModules.Scripting.RegionReady namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
{ {
@ -56,10 +54,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
private bool m_lastOarLoadedOk; private bool m_lastOarLoadedOk;
private int m_channelNotify = -1000; private int m_channelNotify = -1000;
private bool m_enabled = false; private bool m_enabled = false;
private bool m_disable_logins = false; private bool m_disable_logins;
private string m_uri = string.Empty; private string m_uri = string.Empty;
Scene m_scene = null; Scene m_scene;
#region INonSharedRegionModule interface #region INonSharedRegionModule interface
@ -99,47 +97,35 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
m_lastOarLoadedOk = true; m_lastOarLoadedOk = true;
m_scene.EventManager.OnOarFileLoaded += OnOarFileLoaded; m_scene.EventManager.OnOarFileLoaded += OnOarFileLoaded;
m_scene.EventManager.OnRezScript += OnRezScript;
m_scene.EventManager.OnLoginsEnabled += OnLoginsEnabled;
m_log.DebugFormat("[RegionReady]: Enabled for region {0}", scene.RegionInfo.RegionName); m_log.DebugFormat("[RegionReady]: Enabled for region {0}", scene.RegionInfo.RegionName);
if (m_disable_logins == true) if (m_disable_logins)
{ {
scene.LoginLock = true; m_scene.LoginLock = true;
scene.LoginsDisabled = true; m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue;
m_log.InfoFormat("[RegionReady]: Region {0} - logins disabled during initialization.",m_scene.RegionInfo.RegionName);
if(m_uri != string.Empty) m_log.InfoFormat("[RegionReady]: Region {0} - LOGINS DISABLED DURING INITIALIZATION.", m_scene.Name);
if (m_uri != string.Empty)
{ {
RRAlert("disabled"); RRAlert("disabled");
} }
} }
} }
void OnRezScript (uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource)
{
if (!m_ScriptRez)
{
m_ScriptRez = true;
m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue;
m_scene.EventManager.OnRezScript -= OnRezScript;
}
}
public void RemoveRegion(Scene scene) public void RemoveRegion(Scene scene)
{ {
if (!m_enabled) if (!m_enabled)
return; return;
m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue;
m_scene.EventManager.OnOarFileLoaded -= OnOarFileLoaded; m_scene.EventManager.OnOarFileLoaded -= OnOarFileLoaded;
m_scene.EventManager.OnLoginsEnabled -= OnLoginsEnabled;
if(m_uri != string.Empty) if (m_disable_logins)
{ m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue;
if (m_uri != string.Empty)
RRAlert("shutdown"); RRAlert("shutdown");
}
m_scene = null; m_scene = null;
} }
@ -159,7 +145,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
#endregion #endregion
void OnEmptyScriptCompileQueue(int numScriptsFailed, string message) void OnEmptyScriptCompileQueue(int numScriptsFailed, string message)
{ {
m_log.DebugFormat("[RegionReady]: Script compile queue empty!"); m_log.DebugFormat("[RegionReady]: Script compile queue empty!");
@ -193,75 +178,80 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
m_scene.RegionInfo.RegionName, c.Message, m_channelNotify); m_scene.RegionInfo.RegionName, c.Message, m_channelNotify);
m_scene.EventManager.TriggerOnChatBroadcast(this, c); m_scene.EventManager.TriggerOnChatBroadcast(this, c);
m_scene.EventManager.TriggerLoginsEnabled(m_scene.RegionInfo.RegionName);
m_scene.SceneGridService.InformNeighborsThatRegionisUp(m_scene.RequestModuleInterface<INeighbourService>(), m_scene.RegionInfo); TriggerRegionReady(m_scene);
} }
} }
void OnOarFileLoaded(Guid requestId, string message) void OnOarFileLoaded(Guid requestId, string message)
{ {
m_oarFileLoading = true; m_oarFileLoading = true;
if (message==String.Empty) if (message==String.Empty)
{ {
m_lastOarLoadedOk = true; m_lastOarLoadedOk = true;
} else { }
else
{
m_log.WarnFormat("[RegionReady]: Oar file load errors: {0}", message); m_log.WarnFormat("[RegionReady]: Oar file load errors: {0}", message);
m_lastOarLoadedOk = false; m_lastOarLoadedOk = false;
} }
} }
// This will be triggerd by Scene if we have no scripts /// <summary>
// m_ScriptsRezzing will be false if there were none /// This will be triggered by Scene directly if it contains no scripts on startup. Otherwise it is triggered
// else it will be true and we should wait on the /// when the script compile queue is empty after initial region startup.
// empty compile queue /// </summary>
void OnLoginsEnabled(string regionName) /// <param name='scene'></param>
public void TriggerRegionReady(IScene scene)
{ {
if (m_disable_logins == true) m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue;
m_scene.LoginLock = false;
if (!m_scene.StartDisabled)
{ {
if (m_scene.StartDisabled == false) m_scene.LoginsEnabled = true;
{
m_scene.LoginsDisabled = false;
m_scene.LoginLock = false;
m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue; // 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}, Oar {1}", m_log.InfoFormat(
// m_scene.RegionInfo.RegionName, m_oarFileLoading.ToString()); "[RegionReady]: INITIALIZATION COMPLETE FOR {0} - LOGINS ENABLED", m_scene.Name);
m_log.InfoFormat(
"[RegionReady]: INITIALIZATION COMPLETE FOR {0} - LOGINS ENABLED", m_scene.Name);
if (m_uri != string.Empty)
{
RRAlert("enabled");
}
}
} }
m_scene.SceneGridService.InformNeighborsThatRegionisUp(
m_scene.RequestModuleInterface<INeighbourService>(), m_scene.RegionInfo);
if (m_uri != string.Empty)
{
RRAlert("enabled");
}
m_scene.EventManager.TriggerRegionReady(m_scene);
} }
public void OarLoadingAlert(string msg) public void OarLoadingAlert(string msg)
{ {
// Let's bypass this for now until some better feedback can be established // Let's bypass this for now until some better feedback can be established
// //
return;
if (msg == "load") // if (msg == "load")
{ // {
m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue; // m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue;
m_scene.EventManager.OnOarFileLoaded += OnOarFileLoaded; // m_scene.EventManager.OnOarFileLoaded += OnOarFileLoaded;
m_scene.EventManager.OnLoginsEnabled += OnLoginsEnabled; // m_scene.EventManager.OnLoginsEnabled += OnLoginsEnabled;
m_scene.EventManager.OnRezScript += OnRezScript; // m_scene.EventManager.OnRezScript += OnRezScript;
m_oarFileLoading = true; // m_oarFileLoading = true;
m_firstEmptyCompileQueue = true; // m_firstEmptyCompileQueue = true;
//
m_scene.LoginsDisabled = true; // m_scene.LoginsDisabled = true;
m_scene.LoginLock = true; // m_scene.LoginLock = true;
if ( m_uri != string.Empty ) // if ( m_uri != string.Empty )
{ // {
RRAlert("loading oar"); // RRAlert("loading oar");
RRAlert("disabled"); // RRAlert("disabled");
} // }
} // }
} }
public void RRAlert(string status) public void RRAlert(string status)

View File

@ -3973,23 +3973,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (agentItem == null) if (agentItem == null)
return; return;
byte[] bucket = new byte[17];
bucket[0] = (byte)item.Type;
byte[] objBytes = agentItem.ID.GetBytes();
Array.Copy(objBytes, 0, bucket, 1, 16);
GridInstantMessage msg = new GridInstantMessage(World,
m_host.UUID, m_host.Name + ", an object owned by " +
resolveName(m_host.OwnerID) + ",", destId,
(byte)InstantMessageDialog.TaskInventoryOffered,
false, item.Name + "\n" + m_host.Name + " is located at " +
World.RegionInfo.RegionName+" "+
m_host.AbsolutePosition.ToString(),
agentItem.ID, true, m_host.AbsolutePosition,
bucket);
if (m_TransferModule != null) if (m_TransferModule != null)
{
byte[] bucket = new byte[] { (byte)item.Type };
GridInstantMessage msg = new GridInstantMessage(World,
m_host.UUID, m_host.Name + ", an object owned by " +
resolveName(m_host.OwnerID) + ",", destId,
(byte)InstantMessageDialog.TaskInventoryOffered,
false, item.Name + "\n" + m_host.Name + " is located at " +
World.RegionInfo.RegionName+" "+
m_host.AbsolutePosition.ToString(),
agentItem.ID, true, m_host.AbsolutePosition,
bucket);
m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); m_TransferModule.SendInstantMessage(msg, delegate(bool success) {});
}
ScriptSleep(3000); ScriptSleep(3000);
} }
@ -6397,23 +6396,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (folderID == UUID.Zero) if (folderID == UUID.Zero)
return; return;
byte[] bucket = new byte[17];
bucket[0] = (byte)AssetType.Folder;
byte[] objBytes = folderID.GetBytes();
Array.Copy(objBytes, 0, bucket, 1, 16);
GridInstantMessage msg = new GridInstantMessage(World,
m_host.UUID, m_host.Name + ", an object owned by " +
resolveName(m_host.OwnerID) + ",", destID,
(byte)InstantMessageDialog.InventoryOffered,
false, category + "\n" + m_host.Name + " is located at " +
World.RegionInfo.RegionName + " " +
m_host.AbsolutePosition.ToString(),
folderID, true, m_host.AbsolutePosition,
bucket);
if (m_TransferModule != null) if (m_TransferModule != null)
{
byte[] bucket = new byte[] { (byte)AssetType.Folder };
GridInstantMessage msg = new GridInstantMessage(World,
m_host.UUID, m_host.Name + ", an object owned by " +
resolveName(m_host.OwnerID) + ",", destID,
(byte)InstantMessageDialog.TaskInventoryOffered,
false, category + "\n" + m_host.Name + " is located at " +
World.RegionInfo.RegionName + " " +
m_host.AbsolutePosition.ToString(),
folderID, true, m_host.AbsolutePosition,
bucket);
m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); m_TransferModule.SendInstantMessage(msg, delegate(bool success) {});
}
} }
public void llSetVehicleType(int type) public void llSetVehicleType(int type)

View File

@ -644,6 +644,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
m_Scene.EventManager.OnGetScriptRunning += OnGetScriptRunning; m_Scene.EventManager.OnGetScriptRunning += OnGetScriptRunning;
m_Scene.EventManager.OnShutdown += OnShutdown; m_Scene.EventManager.OnShutdown += OnShutdown;
// If region ready has been triggered, then the region had no scripts to compile and completed its other
// work.
m_Scene.EventManager.OnRegionReady += s => m_InitialStartup = false;
if (m_SleepTime > 0) if (m_SleepTime > 0)
{ {
m_ThreadPool.QueueWorkItem(new WorkItemCallback(this.DoMaintenance), m_ThreadPool.QueueWorkItem(new WorkItemCallback(this.DoMaintenance),

View File

@ -190,7 +190,7 @@ namespace OpenSim.Tests.Common
= physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", new IniConfigSource(), "test"); = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", new IniConfigSource(), "test");
testScene.RegionInfo.EstateSettings = new EstateSettings(); testScene.RegionInfo.EstateSettings = new EstateSettings();
testScene.LoginsDisabled = false; testScene.LoginsEnabled = true;
testScene.RegisterRegionWithGrid(); testScene.RegisterRegionWithGrid();
SceneManager.Add(testScene); SceneManager.Add(testScene);