Commit Graph

828 Commits (9fcf1de0fabf51ece937dd7b3ec581c29bae0c52)

Author SHA1 Message Date
Justin Clark-Casey (justincc) 69d0e168fb Fix a very unlikely-to-occur NullReferenceException race condition in llPushObject() where the code assumed that the physics actor it null-checked would still be null when it invoked a method on it 2013-02-14 00:20:23 +00:00
Melanie 6504e3d4ce Rename "Bounciness" to "Restitution" 2013-02-07 03:30:02 +00:00
Melanie e5beb480ea Partial port of Avination's support for the new physics parameters.
Implements the parameters as properties, the serialization and
database storage (MySQL only). Implements llSetPrimitiveParams for
prim physics shape and the other 4 extra params. Only the prim shape type
"None" is currently functional. No support for the Viewer UI (yet), that
will be ported in due course. Lots more to port, this is a large-ish changeset.
2013-02-06 08:03:04 +00:00
Justin Clark-Casey (justincc) 5c94346bd7 refactor: Move functions that lookup asset ids from task inventory or pass them through to ScriptUtils class in OpenSim.Region.Framework.dll
Renames functions to better reflect what they do.
This is so that code registering with modInvoke() can reuse this code to provide functions that behave in a consistent manner with existing LSL/OSSL functions.
2013-02-06 01:17:19 +00:00
Justin Clark-Casey (justincc) 2ff301ca11 Correct spelling mistake in new RayFilterFlags, LSLPhanton -> LSLPhantom 2013-02-02 01:34:49 +00:00
Talun ceabb1b49a Mantis 6343: Turn a prim to flexy to OFF don't work llSetPrimParams
Correction so that scripts can turn Flexi off as well as on.
2013-01-26 02:55:24 +00:00
teravus 878df52515 * This makes the non-physics llCastRay 'better'. It's not 'correctly working', and if you look deep enough, you see that the results are not really stable depending on the direction of the ray. 2013-01-23 21:58:51 -05:00
Justin Clark-Casey (justincc) 55c6753b13 Merge branch 'master' into cooptermination 2013-01-24 00:03:44 +00:00
Justin Clark-Casey (justincc) 8a22ac3f94 Pass narrower WaitHandle rather than EventWaitHandle as co-op termination wait handle to script APIs.
APIs don't need to reference any methods on EventWaitHandle
2013-01-23 23:38:08 +00:00
Melanie c1795ed399 Add the Avination physics raycast glue so Core Physics can implement raycast 2013-01-23 21:03:24 +00:00
Melanie 6a2b673fca Remove the return value from llGiveMoney and add llTransferLindenDollars. Also
make llGiveMoney async so the script thread is not held up waiting for comms
to an external server.
2013-01-23 19:45:36 +00:00
Robert Adams 95c53ecae7 Have SOP and LSL_Api call the proper GetCenterOfMass and GetGeometricCenter
routines on the physics engine. Won't make a difference for any
existing scripts since ODE always returned Vector3.Zero.
2013-01-21 15:55:54 -08:00
Talun 27e2ec177a New constants for llGetObjectDetails
New constants for llGetObjectDetails OBJECT_CHARACTER_TIME,
OBJECT_ROOT, OBJECT_ATTACHED_POINT, OBJECT_PATHFINDING_TYPE,
OBJECT_PHYSICS, OBJECT_PHANTOM and OBJECT_TEMP_ON_REZ
also Pathfining constants, 3 of which are used by llGetObjectDetails
2013-01-19 01:50:16 +00:00
Talun 4f70e423df Mantis 6507 keys returned by llGetAgentList incorrect for llList2Key
The type of the keys returned by llGetAgentList corrected to LSL_Key
2013-01-19 01:14:11 +00:00
Justin Clark-Casey (justincc) 74256c0cc4 Restore previous client AO behaviour by not allowing them to remove the default animation but continue to allow scripts to do so.
This keeps the fix from http://opensimulator.org/mantis/view.php?id=6327
and fixes the behaviour regression in http://opensimulator.org/mantis/view.php?id=6483
Animations may still exhibit different behaviour if both scripts and clients are adjusting animations.
A change in the behaviour of client AO to not remove all animations may be a better long term approach.
2013-01-18 22:57:09 +00:00
Justin Clark-Casey (justincc) c8afc8523b Implement non-wait co-operative termination of scripts for XEngine in addition to termination on wait.
This involves inserting opensim_reserved_CheckForCoopTermination() calls in lsl -> c# translation at any place where the script could be in a loop with no wait calls.
These places are for, while, do-while, label, user function call and manual event function call.
Call goes through to an XEngineScriptBase which extends ScriptBase.
IEngine is extended to supply necessary engine-specific parent class references and constructor parameters to Compiler.
Unfortunately, since XEngineScriptBase has to be passed WaitHandle in its constructor, older compiled scripts will fail to load with an error on the OpenSim console.
Such scripts will need to be recompiled, either by removing all *.dll files from the bin/ScriptEngines/<region-id> or by setting DeleteScriptsOnStartup = true in [XEngine] for one run.
Automatic recompilation may be implemented in a later commit.
This feature should not yet be used, default remains termination with Thread.Abort() which will work as normal once scripts are recompiled.
2013-01-17 23:39:09 +00:00
Justin Clark-Casey (justincc) 0963ece25b Implement co-operative script termination if termination comes during a script wait event (llSleep(), etc.)
This makes use of EventWaitHandles since various web references indicate that Thread.Interrupt() can also cause runtime instability.
If co-op termination is enabled, then termination sets the wait handle instead of waiting for a timeout before possibly aborting the thread.
This allows the script to cleanly terminate if it's in a llSleep/LL function delay or the next time it enters such a wait without any timeout period.
Co-op termination is not yet testable since checking for termination request within loops that never trigger a wait is not yet implemented.
This commit, unlike 1b5c41c, passes the wait handle as an extra parameter through IScript.Initialize() instead of passing IScriptInstance itself.
2013-01-16 02:07:43 +00:00
Justin Clark-Casey (justincc) b8949024bc Revert "Implement co-operative script termination if termination comes during a script wait event (llSleep(), etc.)"
Doing this as a favour to Melanie.  This will be back with passing the wait handles directly to the api.

