diff options
author | lbsa71 | 2007-09-19 00:30:55 +0000 |
---|---|---|
committer | lbsa71 | 2007-09-19 00:30:55 +0000 |
commit | 8f0b03597b0bc8ea6873af9a55495407fae1ec56 (patch) | |
tree | f9f4de38379aebf2223ad4cb10a3d9ebcfa52a4f /OpenSim/Region/Environment/Scenes/Scripting | |
parent | * Moved SendLogoutPacket back to IClientAPI. (diff) | |
download | opensim-SC_OLD-8f0b03597b0bc8ea6873af9a55495407fae1ec56.zip opensim-SC_OLD-8f0b03597b0bc8ea6873af9a55495407fae1ec56.tar.gz opensim-SC_OLD-8f0b03597b0bc8ea6873af9a55495407fae1ec56.tar.bz2 opensim-SC_OLD-8f0b03597b0bc8ea6873af9a55495407fae1ec56.tar.xz |
* Modernized ScriptManager to new interface-based module calls.
* 'remove redundant this qualifier' ftw
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scripting')
4 files changed, 50 insertions, 50 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs b/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs index 7cf9cb7..dbd43be 100644 --- a/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs +++ b/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs | |||
@@ -1,20 +1,18 @@ | |||
1 | using System; | 1 | using Axiom.Math; |
2 | using System.Collections.Generic; | 2 | using libsecondlife; |
3 | using System.Text; | 3 | |
4 | using libsecondlife; | ||
5 | |||
6 | namespace OpenSim.Region.Environment.Scenes.Scripting | 4 | namespace OpenSim.Region.Environment.Scenes.Scripting |
7 | { | 5 | { |
8 | public interface IScriptHost | 6 | public interface IScriptHost |
9 | { | 7 | { |
10 | string Name { get; set;} | 8 | string Name { get; set; } |
11 | string SitName{ get; set;} | 9 | string SitName { get; set; } |
12 | string TouchName { get; set;} | 10 | string TouchName { get; set; } |
13 | string Description { get; set; } | 11 | string Description { get; set; } |
14 | LLUUID UUID { get; } | 12 | LLUUID UUID { get; } |
15 | LLUUID ObjectOwner { get;} | 13 | LLUUID ObjectOwner { get; } |
16 | LLUUID ObjectCreator { get; } | 14 | LLUUID ObjectCreator { get; } |
17 | LLVector3 AbsolutePosition { get; } | 15 | LLVector3 AbsolutePosition { get; } |
18 | void SetText(string text, Axiom.Math.Vector3 color, double alpha); | 16 | void SetText(string text, Vector3 color, double alpha); |
19 | } | 17 | } |
20 | } | 18 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs b/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs index 875e4cb..6876cfb 100644 --- a/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs +++ b/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs | |||
@@ -1,14 +1,13 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using Axiom.Math; |
3 | using System.Text; | 3 | using libsecondlife; |
4 | using libsecondlife; | 4 | |
5 | |||
6 | namespace OpenSim.Region.Environment.Scenes.Scripting | 5 | namespace OpenSim.Region.Environment.Scenes.Scripting |
7 | { | 6 | { |
8 | public class NullScriptHost : IScriptHost | 7 | public class NullScriptHost : IScriptHost |
9 | { | 8 | { |
10 | 9 | private LLVector3 m_pos = new LLVector3(128, 128, 30); | |
11 | LLVector3 m_pos = new LLVector3( 128, 128, 30 ); | 10 | |
12 | public string Name | 11 | public string Name |
13 | { | 12 | { |
14 | get { return "Object"; } | 13 | get { return "Object"; } |
@@ -39,18 +38,23 @@ namespace OpenSim.Region.Environment.Scenes.Scripting | |||
39 | } | 38 | } |
40 | 39 | ||
41 | public LLUUID ObjectOwner | 40 | public LLUUID ObjectOwner |
42 | { get { return LLUUID.Zero; } } | 41 | { |
42 | get { return LLUUID.Zero; } | ||
43 | } | ||
43 | 44 | ||
44 | public LLUUID ObjectCreator { get { return LLUUID.Zero; } } | 45 | public LLUUID ObjectCreator |
46 | { | ||
47 | get { return LLUUID.Zero; } | ||
48 | } | ||
45 | 49 | ||
46 | public LLVector3 AbsolutePosition | 50 | public LLVector3 AbsolutePosition |
47 | { | 51 | { |
48 | get { return m_pos; } | 52 | get { return m_pos; } |
49 | } | 53 | } |
50 | 54 | ||
51 | public void SetText(string text, Axiom.Math.Vector3 color, double alpha) | 55 | public void SetText(string text, Vector3 color, double alpha) |
52 | { | 56 | { |
53 | Console.WriteLine("Tried to SetText [{0}] on NullScriptHost", text); | 57 | Console.WriteLine("Tried to SetText [{0}] on NullScriptHost", text); |
54 | } | 58 | } |
55 | } | 59 | } |
56 | } | 60 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineInterface.cs b/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineInterface.cs index 5e8ff87..06bedaf 100644 --- a/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineInterface.cs +++ b/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineInterface.cs | |||
@@ -26,18 +26,16 @@ | |||
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | /* Original code: Tedd Hansen */ | 28 | /* Original code: Tedd Hansen */ |
29 | using System; | 29 | using OpenSim.Framework.Console; |
30 | using System.Collections.Generic; | 30 | |
31 | using System.Text; | 31 | //TODO: WHERE TO PLACE THIS? |
32 | using OpenSim.Region.Environment.Scenes.Scripting; | 32 | |
33 | |||
34 | //TODO: WHERE TO PLACE THIS? | ||
35 | namespace OpenSim.Region.Environment.Scenes.Scripting | 33 | namespace OpenSim.Region.Environment.Scenes.Scripting |
36 | { | 34 | { |
37 | public interface ScriptEngineInterface | 35 | public interface ScriptEngineInterface |
38 | { | 36 | { |
39 | void InitializeEngine(OpenSim.Region.Environment.Scenes.Scene Sceneworld, OpenSim.Framework.Console.LogBase logger); | 37 | void InitializeEngine(Scene Sceneworld, LogBase logger); |
40 | void Shutdown(); | 38 | void Shutdown(); |
41 | // void StartScript(string ScriptID, IScriptHost ObjectID); | 39 | // void StartScript(string ScriptID, IScriptHost ObjectID); |
42 | } | 40 | } |
43 | } | 41 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineLoader.cs b/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineLoader.cs index 83bd0ab..5355388 100644 --- a/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineLoader.cs +++ b/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineLoader.cs | |||
@@ -26,18 +26,18 @@ | |||
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | /* Original code: Tedd Hansen */ | 28 | /* Original code: Tedd Hansen */ |
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.IO; |
31 | using System.IO; | 31 | using System.Reflection; |
32 | using System.Text; | 32 | using OpenSim.Framework.Console; |
33 | using System.Reflection; | 33 | |
34 | |||
35 | namespace OpenSim.Region.Environment.Scenes.Scripting | 34 | namespace OpenSim.Region.Environment.Scenes.Scripting |
36 | { | 35 | { |
37 | public class ScriptEngineLoader | 36 | public class ScriptEngineLoader |
38 | { | 37 | { |
39 | private OpenSim.Framework.Console.LogBase m_log; | 38 | private LogBase m_log; |
40 | public ScriptEngineLoader(OpenSim.Framework.Console.LogBase logger) | 39 | |
40 | public ScriptEngineLoader(LogBase logger) | ||
41 | { | 41 | { |
42 | m_log = logger; | 42 | m_log = logger; |
43 | } | 43 | } |
@@ -47,12 +47,16 @@ namespace OpenSim.Region.Environment.Scenes.Scripting | |||
47 | ScriptEngineInterface ret = null; | 47 | ScriptEngineInterface ret = null; |
48 | try | 48 | try |
49 | { | 49 | { |
50 | ret = LoadAndInitAssembly(Path.Combine("ScriptEngines", "OpenSim.Region.ScriptEngine." + EngineName + ".dll"), | 50 | ret = |
51 | "OpenSim.Region.ScriptEngine." + EngineName + ".ScriptEngine"); | 51 | LoadAndInitAssembly( |
52 | Path.Combine("ScriptEngines", "OpenSim.Region.ScriptEngine." + EngineName + ".dll"), | ||
53 | "OpenSim.Region.ScriptEngine." + EngineName + ".ScriptEngine"); | ||
52 | } | 54 | } |
53 | catch (Exception e) | 55 | catch (Exception e) |
54 | { | 56 | { |
55 | m_log.Error("ScriptEngine", "Error loading assembly \"" + EngineName + "\": " + e.Message + ", " + e.StackTrace.ToString()); | 57 | m_log.Error("ScriptEngine", |
58 | "Error loading assembly \"" + EngineName + "\": " + e.Message + ", " + | ||
59 | e.StackTrace.ToString()); | ||
56 | } | 60 | } |
57 | return ret; | 61 | return ret; |
58 | } | 62 | } |
@@ -107,18 +111,14 @@ namespace OpenSim.Region.Environment.Scenes.Scripting | |||
107 | ScriptEngineInterface ret; | 111 | ScriptEngineInterface ret; |
108 | //try | 112 | //try |
109 | //{ | 113 | //{ |
110 | ret = (ScriptEngineInterface)Activator.CreateInstance(t); | 114 | ret = (ScriptEngineInterface) Activator.CreateInstance(t); |
111 | //} | 115 | //} |
112 | //catch (Exception e) | 116 | //catch (Exception e) |
113 | //{ | 117 | //{ |
114 | // m_log.Error("ScriptEngine", "Error initializing type \"" + NameSpace + "\" from \"" + FileName + "\": " + e.ToString()); | 118 | // m_log.Error("ScriptEngine", "Error initializing type \"" + NameSpace + "\" from \"" + FileName + "\": " + e.ToString()); |
115 | //} | 119 | //} |
116 | 120 | ||
117 | return ret; | 121 | return ret; |
118 | 122 | } | |
119 | |||
120 | } | ||
121 | |||
122 | |||
123 | } | 123 | } |
124 | } | 124 | } \ No newline at end of file |