parent
86defd0a69
commit
9a0ef22ed9
|
@ -643,6 +643,8 @@ namespace OpenSim.Framework
|
||||||
public delegate void EstateDebugRegionRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, bool scripted, bool collisionEvents, bool physics);
|
public delegate void EstateDebugRegionRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, bool scripted, bool collisionEvents, bool physics);
|
||||||
public delegate void EstateTeleportOneUserHomeRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, LLUUID prey);
|
public delegate void EstateTeleportOneUserHomeRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, LLUUID prey);
|
||||||
public delegate void ScriptReset(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID);
|
public delegate void ScriptReset(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID);
|
||||||
|
public delegate void GetScriptRunning(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID);
|
||||||
|
public delegate void SetScriptRunning(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID, bool running);
|
||||||
|
|
||||||
public interface IClientAPI
|
public interface IClientAPI
|
||||||
{
|
{
|
||||||
|
@ -839,6 +841,8 @@ namespace OpenSim.Framework
|
||||||
|
|
||||||
event RequestObjectPropertiesFamily OnObjectGroupRequest;
|
event RequestObjectPropertiesFamily OnObjectGroupRequest;
|
||||||
event ScriptReset OnScriptReset;
|
event ScriptReset OnScriptReset;
|
||||||
|
event GetScriptRunning OnGetScriptRunning;
|
||||||
|
event SetScriptRunning OnSetScriptRunning;
|
||||||
event UpdateVector OnAutoPilotGo;
|
event UpdateVector OnAutoPilotGo;
|
||||||
|
|
||||||
// [Obsolete("IClientAPI.OutPacket SHOULD NOT EXIST outside of LLClientView please refactor appropriately.")]
|
// [Obsolete("IClientAPI.OutPacket SHOULD NOT EXIST outside of LLClientView please refactor appropriately.")]
|
||||||
|
@ -1015,6 +1019,8 @@ namespace OpenSim.Framework
|
||||||
|
|
||||||
void SendLandStatReply(uint reportType, uint requestFlags, uint resultCount, LandStatReportItem[] lsrpia);
|
void SendLandStatReply(uint reportType, uint requestFlags, uint resultCount, LandStatReportItem[] lsrpia);
|
||||||
|
|
||||||
|
void SendScriptRunningReply(LLUUID objectID, LLUUID itemID, bool running);
|
||||||
|
|
||||||
void SendAsset(AssetRequestToClient req);
|
void SendAsset(AssetRequestToClient req);
|
||||||
|
|
||||||
void SendTexture(AssetBase TextureAsset);
|
void SendTexture(AssetBase TextureAsset);
|
||||||
|
|
|
@ -93,7 +93,7 @@ namespace OpenSim.Grid.ScriptServer
|
||||||
|
|
||||||
if (Command == "OnRezScript")
|
if (Command == "OnRezScript")
|
||||||
{
|
{
|
||||||
Engine.EventManager().OnRezScript((uint)p[0], new LLUUID((string)p[1]), (string)p[2]);
|
Engine.EventManager().OnRezScript((uint)p[0], new LLUUID((string)p[1]), (string)p[2], 0, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -535,7 +535,7 @@ namespace OpenSim
|
||||||
}
|
}
|
||||||
|
|
||||||
// We need to do this after we've initialized the scripting engines.
|
// We need to do this after we've initialized the scripting engines.
|
||||||
scene.StartScripts();
|
scene.CreateScriptInstances();
|
||||||
|
|
||||||
scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
|
scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
|
||||||
scene.EventManager.TriggerParcelPrimCountUpdate();
|
scene.EventManager.TriggerParcelPrimCountUpdate();
|
||||||
|
@ -729,3 +729,4 @@ namespace OpenSim
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -277,6 +277,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
private RequestObjectPropertiesFamily handlerObjectGroupRequest = null;
|
private RequestObjectPropertiesFamily handlerObjectGroupRequest = null;
|
||||||
private ScriptReset handlerScriptReset = null;
|
private ScriptReset handlerScriptReset = null;
|
||||||
|
private GetScriptRunning handlerGetScriptRunning = null;
|
||||||
|
private SetScriptRunning handlerSetScriptRunning = null;
|
||||||
private UpdateVector handlerAutoPilotGo = null;
|
private UpdateVector handlerAutoPilotGo = null;
|
||||||
|
|
||||||
/* Properties */
|
/* Properties */
|
||||||
|
@ -921,6 +923,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
public event EstateDebugRegionRequest OnEstateDebugRegionRequest;
|
public event EstateDebugRegionRequest OnEstateDebugRegionRequest;
|
||||||
public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest;
|
public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest;
|
||||||
public event ScriptReset OnScriptReset;
|
public event ScriptReset OnScriptReset;
|
||||||
|
public event GetScriptRunning OnGetScriptRunning;
|
||||||
|
public event SetScriptRunning OnSetScriptRunning;
|
||||||
public event UpdateVector OnAutoPilotGo;
|
public event UpdateVector OnAutoPilotGo;
|
||||||
|
|
||||||
#region Scene/Avatar to Client
|
#region Scene/Avatar to Client
|
||||||
|
@ -6187,7 +6191,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
m_log.Warn("[CLIENT]: unhandled InventoryDescent packet");
|
m_log.Warn("[CLIENT]: unhandled InventoryDescent packet");
|
||||||
break;
|
break;
|
||||||
case PacketType.GetScriptRunning:
|
case PacketType.GetScriptRunning:
|
||||||
m_log.Warn("[CLIENT]: unhandled GetScriptRunning packet");
|
GetScriptRunningPacket scriptRunning = (GetScriptRunningPacket)Pack;
|
||||||
|
handlerGetScriptRunning = OnGetScriptRunning;
|
||||||
|
if (handlerGetScriptRunning != null)
|
||||||
|
{
|
||||||
|
handlerGetScriptRunning(this, scriptRunning.Script.ObjectID, scriptRunning.Script.ItemID);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case PacketType.SetScriptRunning:
|
||||||
|
SetScriptRunningPacket setScriptRunning = (SetScriptRunningPacket)Pack;
|
||||||
|
handlerSetScriptRunning = OnSetScriptRunning;
|
||||||
|
if (handlerSetScriptRunning != null)
|
||||||
|
{
|
||||||
|
handlerSetScriptRunning(this, setScriptRunning.Script.ObjectID, setScriptRunning.Script.ItemID, setScriptRunning.Script.Running);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
m_log.Warn("[CLIENT]: unhandled packet " + Pack.ToString());
|
m_log.Warn("[CLIENT]: unhandled packet " + Pack.ToString());
|
||||||
|
@ -6390,6 +6407,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
OutPacket(lsrp, ThrottleOutPacketType.Task);
|
OutPacket(lsrp, ThrottleOutPacketType.Task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SendScriptRunningReply(LLUUID objectID, LLUUID itemID, bool running)
|
||||||
|
{
|
||||||
|
ScriptRunningReplyPacket scriptRunningReply = new ScriptRunningReplyPacket();
|
||||||
|
scriptRunningReply.Script.ObjectID = objectID;
|
||||||
|
scriptRunningReply.Script.ItemID = itemID;
|
||||||
|
scriptRunningReply.Script.Running = running;
|
||||||
|
|
||||||
|
OutPacket(scriptRunningReply, ThrottleOutPacketType.Task);
|
||||||
|
}
|
||||||
|
|
||||||
public void SendAsset(AssetRequestToClient req)
|
public void SendAsset(AssetRequestToClient req)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) Contributors, http://opensimulator.org/
|
||||||
|
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of the OpenSim Project nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using OpenSim.Framework;
|
||||||
|
using libsecondlife;
|
||||||
|
|
||||||
|
namespace OpenSim.Region.Environment.Interfaces
|
||||||
|
{
|
||||||
|
public interface IScriptModule : IRegionModule
|
||||||
|
{
|
||||||
|
bool GetScriptRunning(LLUUID objectID, LLUUID itemID);
|
||||||
|
}
|
||||||
|
}
|
|
@ -291,6 +291,8 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
|
||||||
public event EstateDebugRegionRequest OnEstateDebugRegionRequest;
|
public event EstateDebugRegionRequest OnEstateDebugRegionRequest;
|
||||||
public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest;
|
public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest;
|
||||||
public event ScriptReset OnScriptReset;
|
public event ScriptReset OnScriptReset;
|
||||||
|
public event GetScriptRunning OnGetScriptRunning;
|
||||||
|
public event SetScriptRunning OnSetScriptRunning;
|
||||||
public event UpdateVector OnAutoPilotGo;
|
public event UpdateVector OnAutoPilotGo;
|
||||||
|
|
||||||
#pragma warning restore 67
|
#pragma warning restore 67
|
||||||
|
@ -783,6 +785,10 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SendScriptRunningReply(LLUUID objectID, LLUUID itemID, bool running)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public void SendLandStatReply(uint reportType, uint requestFlags, uint resultCount, LandStatReportItem[] lsrpia)
|
public void SendLandStatReply(uint reportType, uint requestFlags, uint resultCount, LandStatReportItem[] lsrpia)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -300,6 +300,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||||
LLObject.ObjectFlags.ObjectMove | // tells client that you can move the object (only, no mod)
|
LLObject.ObjectFlags.ObjectMove | // tells client that you can move the object (only, no mod)
|
||||||
LLObject.ObjectFlags.ObjectTransfer | // tells the client that you can /take/ the object if you don't own it
|
LLObject.ObjectFlags.ObjectTransfer | // tells the client that you can /take/ the object if you don't own it
|
||||||
LLObject.ObjectFlags.ObjectYouOwner | // Tells client that you're the owner of the object
|
LLObject.ObjectFlags.ObjectYouOwner | // Tells client that you're the owner of the object
|
||||||
|
LLObject.ObjectFlags.ObjectAnyOwner | // Tells client that someone owns the object
|
||||||
LLObject.ObjectFlags.ObjectOwnerModify | // Tells client that you're the owner of the object
|
LLObject.ObjectFlags.ObjectOwnerModify | // Tells client that you're the owner of the object
|
||||||
LLObject.ObjectFlags.ObjectYouOfficer // Tells client that you've got group object editing permission. Used when ObjectGroupOwned is set
|
LLObject.ObjectFlags.ObjectYouOfficer // Tells client that you've got group object editing permission. Used when ObjectGroupOwned is set
|
||||||
);
|
);
|
||||||
|
@ -307,7 +308,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
|
||||||
// Creating the three ObjectFlags options for this method to choose from.
|
// Creating the three ObjectFlags options for this method to choose from.
|
||||||
// Customize the OwnerMask
|
// Customize the OwnerMask
|
||||||
uint objectOwnerMask = ApplyObjectModifyMasks(task.OwnerMask, objflags);
|
uint objectOwnerMask = ApplyObjectModifyMasks(task.OwnerMask, objflags);
|
||||||
objectOwnerMask |= (uint)LLObject.ObjectFlags.ObjectYouOwner | (uint)LLObject.ObjectFlags.ObjectOwnerModify;
|
objectOwnerMask |= (uint)LLObject.ObjectFlags.ObjectYouOwner | (uint)LLObject.ObjectFlags.ObjectAnyOwner | (uint)LLObject.ObjectFlags.ObjectOwnerModify;
|
||||||
|
|
||||||
// Customize the GroupMask
|
// Customize the GroupMask
|
||||||
// uint objectGroupMask = ApplyObjectModifyMasks(task.GroupMask, objflags);
|
// uint objectGroupMask = ApplyObjectModifyMasks(task.GroupMask, objflags);
|
||||||
|
|
|
@ -95,17 +95,22 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public event OnPermissionErrorDelegate OnPermissionError;
|
public event OnPermissionErrorDelegate OnPermissionError;
|
||||||
|
|
||||||
public delegate void NewRezScript(uint localID, LLUUID itemID, string script);
|
public delegate void NewRezScript(uint localID, LLUUID itemID, string script, int startParam, bool postOnRez);
|
||||||
public delegate void RezEvent(uint localID, LLUUID itemID, int param);
|
|
||||||
|
|
||||||
public event NewRezScript OnRezScript;
|
public event NewRezScript OnRezScript;
|
||||||
|
|
||||||
public event RezEvent OnRezEvent;
|
|
||||||
|
|
||||||
public delegate void RemoveScript(uint localID, LLUUID itemID);
|
public delegate void RemoveScript(uint localID, LLUUID itemID);
|
||||||
|
|
||||||
public event RemoveScript OnRemoveScript;
|
public event RemoveScript OnRemoveScript;
|
||||||
|
|
||||||
|
public delegate void StartScript(uint localID, LLUUID itemID);
|
||||||
|
|
||||||
|
public event StartScript OnStartScript;
|
||||||
|
|
||||||
|
public delegate void StopScript(uint localID, LLUUID itemID);
|
||||||
|
|
||||||
|
public event StopScript OnStopScript;
|
||||||
|
|
||||||
public delegate bool SceneGroupMoved(LLUUID groupID, LLVector3 delta);
|
public delegate bool SceneGroupMoved(LLUUID groupID, LLVector3 delta);
|
||||||
|
|
||||||
public event SceneGroupMoved OnSceneGroupMove;
|
public event SceneGroupMoved OnSceneGroupMove;
|
||||||
|
@ -332,8 +337,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
private ObjectDeGrabDelegate handlerObjectDeGrab = null; //OnObjectDeGrab;
|
private ObjectDeGrabDelegate handlerObjectDeGrab = null; //OnObjectDeGrab;
|
||||||
private ScriptResetDelegate handlerScriptReset = null; // OnScriptReset
|
private ScriptResetDelegate handlerScriptReset = null; // OnScriptReset
|
||||||
private NewRezScript handlerRezScript = null; //OnRezScript;
|
private NewRezScript handlerRezScript = null; //OnRezScript;
|
||||||
private RezEvent handlerOnRezEvent = null; //OnRezEvent;
|
|
||||||
private RemoveScript handlerRemoveScript = null; //OnRemoveScript;
|
private RemoveScript handlerRemoveScript = null; //OnRemoveScript;
|
||||||
|
private StartScript handlerStartScript = null; //OnStartScript;
|
||||||
|
private StopScript handlerStopScript = null; //OnStopScript;
|
||||||
private SceneGroupMoved handlerSceneGroupMove = null; //OnSceneGroupMove;
|
private SceneGroupMoved handlerSceneGroupMove = null; //OnSceneGroupMove;
|
||||||
private SceneGroupGrabed handlerSceneGroupGrab = null; //OnSceneGroupGrab;
|
private SceneGroupGrabed handlerSceneGroupGrab = null; //OnSceneGroupGrab;
|
||||||
private LandObjectAdded handlerLandObjectAdded = null; //OnLandObjectAdded;
|
private LandObjectAdded handlerLandObjectAdded = null; //OnLandObjectAdded;
|
||||||
|
@ -523,21 +529,30 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TriggerRezScript(uint localID, LLUUID itemID, string script)
|
public void TriggerRezScript(uint localID, LLUUID itemID, string script, int startParam, bool postOnRez)
|
||||||
{
|
{
|
||||||
handlerRezScript = OnRezScript;
|
handlerRezScript = OnRezScript;
|
||||||
if (handlerRezScript != null)
|
if (handlerRezScript != null)
|
||||||
{
|
{
|
||||||
handlerRezScript(localID, itemID, script);
|
handlerRezScript(localID, itemID, script, startParam, postOnRez);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TriggerOnRezEvent(uint localID, LLUUID itemID, int param)
|
public void TriggerStartScript(uint localID, LLUUID itemID)
|
||||||
{
|
{
|
||||||
handlerOnRezEvent = OnRezEvent;
|
handlerStartScript = OnStartScript;
|
||||||
if (handlerOnRezEvent != null)
|
if (handlerStartScript != null)
|
||||||
{
|
{
|
||||||
handlerOnRezEvent(localID, itemID, param);
|
handlerStartScript(localID, itemID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void TriggerStopScript(uint localID, LLUUID itemID)
|
||||||
|
{
|
||||||
|
handlerStopScript = OnStopScript;
|
||||||
|
if (handlerStopScript != null)
|
||||||
|
{
|
||||||
|
handlerStopScript(localID, itemID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1522,7 +1522,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
copy.UpdateGroupRotation(new LLQuaternion(rot.x, rot.y, rot.z, rot.w));
|
copy.UpdateGroupRotation(new LLQuaternion(rot.x, rot.y, rot.z, rot.w));
|
||||||
}
|
}
|
||||||
|
|
||||||
copy.StartScripts();
|
copy.CreateScriptInstances(0, false);
|
||||||
copy.HasGroupChanged = true;
|
copy.HasGroupChanged = true;
|
||||||
copy.ScheduleGroupForFullUpdate();
|
copy.ScheduleGroupForFullUpdate();
|
||||||
return copy;
|
return copy;
|
||||||
|
|
|
@ -46,7 +46,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Start all the scripts in the scene which should be started.
|
/// Start all the scripts in the scene which should be started.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void StartScripts()
|
public void CreateScriptInstances()
|
||||||
{
|
{
|
||||||
m_log.Info("[PRIM INVENTORY]: Starting scripts in scene");
|
m_log.Info("[PRIM INVENTORY]: Starting scripts in scene");
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
if (group is SceneObjectGroup)
|
if (group is SceneObjectGroup)
|
||||||
{
|
{
|
||||||
((SceneObjectGroup) group).StartScripts();
|
((SceneObjectGroup) group).CreateScriptInstances(0, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -234,6 +234,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
AssetBase asset = CreateAsset(item.Name, item.Description, (sbyte)AssetType.LSLText, data);
|
AssetBase asset = CreateAsset(item.Name, item.Description, (sbyte)AssetType.LSLText, data);
|
||||||
AssetCache.AddAsset(asset);
|
AssetCache.AddAsset(asset);
|
||||||
|
|
||||||
|
if (isScriptRunning)
|
||||||
|
{
|
||||||
|
part.RemoveScriptInstance(item.ItemID);
|
||||||
|
}
|
||||||
// Update item with new asset
|
// Update item with new asset
|
||||||
item.AssetID = asset.FullID;
|
item.AssetID = asset.FullID;
|
||||||
group.UpdateInventoryItem(item);
|
group.UpdateInventoryItem(item);
|
||||||
|
@ -242,8 +246,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
// Trigger rerunning of script (use TriggerRezScript event, see RezScript)
|
// Trigger rerunning of script (use TriggerRezScript event, see RezScript)
|
||||||
if (isScriptRunning)
|
if (isScriptRunning)
|
||||||
{
|
{
|
||||||
group.StopScript(part.LocalId, item.ItemID);
|
part.CreateScriptInstance(item.ItemID, 0, false);
|
||||||
group.StartScript(part.LocalId, item.ItemID);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1219,7 +1222,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
if (ExternalChecks.ExternalChecksCanRunScript(item.ID, part.UUID, remoteClient.AgentId))
|
if (ExternalChecks.ExternalChecksCanRunScript(item.ID, part.UUID, remoteClient.AgentId))
|
||||||
{
|
{
|
||||||
part.ParentGroup.AddInventoryItem(remoteClient, localID, item, copyID);
|
part.ParentGroup.AddInventoryItem(remoteClient, localID, item, copyID);
|
||||||
part.ParentGroup.StartScript(localID, copyID);
|
// TODO: set this to "true" when scripts in inventory have persistent state to fire on_rez
|
||||||
|
part.CreateScriptInstance(copyID, 0, false);
|
||||||
part.GetProperties(remoteClient);
|
part.GetProperties(remoteClient);
|
||||||
|
|
||||||
// m_log.InfoFormat("[PRIMINVENTORY]: " +
|
// m_log.InfoFormat("[PRIMINVENTORY]: " +
|
||||||
|
@ -1280,7 +1284,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
if (ExternalChecks.ExternalChecksCanRunScript(taskItem.AssetID, part.UUID, remoteClient.AgentId))
|
if (ExternalChecks.ExternalChecksCanRunScript(taskItem.AssetID, part.UUID, remoteClient.AgentId))
|
||||||
{
|
{
|
||||||
part.StartScript(taskItem);
|
part.CreateScriptInstance(taskItem, 0, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1312,6 +1316,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Must own the object, and have modify rights
|
||||||
|
if(srcPart.OwnerID != destPart.OwnerID)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if((destPart.OwnerMask & (uint)PermissionMask.Modify) == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
if (destPart.ScriptAccessPin != pin)
|
if (destPart.ScriptAccessPin != pin)
|
||||||
{
|
{
|
||||||
m_log.WarnFormat(
|
m_log.WarnFormat(
|
||||||
|
@ -1362,17 +1373,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
destTaskItem.InvType = srcTaskItem.InvType;
|
destTaskItem.InvType = srcTaskItem.InvType;
|
||||||
destTaskItem.Type = srcTaskItem.Type;
|
destTaskItem.Type = srcTaskItem.Type;
|
||||||
|
|
||||||
// need something like destPart.AddInventoryItemExclusive(destTaskItem);
|
destPart.AddInventoryItemExclusive(destTaskItem);
|
||||||
// this function is supposed to silently overwrite an existing script with the same name
|
|
||||||
|
|
||||||
destPart.AddInventoryItem(destTaskItem);
|
|
||||||
|
|
||||||
if ( running > 0 )
|
if ( running > 0 )
|
||||||
{
|
{
|
||||||
if (ExternalChecks.ExternalChecksCanRunScript(destTaskItem.AssetID, destPart.UUID, destPart.OwnerID))
|
if (ExternalChecks.ExternalChecksCanRunScript(destTaskItem.AssetID, destPart.UUID, destPart.OwnerID))
|
||||||
{
|
{
|
||||||
// why doesn't the start_param propogate?
|
destPart.CreateScriptInstance(destTaskItem, 0, false);
|
||||||
destPart.StartScript(destTaskItem, start_param);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1874,7 +1881,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
//group.ApplyPhysics(m_physicalPrim);
|
//group.ApplyPhysics(m_physicalPrim);
|
||||||
}
|
}
|
||||||
|
|
||||||
group.StartScripts();
|
// TODO: make this true to fire on_rez when scripts have state while in inventory
|
||||||
|
group.CreateScriptInstances(0, false);
|
||||||
|
|
||||||
if (!attachment)
|
if (!attachment)
|
||||||
rootPart.ScheduleFullUpdate();
|
rootPart.ScheduleFullUpdate();
|
||||||
|
@ -1919,9 +1927,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
AddNewSceneObject(group, true);
|
AddNewSceneObject(group, true);
|
||||||
|
|
||||||
// Set the startup parameter for on_rez event and llGetStartParameter() function
|
|
||||||
group.StartParameter = param;
|
|
||||||
|
|
||||||
// we set it's position in world.
|
// we set it's position in world.
|
||||||
group.AbsolutePosition = pos;
|
group.AbsolutePosition = pos;
|
||||||
|
|
||||||
|
@ -1970,7 +1975,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
group.UpdateGroupRotation(rot);
|
group.UpdateGroupRotation(rot);
|
||||||
group.ApplyPhysics(m_physicalPrim);
|
group.ApplyPhysics(m_physicalPrim);
|
||||||
group.Velocity = vel;
|
group.Velocity = vel;
|
||||||
group.StartScripts(param);
|
group.CreateScriptInstances(param, true);
|
||||||
rootPart.ScheduleFullUpdate();
|
rootPart.ScheduleFullUpdate();
|
||||||
return rootPart.ParentGroup;
|
return rootPart.ParentGroup;
|
||||||
}
|
}
|
||||||
|
@ -2120,5 +2125,26 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void GetScriptRunning(IClientAPI controllingClient, LLUUID objectID, LLUUID itemID)
|
||||||
|
{
|
||||||
|
IScriptModule scriptModule = RequestModuleInterface<IScriptModule>();
|
||||||
|
if(scriptModule == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
controllingClient.SendScriptRunningReply(objectID, itemID,
|
||||||
|
scriptModule.GetScriptRunning(objectID, itemID));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetScriptRunning(IClientAPI controllingClient, LLUUID objectID, LLUUID itemID, bool running)
|
||||||
|
{
|
||||||
|
SceneObjectPart part = GetSceneObjectPart(objectID);
|
||||||
|
if(part == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(running)
|
||||||
|
EventManager.TriggerStartScript(part.LocalId, itemID);
|
||||||
|
else
|
||||||
|
EventManager.TriggerStopScript(part.LocalId, itemID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -553,7 +553,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
if (ent is SceneObjectGroup)
|
if (ent is SceneObjectGroup)
|
||||||
{
|
{
|
||||||
((SceneObjectGroup)ent).StopScripts();
|
((SceneObjectGroup)ent).RemoveScriptInstances();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -567,7 +567,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
if (ent is SceneObjectGroup)
|
if (ent is SceneObjectGroup)
|
||||||
{
|
{
|
||||||
((SceneObjectGroup)ent).StartScripts();
|
((SceneObjectGroup)ent).CreateScriptInstances(0, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2029,6 +2029,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
client.OnObjectGroupRequest += m_innerScene.HandleObjectGroupUpdate;
|
client.OnObjectGroupRequest += m_innerScene.HandleObjectGroupUpdate;
|
||||||
client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel;
|
client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel;
|
||||||
client.OnScriptReset += ProcessScriptReset;
|
client.OnScriptReset += ProcessScriptReset;
|
||||||
|
client.OnGetScriptRunning += GetScriptRunning;
|
||||||
|
client.OnSetScriptRunning += SetScriptRunning;
|
||||||
|
|
||||||
// EventManager.TriggerOnNewClient(client);
|
// EventManager.TriggerOnNewClient(client);
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,6 +72,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
(uint)LLObject.ObjectFlags.ObjectMove |
|
(uint)LLObject.ObjectFlags.ObjectMove |
|
||||||
(uint)LLObject.ObjectFlags.ObjectTransfer |
|
(uint)LLObject.ObjectFlags.ObjectTransfer |
|
||||||
(uint)LLObject.ObjectFlags.ObjectYouOwner |
|
(uint)LLObject.ObjectFlags.ObjectYouOwner |
|
||||||
|
(uint)LLObject.ObjectFlags.ObjectAnyOwner |
|
||||||
(uint)LLObject.ObjectFlags.ObjectOwnerModify |
|
(uint)LLObject.ObjectFlags.ObjectOwnerModify |
|
||||||
(uint)LLObject.ObjectFlags.ObjectYouOfficer;
|
(uint)LLObject.ObjectFlags.ObjectYouOfficer;
|
||||||
|
|
||||||
|
|
|
@ -38,115 +38,32 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Start a given script.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="localID">
|
|
||||||
/// A <see cref="System.UInt32"/>
|
|
||||||
/// </param>
|
|
||||||
public void StartScript(uint localID, LLUUID itemID)
|
|
||||||
{
|
|
||||||
SceneObjectPart part = GetChildPart(localID);
|
|
||||||
if (part != null)
|
|
||||||
{
|
|
||||||
|
|
||||||
part.StartScript(itemID);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_log.ErrorFormat(
|
|
||||||
"[PRIM INVENTORY]: " +
|
|
||||||
"Couldn't find part {0} in object group {1}, {2} to start script with ID {3}",
|
|
||||||
localID, Name, UUID, itemID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// /// Start a given script.
|
|
||||||
// /// </summary>
|
|
||||||
// /// <param name="localID">
|
|
||||||
// /// A <see cref="System.UInt32"/>
|
|
||||||
// /// </param>
|
|
||||||
// public void StartScript(LLUUID partID, LLUUID itemID)
|
|
||||||
// {
|
|
||||||
// SceneObjectPart part = GetChildPart(partID);
|
|
||||||
// if (part != null)
|
|
||||||
// {
|
|
||||||
// part.StartScript(itemID);
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// m_log.ErrorFormat(
|
|
||||||
// "[PRIM INVENTORY]: " +
|
|
||||||
// "Couldn't find part {0} in object group {1}, {2} to start script with ID {3}",
|
|
||||||
// localID, Name, UUID, itemID);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Start the scripts contained in all the prims in this group.
|
/// Start the scripts contained in all the prims in this group.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void StartScripts()
|
public void CreateScriptInstances(int startParam, bool postOnRez)
|
||||||
{
|
{
|
||||||
// Don't start scripts if they're turned off in the region!
|
// Don't start scripts if they're turned off in the region!
|
||||||
if (!((m_scene.RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts))
|
if (!((m_scene.RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts))
|
||||||
{
|
{
|
||||||
foreach (SceneObjectPart part in m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
part.StartScripts();
|
part.CreateScriptInstances(startParam, postOnRez);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
public void RemoveScriptInstances()
|
||||||
/// Start the scripts contained in all the prims in this group.
|
|
||||||
/// </summary>
|
|
||||||
public void StartScripts(int param)
|
|
||||||
{
|
|
||||||
// Don't start scripts if they're turned off in the region!
|
|
||||||
if (!((m_scene.RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts))
|
|
||||||
{
|
|
||||||
foreach (SceneObjectPart part in m_parts.Values)
|
|
||||||
{
|
|
||||||
part.StartScripts(param);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void StopScripts()
|
|
||||||
{
|
{
|
||||||
lock (m_parts)
|
lock (m_parts)
|
||||||
{
|
{
|
||||||
foreach (SceneObjectPart part in m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
part.StopScripts();
|
part.RemoveScriptInstances();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Start a given script.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="localID">
|
|
||||||
/// A <see cref="System.UInt32"/>
|
|
||||||
/// </param>
|
|
||||||
public void StopScript(uint partID, LLUUID itemID)
|
|
||||||
{
|
|
||||||
SceneObjectPart part = GetChildPart(partID);
|
|
||||||
if (part != null)
|
|
||||||
{
|
|
||||||
part.StopScript(itemID);
|
|
||||||
part.RemoveScriptEvents(itemID);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_log.ErrorFormat(
|
|
||||||
"[PRIM INVENTORY]: " +
|
|
||||||
"Couldn't find part {0} in object group {1}, {2} to stop script with ID {3}",
|
|
||||||
partID, Name, UUID, itemID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -114,8 +114,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
private bool m_scriptListens_atTarget = false;
|
private bool m_scriptListens_atTarget = false;
|
||||||
private bool m_scriptListens_notAtTarget = false;
|
private bool m_scriptListens_notAtTarget = false;
|
||||||
|
|
||||||
private int m_startparameter = 0;
|
|
||||||
|
|
||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -136,16 +134,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected bool m_isSelected = false;
|
protected bool m_isSelected = false;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Set start parameter for on_rez event and llGetStartParameter()
|
|
||||||
/// </summary>
|
|
||||||
[XmlIgnore]
|
|
||||||
public int StartParameter
|
|
||||||
{
|
|
||||||
get { return m_startparameter; }
|
|
||||||
set { m_startparameter = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of prims in this group
|
/// Number of prims in this group
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -937,7 +925,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
foreach (SceneObjectPart part in m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
part.StopScripts();
|
part.RemoveScriptInstances();
|
||||||
|
|
||||||
List<ScenePresence> avatars = Scene.GetScenePresences();
|
List<ScenePresence> avatars = Scene.GetScenePresences();
|
||||||
for (int i = 0; i < avatars.Count; i++)
|
for (int i = 0; i < avatars.Count; i++)
|
||||||
|
|
|
@ -137,7 +137,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Start all the scripts contained in this prim's inventory
|
/// Start all the scripts contained in this prim's inventory
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void StartScripts()
|
public void CreateScriptInstances(int startParam, bool postOnRez)
|
||||||
{
|
{
|
||||||
lock (m_taskInventory)
|
lock (m_taskInventory)
|
||||||
{
|
{
|
||||||
|
@ -146,25 +146,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
// XXX more hardcoding badness. Should be an enum in TaskInventoryItem
|
// XXX more hardcoding badness. Should be an enum in TaskInventoryItem
|
||||||
if (10 == item.Type)
|
if (10 == item.Type)
|
||||||
{
|
{
|
||||||
StartScript(item);
|
CreateScriptInstance(item, startParam, postOnRez);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Start all the scripts contained in this prim's inventory
|
|
||||||
/// </summary>
|
|
||||||
public void StartScripts(int param)
|
|
||||||
{
|
|
||||||
lock (m_taskInventory)
|
|
||||||
{
|
|
||||||
foreach (TaskInventoryItem item in m_taskInventory.Values)
|
|
||||||
{
|
|
||||||
// XXX more hardcoding badness. Should be an enum in TaskInventoryItem
|
|
||||||
if (10 == item.Type)
|
|
||||||
{
|
|
||||||
StartScript(item, param);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -173,7 +155,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stop all the scripts in this prim.
|
/// Stop all the scripts in this prim.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void StopScripts()
|
public void RemoveScriptInstances()
|
||||||
{
|
{
|
||||||
lock (m_taskInventory)
|
lock (m_taskInventory)
|
||||||
{
|
{
|
||||||
|
@ -181,7 +163,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
if (10 == item.Type)
|
if (10 == item.Type)
|
||||||
{
|
{
|
||||||
StopScript(item.ItemID);
|
RemoveScriptInstance(item.ItemID);
|
||||||
RemoveScriptEvents(item.ItemID);
|
RemoveScriptEvents(item.ItemID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -193,13 +175,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="item"></param>
|
/// <param name="item"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public void StartScript(TaskInventoryItem item, int param)
|
|
||||||
{
|
|
||||||
StartScript(item);
|
|
||||||
m_parentGroup.Scene.EventManager.TriggerOnRezEvent(LocalId, item.ItemID, param);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void StartScript(TaskInventoryItem item)
|
public void CreateScriptInstance(TaskInventoryItem item, int startParam, bool postOnRez)
|
||||||
{
|
{
|
||||||
// m_log.InfoFormat(
|
// m_log.InfoFormat(
|
||||||
// "[PRIM INVENTORY]: " +
|
// "[PRIM INVENTORY]: " +
|
||||||
|
@ -223,7 +200,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string script = Helpers.FieldToUTF8String(asset.Data);
|
string script = Helpers.FieldToUTF8String(asset.Data);
|
||||||
m_parentGroup.Scene.EventManager.TriggerRezScript(LocalId,item.ItemID,script);
|
m_parentGroup.Scene.EventManager.TriggerRezScript(LocalId,item.ItemID,script, startParam, postOnRez);
|
||||||
m_parentGroup.AddActiveScriptCount(1);
|
m_parentGroup.AddActiveScriptCount(1);
|
||||||
ScheduleFullUpdate();
|
ScheduleFullUpdate();
|
||||||
}
|
}
|
||||||
|
@ -237,13 +214,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="itemId">
|
/// <param name="itemId">
|
||||||
/// A <see cref="LLUUID"/>
|
/// A <see cref="LLUUID"/>
|
||||||
/// </param>
|
/// </param>
|
||||||
public void StartScript(LLUUID itemId)
|
public void CreateScriptInstance(LLUUID itemId, int startParam, bool postOnRez)
|
||||||
{
|
{
|
||||||
lock (m_taskInventory)
|
lock (m_taskInventory)
|
||||||
{
|
{
|
||||||
if (m_taskInventory.ContainsKey(itemId))
|
if (m_taskInventory.ContainsKey(itemId))
|
||||||
{
|
{
|
||||||
StartScript(m_taskInventory[itemId]);
|
CreateScriptInstance(m_taskInventory[itemId], startParam, postOnRez);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -260,7 +237,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// Stop a script which is in this prim's inventory.
|
/// Stop a script which is in this prim's inventory.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="itemId"></param>
|
/// <param name="itemId"></param>
|
||||||
public void StopScript(LLUUID itemId)
|
public void RemoveScriptInstance(LLUUID itemId)
|
||||||
{
|
{
|
||||||
if (m_taskInventory.ContainsKey(itemId))
|
if (m_taskInventory.ContainsKey(itemId))
|
||||||
{
|
{
|
||||||
|
@ -330,6 +307,35 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
ParentGroup.HasGroupChanged = true;
|
ParentGroup.HasGroupChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AddInventoryItemExclusive(TaskInventoryItem item)
|
||||||
|
{
|
||||||
|
item.ParentID = UUID;
|
||||||
|
item.ParentPartID = UUID;
|
||||||
|
|
||||||
|
List<TaskInventoryItem> il = new List<TaskInventoryItem>(m_taskInventory.Values);
|
||||||
|
foreach(TaskInventoryItem i in il)
|
||||||
|
{
|
||||||
|
if(i.Name == item.Name)
|
||||||
|
{
|
||||||
|
if(i.Type == 10)
|
||||||
|
RemoveScriptInstance(i.ItemID);
|
||||||
|
RemoveInventoryItem(i.ItemID);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lock (m_taskInventory)
|
||||||
|
{
|
||||||
|
m_taskInventory.Add(item.ItemID, item);
|
||||||
|
TriggerScriptChangedEvent(Changed.INVENTORY);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_inventorySerial++;
|
||||||
|
//m_inventorySerial += 2;
|
||||||
|
HasInventoryChanged = true;
|
||||||
|
ParentGroup.HasGroupChanged = true;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Restore a whole collection of items to the prim's inventory at once.
|
/// Restore a whole collection of items to the prim's inventory at once.
|
||||||
/// We assume that the items already have all their fields correctly filled out.
|
/// We assume that the items already have all their fields correctly filled out.
|
||||||
|
|
|
@ -196,6 +196,8 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||||
public event EstateDebugRegionRequest OnEstateDebugRegionRequest;
|
public event EstateDebugRegionRequest OnEstateDebugRegionRequest;
|
||||||
public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest;
|
public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest;
|
||||||
public event ScriptReset OnScriptReset;
|
public event ScriptReset OnScriptReset;
|
||||||
|
public event GetScriptRunning OnGetScriptRunning;
|
||||||
|
public event SetScriptRunning OnSetScriptRunning;
|
||||||
public event UpdateVector OnAutoPilotGo;
|
public event UpdateVector OnAutoPilotGo;
|
||||||
|
|
||||||
#pragma warning restore 67
|
#pragma warning restore 67
|
||||||
|
@ -776,6 +778,10 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SendScriptRunningReply(LLUUID objectID, LLUUID itemID, bool running)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public void SendAsset(AssetRequestToClient req)
|
public void SendAsset(AssetRequestToClient req)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -2344,8 +2344,8 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
public LSL_Types.LSLInteger llGetStartParameter()
|
public LSL_Types.LSLInteger llGetStartParameter()
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
// NotImplemented("llGetStartParameter");
|
NotImplemented("llGetStartParameter");
|
||||||
return m_host.ParentGroup.StartParameter;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void llGodLikeRezObject(string inventory, LSL_Types.Vector3 pos)
|
public void llGodLikeRezObject(string inventory, LSL_Types.Vector3 pos)
|
||||||
|
|
|
@ -186,7 +186,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||||
myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_end", detstruct, new object[] { new LSL_Types.LSLInteger(1) });
|
myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_end", detstruct, new object[] { new LSL_Types.LSLInteger(1) });
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnRezScript(uint localID, LLUUID itemID, string script)
|
public void OnRezScript(uint localID, LLUUID itemID, string script, int startParam, bool postOnRez)
|
||||||
{
|
{
|
||||||
Console.WriteLine("OnRezScript localID: " + localID + " LLUID: " + itemID.ToString() + " Size: " +
|
Console.WriteLine("OnRezScript localID: " + localID + " LLUID: " + itemID.ToString() + " Size: " +
|
||||||
script.Length);
|
script.Length);
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
public interface RemoteEvents
|
public interface RemoteEvents
|
||||||
{
|
{
|
||||||
void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient);
|
void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient);
|
||||||
void OnRezScript(uint localID, LLUUID itemID, string script);
|
void OnRezScript(uint localID, LLUUID itemID, string script, int startParam, bool postOnRez);
|
||||||
void OnRemoveScript(uint localID, LLUUID itemID);
|
void OnRemoveScript(uint localID, LLUUID itemID);
|
||||||
void state_exit(uint localID);
|
void state_exit(uint localID);
|
||||||
void touch(uint localID, LLUUID itemID);
|
void touch(uint localID, LLUUID itemID);
|
||||||
|
|
|
@ -53,6 +53,7 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
|
||||||
void SetScriptState(LLUUID itemID, bool state);
|
void SetScriptState(LLUUID itemID, bool state);
|
||||||
bool GetScriptState(LLUUID itemID);
|
bool GetScriptState(LLUUID itemID);
|
||||||
void SetState(LLUUID itemID, string newState);
|
void SetState(LLUUID itemID, string newState);
|
||||||
|
int GetStartParameter(LLUUID itemID);
|
||||||
|
|
||||||
DetectParams GetDetectParams(LLUUID item, int number);
|
DetectParams GetDetectParams(LLUUID item, int number);
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnRezScript(uint localID, LLUUID itemID, string script)
|
public void OnRezScript(uint localID, LLUUID itemID, string script, int startParam, bool postOnRez)
|
||||||
{
|
{
|
||||||
// WE ARE CREATING A NEW SCRIPT ... CREATE SCRIPT, GET A REMOTEID THAT WE MAP FROM LOCALID
|
// WE ARE CREATING A NEW SCRIPT ... CREATE SCRIPT, GET A REMOTEID THAT WE MAP FROM LOCALID
|
||||||
myScriptEngine.Log.Info("[RemoteEngine]: Creating new script (with connection)");
|
myScriptEngine.Log.Info("[RemoteEngine]: Creating new script (with connection)");
|
||||||
|
|
|
@ -2200,8 +2200,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
public LSL_Types.LSLInteger llGetStartParameter()
|
public LSL_Types.LSLInteger llGetStartParameter()
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
// NotImplemented("llGetStartParameter");
|
return m_ScriptEngine.GetStartParameter(m_itemID);
|
||||||
return m_host.ParentGroup.StartParameter;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void llGodLikeRezObject(string inventory, LSL_Types.Vector3 pos)
|
public void llGodLikeRezObject(string inventory, LSL_Types.Vector3 pos)
|
||||||
|
|
|
@ -53,7 +53,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
myScriptEngine.Log.Info("[XEngine] Hooking up to server events");
|
myScriptEngine.Log.Info("[XEngine] Hooking up to server events");
|
||||||
myScriptEngine.World.EventManager.OnObjectGrab += touch_start;
|
myScriptEngine.World.EventManager.OnObjectGrab += touch_start;
|
||||||
myScriptEngine.World.EventManager.OnObjectDeGrab += touch_end;
|
myScriptEngine.World.EventManager.OnObjectDeGrab += touch_end;
|
||||||
myScriptEngine.World.EventManager.OnRezEvent += on_rez;
|
|
||||||
myScriptEngine.World.EventManager.OnScriptChangedEvent += changed;
|
myScriptEngine.World.EventManager.OnScriptChangedEvent += changed;
|
||||||
myScriptEngine.World.EventManager.OnScriptAtTargetEvent += at_target;
|
myScriptEngine.World.EventManager.OnScriptAtTargetEvent += at_target;
|
||||||
myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target;
|
myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target;
|
||||||
|
@ -254,14 +253,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
// timer: not handled here
|
// timer: not handled here
|
||||||
// listen: not handled here
|
// listen: not handled here
|
||||||
|
|
||||||
public void on_rez(uint localID, LLUUID itemID, int startParam)
|
|
||||||
{
|
|
||||||
myScriptEngine.PostObjectEvent(localID, new EventParams(
|
|
||||||
"on_rez",new object[] {
|
|
||||||
new LSL_Types.LSLInteger(startParam)},
|
|
||||||
new DetectParams[0]));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void control(uint localID, LLUUID itemID, LLUUID agentID, uint held, uint change)
|
public void control(uint localID, LLUUID itemID, LLUUID agentID, uint held, uint change)
|
||||||
{
|
{
|
||||||
myScriptEngine.PostObjectEvent(localID, new EventParams(
|
myScriptEngine.PostObjectEvent(localID, new EventParams(
|
||||||
|
|
|
@ -49,7 +49,7 @@ using OpenSim.Region.ScriptEngine.Interfaces;
|
||||||
|
|
||||||
namespace OpenSim.Region.ScriptEngine.XEngine
|
namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
{
|
{
|
||||||
public class XEngine : IRegionModule, IScriptEngine
|
public class XEngine : IScriptModule, IScriptEngine
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
|
@ -64,6 +64,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
private int m_EventLimit;
|
private int m_EventLimit;
|
||||||
private bool m_KillTimedOutScripts;
|
private bool m_KillTimedOutScripts;
|
||||||
public AsyncCommandManager m_AsyncCommands;
|
public AsyncCommandManager m_AsyncCommands;
|
||||||
|
bool m_firstStart = true;
|
||||||
|
|
||||||
private static List<XEngine> m_ScriptEngines =
|
private static List<XEngine> m_ScriptEngines =
|
||||||
new List<XEngine>();
|
new List<XEngine>();
|
||||||
|
@ -93,6 +94,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
private Dictionary<LLUUID, List<LLUUID> > m_DomainScripts =
|
private Dictionary<LLUUID, List<LLUUID> > m_DomainScripts =
|
||||||
new Dictionary<LLUUID, List<LLUUID> >();
|
new Dictionary<LLUUID, List<LLUUID> >();
|
||||||
|
|
||||||
|
private Queue m_CompileQueue = new Queue(100);
|
||||||
|
IWorkItemResult m_CurrentCompile = null;
|
||||||
|
|
||||||
public string ScriptEngineName
|
public string ScriptEngineName
|
||||||
{
|
{
|
||||||
get { return "XEngine"; }
|
get { return "XEngine"; }
|
||||||
|
@ -202,6 +206,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
m_Scene.EventManager.OnRezScript += OnRezScript;
|
m_Scene.EventManager.OnRezScript += OnRezScript;
|
||||||
m_Scene.EventManager.OnRemoveScript += OnRemoveScript;
|
m_Scene.EventManager.OnRemoveScript += OnRemoveScript;
|
||||||
m_Scene.EventManager.OnScriptReset += OnScriptReset;
|
m_Scene.EventManager.OnScriptReset += OnScriptReset;
|
||||||
|
m_Scene.EventManager.OnStartScript += OnStartScript;
|
||||||
|
m_Scene.EventManager.OnStopScript += OnStopScript;
|
||||||
|
|
||||||
m_AsyncCommands = new AsyncCommandManager(this);
|
m_AsyncCommands = new AsyncCommandManager(this);
|
||||||
|
|
||||||
|
@ -217,6 +223,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
m_ThreadPool.QueueWorkItem(new WorkItemCallback(
|
m_ThreadPool.QueueWorkItem(new WorkItemCallback(
|
||||||
this.DoBackup), new Object[] { saveTime });
|
this.DoBackup), new Object[] { saveTime });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scene.RegisterModuleInterface<IScriptModule>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PostInitialise()
|
public void PostInitialise()
|
||||||
|
@ -314,23 +322,90 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
get { return m_MaxScriptQueue; }
|
get { return m_MaxScriptQueue; }
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
public void OnRezScript(uint localID, LLUUID itemID, string script, int startParam, bool postOnRez)
|
||||||
// Hooks
|
|
||||||
//
|
|
||||||
public void OnRezScript(uint localID, LLUUID itemID, string script)
|
|
||||||
{
|
{
|
||||||
// m_ThreadPool.QueueWorkItem(new WorkItemCallback(
|
Object[] parms = new Object[]
|
||||||
// this.DoOnRezScript), new Object[]
|
{ localID, itemID, script, startParam, postOnRez};
|
||||||
// { localID, itemID, script});
|
|
||||||
DoOnRezScript(new Object[] { localID, itemID, script});
|
lock(m_CompileQueue)
|
||||||
|
{
|
||||||
|
m_CompileQueue.Enqueue(parms);
|
||||||
|
if(m_CurrentCompile == null)
|
||||||
|
{
|
||||||
|
if(m_firstStart)
|
||||||
|
{
|
||||||
|
m_firstStart = false;
|
||||||
|
m_CurrentCompile = m_ThreadPool.QueueWorkItem(
|
||||||
|
new WorkItemCallback(
|
||||||
|
this.DoScriptWait), new Object[0]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m_CurrentCompile = m_ThreadPool.QueueWorkItem(
|
||||||
|
new WorkItemCallback(
|
||||||
|
this.DoOnRezScriptQueue), new Object[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private object DoOnRezScript(object parm)
|
public Object DoScriptWait(Object dummy)
|
||||||
|
{
|
||||||
|
Thread.Sleep(30000);
|
||||||
|
|
||||||
|
lock(m_CompileQueue)
|
||||||
|
{
|
||||||
|
if(m_CompileQueue.Count > 0)
|
||||||
|
{
|
||||||
|
m_CurrentCompile = m_ThreadPool.QueueWorkItem(
|
||||||
|
new WorkItemCallback(
|
||||||
|
this.DoOnRezScriptQueue), new Object[0]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_CurrentCompile = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object DoOnRezScriptQueue(Object dummy)
|
||||||
|
{
|
||||||
|
Object o;
|
||||||
|
lock(m_CompileQueue)
|
||||||
|
{
|
||||||
|
o = m_CompileQueue.Dequeue();
|
||||||
|
if(o == null)
|
||||||
|
{
|
||||||
|
m_CurrentCompile = null;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DoOnRezScript(o);
|
||||||
|
|
||||||
|
lock(m_CompileQueue)
|
||||||
|
{
|
||||||
|
if(m_CompileQueue.Count > 0)
|
||||||
|
{
|
||||||
|
m_CurrentCompile = m_ThreadPool.QueueWorkItem(
|
||||||
|
new WorkItemCallback(
|
||||||
|
this.DoOnRezScriptQueue), new Object[0]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_CurrentCompile = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool DoOnRezScript(object parm)
|
||||||
{
|
{
|
||||||
Object[] p = (Object[])parm;
|
Object[] p = (Object[])parm;
|
||||||
uint localID = (uint)p[0];
|
uint localID = (uint)p[0];
|
||||||
LLUUID itemID = (LLUUID)p[1];
|
LLUUID itemID = (LLUUID)p[1];
|
||||||
string script =(string)p[2];
|
string script =(string)p[2];
|
||||||
|
int startParam = (int)p[3];
|
||||||
|
bool postOnRez = (bool)p[4];
|
||||||
|
|
||||||
// Get the asset ID of the script, so we can check if we
|
// Get the asset ID of the script, so we can check if we
|
||||||
// already have it.
|
// already have it.
|
||||||
|
@ -427,7 +502,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
part.UUID, itemID, assetID, assembly,
|
part.UUID, itemID, assetID, assembly,
|
||||||
m_AppDomains[appDomain],
|
m_AppDomains[appDomain],
|
||||||
part.ParentGroup.RootPart.Name,
|
part.ParentGroup.RootPart.Name,
|
||||||
item.Name, XScriptInstance.StateSource.NewRez);
|
item.Name, startParam, postOnRez,
|
||||||
|
XScriptInstance.StateSource.NewRez);
|
||||||
|
|
||||||
m_log.DebugFormat("[XEngine] Loaded script {0}.{1}",
|
m_log.DebugFormat("[XEngine] Loaded script {0}.{1}",
|
||||||
part.ParentGroup.RootPart.Name, item.Name);
|
part.ParentGroup.RootPart.Name, item.Name);
|
||||||
|
@ -505,6 +581,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
ResetScript(itemID);
|
ResetScript(itemID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void OnStartScript(uint localID, LLUUID itemID)
|
||||||
|
{
|
||||||
|
StartScript(itemID);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnStopScript(uint localID, LLUUID itemID)
|
||||||
|
{
|
||||||
|
StopScript(itemID);
|
||||||
|
}
|
||||||
|
|
||||||
private void CleanAssemblies()
|
private void CleanAssemblies()
|
||||||
{
|
{
|
||||||
List<LLUUID> assetIDList = new List<LLUUID>(m_Assemblies.Keys);
|
List<LLUUID> assetIDList = new List<LLUUID>(m_Assemblies.Keys);
|
||||||
|
@ -674,7 +760,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
if (running)
|
if (running)
|
||||||
instance.Start();
|
instance.Start();
|
||||||
else
|
else
|
||||||
instance.Stop(500);
|
instance.Stop(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -693,6 +779,20 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
instance.ResetScript();
|
instance.ResetScript();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void StartScript(LLUUID itemID)
|
||||||
|
{
|
||||||
|
XScriptInstance instance = GetInstance(itemID);
|
||||||
|
if (instance != null)
|
||||||
|
instance.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StopScript(LLUUID itemID)
|
||||||
|
{
|
||||||
|
XScriptInstance instance = GetInstance(itemID);
|
||||||
|
if (instance != null)
|
||||||
|
instance.Stop(0);
|
||||||
|
}
|
||||||
|
|
||||||
public DetectParams GetDetectParams(LLUUID itemID, int idx)
|
public DetectParams GetDetectParams(LLUUID itemID, int idx)
|
||||||
{
|
{
|
||||||
XScriptInstance instance = GetInstance(itemID);
|
XScriptInstance instance = GetInstance(itemID);
|
||||||
|
@ -723,6 +823,19 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
return "default";
|
return "default";
|
||||||
return instance.State;
|
return instance.State;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int GetStartParameter(LLUUID itemID)
|
||||||
|
{
|
||||||
|
XScriptInstance instance = GetInstance(itemID);
|
||||||
|
if (instance == null)
|
||||||
|
return 0;
|
||||||
|
return instance.StartParam;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool GetScriptRunning(LLUUID objectID, LLUUID itemID)
|
||||||
|
{
|
||||||
|
return GetScriptState(itemID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class XScriptInstance
|
public class XScriptInstance
|
||||||
|
@ -745,6 +858,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
private string m_PrimName;
|
private string m_PrimName;
|
||||||
private string m_ScriptName;
|
private string m_ScriptName;
|
||||||
private string m_Assembly;
|
private string m_Assembly;
|
||||||
|
private int m_StartParam = 0;
|
||||||
|
|
||||||
private Dictionary<string,IScriptApi> m_Apis = new Dictionary<string,IScriptApi>();
|
private Dictionary<string,IScriptApi> m_Apis = new Dictionary<string,IScriptApi>();
|
||||||
|
|
||||||
public enum StateSource
|
public enum StateSource
|
||||||
|
@ -823,9 +938,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
m_EventQueue.Clear();
|
m_EventQueue.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int StartParam
|
||||||
|
{
|
||||||
|
get { return m_StartParam; }
|
||||||
|
set { m_StartParam = value; }
|
||||||
|
}
|
||||||
|
|
||||||
public XScriptInstance(XEngine engine, uint localID, LLUUID objectID,
|
public XScriptInstance(XEngine engine, uint localID, LLUUID objectID,
|
||||||
LLUUID itemID, LLUUID assetID, string assembly, AppDomain dom,
|
LLUUID itemID, LLUUID assetID, string assembly, AppDomain dom,
|
||||||
string primName, string scriptName, StateSource stateSource)
|
string primName, string scriptName, int startParam,
|
||||||
|
bool postOnRez, StateSource stateSource)
|
||||||
{
|
{
|
||||||
m_Engine = engine;
|
m_Engine = engine;
|
||||||
|
|
||||||
|
@ -836,6 +958,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
m_PrimName = primName;
|
m_PrimName = primName;
|
||||||
m_ScriptName = scriptName;
|
m_ScriptName = scriptName;
|
||||||
m_Assembly = assembly;
|
m_Assembly = assembly;
|
||||||
|
m_StartParam = startParam;
|
||||||
|
|
||||||
ApiManager am = new ApiManager();
|
ApiManager am = new ApiManager();
|
||||||
|
|
||||||
|
@ -918,6 +1041,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
{
|
{
|
||||||
m_RunEvents = false;
|
m_RunEvents = false;
|
||||||
Start();
|
Start();
|
||||||
|
if(postOnRez)
|
||||||
|
PostEvent(new EventParams("on_rez",
|
||||||
|
new Object[] {new LSL_Types.LSLInteger(startParam)}, new DetectParams[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
// we get new rez events on sim restart, too
|
// we get new rez events on sim restart, too
|
||||||
|
@ -934,25 +1060,36 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_Engine.Log.Error("[XEngine] Unable to load script state: Memory limit exceeded");
|
m_Engine.Log.Error("[XEngine] Unable to load script state: Memory limit exceeded");
|
||||||
|
Start();
|
||||||
PostEvent(new EventParams("state_entry",
|
PostEvent(new EventParams("state_entry",
|
||||||
new Object[0], new DetectParams[0]));
|
new Object[0], new DetectParams[0]));
|
||||||
Start();
|
if(postOnRez)
|
||||||
|
PostEvent(new EventParams("on_rez",
|
||||||
|
new Object[] {new LSL_Types.LSLInteger(startParam)}, new DetectParams[0]));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_Engine.Log.ErrorFormat("[XEngine] Unable to load script state from xml: {0}\n"+e.ToString(), xml);
|
m_Engine.Log.ErrorFormat("[XEngine] Unable to load script state from xml: {0}\n"+e.ToString(), xml);
|
||||||
|
Start();
|
||||||
PostEvent(new EventParams("state_entry",
|
PostEvent(new EventParams("state_entry",
|
||||||
new Object[0], new DetectParams[0]));
|
new Object[0], new DetectParams[0]));
|
||||||
Start();
|
if(postOnRez)
|
||||||
|
PostEvent(new EventParams("on_rez",
|
||||||
|
new Object[] {new LSL_Types.LSLInteger(startParam)}, new DetectParams[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_Engine.Log.ErrorFormat("[XEngine] Unable to load script state, file not found");
|
// m_Engine.Log.ErrorFormat("[XEngine] Unable to load script state, file not found");
|
||||||
|
Start();
|
||||||
PostEvent(new EventParams("state_entry",
|
PostEvent(new EventParams("state_entry",
|
||||||
new Object[0], new DetectParams[0]));
|
new Object[0], new DetectParams[0]));
|
||||||
Start();
|
|
||||||
|
if(postOnRez)
|
||||||
|
PostEvent(new EventParams("on_rez",
|
||||||
|
new Object[] {new LSL_Types.LSLInteger(startParam)}, new DetectParams[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1062,6 +1199,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
{
|
{
|
||||||
// m_Engine.Log.DebugFormat("[XEngine] Posted event {2} in state {3} to {0}.{1}",
|
// m_Engine.Log.DebugFormat("[XEngine] Posted event {2} in state {3} to {0}.{1}",
|
||||||
// m_PrimName, m_ScriptName, data.EventName, m_State);
|
// m_PrimName, m_ScriptName, data.EventName, m_State);
|
||||||
|
|
||||||
|
if(!Running)
|
||||||
|
return;
|
||||||
|
|
||||||
lock (m_EventQueue)
|
lock (m_EventQueue)
|
||||||
{
|
{
|
||||||
if (m_EventQueue.Count >= m_Engine.MaxScriptQueue)
|
if (m_EventQueue.Count >= m_Engine.MaxScriptQueue)
|
||||||
|
|
Loading…
Reference in New Issue