* Added the Scripted objectflag if there is a script running in a prim. Remove the flag if you delete all of the scripts in the object.

ThreadPoolClientBranch
Teravus Ovares 2008-02-07 01:52:39 +00:00
parent caa255bcdf
commit 1b8e89751a
3 changed files with 21 additions and 2 deletions

View File

@ -1003,6 +1003,7 @@ namespace OpenSim.Region.Environment.Scenes
{ {
AddEntityFromStorage(group); AddEntityFromStorage(group);
SceneObjectPart rootPart = group.GetChildPart(group.UUID); SceneObjectPart rootPart = group.GetChildPart(group.UUID);
rootPart.ObjectFlags &= ~(uint)LLObject.ObjectFlags.Scripted;
rootPart.TrimPermissions(); rootPart.TrimPermissions();
group.ApplyPhysics(m_physicalPrim); group.ApplyPhysics(m_physicalPrim);

View File

@ -151,12 +151,15 @@ namespace OpenSim.Region.Environment.Scenes
// "[PRIMINVENTORY]: " + // "[PRIMINVENTORY]: " +
// "Starting script {0}, {1} in prim {2}, {3}", // "Starting script {0}, {1} in prim {2}, {3}",
// item.Name, item.ItemID, Name, UUID)); // item.Name, item.ItemID, Name, UUID));
AddFlag(LLObject.ObjectFlags.Scripted);
if (!((m_parentGroup.Scene.RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts)) if (!((m_parentGroup.Scene.RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts))
{ {
AssetBase rezAsset = m_parentGroup.Scene.AssetCache.GetAsset(item.AssetID, false); AssetBase rezAsset = m_parentGroup.Scene.AssetCache.GetAsset(item.AssetID, false);
if (rezAsset != null) if (rezAsset != null)
{ {
string script = Helpers.FieldToUTF8String(rezAsset.Data); string script = Helpers.FieldToUTF8String(rezAsset.Data);
m_parentGroup.Scene.EventManager.TriggerRezScript(LocalID, item.ItemID, script); m_parentGroup.Scene.EventManager.TriggerRezScript(LocalID, item.ItemID, script);
m_parentGroup.AddActiveScriptCount(1); m_parentGroup.AddActiveScriptCount(1);
@ -169,6 +172,7 @@ namespace OpenSim.Region.Environment.Scenes
item.Name, item.ItemID, item.AssetID)); item.Name, item.ItemID, item.AssetID));
} }
} }
ScheduleFullUpdate();
} }
/// <summary> /// <summary>
@ -202,10 +206,18 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="itemId"></param> /// <param name="itemId"></param>
public void StopScript(LLUUID itemId) public void StopScript(LLUUID itemId)
{ {
if (m_taskInventory.ContainsKey(itemId)) if (m_taskInventory.ContainsKey(itemId))
{ {
m_parentGroup.Scene.EventManager.TriggerRemoveScript(LocalID, itemId); m_parentGroup.Scene.EventManager.TriggerRemoveScript(LocalID, itemId);
m_parentGroup.AddActiveScriptCount(-1); m_parentGroup.AddActiveScriptCount(-1);
} }
else else
{ {
@ -214,6 +226,7 @@ namespace OpenSim.Region.Environment.Scenes
"Couldn't stop script with ID {0} since it couldn't be found for prim {1}, {2}", "Couldn't stop script with ID {0} since it couldn't be found for prim {1}, {2}",
itemId, Name, UUID)); itemId, Name, UUID));
} }
} }
/// <summary> /// <summary>

View File

@ -670,6 +670,7 @@ namespace OpenSim.Region.Environment.Scenes
LLObject.ObjectFlags.AllowInventoryDrop | LLObject.ObjectFlags.AllowInventoryDrop |
LLObject.ObjectFlags.CreateSelected; LLObject.ObjectFlags.CreateSelected;
TrimPermissions(); TrimPermissions();
ScheduleFullUpdate(); ScheduleFullUpdate();
@ -708,6 +709,10 @@ namespace OpenSim.Region.Environment.Scenes
RotationOffset = rotation; RotationOffset = rotation;
ObjectFlags = flags; ObjectFlags = flags;
// Since we don't store script state, this is only a 'temporary' objectflag now
// If the object is scripted, the script will get loaded and this will be set again
ObjectFlags &= ~(uint)LLObject.ObjectFlags.Scripted;
TrimPermissions(); TrimPermissions();
// ApplyPhysics(); // ApplyPhysics();