From 1eec177d4b11e2793a5d77c20e9112a20138464a Mon Sep 17 00:00:00 2001
From: Adam Frisby
Date: Wed, 27 Jun 2007 09:30:07 +0000
Subject: * Begun reimplementing scripting.
---
OpenSim/OpenSim.Region/OpenSim.Region.csproj | 55 ++++++++++--------
OpenSim/OpenSim.Scripting/OpenSim.Scripting.csproj | 66 ++++++++++++++++++++++
.../OpenSim.Scripting/Properties/AssemblyInfo.cs | 35 ++++++++++++
OpenSim/OpenSim.Scripting/Script.cs | 32 +++++++++++
OpenSim/OpenSim.Scripting/ScriptAccess.cs | 31 ++++++++++
5 files changed, 196 insertions(+), 23 deletions(-)
create mode 100644 OpenSim/OpenSim.Scripting/OpenSim.Scripting.csproj
create mode 100644 OpenSim/OpenSim.Scripting/Properties/AssemblyInfo.cs
create mode 100644 OpenSim/OpenSim.Scripting/Script.cs
create mode 100644 OpenSim/OpenSim.Scripting/ScriptAccess.cs
diff --git a/OpenSim/OpenSim.Region/OpenSim.Region.csproj b/OpenSim/OpenSim.Region/OpenSim.Region.csproj
index 4edcd58..0868c68 100644
--- a/OpenSim/OpenSim.Region/OpenSim.Region.csproj
+++ b/OpenSim/OpenSim.Region/OpenSim.Region.csproj
@@ -1,4 +1,4 @@
-
+
Local
8.0.50727
@@ -6,7 +6,8 @@
{196916AF-0000-0000-0000-000000000000}
Debug
AnyCPU
-
+
+
OpenSim.Region
@@ -15,9 +16,11 @@
IE50
false
Library
-
+
+
OpenSim.Region
-
+
+
@@ -28,7 +31,8 @@
TRACE;DEBUG
-
+
+
True
4096
False
@@ -37,7 +41,8 @@
False
False
4
-
+
+
False
@@ -46,7 +51,8 @@
TRACE
-
+
+
False
4096
True
@@ -55,26 +61,28 @@
False
False
4
-
+
+
-
+
..\..\bin\Axiom.MathLib.dll
False
-
+
..\..\bin\Db4objects.Db4o.dll
False
-
+
..\..\bin\libsecondlife.dll
False
-
+
System.dll
False
-
+
+
System.Xml.dll
False
@@ -84,55 +92,55 @@
OpenGrid.Framework.Communications
{683344D5-0000-0000-0000-000000000000}
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- False
+ False
OpenSim.Caches
{1938EB12-0000-0000-0000-000000000000}
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- False
+ False
OpenSim.Framework
{8ACA2445-0000-0000-0000-000000000000}
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- False
+ False
OpenSim.Framework.Console
{A7CD0630-0000-0000-0000-000000000000}
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- False
+ False
OpenSim.GenericConfig.Xml
{E88EF749-0000-0000-0000-000000000000}
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- False
+ False
OpenSim.Physics.Manager
{8BE16150-0000-0000-0000-000000000000}
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- False
+ False
OpenSim.Servers
{8BB20F0A-0000-0000-0000-000000000000}
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- False
+ False
OpenSim.Terrain.BasicTerrain
{2270B8FE-0000-0000-0000-000000000000}
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- False
+ False
XMLRPC
{8E81D43C-0000-0000-0000-000000000000}
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- False
+ False
@@ -169,6 +177,7 @@
Code
+
Code
@@ -207,4 +216,4 @@
-
+
\ No newline at end of file
diff --git a/OpenSim/OpenSim.Scripting/OpenSim.Scripting.csproj b/OpenSim/OpenSim.Scripting/OpenSim.Scripting.csproj
new file mode 100644
index 0000000..41b852d
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/OpenSim.Scripting.csproj
@@ -0,0 +1,66 @@
+
+
+ Debug
+ AnyCPU
+ 8.0.50727
+ 2.0
+ {3C3A8BD5-F53C-42D0-8ADE-E2492790788A}
+ Library
+ Properties
+ OpenSim.Scripting
+ OpenSim.Scripting
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ False
+ ..\..\bin\libsecondlife.dll
+
+
+
+
+
+
+
+
+
+
+
+
+ {A7CD0630-0000-0000-0000-000000000000}
+ OpenSim.Framework.Console
+
+
+ {8ACA2445-0000-0000-0000-000000000000}
+ OpenSim.Framework
+
+
+ {196916AF-0000-0000-0000-000000000000}
+ OpenSim.Region
+
+
+
+
+
\ No newline at end of file
diff --git a/OpenSim/OpenSim.Scripting/Properties/AssemblyInfo.cs b/OpenSim/OpenSim.Scripting/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..f5da4c0
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("OpenSim.Scripting")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("OpenSim.Scripting")]
+[assembly: AssemblyCopyright("Copyright © 2007")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("61eae1ad-82aa-4c77-8bc5-b5a8c9522b18")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/OpenSim.Scripting/Script.cs b/OpenSim/OpenSim.Scripting/Script.cs
new file mode 100644
index 0000000..0f4af00
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/Script.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using OpenSim.Framework.Console;
+using OpenSim.Framework;
+using OpenSim.Region;
+using OpenSim.Region.Scenes;
+
+namespace OpenSim.Scripting
+{
+ public interface IScript
+ {
+ void Initialise(ScriptInfo scriptInfo);
+ }
+
+ public class TestScript : IScript
+ {
+ ScriptInfo script;
+
+ public void Initialise(ScriptInfo scriptInfo)
+ {
+ script = scriptInfo;
+ script.events.OnFrame += new OpenSim.Region.Scenes.EventManager.OnFrameDelegate(events_OnFrame);
+ }
+
+ void events_OnFrame()
+ {
+ script.logger.Verbose("Hello World!");
+ }
+ }
+}
diff --git a/OpenSim/OpenSim.Scripting/ScriptAccess.cs b/OpenSim/OpenSim.Scripting/ScriptAccess.cs
new file mode 100644
index 0000000..a9fede5
--- /dev/null
+++ b/OpenSim/OpenSim.Scripting/ScriptAccess.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using OpenSim.Region.Scenes;
+using OpenSim.Framework.Console;
+
+namespace OpenSim.Scripting
+{
+ ///
+ /// Class which provides access to the world
+ ///
+ public class ScriptInfo
+ {
+ // Reference to world.eventsManager provided for convenience
+ public EventManager events;
+
+ // The main world
+ public Scene world;
+
+ // The console
+ public LogBase logger;
+
+ public ScriptInfo(Scene scene)
+ {
+ world = scene;
+ events = world.eventManager;
+ logger = OpenSim.Framework.Console.MainLog.Instance;
+ }
+ }
+}
--
cgit v1.1