aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scripting
diff options
context:
space:
mode:
authorSean Dague2007-09-17 12:52:03 +0000
committerSean Dague2007-09-17 12:52:03 +0000
commitb8d9737a47696952bedec33dface8f18df47341f (patch)
tree9279f45510f8a9285ac5b9c9165ab6c741009eac /OpenSim/Region/Environment/Scenes/Scripting
parentI think this is the last bits for a consistant pristine (diff)
downloadopensim-SC_OLD-b8d9737a47696952bedec33dface8f18df47341f.zip
opensim-SC_OLD-b8d9737a47696952bedec33dface8f18df47341f.tar.gz
opensim-SC_OLD-b8d9737a47696952bedec33dface8f18df47341f.tar.bz2
opensim-SC_OLD-b8d9737a47696952bedec33dface8f18df47341f.tar.xz
fixing me some line endings
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scripting')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs40
-rw-r--r--OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs112
-rw-r--r--OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineInterface.cs86
-rw-r--r--OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineLoader.cs248
4 files changed, 243 insertions, 243 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs b/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs
index 2f248ce..7cf9cb7 100644
--- a/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs
+++ b/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs
@@ -1,20 +1,20 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4using libsecondlife; 4using libsecondlife;
5 5
6namespace OpenSim.Region.Environment.Scenes.Scripting 6namespace OpenSim.Region.Environment.Scenes.Scripting
7{ 7{
8 public interface IScriptHost 8 public interface IScriptHost
9 { 9 {
10 string Name { get; set;} 10 string Name { get; set;}
11 string SitName{ get; set;} 11 string SitName{ get; set;}
12 string TouchName { get; set;} 12 string TouchName { get; set;}
13 string Description { get; set; } 13 string Description { get; set; }
14 LLUUID UUID { get; } 14 LLUUID UUID { get; }
15 LLUUID ObjectOwner { get;} 15 LLUUID ObjectOwner { get;}
16 LLUUID ObjectCreator { get; } 16 LLUUID ObjectCreator { get; }
17 LLVector3 AbsolutePosition { get; } 17 LLVector3 AbsolutePosition { get; }
18 void SetText(string text, Axiom.Math.Vector3 color, double alpha); 18 void SetText(string text, Axiom.Math.Vector3 color, double alpha);
19 } 19 }
20} 20}
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs b/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs
index 5e3dcae..875e4cb 100644
--- a/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs
+++ b/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs
@@ -1,56 +1,56 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4using libsecondlife; 4using libsecondlife;
5 5
6namespace OpenSim.Region.Environment.Scenes.Scripting 6namespace OpenSim.Region.Environment.Scenes.Scripting
7{ 7{
8 public class NullScriptHost : IScriptHost 8 public class NullScriptHost : IScriptHost
9 { 9 {
10 10
11 LLVector3 m_pos = new LLVector3( 128, 128, 30 ); 11 LLVector3 m_pos = new LLVector3( 128, 128, 30 );
12 public string Name 12 public string Name
13 { 13 {
14 get { return "Object"; } 14 get { return "Object"; }
15 set { } 15 set { }
16 } 16 }
17 17
18 public string SitName 18 public string SitName
19 { 19 {
20 get { return ""; } 20 get { return ""; }
21 set { } 21 set { }
22 } 22 }
23 23
24 public string TouchName 24 public string TouchName
25 { 25 {
26 get { return ""; } 26 get { return ""; }
27 set { } 27 set { }
28 } 28 }
29 29
30 public string Description 30 public string Description
31 { 31 {
32 get { return ""; } 32 get { return ""; }
33 set { } 33 set { }
34 } 34 }
35 35
36 public LLUUID UUID 36 public LLUUID UUID
37 { 37 {
38 get { return LLUUID.Zero; } 38 get { return LLUUID.Zero; }
39 } 39 }
40 40
41 public LLUUID ObjectOwner 41 public LLUUID ObjectOwner
42 { get { return LLUUID.Zero; } } 42 { get { return LLUUID.Zero; } }
43 43
44 public LLUUID ObjectCreator { get { return LLUUID.Zero; } } 44 public LLUUID ObjectCreator { get { return LLUUID.Zero; } }
45 45
46 public LLVector3 AbsolutePosition 46 public LLVector3 AbsolutePosition
47 { 47 {
48 get { return m_pos; } 48 get { return m_pos; }
49 } 49 }
50 50
51 public void SetText(string text, Axiom.Math.Vector3 color, double alpha) 51 public void SetText(string text, Axiom.Math.Vector3 color, double alpha)
52 { 52 {
53 Console.WriteLine("Tried to SetText [{0}] on NullScriptHost", text); 53 Console.WriteLine("Tried to SetText [{0}] on NullScriptHost", text);
54 } 54 }
55 } 55 }
56} 56}
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineInterface.cs b/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineInterface.cs
index d3d58fe..5e8ff87 100644
--- a/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineInterface.cs
+++ b/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineInterface.cs
@@ -1,43 +1,43 @@
1/* 1/*
2* Copyright (c) Contributors, http://opensimulator.org/ 2* Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28/* Original code: Tedd Hansen */ 28/* Original code: Tedd Hansen */
29using System; 29using System;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Text; 31using System.Text;
32using OpenSim.Region.Environment.Scenes.Scripting; 32using OpenSim.Region.Environment.Scenes.Scripting;
33 33
34//TODO: WHERE TO PLACE THIS? 34//TODO: WHERE TO PLACE THIS?
35namespace OpenSim.Region.Environment.Scenes.Scripting 35namespace OpenSim.Region.Environment.Scenes.Scripting
36{ 36{
37 public interface ScriptEngineInterface 37 public interface ScriptEngineInterface
38 { 38 {
39 void InitializeEngine(OpenSim.Region.Environment.Scenes.Scene Sceneworld, OpenSim.Framework.Console.LogBase logger); 39 void InitializeEngine(OpenSim.Region.Environment.Scenes.Scene Sceneworld, OpenSim.Framework.Console.LogBase logger);
40 void Shutdown(); 40 void Shutdown();
41// void StartScript(string ScriptID, IScriptHost ObjectID); 41// void StartScript(string ScriptID, IScriptHost ObjectID);
42 } 42 }
43} 43}
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineLoader.cs b/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineLoader.cs
index 3500545..83bd0ab 100644
--- a/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineLoader.cs
+++ b/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineLoader.cs
@@ -1,124 +1,124 @@
1/* 1/*
2* Copyright (c) Contributors, http://opensimulator.org/ 2* Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28/* Original code: Tedd Hansen */ 28/* Original code: Tedd Hansen */
29using System; 29using System;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.IO; 31using System.IO;
32using System.Text; 32using System.Text;
33using System.Reflection; 33using System.Reflection;
34 34
35namespace OpenSim.Region.Environment.Scenes.Scripting 35namespace OpenSim.Region.Environment.Scenes.Scripting
36{ 36{
37 public class ScriptEngineLoader 37 public class ScriptEngineLoader
38 { 38 {
39 private OpenSim.Framework.Console.LogBase m_log; 39 private OpenSim.Framework.Console.LogBase m_log;
40 public ScriptEngineLoader(OpenSim.Framework.Console.LogBase logger) 40 public ScriptEngineLoader(OpenSim.Framework.Console.LogBase logger)
41 { 41 {
42 m_log = logger; 42 m_log = logger;
43 } 43 }
44 44
45 public ScriptEngineInterface LoadScriptEngine(string EngineName) 45 public ScriptEngineInterface LoadScriptEngine(string EngineName)
46 { 46 {
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 = LoadAndInitAssembly(Path.Combine("ScriptEngines", "OpenSim.Region.ScriptEngine." + EngineName + ".dll"),
51 "OpenSim.Region.ScriptEngine." + EngineName + ".ScriptEngine"); 51 "OpenSim.Region.ScriptEngine." + EngineName + ".ScriptEngine");
52 } 52 }
53 catch (Exception e) 53 catch (Exception e)
54 { 54 {
55 m_log.Error("ScriptEngine", "Error loading assembly \"" + EngineName + "\": " + e.Message + ", " + e.StackTrace.ToString()); 55 m_log.Error("ScriptEngine", "Error loading assembly \"" + EngineName + "\": " + e.Message + ", " + e.StackTrace.ToString());
56 } 56 }
57 return ret; 57 return ret;
58 } 58 }
59 59
60 /// <summary> 60 /// <summary>
61 /// Does actual loading and initialization of script Assembly 61 /// Does actual loading and initialization of script Assembly
62 /// </summary> 62 /// </summary>
63 /// <param name="FreeAppDomain">AppDomain to load script into</param> 63 /// <param name="FreeAppDomain">AppDomain to load script into</param>
64 /// <param name="FileName">FileName of script assembly (.dll)</param> 64 /// <param name="FileName">FileName of script assembly (.dll)</param>
65 /// <returns></returns> 65 /// <returns></returns>
66 private ScriptEngineInterface LoadAndInitAssembly(string FileName, string NameSpace) 66 private ScriptEngineInterface LoadAndInitAssembly(string FileName, string NameSpace)
67 { 67 {
68 //Common.SendToDebug("Loading ScriptEngine Assembly " + FileName); 68 //Common.SendToDebug("Loading ScriptEngine Assembly " + FileName);
69 // Load .Net Assembly (.dll) 69 // Load .Net Assembly (.dll)
70 // Initialize and return it 70 // Initialize and return it
71 71
72 // TODO: Add error handling 72 // TODO: Add error handling
73 73
74 Assembly a; 74 Assembly a;
75 //try 75 //try
76 //{ 76 //{
77 77
78 78
79 // Load to default appdomain (temporary) 79 // Load to default appdomain (temporary)
80 a = Assembly.LoadFrom(FileName); 80 a = Assembly.LoadFrom(FileName);
81 // Load to specified appdomain 81 // Load to specified appdomain
82 // TODO: Insert security 82 // TODO: Insert security
83 //a = FreeAppDomain.Load(FileName); 83 //a = FreeAppDomain.Load(FileName);
84 //} 84 //}
85 //catch (Exception e) 85 //catch (Exception e)
86 //{ 86 //{
87 // m_log.Error("ScriptEngine", "Error loading assembly \"" + FileName + "\": " + e.ToString()); 87 // m_log.Error("ScriptEngine", "Error loading assembly \"" + FileName + "\": " + e.ToString());
88 //} 88 //}
89 89
90 90
91 //Console.WriteLine("Loading: " + FileName); 91 //Console.WriteLine("Loading: " + FileName);
92 //foreach (Type _t in a.GetTypes()) 92 //foreach (Type _t in a.GetTypes())
93 //{ 93 //{
94 // Console.WriteLine("Type: " + _t.ToString()); 94 // Console.WriteLine("Type: " + _t.ToString());
95 //} 95 //}
96 96
97 Type t; 97 Type t;
98 //try 98 //try
99 //{ 99 //{
100 t = a.GetType(NameSpace, true); 100 t = a.GetType(NameSpace, true);
101 //} 101 //}
102 //catch (Exception e) 102 //catch (Exception e)
103 //{ 103 //{
104 // m_log.Error("ScriptEngine", "Error initializing type \"" + NameSpace + "\" from \"" + FileName + "\": " + e.ToString()); 104 // m_log.Error("ScriptEngine", "Error initializing type \"" + NameSpace + "\" from \"" + FileName + "\": " + e.ToString());
105 //} 105 //}
106 106
107 ScriptEngineInterface ret; 107 ScriptEngineInterface ret;
108 //try 108 //try
109 //{ 109 //{
110 ret = (ScriptEngineInterface)Activator.CreateInstance(t); 110 ret = (ScriptEngineInterface)Activator.CreateInstance(t);
111 //} 111 //}
112 //catch (Exception e) 112 //catch (Exception e)
113 //{ 113 //{
114 // m_log.Error("ScriptEngine", "Error initializing type \"" + NameSpace + "\" from \"" + FileName + "\": " + e.ToString()); 114 // m_log.Error("ScriptEngine", "Error initializing type \"" + NameSpace + "\" from \"" + FileName + "\": " + e.ToString());
115 //} 115 //}
116 116
117 return ret; 117 return ret;
118 118
119 119
120 } 120 }
121 121
122 122
123 } 123 }
124} 124}