diff options
Diffstat (limited to 'OpenSim/OpenSim.Scripting')
-rw-r--r-- | OpenSim/OpenSim.Scripting/OpenSim.Scripting.csproj | 66 | ||||
-rw-r--r-- | OpenSim/OpenSim.Scripting/Properties/AssemblyInfo.cs | 35 | ||||
-rw-r--r-- | OpenSim/OpenSim.Scripting/Script.cs | 32 | ||||
-rw-r--r-- | OpenSim/OpenSim.Scripting/ScriptAccess.cs | 31 |
4 files changed, 164 insertions, 0 deletions
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 @@ | |||
1 | <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
2 | <PropertyGroup> | ||
3 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
4 | <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
5 | <ProductVersion>8.0.50727</ProductVersion> | ||
6 | <SchemaVersion>2.0</SchemaVersion> | ||
7 | <ProjectGuid>{3C3A8BD5-F53C-42D0-8ADE-E2492790788A}</ProjectGuid> | ||
8 | <OutputType>Library</OutputType> | ||
9 | <AppDesignerFolder>Properties</AppDesignerFolder> | ||
10 | <RootNamespace>OpenSim.Scripting</RootNamespace> | ||
11 | <AssemblyName>OpenSim.Scripting</AssemblyName> | ||
12 | </PropertyGroup> | ||
13 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
14 | <DebugSymbols>true</DebugSymbols> | ||
15 | <DebugType>full</DebugType> | ||
16 | <Optimize>false</Optimize> | ||
17 | <OutputPath>bin\Debug\</OutputPath> | ||
18 | <DefineConstants>DEBUG;TRACE</DefineConstants> | ||
19 | <ErrorReport>prompt</ErrorReport> | ||
20 | <WarningLevel>4</WarningLevel> | ||
21 | </PropertyGroup> | ||
22 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
23 | <DebugType>pdbonly</DebugType> | ||
24 | <Optimize>true</Optimize> | ||
25 | <OutputPath>bin\Release\</OutputPath> | ||
26 | <DefineConstants>TRACE</DefineConstants> | ||
27 | <ErrorReport>prompt</ErrorReport> | ||
28 | <WarningLevel>4</WarningLevel> | ||
29 | </PropertyGroup> | ||
30 | <ItemGroup> | ||
31 | <Reference Include="libsecondlife, Version=0.9.0.0, Culture=neutral, processorArchitecture=MSIL"> | ||
32 | <SpecificVersion>False</SpecificVersion> | ||
33 | <HintPath>..\..\bin\libsecondlife.dll</HintPath> | ||
34 | </Reference> | ||
35 | <Reference Include="System" /> | ||
36 | <Reference Include="System.Data" /> | ||
37 | <Reference Include="System.Xml" /> | ||
38 | </ItemGroup> | ||
39 | <ItemGroup> | ||
40 | <Compile Include="Properties\AssemblyInfo.cs" /> | ||
41 | <Compile Include="Script.cs" /> | ||
42 | <Compile Include="ScriptAccess.cs" /> | ||
43 | </ItemGroup> | ||
44 | <ItemGroup> | ||
45 | <ProjectReference Include="..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj"> | ||
46 | <Project>{A7CD0630-0000-0000-0000-000000000000}</Project> | ||
47 | <Name>OpenSim.Framework.Console</Name> | ||
48 | </ProjectReference> | ||
49 | <ProjectReference Include="..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj"> | ||
50 | <Project>{8ACA2445-0000-0000-0000-000000000000}</Project> | ||
51 | <Name>OpenSim.Framework</Name> | ||
52 | </ProjectReference> | ||
53 | <ProjectReference Include="..\OpenSim.Region\OpenSim.Region.csproj"> | ||
54 | <Project>{196916AF-0000-0000-0000-000000000000}</Project> | ||
55 | <Name>OpenSim.Region</Name> | ||
56 | </ProjectReference> | ||
57 | </ItemGroup> | ||
58 | <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | ||
59 | <!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
60 | Other similar extension points exist, see Microsoft.Common.targets. | ||
61 | <Target Name="BeforeBuild"> | ||
62 | </Target> | ||
63 | <Target Name="AfterBuild"> | ||
64 | </Target> | ||
65 | --> | ||
66 | </Project> \ 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 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("OpenSim.Scripting")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("")] | ||
12 | [assembly: AssemblyProduct("OpenSim.Scripting")] | ||
13 | [assembly: AssemblyCopyright("Copyright © 2007")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("61eae1ad-82aa-4c77-8bc5-b5a8c9522b18")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | // You can specify all the values or you can default the Revision and Build Numbers | ||
33 | // by using the '*' as shown below: | ||
34 | [assembly: AssemblyVersion("1.0.0.0")] | ||
35 | [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 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | |||
5 | using OpenSim.Framework.Console; | ||
6 | using OpenSim.Framework; | ||
7 | using OpenSim.Region; | ||
8 | using OpenSim.Region.Scenes; | ||
9 | |||
10 | namespace OpenSim.Scripting | ||
11 | { | ||
12 | public interface IScript | ||
13 | { | ||
14 | void Initialise(ScriptInfo scriptInfo); | ||
15 | } | ||
16 | |||
17 | public class TestScript : IScript | ||
18 | { | ||
19 | ScriptInfo script; | ||
20 | |||
21 | public void Initialise(ScriptInfo scriptInfo) | ||
22 | { | ||
23 | script = scriptInfo; | ||
24 | script.events.OnFrame += new OpenSim.Region.Scenes.EventManager.OnFrameDelegate(events_OnFrame); | ||
25 | } | ||
26 | |||
27 | void events_OnFrame() | ||
28 | { | ||
29 | script.logger.Verbose("Hello World!"); | ||
30 | } | ||
31 | } | ||
32 | } | ||
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 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | |||
5 | using OpenSim.Region.Scenes; | ||
6 | using OpenSim.Framework.Console; | ||
7 | |||
8 | namespace OpenSim.Scripting | ||
9 | { | ||
10 | /// <summary> | ||
11 | /// Class which provides access to the world | ||
12 | /// </summary> | ||
13 | public class ScriptInfo | ||
14 | { | ||
15 | // Reference to world.eventsManager provided for convenience | ||
16 | public EventManager events; | ||
17 | |||
18 | // The main world | ||
19 | public Scene world; | ||
20 | |||
21 | // The console | ||
22 | public LogBase logger; | ||
23 | |||
24 | public ScriptInfo(Scene scene) | ||
25 | { | ||
26 | world = scene; | ||
27 | events = world.eventManager; | ||
28 | logger = OpenSim.Framework.Console.MainLog.Instance; | ||
29 | } | ||
30 | } | ||
31 | } | ||