aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
diff options
context:
space:
mode:
authorMelanie2012-06-29 22:24:53 +0100
committerMelanie2012-06-29 22:24:53 +0100
commit6137f37028a798f87af3f8afb71ec4856b2a5ad8 (patch)
tree39289035f883415b5ccae36a9b2af1ad60c7acf6 /OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
parentMerge branch 'avination' into careminster (diff)
parentMove update of the final optional ODE total frame stat inside the OdeLock rat... (diff)
downloadopensim-SC-6137f37028a798f87af3f8afb71ec4856b2a5ad8.zip
opensim-SC-6137f37028a798f87af3f8afb71ec4856b2a5ad8.tar.gz
opensim-SC-6137f37028a798f87af3f8afb71ec4856b2a5ad8.tar.bz2
opensim-SC-6137f37028a798f87af3f8afb71ec4856b2a5ad8.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs OpenSim/Region/Framework/Scenes/Scene.cs
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine/XEngine.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs29
1 files changed, 18 insertions, 11 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 79d1944..7364b19 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -847,27 +847,34 @@ namespace OpenSim.Region.ScriptEngine.XEngine
847 if (engine == ScriptEngineName) 847 if (engine == ScriptEngineName)
848 { 848 {
849 // If we are falling back on XEngine as the default engine, then only complain to the user 849 // If we are falling back on XEngine as the default engine, then only complain to the user
850 // if a script language has been explicitly set and it's one that we recognize. If it's 850 // if a script language has been explicitly set and it's one that we recognize or there are
851 // no non-whitespace characters after the colon.
852 //
853 // If the script is
851 // explicitly not allowed or the script is not in LSL then the user will be informed by a later compiler message. 854 // explicitly not allowed or the script is not in LSL then the user will be informed by a later compiler message.
852 // 855 //
856 // If the colon ends the line then we'll risk the false positive as this is more likely
857 // to signal a real scriptengine line where the user wants to use the default compile language.
858 //
853 // This avoids the overwhelming number of false positives where we're in this code because 859 // This avoids the overwhelming number of false positives where we're in this code because
854 // there's a colon in a comment in the first line of a script for entirely 860 // there's a colon in a comment in the first line of a script for entirely
855 // unrelated reasons (e.g. vim settings). 861 // unrelated reasons (e.g. vim settings).
856 // 862 //
857 // TODO: A better fix would be to deprecate simple : detection and look for some less likely 863 // TODO: A better fix would be to deprecate simple : detection and look for some less likely
858 // string to begin the comment (like #! in unix shell scripts). 864 // string to begin the comment (like #! in unix shell scripts).
859 bool scriptExplicitlyInXEngineLanguage = false; 865 bool warnRunningInXEngine = false;
860 string restOfScript = script.Substring(colon + 1); 866 string restOfFirstLine = firstline.Substring(colon + 1);
861 867
862 // FIXME: These are hardcoded because they are currently hardcoded in Compiler.cs 868 // FIXME: These are hardcoded because they are currently hardcoded in Compiler.cs
863 if (restOfScript.StartsWith("c#") 869 if (restOfFirstLine.StartsWith("c#")
864 || restOfScript.StartsWith("vb") 870 || restOfFirstLine.StartsWith("vb")
865 || restOfScript.StartsWith("lsl") 871 || restOfFirstLine.StartsWith("lsl")
866 || restOfScript.StartsWith("js") 872 || restOfFirstLine.StartsWith("js")
867 || restOfScript.StartsWith("yp")) 873 || restOfFirstLine.StartsWith("yp")
868 scriptExplicitlyInXEngineLanguage = true; 874 || restOfFirstLine.Length == 0)
869 875 warnRunningInXEngine = true;
870 if (scriptExplicitlyInXEngineLanguage) 876
877 if (warnRunningInXEngine)
871 { 878 {
872 SceneObjectPart part = 879 SceneObjectPart part =
873 m_Scene.GetSceneObjectPart( 880 m_Scene.GetSceneObjectPart(