diff options
author | Adam Frisby | 2008-04-21 07:09:17 +0000 |
---|---|---|
committer | Adam Frisby | 2008-04-21 07:09:17 +0000 |
commit | fef3b3689492dea63693c964bcdbec9f5137eb5e (patch) | |
tree | 7791eef001d85d3e1de863a68f26ff9434d062ca /OpenSim/Region/ScriptEngine/DotNetEngine | |
parent | * Terrain Module code has been reformatted to comply with guidelines. (diff) | |
download | opensim-SC-fef3b3689492dea63693c964bcdbec9f5137eb5e.zip opensim-SC-fef3b3689492dea63693c964bcdbec9f5137eb5e.tar.gz opensim-SC-fef3b3689492dea63693c964bcdbec9f5137eb5e.tar.bz2 opensim-SC-fef3b3689492dea63693c964bcdbec9f5137eb5e.tar.xz |
* Optimised using statements and namespace references across entire project (this took a while to run).
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine')
4 files changed, 19 insertions, 20 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs index e3013c9..fc38ef2 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs | |||
@@ -30,10 +30,10 @@ using System.CodeDom.Compiler; | |||
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Globalization; | 31 | using System.Globalization; |
32 | using System.IO; | 32 | using System.IO; |
33 | using System.Reflection; | ||
34 | using Microsoft.CSharp; | 33 | using Microsoft.CSharp; |
35 | using Microsoft.VisualBasic; | ||
36 | using Microsoft.JScript; | 34 | using Microsoft.JScript; |
35 | using Microsoft.VisualBasic; | ||
36 | using OpenSim.Region.Environment.Interfaces; | ||
37 | 37 | ||
38 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | 38 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL |
39 | { | 39 | { |
@@ -62,8 +62,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
62 | private bool WriteScriptSourceToDebugFile; | 62 | private bool WriteScriptSourceToDebugFile; |
63 | private bool CompileWithDebugInformation; | 63 | private bool CompileWithDebugInformation; |
64 | private bool CleanUpOldScriptsOnStartup; | 64 | private bool CleanUpOldScriptsOnStartup; |
65 | private System.Collections.Generic.Dictionary<string, Boolean> AllowedCompilers = new Dictionary<string, bool>(StringComparer.CurrentCultureIgnoreCase); | 65 | private Dictionary<string, bool> AllowedCompilers = new Dictionary<string, bool>(StringComparer.CurrentCultureIgnoreCase); |
66 | private System.Collections.Generic.Dictionary<string, enumCompileType> LanguageMapping = new Dictionary<string, enumCompileType>(StringComparer.CurrentCultureIgnoreCase); | 66 | private Dictionary<string, enumCompileType> LanguageMapping = new Dictionary<string, enumCompileType>(StringComparer.CurrentCultureIgnoreCase); |
67 | 67 | ||
68 | private string FilePrefix; | 68 | private string FilePrefix; |
69 | private string ScriptEnginesPath = "ScriptEngines"; | 69 | private string ScriptEnginesPath = "ScriptEngines"; |
@@ -276,7 +276,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
276 | if (enableCommanderLSL == true && l == enumCompileType.cs) | 276 | if (enableCommanderLSL == true && l == enumCompileType.cs) |
277 | { | 277 | { |
278 | foreach (KeyValuePair<string, | 278 | foreach (KeyValuePair<string, |
279 | OpenSim.Region.Environment.Interfaces.ICommander> com | 279 | ICommander> com |
280 | in m_scriptEngine.World.GetCommanders()) | 280 | in m_scriptEngine.World.GetCommanders()) |
281 | { | 281 | { |
282 | compileScript = com.Value.GenerateRuntimeAPI() + compileScript; | 282 | compileScript = com.Value.GenerateRuntimeAPI() + compileScript; |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs index 20c108d..0025b26 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | |||
@@ -26,9 +26,9 @@ | |||
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | using System; | ||
29 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
30 | using System.Text.RegularExpressions; | 31 | using System.Text.RegularExpressions; |
31 | using System; | ||
32 | 32 | ||
33 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | 33 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL |
34 | { | 34 | { |
@@ -61,7 +61,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
61 | public string Convert(string Script) | 61 | public string Convert(string Script) |
62 | { | 62 | { |
63 | quotes.Clear(); | 63 | quotes.Clear(); |
64 | string Return = System.String.Empty; | 64 | string Return = String.Empty; |
65 | Script = " \r\n" + Script; | 65 | Script = " \r\n" + Script; |
66 | 66 | ||
67 | // | 67 | // |
@@ -77,12 +77,12 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
77 | // temporarily replace quotes so we can work our magic on the script without | 77 | // temporarily replace quotes so we can work our magic on the script without |
78 | // always considering if we are inside our outside quotes's | 78 | // always considering if we are inside our outside quotes's |
79 | // TODO: Does this work on half-quotes in strings? ;) | 79 | // TODO: Does this work on half-quotes in strings? ;) |
80 | string _Script = System.String.Empty; | 80 | string _Script = String.Empty; |
81 | string C; | 81 | string C; |
82 | bool in_quote = false; | 82 | bool in_quote = false; |
83 | bool quote_replaced = false; | 83 | bool quote_replaced = false; |
84 | string quote_replacement_string = "Q_U_O_T_E_REPLACEMENT_"; | 84 | string quote_replacement_string = "Q_U_O_T_E_REPLACEMENT_"; |
85 | string quote = System.String.Empty; | 85 | string quote = String.Empty; |
86 | bool last_was_escape = false; | 86 | bool last_was_escape = false; |
87 | int quote_replaced_count = 0; | 87 | int quote_replaced_count = 0; |
88 | for (int p = 0; p < Script.Length; p++) | 88 | for (int p = 0; p < Script.Length; p++) |
@@ -101,7 +101,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
101 | } | 101 | } |
102 | else | 102 | else |
103 | { | 103 | { |
104 | if (quote == System.String.Empty) | 104 | if (quote == String.Empty) |
105 | { | 105 | { |
106 | // We didn't replace quote, probably because of empty string? | 106 | // We didn't replace quote, probably because of empty string? |
107 | _Script += quote_replacement_string + | 107 | _Script += quote_replacement_string + |
@@ -111,7 +111,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
111 | quotes.Add( | 111 | quotes.Add( |
112 | quote_replacement_string + | 112 | quote_replacement_string + |
113 | quote_replaced_count.ToString().PadLeft(5, "0".ToCharArray()[0]), quote); | 113 | quote_replaced_count.ToString().PadLeft(5, "0".ToCharArray()[0]), quote); |
114 | quote = System.String.Empty; | 114 | quote = String.Empty; |
115 | } | 115 | } |
116 | break; | 116 | break; |
117 | } | 117 | } |
@@ -155,10 +155,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
155 | // | 155 | // |
156 | int ilevel = 0; | 156 | int ilevel = 0; |
157 | int lastlevel = 0; | 157 | int lastlevel = 0; |
158 | string ret = System.String.Empty; | 158 | string ret = String.Empty; |
159 | string cache = System.String.Empty; | 159 | string cache = String.Empty; |
160 | bool in_state = false; | 160 | bool in_state = false; |
161 | string current_statename = System.String.Empty; | 161 | string current_statename = String.Empty; |
162 | for (int p = 0; p < Script.Length; p++) | 162 | for (int p = 0; p < Script.Length; p++) |
163 | { | 163 | { |
164 | C = Script.Substring(p, 1); | 164 | C = Script.Substring(p, 1); |
@@ -319,9 +319,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
319 | { | 319 | { |
320 | state_events.Add(statea, convertnametoFlag(eventa)); | 320 | state_events.Add(statea, convertnametoFlag(eventa)); |
321 | } | 321 | } |
322 | System.Console.WriteLine("State:" + statea + ", event: " + eventa); | 322 | Console.WriteLine("State:" + statea + ", event: " + eventa); |
323 | } | 323 | } |
324 | System.Console.WriteLine("Matches:" + eventmatches.GetUpperBound(0)); | 324 | Console.WriteLine("Matches:" + eventmatches.GetUpperBound(0)); |
325 | // Add namespace, class name and inheritance | 325 | // Add namespace, class name and inheritance |
326 | 326 | ||
327 | // Looking *ONLY* for state entry events | 327 | // Looking *ONLY* for state entry events |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs index 6f2dbad..99efed3 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs | |||
@@ -28,13 +28,12 @@ | |||
28 | /* Original code: Tedd Hansen */ | 28 | /* Original code: Tedd Hansen */ |
29 | using System; | 29 | using System; |
30 | using Nini.Config; | 30 | using Nini.Config; |
31 | using OpenSim.Framework.Console; | ||
32 | using OpenSim.Region.Environment.Scenes; | 31 | using OpenSim.Region.Environment.Scenes; |
33 | 32 | ||
34 | namespace OpenSim.Region.ScriptEngine.DotNetEngine | 33 | namespace OpenSim.Region.ScriptEngine.DotNetEngine |
35 | { | 34 | { |
36 | [Serializable] | 35 | [Serializable] |
37 | public class ScriptEngine : OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.ScriptEngine | 36 | public class ScriptEngine : Common.ScriptEngineBase.ScriptEngine |
38 | { | 37 | { |
39 | // We need to override a few things for our DotNetEngine | 38 | // We need to override a few things for our DotNetEngine |
40 | public override void Initialise(Scene scene, IConfigSource config) | 39 | public override void Initialise(Scene scene, IConfigSource config) |
@@ -43,7 +42,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
43 | InitializeEngine(scene, config, true, GetScriptManager()); | 42 | InitializeEngine(scene, config, true, GetScriptManager()); |
44 | } | 43 | } |
45 | 44 | ||
46 | public override OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.ScriptManager _GetScriptManager() | 45 | public override Common.ScriptEngineBase.ScriptManager _GetScriptManager() |
47 | { | 46 | { |
48 | return new ScriptManager(this); | 47 | return new ScriptManager(this); |
49 | } | 48 | } |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs index 05a2d06..e242748 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs | |||
@@ -34,7 +34,7 @@ using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase; | |||
34 | 34 | ||
35 | namespace OpenSim.Region.ScriptEngine.DotNetEngine | 35 | namespace OpenSim.Region.ScriptEngine.DotNetEngine |
36 | { | 36 | { |
37 | public class ScriptManager : OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.ScriptManager | 37 | public class ScriptManager : Common.ScriptEngineBase.ScriptManager |
38 | { | 38 | { |
39 | public ScriptManager(Common.ScriptEngineBase.ScriptEngine scriptEngine) | 39 | public ScriptManager(Common.ScriptEngineBase.ScriptEngine scriptEngine) |
40 | : base(scriptEngine) | 40 | : base(scriptEngine) |