aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine (unfollow)
Commit message (Collapse)AuthorFilesLines
2014-08-18Prevent exception if inventory item in llGiveInventory() call doesn't exist.Kevin Cozens1-0/+1
2014-08-14Added RestrictEmail to make llEmail only send to avatars email address if true.Kevin Cozens1-0/+34
2014-07-21Eliminated some warningsOren Hurvitz1-1/+1
2014-07-16Change default script stop method to co-op instead of abort.Justin Clark-Casey (justincc)1-1/+5
co-op should be more stable as it doesn't abort threads, which can trigger virtual machine instability This change will be invisible to users as script DLLs are recompiled automatically where necessary, though the change won't take affect until the next simulator restart. This change has no effect on existing script state. If you want to continue using abort, set ScriptStopStrategy = abort in the [XEngine] section of OpenSim.ini
2014-07-14Use thread-safe version of .NET Random as the SDK class is not thread-safe.Justin Clark-Casey (justincc)1-4/+2
As per http://msdn.microsoft.com/en-us/library/system.random%28v=vs.100%29.aspx, the .NET Random class is not thread-safe. If called by multiple threads at once, methods may return 0. Except for llRand(), other OpenSimulator code did not lock before calling a shared Random instance. This commit adds a ThreadSafeRandom class that extends Random but does internal locking so that it is thread-safe. This change is invisible to existing callers and the explicit locking in the llFrand() implementation is now redundant.
2014-07-11minor: Move debug xengine script console command to Debug help section where ↵Justin Clark-Casey (justincc)1-1/+1
other debug commands live.
2014-07-11minor: further cleanup of old vb and yield prolog script engine references ↵Justin Clark-Casey (justincc)3-20/+2
that were removed some time ago
2014-07-11If [XEngine] ScriptStopStrategy is changed between abort and co-op, for the ↵Justin Clark-Casey (justincc)6-67/+111
existing session use the previous strategy for that script rather than not starting the script at all. We have to do this since we can't unload existing DLLs if they're all in the same AppDomain. But we can still update the underlying DLL which will be used in the next simulator session.
2014-07-10refactor: use existing Compiler.CreateScriptsDirectory() (renamed to ↵Justin Clark-Casey (justincc)1-26/+4
CheckOrCreateScriptsDirectory()) when checking that scripts directory exists on compile. Code was identical apart from error logging, but if there are failures creating these directories then you'll be seeing lots of errors anyway, and these will be more informative
2014-06-27add LSL constant PRIM_ALPHA_MODEdahlia1-0/+1
2014-06-23add LSL constants PRIM_SPECULAR and PRIM_NORMALdahlia1-0/+2
2014-06-19Improved line map heuristics.Aleric Inglewood1-16/+40
If the C# column can't be found in the positionMap (but the line can), use the map immediately after it while correcting for the offset, unless that results in an LSL position before the previous LSL position in the positionMap. The idea behind this heuristic is that in most, if not all cases C# consumes more characters than LSL (for example LSL_Types.LSLInteger instead of just 'integer'). Thus if the distance between the columns of two markers differ in the C# and LSL file, the distance in the C# file will be larger. Moreover, we can assume that every time this happens we will have a marker at the beginning of the longer 'keyword', because those keywords were generated by us in the first place. For example: C#: LSL_Types.LSLInteger f2(LSL_Types.LSLString s) ^ ^ 1 2 will always have markers at the beginning of the long keywords 'LSL_Types.LSLInteger' and 'LSL_Types.LSLString'. If an error is generated in between (for example at the beginning of the function name 'f2') then the correct position is found by using an offset relative to 2 rather than 1. Note that a case where this isn't working correctly is when the user adds extra spaces. For example: LSL: integer f2( string s) would still use the start of 'string' as reference and then go backwards 3 characters only because the corresponding C# still looks like C#: LSL_Types.LSLInteger f2(LSL_Types.LSLString s) ^ ^ only 3 chars difference and the reported error at 'f2' would be here: LSL: integer f2( string s) ^ This can only be fixed by generating a mapping for 'f2' itself, or generating a mapping whenever the amount of spaces is changed.
2014-06-19Fix looking up line number and colum when there is no exact match.Aleric Inglewood1-18/+11
When a compile error reports a colum/error that is not an exact match in the positionMap dictionary, the last position in the map with a line number and position before the reported error should be returned. The old code had the following problems: 1) It returns l,c - which are line and column of the C# file, not LSL. 2) It doesn't set l to 'line' when the map has an entry with 'line'. 3) It sorts the map without taking columns into account, which may result in a random order of the columns. With my mono implementation the columns were reversed in order. For example, if the map contains the following lines: 99,5,49,10 100,30,50,10 100,40,1,0 101,5,51,10 and a translation of 100,35 was requested, then the old code would compare '100' with the keys in the first column - setting l to that key while it is smaller. Hence, l is set to 99. Then it finds the key 100 and doesn't update l. Because of the reversed sort order, it first compares the column 35 with 40, finding that it is smaller and therefore it stops; returning 99,1 instead of finding the correct 100,30 entry and returning 50,10. This patch causes 50,10 to be returned. The remaining problems after this patch are: 1) The sorting might not be necessary at all. 2) The is code duplication (I fixed both instances, but really there should be no code duplication imho).
2014-06-18refactor: Simplify compilation result tests by factoring out common code.Justin Clark-Casey (justincc)1-71/+45
2014-06-18In compiler regression tests, setup and teardown structures for each test to ↵Justin Clark-Casey (justincc)1-1/+5
avoid any possibility of inter-test inter-ference
2014-06-18Fix issue with LSL jumps screwing up the C# compiler error -> LSL code ↵Justin Clark-Casey (justincc)2-8/+55
position map and leading to invalid error line numbers/columns This is because jump statement generation was mistakenly inserting its own line without updating the csharp positions in CSCodeGenerator. This is Aleric Inglewood's patch in http://opensimulator.org/mantis/view.php?id=7195 but applied to opensim itself rather than the defunct code generation in opensim-libs. Thanks! This patch also adds a regression test for this case from myself.
2014-06-17Change assembly versions to 0.8.1Justin Clark-Casey (justincc)4-4/+4
2014-06-01Fixed a few things pertaining to interfacing with the estate service. ↵Diva Canto1-1/+1
Specifically, StoreEstateSettings was not being used anywhere; instead EstatSetting.Save was being called, but that method is a trigger to the DB-layer code directly, which, besides being wrong, was making it impossible to replace the service with a remote connector. Also added more packing/unpacking code.
2014-05-27In compiler tests, remove the ResolveEventHandlers after test exitJustin Clark-Casey (justincc)1-3/+6
2014-05-27Make CompilerTest add same AssemblyResolver as XEngine to see if this solves ↵Justin Clark-Casey (justincc)1-1/+7
the issue with different AppDomain BaseDirectory in local and Jenkins test runs
2014-05-27Temporarily print regression TestCastAndConcatString() script compile errors ↵Justin Clark-Casey (justincc)1-4/+5
out to console to get a handle on what's going wrong. Does not fail for me locally and I failed to notice this test was failing on Jenkins.
2014-05-24Fix issues where reported LSL compiler error line numbers do not match the ↵Justin Clark-Casey (justincc)2-16/+16
script. This is probably due to changes in the layout of the generated script preamble (using statements etc, ) in c8afc852 (Jan 17 2013). Re-enabled existing regression test that exercises at least one case of this.
2014-05-23Get regression test TestUseUndeclaredVariable() functional again, though not ↵Justin Clark-Casey (justincc)1-8/+19
yet enabled. This reveals the position map problems and will make the fix (and subsequent continual checking) easier.
2014-05-23Reactivate regression test TestCastAndConcatString() in CompilerTests.Justin Clark-Casey (justincc)2-10/+18
2014-05-22If a script calls llSetCameraAtOffset() or llSetCameraEyeOffset() on a child ↵Justin Clark-Casey (justincc)1-0/+6
prim and the root prim has no corresponding value set, then also set the root prim. This matches behaviour just tested on the Linden Lab grid.
2014-05-06Change llUnSit to be able to unsit any avatar that is currently sat on the ↵Vegaslon1-1/+2
object, not just avatars sitting on the sittarget in the object containing the script. or when the object is owned by the parcel, land group or estate owner.
2014-05-06Mantis 7146 The lsl function llGetMassMKS is not implementedTalun3-0/+13
This patch implements llGetMassMKS as it is described in the wiki http://wiki.secondlife.com/wiki/LlGetMassMKS
2014-05-06Show more meaningful error messages when failed to move an item from a prim ↵Oren Hurvitz2-5/+10
to a user's inventory. Also, actually show the error to the user in more cases. (Previously, sometimes the operation failed without telling the user anything.)
2014-05-06Added range-checking for the parameters to PRIM_POINT_LIGHT (used in ↵Oren Hurvitz1-3/+3
llSetLinkPrimitiveParamsFast() )
2014-05-01Mantis 7144 missing ATTACH_AVATAR_CENTER constantTalun1-0/+2
This patch adds ATTACH_AVATAR_CENTER and ATTACH_NECK
2014-04-30Change XEngine to call StateChange rather than RemoveScript on state changesMelanie1-1/+1
2014-04-30Add the "StateChange" function to the async comand manager to differentiateMelanie1-1/+23
between state changes and script exit/reset.
2014-04-23Eliminated many warningsOren Hurvitz2-23/+2
2014-04-11minor: use constants instead of magic numbers in llRequestAgentData() where ↵Justin Clark-Casey (justincc)1-6/+6
possible
2014-04-11Actually add the llRequestAgentData() test class for commit 530c86Justin Clark-Casey (justincc)1-0/+157
2014-04-11Fix the presence info caching used in llRequestAgentData(), which was ↵Justin Clark-Casey (justincc)1-58/+85
completely inoperative. This means the presence info may be out of date by up to 20 seconds, but this avoids scripts potentially triggering constants requests to user accout and presence info services. Relates to http://opensimulator.org/mantis/view.php?id=7088 though I fixed in a different way. Adds regression test for this case.
2014-04-03refactor: Use m_sittingAvatars to maintain the list of sitting avatars ↵Justin Clark-Casey (justincc)1-11/+8
instead of two independent structures that do exactly the same thing m_sittingAvatars code also already properly handles locking to avoid races.
2014-03-31Add check to prevent the return of a wrong value when key is NULL_KEYBlueWall1-1/+4
2014-03-26Also take YP/commented out JS references from script engine CodeTools.Justin Clark-Casey (justincc)2-157/+0
Fixes build break from d3387d591a2bd496c8315f17b2310d6a6f40a7c3
2014-03-26Remove unmaintained and unused YieldProlog scripting languageJustin Clark-Casey (justincc)16-15874/+0
This hasn't been mainntained since 2008 and has not been kept up with the rest of the language infrastructure. Hence, it almost certainly doesn't work and has never been used, afaik If this is wrong, please say on the opensim-users/dev mailing list. Removing to reduce maintenance burden (since it still needs to be made to compile).
2014-03-24Better error messagesOren Hurvitz1-6/+5
This resolves http://opensimulator.org/mantis/view.php?id=6936
2014-03-21Mantis 6922: No particles are generated if their size exceeds the maximum ↵Talun1-4/+10
allowed size. This patch ensures that no particle scal value can exceed 4.0
2014-03-20Mantis 6974 PERMISSION_TRACK_CAMERA should be implicit on attach.Talun1-0/+1
http://wiki.secondlife.com/wiki/Run_time_permissions This change makes PERMISSION_TRACK_CAMERA implicit on attach
2014-03-13Implement osForceBreakAllLinks().Justin Clark-Casey (justincc)4-0/+25
Identical to llBreakAllLinks() except that it doesn't require the script to have link permissions.
2014-03-12Only allow llBreakAllLinks() to work if script has received ↵Justin Clark-Casey (justincc)2-0/+50
PERMISSION_CHANGE_LINKS As per http://wiki.secondlife.com/wiki/LlBreakAllLinks Same as existing llCreateLink() and llBreakLink()
2014-03-12Implement osForceCreateLink() and osForceBreakLink()Justin Clark-Casey (justincc)4-8/+62
These are identical to llCreateLink() and llBreakLink() except that they don't require script permissions. However, osForceCreateLink() still requires that linked and linkee still have the same owner. There's also an AutomaticLinkPermission setting in [XEngine] that could be set to true to prevent the LSL function checks. But this doesn't allow the finer control over which users/scripts, etc. can do this that the OSSL functions provide.
2014-03-07Add Varregion support to osGetRegionSize OSSL functionDev Random1-1/+3
Signed-off-by: Michael Cerquoni <nebadon2025@gmail.com>
2014-03-05If an avatar is sitting, send out position updates to clients for any ↵Justin Clark-Casey (justincc)1-1/+31
change, not just those outside the usual tolerances. This is to allow small adjustments of less than 0.05m in functions such as llSetPrimitiveLinkParams() to work This is another fix for http://opensimulator.org/mantis/view.php?id=7044 Extends regression test for this case.
2014-03-03When positioning agent with PRIM_ROTATION in llSetLinkPrimitiveParams(), set ↵Justin Clark-Casey (justincc)2-12/+38
the global rotation rather than the local rotation Functionally the same as the patch in http://opensimulator.org/mantis/view.php?id=7044, thanks Aleric. This commit also extends the regression test
2014-02-27Stop LSL_Api.GetLinkEntities() from creating an unused list on every ↵Justin Clark-Casey (justincc)1-9/+6
parameter except LINK_THIS. Simplify code.