aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/DotNetEngine
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs30
1 files changed, 28 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
index 55289d9..a328a58 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
@@ -26,6 +26,8 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Reflection;
30using log4net;
29using libsecondlife; 31using libsecondlife;
30using OpenSim.Framework; 32using OpenSim.Framework;
31using OpenSim.Region.Environment.Scenes; 33using OpenSim.Region.Environment.Scenes;
@@ -43,6 +45,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
43 } 45 }
44 private Compiler.LSL.Compiler LSLCompiler; 46 private Compiler.LSL.Compiler LSLCompiler;
45 47
48 private static readonly ILog m_log
49 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
50
46 51
47 public override void Initialize() 52 public override void Initialize()
48 { 53 {
@@ -70,10 +75,31 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
70 75
71 SceneObjectPart m_host = World.GetSceneObjectPart(localID); 76 SceneObjectPart m_host = World.GetSceneObjectPart(localID);
72 77
78 // Xantor 20080525: I need assetID here to see if we already compiled this one previously
79 LLUUID assetID = LLUUID.Zero;
80 TaskInventoryItem taskInventoryItem = new TaskInventoryItem();
81 if(m_host.TaskInventory.TryGetValue(itemID,out taskInventoryItem))
82 assetID = taskInventoryItem.AssetID;
83
84
73 try 85 try
74 { 86 {
75 // Compile (We assume LSL) 87 // Xantor 20080525 see if we already compiled this script this session, stop incessant recompiling on
76 CompiledScriptFile = LSLCompiler.PerformScriptCompile(Script); 88 // scriptreset, spawning of objects with embedded scripts etc.
89
90 if (scriptList.TryGetValue(assetID, out CompiledScriptFile))
91 {
92 m_log.InfoFormat("[SCRIPT]: Found existing compile of assetID {0}: {1}", assetID, CompiledScriptFile);
93 }
94 else
95 {
96 // Compile (We assume LSL)
97 CompiledScriptFile = LSLCompiler.PerformScriptCompile(Script);
98
99 // Xantor 20080525 Save compiled scriptfile for later use
100 m_log.InfoFormat("[SCRIPT]: Compiled assetID {0}: {1}", assetID, CompiledScriptFile);
101 scriptList.Add(assetID, CompiledScriptFile);
102 }
77 103
78//#if DEBUG 104//#if DEBUG
79 //long before; 105 //long before;