aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs39
1 files changed, 20 insertions, 19 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
index 32e1df1..6d8096f 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
@@ -39,6 +39,7 @@ using System.IO;
39using System.Runtime.Serialization.Formatters.Binary; 39using System.Runtime.Serialization.Formatters.Binary;
40using System.Threading; 40using System.Threading;
41using OpenSim.Region.ScriptEngine.Shared.ScriptBase; 41using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
42using OpenSim.Region.ScriptEngine.Shared.CodeTools;
42 43
43namespace OpenSim.Region.ScriptEngine.DotNetEngine 44namespace OpenSim.Region.ScriptEngine.DotNetEngine
44{ 45{
@@ -87,13 +88,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
87 Unload = 2 88 Unload = 2
88 } 89 }
89 90
90 public Dictionary<UUID, String> scriptList =
91 new Dictionary<UUID, string>();
92
93 public Dictionary<uint, Dictionary<UUID, InstanceData>> Scripts = 91 public Dictionary<uint, Dictionary<UUID, InstanceData>> Scripts =
94 new Dictionary<uint, Dictionary<UUID, InstanceData>>(); 92 new Dictionary<uint, Dictionary<UUID, InstanceData>>();
95 93
96 private Compiler.LSL.Compiler LSLCompiler; 94 private Compiler LSLCompiler;
97 95
98 public Scene World 96 public Scene World
99 { 97 {
@@ -105,7 +103,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
105 public void Initialize() 103 public void Initialize()
106 { 104 {
107 // Create our compiler 105 // Create our compiler
108 LSLCompiler = new Compiler.LSL.Compiler(m_scriptEngine); 106 LSLCompiler = new Compiler(m_scriptEngine);
109 } 107 }
110 108
111 public void _StartScript(uint localID, UUID itemID, string Script, 109 public void _StartScript(uint localID, UUID itemID, string Script,
@@ -136,23 +134,22 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
136 if (m_host.TaskInventory.TryGetValue(itemID, out taskInventoryItem)) 134 if (m_host.TaskInventory.TryGetValue(itemID, out taskInventoryItem))
137 assetID = taskInventoryItem.AssetID; 135 assetID = taskInventoryItem.AssetID;
138 136
137 ScenePresence presence =
138 World.GetScenePresence(taskInventoryItem.OwnerID);
139
139 try 140 try
140 { 141 {
141 if (scriptList.TryGetValue(assetID, out CompiledScriptFile)) 142 // Compile (We assume LSL)
142 { 143 CompiledScriptFile =
143 m_log.InfoFormat("[SCRIPT]: Found existing compile of "+ 144 LSLCompiler.PerformScriptCompile(Script,
144 "assetID {0}: {1}", assetID, CompiledScriptFile); 145 assetID.ToString());
145 }
146 else
147 {
148 // Compile (We assume LSL)
149 CompiledScriptFile =
150 LSLCompiler.PerformScriptCompile(Script);
151 146
152 m_log.InfoFormat("[SCRIPT]: Compiled assetID {0}: {1}", 147 if (presence != null)
153 assetID, CompiledScriptFile); 148 presence.ControllingClient.SendAgentAlertMessage(
154 scriptList.Add(assetID, CompiledScriptFile); 149 "Compile successful", false);
155 } 150
151 m_log.InfoFormat("[SCRIPT]: Compiled assetID {0}: {1}",
152 assetID, CompiledScriptFile);
156 153
157 InstanceData id = new InstanceData(); 154 InstanceData id = new InstanceData();
158 155
@@ -201,6 +198,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
201 } 198 }
202 catch (Exception e) // LEGIT: User Scripting 199 catch (Exception e) // LEGIT: User Scripting
203 { 200 {
201 if (presence != null)
202 presence.ControllingClient.SendAgentAlertMessage(
203 "Script saved with errors, check debug window!",
204 false);
204 try 205 try
205 { 206 {
206 // DISPLAY ERROR INWORLD 207 // DISPLAY ERROR INWORLD