* Completed a partial port of OpenSim's LSL API. Thank you to everyone on the OpenSim team for their hard work on this incredibly large feature * Added Agent.GetSimulatorPosition() * Corrected default PrimFlags for agents and prims * Stubs for encoding/decoding prim linkset assets * Route chat through the scene * Stub for grid messaging (IM and email) * Add GetTerrainHeightAt(), removed duplicate heightmap storage in Movement.cs * Added a permissions manager stub * Store wind speeds, added functions to get wind speed * Make sure all of the important prim properties are set before creating an object * Lots of new object manipulation functions in scene * Properly clean up event queues on agent exit * Stubbed out a space for a scripting engine * Stubbed out task inventory * Added ScriptingConsole, which allows you to run LSL functions from the chat console * Added new PacketCategory, Messaging, for chat-related packets * Fixed InventoryObject overrides * Added a NotecardCache, useful for the scripting engine and may become generally useful later * Added several helper functions and new members to SimulationObject git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2462 52acb1d6-8a22-11de-b505-999d5b087335
110 lines
3.8 KiB
C#
110 lines
3.8 KiB
C#
using System;
|
|
using OpenMetaverse;
|
|
|
|
using LSL_Float = Simian.ScriptTypes.LSL_Float;
|
|
using LSL_Integer = Simian.ScriptTypes.LSL_Integer;
|
|
using LSL_Key = Simian.ScriptTypes.LSL_Key;
|
|
using LSL_List = Simian.ScriptTypes.LSL_List;
|
|
using LSL_Rotation = Simian.ScriptTypes.LSL_Rotation;
|
|
using LSL_String = Simian.ScriptTypes.LSL_String;
|
|
using LSL_Vector = Simian.ScriptTypes.LSL_Vector;
|
|
|
|
namespace Simian
|
|
{
|
|
#region Scripting Support Classes
|
|
|
|
/// <summary>
|
|
/// Holds all the data required to execute a scripting event
|
|
/// </summary>
|
|
public class EventParams
|
|
{
|
|
public string EventName;
|
|
public object[] Params;
|
|
public DetectParams[] DetectParams;
|
|
|
|
public EventParams(string eventName, object[] eventParams, DetectParams[] detectParams)
|
|
{
|
|
EventName = eventName;
|
|
Params = eventParams;
|
|
DetectParams = detectParams;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Holds all of the data a script can detect about the containing object
|
|
/// </summary>
|
|
public class DetectParams
|
|
{
|
|
public LSL_Key Key;
|
|
public LSL_Integer LinkNum;
|
|
public LSL_Key Group;
|
|
public LSL_String Name;
|
|
public LSL_Key Owner;
|
|
public LSL_Vector Offset;
|
|
public LSL_Vector Position;
|
|
public LSL_Rotation Rotation;
|
|
public LSL_Vector Velocity;
|
|
public LSL_Integer Type;
|
|
public LSL_Vector TouchST;
|
|
public LSL_Vector TouchNormal;
|
|
public LSL_Vector TouchBinormal;
|
|
public LSL_Vector TouchPos;
|
|
public LSL_Vector TouchUV;
|
|
public LSL_Integer TouchFace;
|
|
|
|
public DetectParams()
|
|
{
|
|
Key = LSL_Key.Zero;
|
|
LinkNum = LSL_Integer.Zero;
|
|
Group = LSL_Key.Zero;
|
|
Name = LSL_String.Empty;
|
|
Owner = LSL_Key.Zero;
|
|
Offset = LSL_Vector.Zero;
|
|
Position = LSL_Vector.Zero;
|
|
Rotation = LSL_Rotation.Identity;
|
|
Velocity = LSL_Vector.Zero;
|
|
Type = LSL_Integer.Zero;
|
|
TouchST = ScriptTypes.TOUCH_INVALID_TEXCOORD;
|
|
TouchNormal = LSL_Vector.Zero;
|
|
TouchBinormal = LSL_Vector.Zero;
|
|
TouchPos = LSL_Vector.Zero;
|
|
TouchUV = ScriptTypes.TOUCH_INVALID_TEXCOORD;
|
|
TouchFace = ScriptTypes.TOUCH_INVALID_FACE;
|
|
}
|
|
}
|
|
|
|
#endregion Scripting Support Classes
|
|
|
|
public interface IScriptEngine
|
|
{
|
|
bool PostScriptEvent(UUID scriptID, EventParams parms);
|
|
bool PostObjectEvent(UUID hostObjectID, EventParams parms);
|
|
|
|
void SetTimerEvent(UUID scriptID, double seconds);
|
|
|
|
DetectParams GetDetectParams(UUID scriptID, int detectIndex);
|
|
|
|
bool GetScriptState(UUID scriptID);
|
|
void SetScriptState(UUID scriptID, bool state);
|
|
|
|
void SetStartParameter(UUID scriptID, int startParam);
|
|
int GetStartParameter(UUID scriptID);
|
|
|
|
void SetScriptMinEventDelay(UUID scriptID, double minDelay);
|
|
|
|
void TriggerState(UUID scriptID, string newState);
|
|
|
|
void ApiResetScript(UUID scriptID);
|
|
void ResetScript(UUID scriptID);
|
|
|
|
int AddListener(UUID scriptID, UUID hostObjectID, int channel, string name, UUID keyID, string message);
|
|
void RemoveListener(UUID scriptID, int handle);
|
|
void RemoveListeners(UUID scriptID);
|
|
void SetListenerState(UUID scriptID, int handle, bool enabled);
|
|
|
|
void SensorOnce(UUID scriptID, UUID hostObjectID, string name, UUID keyID, int type, double range, double arc);
|
|
void SensorRepeat(UUID scriptID, UUID hostObjectID, string name, UUID keyID, int type, double range, double arc, double rate);
|
|
void SensorRemove(UUID scriptID);
|
|
}
|
|
}
|