Commit Graph

17949 Commits (b2c893a7be120b7ce04e019856e43523723182d4)

Author SHA1 Message Date
Justin Clark-Casey (justincc) b2c893a7be If ScriptStopStrategy hasn't been set to co-op in [XEngine] config, then continue to generate C# that is functionality identical to historical generation
This is to eliminate disruption until co-op termination has been well-tested.
In non co-op mode, XEngine will continue to load DLLs of the existing Script class and the new XEngineScript class.
Moving to co-op mode still requires existing script DLL deletion to force recompilation, either manually or by setting DeleteScriptsOnStartup = true for one run.
This change also means that scripts which fail to initialize do not still show up as running scripts.
2013-01-24 03:03:36 +00:00
Justin Clark-Casey (justincc) 3f80ac23b6 Add co-op termination regression test for infinite recursive manual call on event function.
Such code would normally terminate quickly with a stack overflow exception anyway.
2013-01-24 03:03:28 +00:00
Justin Clark-Casey (justincc) 701109c8c9 Set script delay factor to 0 in co-op termination tests
This is to ensure loops aren't actually terminating from a wait on an LSL function.
This was not the case with any of the existing tests.
2013-01-24 03:03:21 +00:00
Justin Clark-Casey (justincc) 5cbda393cd Add regression test for co-op termination on infinite user function call regression.
Such a script would probably run out of stack pretty quickly anyway.
2013-01-24 03:03:10 +00:00
Justin Clark-Casey (justincc) 98d0440c42 Add regression test for co-op stop of an infinite jump loop
Also fixes bug in do-while test
Improves detection of failure due to invalid script in test
Sets up xengine anew for each test rather than once for the while testsuite to improve isolation between tests.
Stop listening for chat after the first 'script is running' chat is received to reduce test run time.
2013-01-24 03:03:04 +00:00
Justin Clark-Casey (justincc) 8148d7e204 Add do-while co-op termination test
Minor changes to scripts in other tests.
2013-01-24 03:02:54 +00:00
Justin Clark-Casey (justincc) b43a6b0199 Add single and comound while loop co-op termination test 2013-01-24 03:02:47 +00:00
Justin Clark-Casey (justincc) d01943fa40 Fix bug in generating termination checks in compound statement for loop.
Add regression test for this case.
2013-01-24 03:02:39 +00:00
Justin Clark-Casey (justincc) b6daf4d4c6 factor out common code in existing co-op termination regression tests 2013-01-24 03:02:33 +00:00
Justin Clark-Casey (justincc) 4495ecd158 Increase WaitForEventCompletionOnScriptStop to 120 secs to show that the co-op setting is active in its regression tests. 2013-01-24 03:02:24 +00:00
Justin Clark-Casey (justincc) 85df66db51 minor: comment out Console.WriteLine debugging message in XEngine 2013-01-24 03:02:17 +00:00
Justin Clark-Casey (justincc) 3024d0e61c Add regression test TestStopOnLongForLoop() 2013-01-24 03:02:11 +00:00
Justin Clark-Casey (justincc) 5ac0447e0f refactor: rename XEngineTest to more descriptive XEngineBasicTests 2013-01-24 03:02:04 +00:00
Oren Hurvitz bb42862639 Assign the SmartThreadPool name in the constructor
This is required because some threads are created in the constructor, so assigning the name afterwards would be too late.
2013-01-24 03:01:26 +00:00
Justin Clark-Casey (justincc) 39b8f339ce Fix use of scene debug commands when region is set to root or a specific region where there is more than one region on the simulator. 2013-01-24 03:01:02 +00:00
Justin Clark-Casey (justincc) af99e5e74a Add "debug set set animations true|false" region console command.
Setting this logs extra information about animation add/remove, such as uuid and animation name
Unfortunately cannot be done per client yet
2013-01-24 03:00:39 +00:00
Justin Clark-Casey (justincc) f79800246a 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-24 03:00:18 +00:00
Melanie 4c1b1d89eb Complete removal of the now unused state queue 2013-01-24 02:04:41 +00:00
Diva Canto a473482413 Changed a couple of debug messages at the request of osgrid. 2013-01-24 02:04:33 +00:00
Justin Clark-Casey (justincc) 535ec23646 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-24 02:03:49 +00:00
Justin Clark-Casey (justincc) 245d6435e3 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-24 02:00:13 +00:00
Justin Clark-Casey (justincc) 8728d4ce6a 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-24 02:00:04 +00:00
Justin Clark-Casey (justincc) 44901f0b31 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-24 01:59:42 +00:00
Justin Clark-Casey (justincc) 5054a07be2 Print full stacktrace from plugin loading failure to help determine what went wrong, rather than a possibly unhelpful simple exception message. 2013-01-24 01:35:08 +00:00
Justin Clark-Casey (justincc) 2f1cc6a06a refactor: Simplify ScriptInstance by retaining reference to SceneObjectPart instead of sometimes but not always looking it up. 2013-01-24 01:34:58 +00:00
Robert Adams ff7693a14b Fix exception reporting in SceneObjectPart so it logs what the exception is rather than just saying it happened. 2013-01-24 01:34:35 +00:00
Justin Clark-Casey (justincc) e89f93c78c Implement a workaround solution for saving manual script state changes by the user before logout instead of wrongly removing the script early.
This workaround relies on the fact that a closing client goes inactive before the attachments derez calls happen.
This reverts the change to remove scripts too early instead of stopping them, since the the two step stop then remove is necessary to execute the detach event.
2013-01-24 01:34:05 +00:00
Justin Clark-Casey (justincc) d51aee876d Save attachments on detach/exit if a contained script state has been changed.
This involves making Attachments module listen for start/stop script changes.
It also involves removing the script from the region on detach in the same manner as every other DeleteSceneObject() call rather than simply stopping it
This is necessary tue to the bad assymetry of start and stop script triggers but it appears to be the correct behaviour anyway, as detached objects are completely gone from the sim.
Not just in a state where their scripts have been stopped.
2013-01-24 01:30:37 +00:00
Justin Clark-Casey (justincc) 3ad03d41e6 Fix a regression in the last few scene commands changes where setting these via the viewer estate dialog stopped working.
Forgot to register the new interface.
Also removes some code which got included by adpating an existing module.
2013-01-24 01:30:21 +00:00
Justin Clark-Casey (justincc) 69104f38f9 Add "debug scene get" console command to list current scene options 2013-01-24 01:29:49 +00:00
Justin Clark-Casey (justincc) c6bb0d9662 Move scene debug commands into separate module. Command changes from "debug scene <key> <value>" to "debug scene set <key> <value>" to accomodate future settings 2013-01-24 01:29:40 +00:00
Justin Clark-Casey (justincc) 73717f2ce7 refactor: route the final scene backup through the same code that handles periodic backup
This is rather than making unnecessary duplicate checks that the SOG later performs again.
2013-01-24 01:29:29 +00:00
Justin Clark-Casey (justincc) 03bc92d112 minor: Capitalize GroupsModule command category 2013-01-24 01:29:12 +00:00
Justin Clark-Casey (justincc) fd015c1ed7 minor: add missing newline to "debug scene" console command 2013-01-24 01:29:03 +00:00
Justin Clark-Casey (justincc) 8e548e4c8a Remove unimplemented "debug teleport" console command 2013-01-24 01:28:55 +00:00
Justin Clark-Casey (justincc) 44adf909b0 Add "debug scene pbackup true|false" console command. This enables or disable periodic scene backup. For debug purposes.
If false, scene is still saved on shutdown.
2013-01-24 01:28:47 +00:00
Justin Clark-Casey (justincc) d43863af78 On baked texture save, replace any HG ID with an ordinary asset ID so the HGAssetBroker doesn't try to save back to the avatar's originating region 2013-01-24 01:28:29 +00:00
Justin Clark-Casey (justincc) 83c70dc914 revert accidental change to MemoryWatchdog stat calculation in previous b1b4687 2013-01-24 01:28:16 +00:00
Justin Clark-Casey (justincc) 10c1b15f12 Add "show script timers" command to show script timers. For debug purposes.
Also, "show sensors" changes to "show script sensors".
2013-01-24 01:28:05 +00:00
Justin Clark-Casey (justincc) be5c6658bb Add "show sensors" command to show script sensor information for debug purposes. 2013-01-24 01:27:58 +00:00
Justin Clark-Casey (justincc) f0a936832b minor: Remove unnecessary commented out code from last commit c28a2f05 and fix up code comment 2013-01-24 01:27:49 +00:00
Justin Clark-Casey (justincc) ce5c2ee506 minor: make spacing consistent in console help output 2013-01-24 01:27:32 +00:00
Justin Clark-Casey (justincc) bd33953c60 minor: Fix command match of "debug script" command to "debug scripts" to match other scripts commands (and it's own short help text) 2013-01-24 01:27:20 +00:00
Justin Clark-Casey (justincc) ab22de03b8 minor: Allow "script *" console commands to take multiple script item ids 2013-01-24 01:27:13 +00:00
Melanie 61af272956 Add the new UpdateAgentInformation cap to make maturity on more recent viewers
work.
2013-01-24 01:27:06 +00:00
Justin Clark-Casey (justincc) e43ddcd5ea minor: Rename BUILDING.txt to BUILDING.md in distbin distribution nant target 2013-01-24 01:26:48 +00:00
Justin Clark-Casey (justincc) 4041cb54f3 refactor: simplify llGetNumberOfPrims() to return prim count + sitting avatar count rather than independently inspecting every scene presence 2013-01-24 01:26:05 +00:00
Justin Clark-Casey (justincc) 87b4f335af minor: Add some doc to the extremely unhelpful 'fudge....' comment as to why we're deselecting the prim in code before scheduling an update on attachment 2013-01-24 01:25:28 +00:00
SignpostMarv f9bb9191cf Improving documentation of AttachToAvatar and GetLine methods in LSL_Api.cs based on doxygen error output 2013-01-24 01:24:26 +00:00
SignpostMarv 4ab7697f00 updating documentation in SampleMoneyModule based on doxygen error log output; changing an xml-style hint to a uri-style hint in the class summary, improving documentation of Initialise method and removing a superfluous parameter, improving documentating of ClientClosed method and documenting an omitted parameter 2013-01-24 01:24:16 +00:00