mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs OpenSim/Region/Framework/Scenes/Scene.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
This commit is contained in:
@@ -6887,22 +6887,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (folderID == UUID.Zero)
|
||||
return;
|
||||
|
||||
byte[] bucket = new byte[1];
|
||||
bucket[0] = (byte)AssetType.Folder;
|
||||
//byte[] objBytes = folderID.GetBytes();
|
||||
//Array.Copy(objBytes, 0, bucket, 1, 16);
|
||||
|
||||
GridInstantMessage msg = new GridInstantMessage(World,
|
||||
m_host.OwnerID, m_host.Name, destID,
|
||||
(byte)InstantMessageDialog.TaskInventoryOffered,
|
||||
false, category+". "+m_host.Name+" is located at "+
|
||||
World.RegionInfo.RegionName+" "+
|
||||
m_host.AbsolutePosition.ToString(),
|
||||
folderID, true, m_host.AbsolutePosition,
|
||||
bucket);
|
||||
|
||||
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) {});
|
||||
}
|
||||
}
|
||||
|
||||
public void llSetVehicleType(int type)
|
||||
|
||||
@@ -312,11 +312,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||
part.SetScriptEvents(ItemID,
|
||||
(int)m_Script.GetStateEventFlags(State));
|
||||
|
||||
Running = false;
|
||||
|
||||
if (ShuttingDown)
|
||||
if (!Running)
|
||||
m_startOnInit = false;
|
||||
|
||||
Running = false;
|
||||
|
||||
// we get new rez events on sim restart, too
|
||||
// but if there is state, then we fire the change
|
||||
// event
|
||||
@@ -352,12 +352,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||
|
||||
public void Init()
|
||||
{
|
||||
if (!m_startOnInit)
|
||||
if (ShuttingDown)
|
||||
return;
|
||||
|
||||
if (m_startedFromSavedState)
|
||||
{
|
||||
Start();
|
||||
if (m_startOnInit)
|
||||
Start();
|
||||
if (m_postOnRez)
|
||||
{
|
||||
PostEvent(new EventParams("on_rez",
|
||||
@@ -389,7 +390,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||
}
|
||||
else
|
||||
{
|
||||
Start();
|
||||
if (m_startOnInit)
|
||||
Start();
|
||||
PostEvent(new EventParams("state_entry",
|
||||
new Object[0], new DetectParams[0]));
|
||||
if (m_postOnRez)
|
||||
|
||||
@@ -109,6 +109,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
private bool m_KillTimedOutScripts;
|
||||
private string m_ScriptEnginesPath = null;
|
||||
|
||||
private ExpiringCache<UUID, bool> m_runFlags = new ExpiringCache<UUID, bool>();
|
||||
|
||||
/// <summary>
|
||||
/// Is the entire simulator in the process of shutting down?
|
||||
/// </summary>
|
||||
@@ -715,6 +717,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
m_Scene.EventManager.OnGetScriptRunning += OnGetScriptRunning;
|
||||
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)
|
||||
{
|
||||
m_ThreadPool.QueueWorkItem(new WorkItemCallback(this.DoMaintenance),
|
||||
@@ -1269,7 +1275,15 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
|
||||
if (instance!=null)
|
||||
instance.Init();
|
||||
|
||||
|
||||
bool runIt;
|
||||
if (m_runFlags.TryGetValue(itemID, out runIt))
|
||||
{
|
||||
if (!runIt)
|
||||
StopScript(itemID);
|
||||
m_runFlags.Remove(itemID);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1660,6 +1674,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
IScriptInstance instance = GetInstance(itemID);
|
||||
if (instance != null)
|
||||
instance.Start();
|
||||
else
|
||||
m_runFlags.AddOrUpdate(itemID, true, 240);
|
||||
}
|
||||
|
||||
public void StopScript(UUID itemID)
|
||||
@@ -1671,6 +1687,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
// cause issues on mono 2.6, 2.10 and possibly later where locks are not released properly on abort.
|
||||
instance.Stop(1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_runFlags.AddOrUpdate(itemID, false, 240);
|
||||
}
|
||||
}
|
||||
|
||||
public DetectParams GetDetectParams(UUID itemID, int idx)
|
||||
|
||||
Reference in New Issue
Block a user