Commit Graph

2401 Commits (1d56029848e96016b5809f596619e32d0ebcc995)

Author SHA1 Message Date
Justin Clark-Casey (justincc) 1d56029848 Fix issue where llRemoteLoadScriptPin() would treat 0 (the default) as a valid set pin in a destination prim rather than the unset no pin state
Adds regression test for this case.
2014-11-11 17:28:24 +00:00
Justin Clark-Casey (justincc) 3372210c46 Label all threadpool calls being made in core OpenSimulator. This is to add problem diagnosis.
"show threadpool calls" now also returns named (labelled), anonymous (unlabelled) and total call stats.
2014-11-04 00:55:48 +00:00
Justin Clark-Casey (justincc) 3e25e6a170 Add some more llGiveInventory() regression tests 2014-10-20 23:57:16 +01:00
Justin Clark-Casey (justincc) 51043746f3 refactor: consistently put all test classes in the OpenSim.Tests.Common package rather than some in OpenSim.Tests.Common.Mock
the separate mock package was not useful and was just another using line to always add
2014-10-08 21:09:25 +01:00
Justin Clark-Casey (justincc) 3c7eacf39b Fix recent regression from 473c5594 where camera started to judder on moving vehicles.
Other parts of OpenSimulator are relying on SP.Velocity == 0 for vehicles.
So add and use SP.GetWorldVelocity() instead when we need vehicle velocity, along the same lines as existing SP.GetWorldRotation()
2014-09-02 23:35:03 +01:00
Justin Clark-Casey (justincc) bb7c88805a As per the LL grid, for attachments make llGetObjectDetails() OBJECT_VELOCITY return the avatar's velocity and not always Vector3.Zero.
This completes http://opensimulator.org/mantis/view.php?id=7177
2014-08-30 00:58:47 +01:00
Justin Clark-Casey (justincc) 4d8bc007e2 minor: fix wrong indentation in previous commit 0cc3cd 2014-08-30 00:54:36 +01:00
Justin Clark-Casey (justincc) 0cc3cdfb4e As per the LL grid, for attachments make llGetObjectDetails() OBJECT_ROT return the avatar's rotation.
This is already the behaviour of OBJECT_POS.
Partially satisfies http://opensimulator.org/mantis/view.php?id=7177
2014-08-30 00:48:59 +01:00
Justin Clark-Casey (justincc) 099212167b Implement STATUS_BLOCK_GRAB_OBJECT in llSetStatus()/llGetStatus() and correct effect of STATUS_BLOCK_GRAB
As per http://wiki.secondlife.com/wiki/LlSetStatus
Setting STATUS_BLOCK_GRAB_OBJECT prevents or allows move of a physical linkset by grab on any prim.
Setting STATUS_BLOCK_GRAB prevents or allows move of a physical linkset by grab on a particular prim.
Previously, setting STATUS_BLOCK_GRAB would prevent drag via all prims of the linkset.
2014-08-29 23:40:21 +01:00
Kevin Cozens 321816b32c Prevent exception if inventory item in llGiveInventory() call doesn't exist. 2014-08-18 16:00:49 -04:00
Kevin Cozens 626536b8cc Added RestrictEmail to make llEmail only send to avatars email address if true. 2014-08-14 02:40:06 -04:00
Oren Hurvitz 9fa8d84598 Eliminated some warnings 2014-07-21 08:30:10 +01:00
Justin Clark-Casey (justincc) 8cd7ca568d Change default script stop method to co-op instead of abort.
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-16 22:58:38 +01:00
Justin Clark-Casey (justincc) 0c8f3dddd8 Use thread-safe version of .NET Random as the SDK class is not thread-safe.
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-14 20:08:11 +01:00
Justin Clark-Casey (justincc) 2766bf3fef minor: Move debug xengine script console command to Debug help section where other debug commands live. 2014-07-11 00:18:39 +01:00
Justin Clark-Casey (justincc) 15b38f0036 minor: further cleanup of old vb and yield prolog script engine references that were removed some time ago 2014-07-11 00:15:47 +01:00
Justin Clark-Casey (justincc) d7b9260496 If [XEngine] ScriptStopStrategy is changed between abort and co-op, for the 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-11 00:03:02 +01:00
Justin Clark-Casey (justincc) 6d3b409af2 refactor: use existing Compiler.CreateScriptsDirectory() (renamed to 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-07-10 19:40:44 +01:00
dahlia 9d2789aff8 add LSL constant PRIM_ALPHA_MODE 2014-06-27 16:06:03 -07:00
dahlia a93799d03b add LSL constants PRIM_SPECULAR and PRIM_NORMAL 2014-06-23 20:06:22 -07:00
Aleric Inglewood c90b986d8b Improved line map heuristics.
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-19 23:52:51 +01:00
Aleric Inglewood 3fe9c7c49d Fix looking up line number and colum when there is no exact match.
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-19 23:52:51 +01:00
Justin Clark-Casey (justincc) 3cbdf3bfe0 refactor: Simplify compilation result tests by factoring out common code. 2014-06-18 23:04:31 +01:00
Justin Clark-Casey (justincc) 7b2f125fb6 In compiler regression tests, setup and teardown structures for each test to avoid any possibility of inter-test inter-ference 2014-06-18 22:46:54 +01:00
Justin Clark-Casey (justincc) a0d6705fe6 Fix issue with LSL jumps screwing up the C# compiler error -> LSL code 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-18 22:24:36 +01:00
Justin Clark-Casey (justincc) 5450b1b024 Change assembly versions to 0.8.1 2014-06-17 18:37:15 +01:00
Diva Canto 2ff9ea3f80 Fixed a few things pertaining to interfacing with the estate service. 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-06-01 10:06:26 -07:00
Justin Clark-Casey (justincc) 5622cf68aa In compiler tests, remove the ResolveEventHandlers after test exit 2014-05-27 18:47:42 +01:00
Justin Clark-Casey (justincc) 394ec508f6 Make CompilerTest add same AssemblyResolver as XEngine to see if this solves the issue with different AppDomain BaseDirectory in local and Jenkins test runs 2014-05-27 18:37:16 +01:00
Justin Clark-Casey (justincc) bcaacb4e41 Temporarily print regression TestCastAndConcatString() script compile errors 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-27 18:19:08 +01:00
Justin Clark-Casey (justincc) 9bae636ff0 Fix issues where reported LSL compiler error line numbers do not match the 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-24 00:12:23 +01:00
Justin Clark-Casey (justincc) cf95b65c10 Get regression test TestUseUndeclaredVariable() functional again, though not yet enabled.
This reveals the position map problems and will make the fix (and subsequent continual checking) easier.
2014-05-23 22:29:47 +01:00
Justin Clark-Casey (justincc) 250ea09328 Reactivate regression test TestCastAndConcatString() in CompilerTests. 2014-05-23 22:12:49 +01:00
Justin Clark-Casey (justincc) 174df94172 If a script calls llSetCameraAtOffset() or llSetCameraEyeOffset() on a child 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-22 23:58:28 +01:00
Vegaslon e245638f24 Change llUnSit to be able to unsit any avatar that is currently sat on the 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-06 17:35:34 +01:00
Talun c9742c826d Mantis 7146 The lsl function llGetMassMKS is not implemented
This patch implements llGetMassMKS as it is described in the wiki
http://wiki.secondlife.com/wiki/LlGetMassMKS
2014-05-06 17:31:21 +01:00
Oren Hurvitz eb79c882ea Show more meaningful error messages when failed to move an item from a prim 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-06 07:28:45 +01:00
Oren Hurvitz 7862d1e20d Added range-checking for the parameters to PRIM_POINT_LIGHT (used in llSetLinkPrimitiveParamsFast() ) 2014-05-06 07:14:58 +01:00
Talun 3a2c099169 Mantis 7144 missing ATTACH_AVATAR_CENTER constant
This patch adds ATTACH_AVATAR_CENTER and ATTACH_NECK
2014-05-01 23:20:31 +01:00
Melanie 7c121a2acc Change XEngine to call StateChange rather than RemoveScript on state changes 2014-04-30 20:56:49 +01:00
Melanie f0eeb47262 Add the "StateChange" function to the async comand manager to differentiate
between state changes and script exit/reset.
2014-04-30 20:54:34 +01:00
Oren Hurvitz 998d7009a6 Eliminated many warnings 2014-04-23 16:37:36 +03:00
Justin Clark-Casey (justincc) 7c148d9b2f minor: use constants instead of magic numbers in llRequestAgentData() where possible 2014-04-11 00:52:28 +01:00
Justin Clark-Casey (justincc) de0ab04d00 Actually add the llRequestAgentData() test class for commit 530c86 2014-04-11 00:36:50 +01:00
Justin Clark-Casey (justincc) 530c86335d Fix the presence info caching used in llRequestAgentData(), which was 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-11 00:29:06 +01:00
Justin Clark-Casey (justincc) 6ac9c9c972 refactor: Use m_sittingAvatars to maintain the list of sitting avatars instead of two independent structures that do exactly the same thing
m_sittingAvatars code also already properly handles locking to avoid races.
2014-04-03 01:14:39 +01:00
BlueWall 59d0e3c3c8 Add check to prevent the return of a wrong value when key is NULL_KEY 2014-03-31 15:49:53 -04:00
Justin Clark-Casey (justincc) 62a03a5cac Also take YP/commented out JS references from script engine CodeTools.
Fixes build break from d3387d591a
2014-03-26 01:20:49 +00:00
Justin Clark-Casey (justincc) d3387d591a Remove unmaintained and unused YieldProlog scripting language
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-26 00:59:57 +00:00
Oren Hurvitz 6734b94761 Better error messages
This resolves http://opensimulator.org/mantis/view.php?id=6936
2014-03-24 12:22:32 +01:00