This reverts commit 1b5c41c14a.
2013-01-16 01:45:09 +00:00
Justin Clark-Casey (justincc) 1b5c41c14a Implement co-operative script termination if termination comes during a script wait event (llSleep(), etc.)
This makes use of EventWaitHandles since various web references indicate that Thread.Interrupt() can also cause runtime instability.
If co-op termination is enabled, then termination sets the wait handle instead of waiting for a timeout before possibly aborting the thread.
This allows the script to cleanly terminate if it's in a llSleep/LL function delay or the next time it enters such a wait without any timeout period.
Co-op termination is not yet testable since checking for termination request within loops that never trigger a wait is not yet implemented.
2013-01-16 00:12:40 +00:00
Justin Clark-Casey (justincc) fccb03227e Instead of passing separate engine, part and item components to script APIs, pass down IScriptInstance instead.
This is to allow the future co-operative script thread terminate feature to detect and act upon termination requests.
This splits the assembly and state loading out from the ScriptInstance() constructor to a separate Load() method
in order to facilititate continued script logic regression testing.
2013-01-15 21:13:22 +00:00
Justin Clark-Casey (justincc) 7232cedd2b Set default particle burst count to 1 instead of 0 in any set particle system script call that does not have an empty list.
As per http://opensimulator.org/mantis/view.php?id=6353
2013-01-04 21:37:11 +00:00
Justin Clark-Casey (justincc) 7e45096314 Fix build break caused by missing ) from dce2809.
Was hand-typing in a line of code I had tested before but not retested this time
2013-01-04 21:22:51 +00:00
Justin Clark-Casey (justincc) dce2809137 Automatically grant sit-related llRequestPermissions() for subsequent avatars sitting on the same scene obejct, instead of wrongly popping up request permissions dialog.
Resolves http://opensimulator.org/mantis/view.php?id=6478
2013-01-04 21:18:53 +00:00
Justin Clark-Casey (justincc) a3bf3a2aa5 refactor: simplify llGetNumberOfPrims() to return prim count + sitting avatar count rather than independently inspecting every scene presence 2013-01-04 20:56:39 +00:00
Justin Clark-Casey (justincc) 9869ca83b4 Fix llGetLinkName() to return the name of the last avatar sat as the last link number.
As per http://wiki.secondlife.com/wiki/LlGetLinkName
2013-01-04 20:54:11 +00:00
Justin Clark-Casey (justincc) 9503383887 Fix llGetLinkKey() to return the last sat avatar as the last link number.
As per http://wiki.secondlife.com/wiki/LlGetLinkKey
This is done by keeping a scene-object wide list of sitters.
This also fixes bugs in this function where linknums 0 and 1 weren't treated properly if there were sitting avatars on a single prim.
This also fixes a minor race condition for multiple concurrent sitters on a prim with no current sitters by locking on the object-wide list rather than individual sop lists
Addresses http://opensimulator.org/mantis/view.php?id=6477
2013-01-04 20:34:39 +00:00
SignpostMarv a5ac6af16a Improving documentation of AttachToAvatar and GetLine methods in LSL_Api.cs based on doxygen error output 2013-01-03 00:17:24 +00:00
Justin Clark-Casey (justincc) 30e5e5cce6 If an NPC is unowned, then always auto-grant permissions requested via llRequestPermissions()
This is consistent with all other OSSL NPC functions that allow unowned avatars to be manipulated.
Aims to address http://opensimulator.org/mantis/view.php?id=6483
2013-01-02 19:25:52 +00:00
Robert Adams 4914d6c0ea Resolve Mantis 6480 (http://opensimulator.org/mantis/view.php?id=6480)
by reversing the sign on the recoil computation and adding a
[XEngine]RecoilScaleFactor parameter which defaults to zero.
Testing in SL seems to show that there is not a recoil action there.
Or, at least, it is very small. If someone knows how small, the default
for the scale factor should be changed.
2012-12-31 19:57:20 -08:00
Robert Adams d15bfcf614 Replace axis rotation numeric constants (STATUS_ROTATE_XYZ) with symbols. Also made it so llSetStatus() can individually enable disable rotation axi using the bitmask of flags. 2012-12-18 19:25:40 -08:00
BlueWall ac65085cc3 XmlRpcGridRouter
Flesh out XmlRpcGridRouter to reap unused channels from gateway when scripts or objects are removed, or when the llCloseRemoteDataChannel is called.

  See: http://http://forge.opensimulator.org/gf/project/xmlrpcrouter/ or
       https://github.com/BlueWall/XmlRpcRouter

  for php gateway and test code.
2012-12-03 20:16:44 -05:00
PixelTomsen 64c80aec64 llSetLinkCamera implementation
wiki: http://wiki.secondlife.com/wiki/LlSetLinkCamera

mantis: http://opensimulator.org/mantis/view.php?id=6397
2012-11-09 14:31:56 -08:00
Melanie 236cc1f268 Change user message on TeskInventoryAccepted to let the viewer format it
properly
2012-11-05 00:05:01 +00:00
SignpostMarv dcac2a7f71 refactoring llCollisionSound to use new KeyOrName method 2012-10-29 23:39:01 +00:00
SignpostMarv a9999a9676 Refactoring llTriggerSoundLimited with a new method on ISoundModule, as the LL Wiki spec for llTriggerSoundLimited states an axis-aligned bounding box, not radial constraint 2012-10-29 23:39:01 +00:00
SignpostMarv ef15711089 refactoring llTriggerSoundLimited to not use the LSL methods, since that will cause unnecessary calls to m_host.AddScriptLPS(1) 2012-10-29 23:39:00 +00:00
SignpostMarv af9dc483e9 refactoring llGetPos() to take advantage of implicit converter 2012-10-29 23:39:00 +00:00
SignpostMarv f9923d4423 shifting from two instances of typecasting to one instance of typecasting in llTriggerSoundLimited 2012-10-29 23:39:00 +00:00
SignpostMarv c796f7861e 80-character width terminal formatting of recent commits to llPlaySound, llPlaySoundSlave, llTriggerSound and llTriggerSoundLimited 2012-10-29 23:39:00 +00:00
SignpostMarv c5af16aef8 shuffling code around so that the interface for ISoundModule.SendSound() specifies a UUID rather than a string 2012-10-29 23:39:00 +00:00
SignpostMarv 5abcecc735 moving SendSound from SceneObjectPart to ISoundModule 2012-10-29 23:39:00 +00:00
SignpostMarv 9df510157e deduplicating code into a single LoopSound method 2012-10-29 23:38:59 +00:00
SignpostMarv d7ffcace8f adjusting parameter order of PreloadSound to be more logical 2012-10-29 23:38:59 +00:00
SignpostMarv 29a8ae48b5 transposing LoopSoundMaster to Sound Module 2012-10-29 23:38:59 +00:00
SignpostMarv a68e2fe169 transposing preload sound onto sound module 2012-10-29 23:38:58 +00:00
SignpostMarv 8763a637b5 transposing stop sound into sound module 2012-10-29 23:38:58 +00:00
SignpostMarv 206a694c6b moving comment for llStopSound inside the method block prior to transposition to sound module 2012-10-29 23:38:58 +00:00
SignpostMarv 7560010f34 Immediately setting gain to zero as a workaround for code not stopping sound started by llPlaySound 2012-10-29 23:38:56 +00:00
Melanie 1c5f6e48b8 Separate LSL's notion of the default anim from the actually playing anims. 2012-10-26 21:23:20 +01:00
Justin Clark-Casey (justincc) d9aaf51561 When scripts generate expected exceptions (e.g. due to checked bad parameter) throw ScriptException instead of just a plain old exception.
This is to make it easier to distinguish these exceptions from unexpected OpenSimulator problems internally and in regression tests.
No functional changes.
2012-10-25 02:52:20 +01:00
SignpostMarv af5383e479 altering documentation for llGetLinkName, as the current documentation is rather lengthy for a "summary". 2012-10-19 02:48:59 +01:00
SignpostMarv 645e3171b4 since llGetLinkName has a "simplest case", it should be the first check made. 2012-10-19 02:48:59 +01:00
SignpostMarv 597df51f91 the simplest case for llGetLinkName also applies to the LINK_THIS constant 2012-10-19 02:48:59 +01:00
SignpostMarv ec044537d5 ensuring that operand order in llGetLinkName is internally consistent 2012-10-19 02:48:59 +01:00
Justin Clark-Casey (justincc) ab0294f010 Add missing category paremeter to llGiveInventoryList grid IM construction.
This was a regression from 16c9c1df Sat Oct 6 02:34:49 2012 +0100.
Should resolve http://opensimulator.org/mantis/view.php?id=6360
2012-10-16 01:33:35 +01:00
Justin Clark-Casey (justincc) 330b976a62 Improve on TBG Renfold's fix to llRequestSimulatorData DATA_SIM_POS by only performing HG regionflags service check if the region secret is not empty.
An empty RegionSecret is never HG, whilst a non-empty one may be HG or being genuinely used as a RegionSecret.
2012-10-13 01:03:09 +01:00
TBG Renfold f6e166cd0b Now using region flags for llRequestSimulatorData DATA_SIM_POS.
If the region is not classed a hypergrid region, then the region secret is checked to make sure that it is a valid UUID.

Just a temporary fix at this time.
2012-10-13 00:50:34 +01:00
Justin Clark-Casey (justincc) 16c9c1dff7 On receiving TaskInventoryAccepted with a destination folder in the binary bucket slot for RLV, notify the viewer about inventory folder updates.
The viewer would not see the folder move without this, either on accept or decline.
This commit also updates the TaskInventoryOffered message to better conform with the data LL uses
Changes are, agentID is prim owner rather than prim id, agent name is now simply object name rather than name with owner detail,
message is just folder name in single quotes, message is not timestamped.
However, folder is not renamed "still #RLV/~<name>".  Long term solution is probably not to do these operations server-side.
Notes will be added to http://opensimulator.org/mantis/view.php?id=6311
2012-10-06 02:34:49 +01:00
Melanie 653a98e891 Fix a viewer crash issue
Conflicts:

	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
2012-10-03 17:39:13 +01:00
Justin Clark-Casey (justincc) 5df3944607 Fix llListFindList() returning no match when there is a match with a script constant component in the source list.
Adds regression test for this case.
Based on http://opensimulator.org/mantis/view.php?id=6156
Thanks SignpostMarv.
2012-09-22 00:23:25 +01:00
SignpostMarv e041f09750 refactoring to allow Scene.GetLandData to accept Vector3 as an argument. Note that the prior work on LSL_Vector implicit operators means one does not need to explicitly cast a LSL_Vector to Vector3 2012-09-08 00:44:27 +01:00
SignpostMarv 874bde366a 4096 is used in various places as the maximum height of a region, refactoring to be a constant 2012-09-08 00:14:39 +01:00
Melanie d297eb39e5 Revert "made setting rotation match Second Life"
Second Life seems to have introduced a bug, as we have confirmation that SL
behavior changed recently and changed in contradiction to their stated intention
This appears to be another of the bugs SL is notorious for. Signpost and I have
decided to back this out until SL's intention becomes clear.

This reverts commit f7b88d1c40.
2012-09-03 21:52:12 +01:00
Melanie 29218cdb31 Revert "no need to assign rotation to a variable now"
This reverts commit a3d140b57c.
2012-09-03 21:52:03 +01:00
Melanie 359f9efc76 Revert "formatting"
This reverts commit fb211c64fd.
2012-09-03 21:51:54 +01:00
SignpostMarv fb211c64fd formatting 2012-09-03 13:55:41 +01:00
SignpostMarv a3d140b57c no need to assign rotation to a variable now 2012-09-03 13:55:40 +01:00
SignpostMarv f7b88d1c40 made setting rotation match Second Life 2012-09-03 13:55:40 +01:00
SignpostMarv 3c019bea8c Implementing a vastly simpler means of allowing region modules to access GetLinkParts than mantis 6236 2012-08-31 01:19:17 +01:00
SignpostMarv 6b277394c0 refactoring as the list funcs either skip invalid values or recall ToDoubleList 2012-08-30 00:10:28 +01:00
SignpostMarv 0c3061f973 implementing rule tracking 2012-08-29 02:10:04 +01:00
SignpostMarv 3bf7bd6359 track originating IScriptApi method for SL-like error messages. Will add rule number tracking in next commit. 2012-08-29 02:10:04 +01:00
SignpostMarv 6e86b23012 implementing PRIM_LINK_TARGET on GetPrimParams ala SetPrimParams 2012-08-25 02:30:23 +01:00
SignpostMarv 58714b0aca minor formatting 2012-08-25 02:30:23 +01:00
SignpostMarv 2a2e120470 since we will be making the Get return type the remaining ruleset as with the Set return type, we need to move the original return type to a ref param 2012-08-25 02:30:23 +01:00
SignpostMarv a8044999fb use SceneObjectPart instead of var 2012-08-25 02:30:23 +01:00
SignpostMarv 3d504261b0 renaming to be similar to equivalent Set command 2012-08-25 02:30:23 +01:00
SignpostMarv 67477290ad stripping superfluous whitespace
Signed-off-by: Melanie <melanie@t-data.com>
2012-08-24 17:44:35 +01:00
SignpostMarv 582a256646 immediately returning the string.Join operation instead of checking if the list has members 2012-08-24 17:44:14 +01:00
SignpostMarv d188272462 refactoring using List.ConvertAll<string> 2012-08-24 17:44:14 +01:00
SignpostMarv 4820dfd733 this should be an if-else block in case the non-phys min/max are smaller than the physical min/max 2012-08-22 23:55:01 +01:00
SignpostMarv 481c00f50a refactoring out SetFaceColor 2012-08-20 23:10:25 +01:00
SignpostMarv ede3b9ab07 making use of implicit operators and Util.Clip handling of Vector3 2012-08-20 23:10:25 +01:00
SignpostMarv b863a15a82 single operation for PRIM_COLOR 2012-08-20 23:10:25 +01:00
SignpostMarv d72d599056 integrating redundant code into operator 2012-08-18 18:30:00 +01:00
SignpostMarv ca33619e11 Rot2Quaternion is now redundant 2012-08-18 18:30:00 +01:00
SignpostMarv fb84ff96a9 implicit operators mean one does not need to instantiate new objects manually 2012-08-18 18:29:59 +01:00
SignpostMarv 52d7af05bc adding missing refactor for LSL_Vector 2012-08-18 18:29:59 +01:00
Melanie 2a70afeca2 Fix the whitespace formatting error introduced by the last patch 2012-08-18 14:00:10 +01:00
SignpostMarv 5d7751da89 refactoring for Vector3 operator & constructor tweaks 2012-08-18 13:21:55 +01:00
Melanie 9d6fe1224a Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim 2012-08-18 12:57:49 +01:00
SignpostMarv 28d0aff2e3 adding null return to fix building 2012-08-17 23:23:03 +01:00
SignpostMarv 7068fddd2f fixing bug that get/set the wrong property for prim types other than sphere & box 2012-08-17 23:23:03 +01:00
SignpostMarv 466d684fbe implemented 2012-08-17 23:23:03 +01:00
SignpostMarv 74f5253a36 attempt to handle InvalidCastException in a manner similar to Second Life 2012-08-17 23:08:24 +01:00
SignpostMarv e9ea911563 adding a clip method to handle Vector3 objects to enable a minor amount of refactoring 2012-08-17 18:40:49 +01:00
Melanie 9995421df1 Do a proper null check to avoid the overloaded operator == trap 2012-08-16 02:35:03 +01:00
SignpostMarv ef4122213c enables configurable minimum sizes for physical & non-physical prims 2012-08-15 23:35:23 +01:00
SignpostMarv 0aa1f1cc3f Implementing PRIM_LINK_TARGET in a non-recursive fashion 2012-08-15 22:58:33 +01:00
Melanie ebbf349c6a Let the temp attachment module add a command to allow attaching without permissions and add support for this (incomplete!) to LSL 2012-08-15 19:37:16 +01:00