From a0a189aed297109777584644f1b642fa21efc306 Mon Sep 17 00:00:00 2001
From: Charles Krinke
Date: Wed, 12 Dec 2007 22:07:40 +0000
Subject: Thanks to Alondria for: llResetScript() is now functional. With this
 patch, Kan-script 0000003 should run. Noted the llListen(0,"","","") errored
 due to "" != UUID - patched to set to NULL_KEY which then works to listen to
 everything.

---
 .../Compiler/Server_API/LSL_BuiltIn_Commands.cs    |  4 +++
 .../ScriptEngine/DotNetEngine/ScriptManager.cs     | 31 ++++++++++++----------
 2 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs
index 0e905be..94479a0 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs
@@ -292,6 +292,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
 
         public int llListen(int channelID, string name, string ID, string msg)
         {
+            if (ID == "")
+            {
+                ID = LLUUID.Zero.ToString();
+            }
             IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
             return wComm.Listen(m_localID, m_itemID, m_host.UUID, channelID, name, ID, msg);
         }
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
index 0d49174..6b83dff 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
@@ -127,18 +127,16 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
                 {
                     if (loadQueue.Count == 0 && unloadQueue.Count == 0)
                         Thread.Sleep(scriptLoadUnloadThread_IdleSleepms);
-
-                    if (loadQueue.Count > 0)
-                    {
-                        LoadStruct item = loadQueue.Dequeue();
-                        _StartScript(item.localID, item.itemID, item.script);
-                    }
-
                     if (unloadQueue.Count > 0)
                     {
                         UnloadStruct item = unloadQueue.Dequeue();
                         _StopScript(item.localID, item.itemID);
                     }
+                    if (loadQueue.Count > 0)
+                    {
+                        LoadStruct item = loadQueue.Dequeue();
+                        _StartScript(item.localID, item.itemID, item.script);
+                    }
                 }
             }
             catch (ThreadAbortException tae)
@@ -279,13 +277,18 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
 
                 try
                 {
-                    
-                    // Compile (We assume LSL)
-                    ScriptSource = LSLCompiler.CompileFromLSLText(Script);
-                    //Console.WriteLine("Compilation of " + FileName + " done");
-                    // * Insert yield into code
-                    ScriptSource = ProcessYield(ScriptSource);
-
+                    if (!Script.EndsWith("dll"))
+                    {
+                        // Compile (We assume LSL)
+                        ScriptSource = LSLCompiler.CompileFromLSLText(Script);
+                        //Console.WriteLine("Compilation of " + FileName + " done");
+                        // * Insert yield into code
+                        ScriptSource = ProcessYield(ScriptSource);
+                    }
+                    else
+                    {
+                        ScriptSource = Script;
+                    }
 
 #if DEBUG
                     long before;
-- 
cgit v1.1