let engines Suspend and resume scripts return false if script not on that engine
parent
5f52de2578
commit
66eb8a2c2e
|
@ -70,13 +70,13 @@ namespace OpenSim.Region.Framework.Interfaces
|
|||
/// Suspends a script.
|
||||
/// </summary>
|
||||
/// <param name="itemID">The item ID of the script.</param>
|
||||
void SuspendScript(UUID itemID);
|
||||
bool SuspendScript(UUID itemID);
|
||||
|
||||
/// <summary>
|
||||
/// Resumes a script.
|
||||
/// </summary>
|
||||
/// <param name="itemID">The item ID of the script.</param>
|
||||
void ResumeScript(UUID itemID);
|
||||
bool ResumeScript(UUID itemID);
|
||||
|
||||
ArrayList GetScriptErrors(UUID itemID);
|
||||
|
||||
|
|
|
@ -410,10 +410,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
Rezzed = DateTime.UtcNow;
|
||||
Description = String.Empty;
|
||||
PseudoCRC = (int)DateTime.UtcNow.Ticks; // random could be as good; fallbak if not on region db
|
||||
|
||||
// Prims currently only contain a single folder (Contents). From looking at the Second Life protocol,
|
||||
// this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from
|
||||
// the prim into an agent inventory (Linden client reports that the "Object not found for drop" in its log
|
||||
m_inventory = new SceneObjectPartInventory(this);
|
||||
LastColSoundSentTime = Util.EnvironmentTickCount();
|
||||
}
|
||||
|
@ -449,7 +445,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
APIDActive = false;
|
||||
Flags = 0;
|
||||
CreateSelected = true;
|
||||
PseudoCRC = (int)DateTime.UtcNow.Ticks; // random could be as good
|
||||
TrimPermissions();
|
||||
AggregateInnerPerms();
|
||||
}
|
||||
|
|
|
@ -388,10 +388,13 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if (textureEntry.FaceTextures != null)
|
||||
{
|
||||
// Loop through the rest of the texture faces (a non-null face means the face is different from DefaultTexture)
|
||||
int nsides = part.GetNumberOfSides();
|
||||
foreach (Primitive.TextureEntryFace texture in textureEntry.FaceTextures)
|
||||
{
|
||||
if (texture != null)
|
||||
RecordTextureEntryAssetUuids(texture);
|
||||
if(--nsides <= 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -646,6 +649,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
/// </summary>
|
||||
private void RecordTextureEntryAssetUuids(Primitive.TextureEntryFace texture)
|
||||
{
|
||||
if (texture.TextureID != UUID.Zero)
|
||||
GatheredUuids[texture.TextureID] = (sbyte)AssetType.Texture;
|
||||
|
||||
if (texture.MaterialID != UUID.Zero)
|
||||
|
|
|
@ -1466,6 +1466,5 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
|||
{
|
||||
return m_OSSL_Functions.osClearObjectAnimations();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2460,38 +2460,31 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
return (float)si.ExecutionTime.GetSumTime().TotalMilliseconds;
|
||||
}
|
||||
|
||||
public void SuspendScript(UUID itemID)
|
||||
public bool SuspendScript(UUID itemID)
|
||||
{
|
||||
// m_log.DebugFormat("[XEngine]: Received request to suspend script with ID {0}", itemID);
|
||||
|
||||
IScriptInstance instance = GetInstance(itemID);
|
||||
if (instance != null)
|
||||
instance.Suspend();
|
||||
// else
|
||||
// m_log.DebugFormat("[XEngine]: Could not find script with ID {0} to resume", itemID);
|
||||
|
||||
// Send the new number of threads that are in use by the thread
|
||||
// pool, I believe that by adding them to the locations where the
|
||||
// script is changing states that I will catch all changes to the
|
||||
// thread pool
|
||||
m_Scene.setThreadCount(m_ThreadPool.InUseThreads);
|
||||
IScriptInstance instance = GetInstance(itemID);
|
||||
if (instance == null)
|
||||
return false;
|
||||
|
||||
instance.Suspend();
|
||||
return true;
|
||||
}
|
||||
|
||||
public void ResumeScript(UUID itemID)
|
||||
public bool ResumeScript(UUID itemID)
|
||||
{
|
||||
// m_log.DebugFormat("[XEngine]: Received request to resume script with ID {0}", itemID);
|
||||
|
||||
m_Scene.setThreadCount(m_ThreadPool.InUseThreads);
|
||||
|
||||
IScriptInstance instance = GetInstance(itemID);
|
||||
if (instance != null)
|
||||
{
|
||||
instance.Resume();
|
||||
// else
|
||||
// m_log.DebugFormat("[XEngine]: Could not find script with ID {0} to resume", itemID);
|
||||
|
||||
// Send the new number of threads that are in use by the thread
|
||||
// pool, I believe that by adding them to the locations where the
|
||||
// script is changing states that I will catch all changes to the
|
||||
// thread pool
|
||||
m_Scene.setThreadCount(m_ThreadPool.InUseThreads);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool HasScript(UUID itemID, out bool running)
|
||||
|
|
Loading…
Reference in New Issue