From 16defc30eb2a01ce80b59511120066531363cc83 Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Tue, 14 Aug 2007 19:06:57 +0000 Subject: krinkec's updates to ll* interface and functions --- .../DotNetEngine/Compiler/LSL/LSL_BaseClass.cs | 175 +++++++------- .../Server_API/LSL_BuiltIn_Commands_Interface.cs | 263 ++++++++++++++------- .../ScriptEngine/DotNetEngine/EventQueueManager.cs | 4 + .../ScriptEngine/DotNetEngine/ScriptEngine.cs | 6 +- .../ScriptEngine/DotNetEngine/ScriptManager.cs | 112 +++++---- 5 files changed, 342 insertions(+), 218 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs index 641a3f2..b3df390 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs @@ -24,6 +24,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL + public float llSin(float f) { return 0; } public float llCos(float f) { return 0; } public float llTan(float f) { return 0; } @@ -255,116 +256,120 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL public Int32 llOverMyLand(string id) { return 0; } public string llGetLandOwnerAt(Axiom.Math.Vector3 pos) { return ""; } public string llGetNotecardLine(string name, Int32 line) { return ""; } - public void llGetAgentSize() { } - public void llSameGroup() { } - public void llUnSit() { } - public void llGroundSlope() { } - public void llGroundNormal() { } - public void llGroundContour() { } - public void llGetAttached() { } - public void llGetFreeMemory() { } - public void llGetRegionName() { } - public void llGetRegionTimeDilation() { } - public void llGetRegionFPS() { } - public void llParticleSystem() { } - public void llGroundRepel() { } + public Axiom.Math.Vector3 llGetAgentSize(string id) { return new Axiom.Math.Vector3(); } + public Int32 llSameGroup(string agent) { return 0; } + public void llUnSit(string id) { } + public Axiom.Math.Vector3 llGroundSlope(Axiom.Math.Vector3 offset) { return new Axiom.Math.Vector3(); } + public Axiom.Math.Vector3 llGroundNormal(Axiom.Math.Vector3 offset) { return new Axiom.Math.Vector3(); } + public Axiom.Math.Vector3 llGroundContour(Axiom.Math.Vector3 offset) { return new Axiom.Math.Vector3(); } + public Int32 llGetAttached() { return 0; } + public Int32 llGetFreeMemory() { return 0; } + public string llGetRegionName() { return ""; } + public float llGetRegionTimeDilation() { return 0; } + public float llGetRegionFPS() { return 0; } + public void llParticleSystem(List rules) { } + public void llGroundRepel(float height, Int32 water, float tau) { } public void llGiveInventoryList() { } - public void llSetVehicleType() { } - public void llSetVehicleFloatParam() { } - public void llSetVehicleVectorParam() { } - public void llSetVehicleRotationParam() { } - public void llSetVehicleFlags() { } - public void llRemoveVehicleFlags() { } - public void llSitTarget() { } - public void llAvatarOnSitTarget() { } - public void llAddToLandPassList() { } - public void llSetTouchText() { } - public void llSetSitText() { } - public void llSetCameraEyeOffset() { } - public void llSetCameraAtOffset() { } + public void llSetVehicleType(Int32 type) { } + public void llSetVehicleFloatParam(Int32 param, float value) { } + public void llSetVehicleVectorParam(Int32 param, Axiom.Math.Vector3 vec) { } + public void llSetVehicleRotationParam(Int32 param, Axiom.Math.Quaternion rot) { } + public void llSetVehicleFlags(Int32 flags) { } + public void llRemoveVehicleFlags(Int32 flags) { } + public void llSitTarget(Axiom.Math.Vector3 offset, Axiom.Math.Quaternion rot) { } + public string llAvatarOnSitTarget() { return ""; } + public void llAddToLandPassList(string avatar, float hours) { } + public void llSetTouchText(string text) + { + } + public void llSetSitText(string text) + { + } + public void llSetCameraEyeOffset(Axiom.Math.Vector3 offset) { } + public void llSetCameraAtOffset(Axiom.Math.Vector3 offset) { } public void llDumpList2String() { } - public void llScriptDanger() { } + public void llScriptDanger(Axiom.Math.Vector3 pos) { } public void llDialog() { } - public void llVolumeDetect() { } - public void llResetOtherScript() { } - public void llGetScriptState() { } + public void llVolumeDetect(Int32 detect) { } + public void llResetOtherScript(string name) { } + public Int32 llGetScriptState(string name) { return 0; } public void llRemoteLoadScript() { } - public void llSetRemoteScriptAccessPin() { } - public void llRemoteLoadScriptPin() { } + public void llSetRemoteScriptAccessPin(Int32 pin) { } + public void llRemoteLoadScriptPin(string target, string name, Int32 pin, Int32 running, Int32 start_param) { } public void llOpenRemoteDataChannel() { } - public void llSendRemoteData() { } - public void llRemoteDataReply() { } - public void llCloseRemoteDataChannel() { } - public void llMD5String() { } + public string llSendRemoteData(string channel, string dest, Int32 idata, string sdata) { return ""; } + public void llRemoteDataReply(string channel, string message_id, string sdata, Int32 idata) { } + public void llCloseRemoteDataChannel(string channel) { } + public void llMD5String(string src, Int32 nonce) { } public void llSetPrimitiveParams() { } - public void llStringToBase64() { } - public void llBase64ToString() { } + public string llStringToBase64(string str) { return ""; } + public string llBase64ToString(string str) { return ""; } public void llXorBase64Strings() { } public void llRemoteDataSetRegion() { } - public void llLog10() { } - public void llLog() { } + public float llLog10(float val) { return 0; } + public float llLog(float val) { return 0; } public void llGetAnimationList() { } - public void llSetParcelMusicURL() { } - public void llGetRootPosition() { } - public void llGetRootRotation() { } - public void llGetObjectDesc() { } - public void llSetObjectDesc() { } - public void llGetCreator() { } - public void llGetTimestamp() { } - public void llSetLinkAlpha() { } - public void llGetNumberOfPrims() { } - public void llGetNumberOfNotecardLines() { } + public void llSetParcelMusicURL(string url) { } + public Axiom.Math.Vector3 llGetRootPosition() { return new Axiom.Math.Vector3(); } + public Axiom.Math.Quaternion llGetRootRotation() { return new Axiom.Math.Quaternion(); } + public string llGetObjectDesc() { return ""; } + public void llSetObjectDesc(string desc) { } + public string llGetCreator() { return ""; } + public string llGetTimestamp() { return ""; } + public void llSetLinkAlpha(Int32 linknumber, float alpha, Int32 face) { } + public Int32 llGetNumberOfPrims() { return 0; } + public string llGetNumberOfNotecardLines(string name) { return ""; } public void llGetBoundingBox() { } - public void llGetGeometricCenter() { } + public Axiom.Math.Vector3 llGetGeometricCenter() { return new Axiom.Math.Vector3(); } public void llGetPrimitiveParams() { } - public void llIntegerToBase64() { } - public void llBase64ToInteger() { } - public void llGetGMTclock() { } - public void llGetSimulatorHostname() { } - public void llSetLocalRot() { } + public string llIntegerToBase64(Int32 number) { return ""; } + public Int32 llBase64ToInteger(string str) { return 0; } + public float llGetGMTclock() { return 0; } + public string llGetSimulatorHostname() { return ""; } + public void llSetLocalRot(Axiom.Math.Quaternion rot) { } public void llParseStringKeepNulls() { } - public void llRezAtRoot() { } - public void llGetObjectPermMask() { } - public void llSetObjectPermMask() { } - public void llGetInventoryPermMask() { } - public void llSetInventoryPermMask() { } - public void llGetInventoryCreator() { } - public void llOwnerSay() { } - public void llRequestSimulatorData() { } - public void llForceMouselook() { } - public void llGetObjectMass() { } + public void llRezAtRoot(string inventory, Axiom.Math.Vector3 position, Axiom.Math.Vector3 velocity, Axiom.Math.Quaternion rot, Int32 param) { } + public Int32 llGetObjectPermMask(Int32 mask) { return 0; } + public void llSetObjectPermMask(Int32 mask, Int32 value) { } + public void llGetInventoryPermMask(string item, Int32 mask) { } + public void llSetInventoryPermMask(string item, Int32 mask, Int32 value) { } + public string llGetInventoryCreator(string item) { return ""; } + public void llOwnerSay(string msg) { } + public void llRequestSimulatorData(string simulator, Int32 data) { } + public void llForceMouselook(Int32 mouselook) { } + public float llGetObjectMass(string id) { return 0; } public void llListReplaceList() { } - public void llLoadURL() { } + public void llLoadURL(string avatar_id, string message, string url) { } public void llParcelMediaCommandList() { } public void llParcelMediaQuery() { } - public void llModPow() { } - public void llGetInventoryType() { } + public Int32 llModPow(Int32 a, Int32 b, Int32 c) { return 0; } + public Int32 llGetInventoryType(string name) { return 0; } public void llSetPayPrice() { } - public void llGetCameraPos() { } - public void llGetCameraRot() { } + public Axiom.Math.Vector3 llGetCameraPos() { return new Axiom.Math.Vector3(); } + public Axiom.Math.Quaternion llGetCameraRot() { return new Axiom.Math.Quaternion(); } public void llSetPrimURL() { } public void llRefreshPrimURL() { } - public void llEscapeURL() { } - public void llUnescapeURL() { } - public void llMapDestination() { } - public void llAddToLandBanList() { } - public void llRemoveFromLandPassList() { } - public void llRemoveFromLandBanList() { } + public string llEscapeURL(string url) { return ""; } + public string llUnescapeURL(string url) { return ""; } + public void llMapDestination(string simname, Axiom.Math.Vector3 pos, Axiom.Math.Vector3 look_at) { } + public void llAddToLandBanList(string avatar, float hours) { } + public void llRemoveFromLandPassList(string avatar) { } + public void llRemoveFromLandBanList(string avatar) { } public void llSetCameraParams() { } public void llClearCameraParams() { } public void llListStatistics() { } - public void llGetUnixTime() { } - public void llGetParcelFlags() { } - public void llGetRegionFlags() { } - public void llXorBase64StringsCorrect() { } + public Int32 llGetUnixTime() { return 0; } + public Int32 llGetParcelFlags(Axiom.Math.Vector3 pos) { return 0; } + public Int32 llGetRegionFlags() { return 0; } + public string llXorBase64StringsCorrect(string str1, string str2) { return ""; } public void llHTTPRequest() { } public void llResetLandBanList() { } public void llResetLandPassList() { } - public void llGetParcelPrimCount() { } + public Int32 llGetParcelPrimCount(Axiom.Math.Vector3 pos, Int32 category, Int32 sim_wide) { return 0; } public void llGetParcelPrimOwners() { } - public void llGetObjectPrimCount() { } - public void llGetParcelMaxPrims() { } - public void llGetParcelDetails() { } + public Int32 llGetObjectPrimCount(string object_id) { return 0; } + public Int32 llGetParcelMaxPrims(Axiom.Math.Vector3 pos, Int32 sim_wide) { return 0; } + public List llGetParcelDetails(Axiom.Math.Vector3 pos, List param) { return new List(); } } } diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands_Interface.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands_Interface.cs index 8eefac8..b7eba61 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands_Interface.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands_Interface.cs @@ -394,115 +394,208 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler string llGetLandOwnerAt(Axiom.Math.Vector3 pos); //wiki: key llGetNotecardLine(string name, integer line) string llGetNotecardLine(string name, Int32 line); - void llGetAgentSize(); - void llSameGroup(); - void llUnSit(); - void llGroundSlope(); - void llGroundNormal(); - void llGroundContour(); - void llGetAttached(); - void llGetFreeMemory(); - void llGetRegionName(); - void llGetRegionTimeDilation(); - void llGetRegionFPS(); - void llParticleSystem(); - void llGroundRepel(); + //wiki: vector llGetAgentSize(key id) + Axiom.Math.Vector3 llGetAgentSize(string id); + //wiki: integer llSameGroup(key agent) + Int32 llSameGroup(string agent); + //wiki: llUnSit(key id) + void llUnSit(string id); + //wiki: vector llGroundSlope(vector offset) + Axiom.Math.Vector3 llGroundSlope(Axiom.Math.Vector3 offset); + //wiki: vector llGroundNormal(vector offset) + Axiom.Math.Vector3 llGroundNormal(Axiom.Math.Vector3 offset); + //wiki: vector llGroundContour(vector offset) + Axiom.Math.Vector3 llGroundContour(Axiom.Math.Vector3 offset); + //wiki: integer llGetAttached() + Int32 llGetAttached(); + //wiki: integer llGetFreeMemory() + Int32 llGetFreeMemory(); + //wiki: string llGetRegionName() + string llGetRegionName(); + //wiki: float llGetRegionTimeDilation() + float llGetRegionTimeDilation(); + //wiki: float llGetRegionFPS() + float llGetRegionFPS(); + //wiki: llParticleSystem(List rules + void llParticleSystem(List rules); + //wiki: llGroundRepel(float height, integer water, float tau) + void llGroundRepel(float height, Int32 water, float tau); void llGiveInventoryList(); - void llSetVehicleType(); - void llSetVehicleFloatParam(); - void llSetVehicleVectorParam(); - void llSetVehicleRotationParam(); - void llSetVehicleFlags(); - void llRemoveVehicleFlags(); - void llSitTarget(); - void llAvatarOnSitTarget(); - void llAddToLandPassList(); - void llSetTouchText(); - void llSetSitText(); - void llSetCameraEyeOffset(); - void llSetCameraAtOffset(); + //wiki: llSetVehicleType(integer type) + void llSetVehicleType(Int32 type); + //wiki: llSetVehicleFloatParam(integer param, float value) + void llSetVehicleFloatParam(Int32 param, float value); + //wiki: llSetVehicleVectorParam(integer param, vector vec) + void llSetVehicleVectorParam(Int32 param, Axiom.Math.Vector3 vec); + //wiki: llSetVehicleRotationParam(integer param, rotation rot) + void llSetVehicleRotationParam(Int32 param, Axiom.Math.Quaternion rot); + //wiki: llSetVehicleFlags(integer flags) + void llSetVehicleFlags(Int32 flags); + //wiki: llRemoveVehicleFlags(integer flags) + void llRemoveVehicleFlags(Int32 flags); + //wiki: llSitTarget(vector offset, rotation rot) + void llSitTarget(Axiom.Math.Vector3 offset, Axiom.Math.Quaternion rot); + //wiki key llAvatarOnSitTarget() + string llAvatarOnSitTarget(); + //wiki: llAddToLandPassList(key avatar, float hours) + void llAddToLandPassList(string avatar, float hours); + //wiki: llSetTouchText(string text) + void llSetTouchText(string text); + //wiki: llSetSitText(string text) + void llSetSitText(string text); + //wiki: llSetCameraEyeOffset(vector offset) + void llSetCameraEyeOffset(Axiom.Math.Vector3 offset); + //wiki: llSeteCameraAtOffset(vector offset) + void llSetCameraAtOffset(Axiom.Math.Vector3 offset); void llDumpList2String(); - void llScriptDanger(); + //wiki: integer llScriptDanger(vector pos) + void llScriptDanger(Axiom.Math.Vector3 pos); void llDialog(); - void llVolumeDetect(); - void llResetOtherScript(); - void llGetScriptState(); + //wiki: llVolumeDetect(integer detect) + void llVolumeDetect(Int32 detect); + //wiki: llResetOtherScript(string name) + void llResetOtherScript(string name); + //wiki: integer llGetScriptState(string name) + Int32 llGetScriptState(string name); + //wiki: (deprecated) void llRemoteLoadScript(); - void llSetRemoteScriptAccessPin(); - void llRemoteLoadScriptPin(); + //wiki: llSetRemoteScriptAccessPin(integer pin) + void llSetRemoteScriptAccessPin(Int32 pin); + //wiki: llRemoteLoadScriptPin(key target, string name, integer pin, integer running, integer start_param) + void llRemoteLoadScriptPin(string target, string name, Int32 pin, Int32 running, Int32 start_param); + //wiki: llOpenRemoteDataChannel() void llOpenRemoteDataChannel(); - void llSendRemoteData(); - void llRemoteDataReply(); - void llCloseRemoteDataChannel(); - void llMD5String(); + //wiki: key llSendRemoteData(key channel, string dest, integer idata, string sdata) + string llSendRemoteData(string channel, string dest, Int32 idata, string sdata); + //wiki: llRemoteDataReply(key channel, key message_id, string sdata, integer idata) + void llRemoteDataReply(string channel, string message_id, string sdata, Int32 idata); + //wiki: llCloseRemoteDataChannel(key channel) + void llCloseRemoteDataChannel(string channel); + //wiki: string llMD5String(string src, integer nonce) + void llMD5String(string src, Int32 nonce); void llSetPrimitiveParams(); - void llStringToBase64(); - void llBase64ToString(); + //wiki: string llStringToBase64(string str) + string llStringToBase64(string str); + //wiki: string llBase64ToString(string str) + string llBase64ToString(string str); + //wiki: (deprecated) void llXorBase64Strings(); + //wiki: llRemoteDataSetRegion() void llRemoteDataSetRegion(); - void llLog10(); - void llLog(); + //wiki: float llLog10(float val) + float llLog10(float val); + //wiki: float llLog(float val) + float llLog(float val); void llGetAnimationList(); - void llSetParcelMusicURL(); - void llGetRootPosition(); - void llGetRootRotation(); - void llGetObjectDesc(); - void llSetObjectDesc(); - void llGetCreator(); - void llGetTimestamp(); - void llSetLinkAlpha(); - void llGetNumberOfPrims(); - void llGetNumberOfNotecardLines(); + //wiki: llSetParcelMusicURL(string url) + void llSetParcelMusicURL(string url); + //wiki: vector llGetRootPosition() + Axiom.Math.Vector3 llGetRootPosition(); + //wiki: rotation llGetRootRotation() + Axiom.Math.Quaternion llGetRootRotation(); + //wiki: string llGetObjectDesc() + string llGetObjectDesc(); + //wiki: llSetObjectDesc(string desc) + void llSetObjectDesc(string desc); + //wiki: key llGetCreator() + string llGetCreator(); + //wiki: string llGetTimestamp() + string llGetTimestamp(); + //wiki: llSetLinkAlpha(integer linknumber, float alpha, integer face) + void llSetLinkAlpha(Int32 linknumber, float alpha, Int32 face); + //wiki: integer llGetNumberOfPrims() + Int32 llGetNumberOfPrims(); + //wiki: key llGetNumberOfNotecardLines(string name) + string llGetNumberOfNotecardLines(string name); void llGetBoundingBox(); - void llGetGeometricCenter(); + //wiki: vector llGetGeometricCenter() + Axiom.Math.Vector3 llGetGeometricCenter(); void llGetPrimitiveParams(); - void llIntegerToBase64(); - void llBase64ToInteger(); - void llGetGMTclock(); - void llGetSimulatorHostname(); - void llSetLocalRot(); + //wiki: string llIntegerToBase64(integer number) + string llIntegerToBase64(Int32 number); + //wiki integer llBase64ToInteger(string str) + Int32 llBase64ToInteger(string str); + //wiki: float llGetGMTclock() + float llGetGMTclock(); + //wiki: string llGetSimulatorHostname() + string llGetSimulatorHostname(); + //llSetLocalRot(rotation rot) + void llSetLocalRot(Axiom.Math.Quaternion rot); void llParseStringKeepNulls(); - void llRezAtRoot(); - void llGetObjectPermMask(); - void llSetObjectPermMask(); - void llGetInventoryPermMask(); - void llSetInventoryPermMask(); - void llGetInventoryCreator(); - void llOwnerSay(); - void llRequestSimulatorData(); - void llForceMouselook(); - void llGetObjectMass(); + //wiki: llRezAtRoot(string inventory, vector position, vector velocity, rotation rot, integer param) + void llRezAtRoot(string inventory, Axiom.Math.Vector3 position, Axiom.Math.Vector3 velocity, Axiom.Math.Quaternion rot, Int32 param); + //wiki: integer llGetObjectPermMask(integer mask) + Int32 llGetObjectPermMask(Int32 mask); + //wiki: llSetObjectPermMask(integer mask, integer value) + void llSetObjectPermMask(Int32 mask, Int32 value); + //wiki integer llGetInventoryPermMask(string item, integer mask) + void llGetInventoryPermMask(string item, Int32 mask); + //wiki: llSetInventoryPermMask(string item, integer mask, integer value) + void llSetInventoryPermMask(string item, Int32 mask, Int32 value); + //wiki: key llGetInventoryCreator(string item) + string llGetInventoryCreator(string item); + //wiki: llOwnerSay(string msg) + void llOwnerSay(string msg); + //wiki: key llRequestSimulatorData(string simulator, integer data) + void llRequestSimulatorData(string simulator, Int32 data); + //wiki: llForceMouselook(integer mouselook) + void llForceMouselook(Int32 mouselook); + //wiki: float llGetObjectMass(key id) + float llGetObjectMass(string id); void llListReplaceList(); - void llLoadURL(); + //wiki: llLoadURL(key avatar_id, string message, string url) + void llLoadURL(string avatar_id, string message, string url); void llParcelMediaCommandList(); void llParcelMediaQuery(); - void llModPow(); - void llGetInventoryType(); + //wiki integer llModPow(integer a, integer b, integer c) + Int32 llModPow(Int32 a, Int32 b, Int32 c); + //wiki: integer llGetInventoryType(string name) + Int32 llGetInventoryType(string name); void llSetPayPrice(); - void llGetCameraPos(); - void llGetCameraRot(); + //wiki: vector llGetCameraPos() + Axiom.Math.Vector3 llGetCameraPos(); + //wiki rotation llGetCameraRot() + Axiom.Math.Quaternion llGetCameraRot(); + //wiki: (deprecated) void llSetPrimURL(); + //wiki: (deprecated) void llRefreshPrimURL(); - void llEscapeURL(); - void llUnescapeURL(); - void llMapDestination(); - void llAddToLandBanList(); - void llRemoveFromLandPassList(); - void llRemoveFromLandBanList(); + //wiki: string llEscapeURL(string url) + string llEscapeURL(string url); + //wiki: string llUnescapeURL(string url) + string llUnescapeURL(string url); + //wiki: llMapDestination(string simname, vector pos, vector look_at) + void llMapDestination(string simname, Axiom.Math.Vector3 pos, Axiom.Math.Vector3 look_at); + //wiki: llAddToLandBanList(key avatar, float hours) + void llAddToLandBanList(string avatar, float hours); + //wiki: llRemoveFromLandPassList(key avatar) + void llRemoveFromLandPassList(string avatar); + //wiki: llRemoveFromLandBanList(key avatar) + void llRemoveFromLandBanList(string avatar); void llSetCameraParams(); void llClearCameraParams(); void llListStatistics(); - void llGetUnixTime(); - void llGetParcelFlags(); - void llGetRegionFlags(); - void llXorBase64StringsCorrect(); + //wiki: integer llGetUnixTime() + Int32 llGetUnixTime(); + //wiki: integer llGetParcelFlags(vector pos) + Int32 llGetParcelFlags(Axiom.Math.Vector3 pos); + //wiki: integer llGetRegionFlags() + Int32 llGetRegionFlags(); + //wiki: string llXorBase64StringsCorrect(string str1, string str2) + string llXorBase64StringsCorrect(string str1, string str2); void llHTTPRequest(); + //wiki: llResetLandBanList() void llResetLandBanList(); + //wiki: llResetLandPassList() void llResetLandPassList(); - void llGetParcelPrimCount(); + //wiki integer llGetParcelPrimCount(vector pos, integer category, integer sim_wide) + Int32 llGetParcelPrimCount(Axiom.Math.Vector3 pos, Int32 category, Int32 sim_wide); void llGetParcelPrimOwners(); - void llGetObjectPrimCount(); - void llGetParcelMaxPrims(); - void llGetParcelDetails(); + //wiki: integer llGetObjectPrimCount(key object_id) + Int32 llGetObjectPrimCount(string object_id); + //wiki: integer llGetParcelMaxPrims( vector pos, integer sim_wide ) + Int32 llGetParcelMaxPrims(Axiom.Math.Vector3 pos, Int32 sim_wide); + //wiki list llGetParcelDetails(vector pos, list params) + List llGetParcelDetails(Axiom.Math.Vector3 pos, List param); } } diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs index 3b6f3e1..368ab11 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs @@ -34,6 +34,10 @@ using System.Reflection; namespace OpenSim.Region.ScriptEngine.DotNetEngine { + /// + /// EventQueueManager handles event queues + /// Events are queued and executed in separate thread + /// class EventQueueManager { private Thread EventQueueThread; diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs index 5f26434..f7947f7 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs @@ -32,11 +32,11 @@ using System.Text; namespace OpenSim.Region.ScriptEngine.DotNetEngine { + /// + /// This is the root object for ScriptEngine + /// public class ScriptEngine : OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineInterface { - // - // This is the root object for ScriptEngine - // internal OpenSim.Region.Environment.Scenes.Scene World; internal EventManager myEventManager; // Handles and queues incoming events from OpenSim diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs index 5f50a52..2de4e62 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs @@ -34,6 +34,11 @@ using System.Reflection; namespace OpenSim.Region.ScriptEngine.DotNetEngine { + /// + /// Loads scripts + /// Compiles them if necessary + /// Execute functions for EventQueueManager + /// class ScriptManager { @@ -106,51 +111,63 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine // We will initialize and start the script. // It will be up to the script itself to hook up the correct events. - string FileName; + string FileName = ""; - // * Fetch script from server - // DEBUG - ScriptID is an actual filename during debug - // (therefore we can also check type by looking at extension) - FileName = ScriptID; - - // * Does script need compile? Send it to LSL compiler first. (TODO: Use (and clean) compiler cache) - //myScriptEngine.m_logger.Verbose("ScriptEngine", "ScriptManager Script extension: " + System.IO.Path.GetExtension(FileName).ToLower()); - switch (System.IO.Path.GetExtension(FileName).ToLower()) + try { - case ".txt": - case ".lsl": - case ".cs": - myScriptEngine.m_logger.Verbose("ScriptEngine", "ScriptManager Script is CS/LSL, compiling to .Net Assembly"); - // Create a new instance of the compiler (currently we don't want reuse) - OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Compiler LSLCompiler = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Compiler(); - // Compile - FileName = LSLCompiler.Compile(FileName); - break; - default: - throw new Exception("Unknown script type."); - } - - myScriptEngine.m_logger.Verbose("ScriptEngine", "Compilation done"); - // * Insert yield into code - FileName = ProcessYield(FileName); - // * Find next available AppDomain to put it in - AppDomain FreeAppDomain = GetFreeAppDomain(); - // * Load and start script - //OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName); - OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName); - string FullScriptID = ScriptID + "." + ObjectID; - // Add it to our temporary active script keeper - //Scripts.Add(FullScriptID, Script); - SetScript(ObjectID, ScriptID, Script); - // We need to give (untrusted) assembly a private instance of BuiltIns - // this private copy will contain Read-Only FullScriptID so that it can bring that on to the server whenever needed. - //OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL_BuiltIn_Commands_Interface LSLB = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL_BuiltIn_Commands_TestImplementation(FullScriptID); + // * Fetch script from server + // DEBUG - ScriptID is an actual filename during debug + // (therefore we can also check type by looking at extension) + FileName = ScriptID; + + // * Does script need compile? Send it to LSL compiler first. (TODO: Use (and clean) compiler cache) + //myScriptEngine.m_logger.Verbose("ScriptEngine", "ScriptManager Script extension: " + System.IO.Path.GetExtension(FileName).ToLower()); + switch (System.IO.Path.GetExtension(FileName).ToLower()) + { + case ".txt": + case ".lsl": + case ".cs": + myScriptEngine.m_logger.Verbose("ScriptEngine", "ScriptManager Script is CS/LSL, compiling to .Net Assembly"); + // Create a new instance of the compiler (currently we don't want reuse) + OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Compiler LSLCompiler = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Compiler(); + // Compile + FileName = LSLCompiler.Compile(FileName); + break; + default: + throw new Exception("Unknown script type."); + } + + + + myScriptEngine.m_logger.Verbose("ScriptEngine", "Compilation done"); + // * Insert yield into code + FileName = ProcessYield(FileName); + + // * Find next available AppDomain to put it in + AppDomain FreeAppDomain = GetFreeAppDomain(); + + // * Load and start script + //OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName); + OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName); + string FullScriptID = ScriptID + "." + ObjectID; + // Add it to our temporary active script keeper + //Scripts.Add(FullScriptID, Script); + SetScript(ObjectID, ScriptID, Script); + // We need to give (untrusted) assembly a private instance of BuiltIns + // this private copy will contain Read-Only FullScriptID so that it can bring that on to the server whenever needed. + //OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL_BuiltIn_Commands_Interface LSLB = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL_BuiltIn_Commands_TestImplementation(FullScriptID); + + // Start the script - giving it BuiltIns + //myScriptEngine.m_logger.Verbose("ScriptEngine", "ScriptManager initializing script, handing over private builtin command interface"); + Script.Start(myScriptEngine.World, ScriptID); - // Start the script - giving it BuiltIns - //myScriptEngine.m_logger.Verbose("ScriptEngine", "ScriptManager initializing script, handing over private builtin command interface"); - Script.Start(myScriptEngine.World, ScriptID); + } + catch (Exception e) + { + myScriptEngine.m_logger.Error("ScriptEngine", "Exception loading script \"" + FileName + "\": " + e.ToString()); + } } @@ -222,13 +239,18 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass Script = myScriptEngine.myScriptManager.GetScript(ObjectID, ScriptID); Type type = Script.GetType(); - //object o = (object)Script; - //System.Collections.Generic.List Functions = (System.Collections.Generic.List) - //Type type = typeof(OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass); + myScriptEngine.m_logger.Verbose("ScriptEngine", "Invoke: \"" + Script.State + "_event_" + FunctionName + "\""); - type.InvokeMember(Script.State + "_event_" + FunctionName, BindingFlags.InvokeMethod, null, Script, args); - //System.Collections.Generic.List Functions = (System.Collections.Generic.List)type.InvokeMember("GetFunctions", BindingFlags.InvokeMethod, null, Script, null); + + try + { + type.InvokeMember(Script.State + "_event_" + FunctionName, BindingFlags.InvokeMethod, null, Script, args); + } + catch (Exception e) + { + myScriptEngine.m_logger.Error("ScriptEngine", "Exception attempting to executing script function: " + e.ToString()); + } //foreach (MemberInfo mi in type.GetMembers()) -- cgit v1.1