aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer
diff options
context:
space:
mode:
authorMW2007-04-11 09:45:48 +0000
committerMW2007-04-11 09:45:48 +0000
commitffd7a6b8c22cd21e355f77fea20b145424e3d912 (patch)
tree94deb515b2b7cb5233fc8fc8d9d531e1a789b7c7 /OpenSim.RegionServer
parent(no commit message) (diff)
downloadopensim-SC_OLD-ffd7a6b8c22cd21e355f77fea20b145424e3d912.zip
opensim-SC_OLD-ffd7a6b8c22cd21e355f77fea20b145424e3d912.tar.gz
opensim-SC_OLD-ffd7a6b8c22cd21e355f77fea20b145424e3d912.tar.bz2
opensim-SC_OLD-ffd7a6b8c22cd21e355f77fea20b145424e3d912.tar.xz
Changed so that a bin\ScriptEngines\ directory will be searched for scripting Engines.
Added the work in progress JVM scripting engine.
Diffstat (limited to 'OpenSim.RegionServer')
-rw-r--r--OpenSim.RegionServer/OpenSim.RegionServer.csproj3
-rw-r--r--OpenSim.RegionServer/OpenSim.RegionServer.dll.build165
-rw-r--r--OpenSim.RegionServer/OpenSimMain.cs2
-rw-r--r--OpenSim.RegionServer/world/World.cs34
4 files changed, 117 insertions, 87 deletions
diff --git a/OpenSim.RegionServer/OpenSim.RegionServer.csproj b/OpenSim.RegionServer/OpenSim.RegionServer.csproj
index d7058e8..2535d66 100644
--- a/OpenSim.RegionServer/OpenSim.RegionServer.csproj
+++ b/OpenSim.RegionServer/OpenSim.RegionServer.csproj
@@ -199,6 +199,9 @@
199 <Compile Include="world\WorldPacketHandlers.cs"> 199 <Compile Include="world\WorldPacketHandlers.cs">
200 <SubType>Code</SubType> 200 <SubType>Code</SubType>
201 </Compile> 201 </Compile>
202 <Compile Include="world\WorldScripting.cs">
203 <SubType>Code</SubType>
204 </Compile>
202 <Compile Include="world\scripting\IScript.cs"> 205 <Compile Include="world\scripting\IScript.cs">
203 <SubType>Code</SubType> 206 <SubType>Code</SubType>
204 </Compile> 207 </Compile>
diff --git a/OpenSim.RegionServer/OpenSim.RegionServer.dll.build b/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
index cd900f5..ac93c19 100644
--- a/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
+++ b/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
@@ -1,82 +1,83 @@
1<?xml version="1.0" ?> 1<?xml version="1.0" ?>
2<project name="OpenSim.RegionServer" default="build"> 2<project name="OpenSim.RegionServer" default="build">
3 <target name="build"> 3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" /> 4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" /> 5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}"> 6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}"> 7 <fileset basedir="${project::get-base-directory()}">
8 </fileset> 8 </fileset>
9 </copy> 9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll"> 10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.RegionServer" dynamicprefix="true" > 11 <resources prefix="OpenSim.RegionServer" dynamicprefix="true" >
12 </resources> 12 </resources>
13 <sources failonempty="true"> 13 <sources failonempty="true">
14 <include name="AgentAssetUpload.cs" /> 14 <include name="AgentAssetUpload.cs" />
15 <include name="ConsoleCmds.cs" /> 15 <include name="ConsoleCmds.cs" />
16 <include name="Grid.cs" /> 16 <include name="Grid.cs" />
17 <include name="OpenSimMain.cs" /> 17 <include name="OpenSimMain.cs" />
18 <include name="OpenSimNetworkHandler.cs" /> 18 <include name="OpenSimNetworkHandler.cs" />
19 <include name="PacketServer.cs" /> 19 <include name="PacketServer.cs" />
20 <include name="QueItem.cs" /> 20 <include name="QueItem.cs" />
21 <include name="RegionInfo.cs" /> 21 <include name="RegionInfo.cs" />
22 <include name="SimClient.cs" /> 22 <include name="SimClient.cs" />
23 <include name="SimConsole.cs" /> 23 <include name="SimConsole.cs" />
24 <include name="VersionInfo.cs" /> 24 <include name="VersionInfo.cs" />
25 <include name="Assets/AssetCache.cs" /> 25 <include name="Assets/AssetCache.cs" />
26 <include name="Assets/InventoryCache.cs" /> 26 <include name="Assets/InventoryCache.cs" />
27 <include name="CAPS/AdminWebFront.cs" /> 27 <include name="CAPS/AdminWebFront.cs" />
28 <include name="types/Mesh.cs" /> 28 <include name="types/Mesh.cs" />
29 <include name="types/Triangle.cs" /> 29 <include name="types/Triangle.cs" />
30 <include name="world/Avatar.cs" /> 30 <include name="world/Avatar.cs" />
31 <include name="world/AvatarAnimations.cs" /> 31 <include name="world/AvatarAnimations.cs" />
32 <include name="world/AvatarClient.cs" /> 32 <include name="world/AvatarClient.cs" />
33 <include name="world/AvatarUpdate.cs" /> 33 <include name="world/AvatarUpdate.cs" />
34 <include name="world/Entity.cs" /> 34 <include name="world/Entity.cs" />
35 <include name="world/Primitive.cs" /> 35 <include name="world/Primitive.cs" />
36 <include name="world/Primitive2.cs" /> 36 <include name="world/Primitive2.cs" />
37 <include name="world/ScriptEngine.cs" /> 37 <include name="world/ScriptEngine.cs" />
38 <include name="world/SurfacePatch.cs" /> 38 <include name="world/SurfacePatch.cs" />
39 <include name="world/World.cs" /> 39 <include name="world/World.cs" />
40 <include name="world/WorldPacketHandlers.cs" /> 40 <include name="world/WorldPacketHandlers.cs" />
41 <include name="world/scripting/IScript.cs" /> 41 <include name="world/WorldScripting.cs" />
42 <include name="world/scripting/IScriptContext.cs" /> 42 <include name="world/scripting/IScript.cs" />
43 <include name="world/scripting/IScriptEntity.cs" /> 43 <include name="world/scripting/IScriptContext.cs" />
44 <include name="world/scripting/IScriptHandler.cs" /> 44 <include name="world/scripting/IScriptEntity.cs" />
45 <include name="world/scripting/Script.cs" /> 45 <include name="world/scripting/IScriptHandler.cs" />
46 <include name="world/scripting/ScriptFactory.cs" /> 46 <include name="world/scripting/Script.cs" />
47 <include name="world/scripting/Scripts/FollowRandomAvatar.cs" /> 47 <include name="world/scripting/ScriptFactory.cs" />
48 </sources> 48 <include name="world/scripting/Scripts/FollowRandomAvatar.cs" />
49 <references basedir="${project::get-base-directory()}"> 49 </sources>
50 <lib> 50 <references basedir="${project::get-base-directory()}">
51 <include name="${project::get-base-directory()}" /> 51 <lib>
52 <include name="${project::get-base-directory()}/${build.dir}" /> 52 <include name="${project::get-base-directory()}" />
53 </lib> 53 <include name="${project::get-base-directory()}/${build.dir}" />
54 <include name="System.dll" /> 54 </lib>
55 <include name="System.Xml.dll" /> 55 <include name="System.dll" />
56 <include name="../bin/libsecondlife.dll" /> 56 <include name="System.Xml.dll" />
57 <include name="../bin/Axiom.MathLib.dll" /> 57 <include name="../bin/libsecondlife.dll" />
58 <include name="../bin/Db4objects.Db4o.dll" /> 58 <include name="../bin/Axiom.MathLib.dll" />
59 <include name="../bin/OpenSim.Terrain.BasicTerrain.dll" /> 59 <include name="../bin/Db4objects.Db4o.dll" />
60 <include name="../bin/OpenSim.Framework.dll" /> 60 <include name="../bin/OpenSim.Terrain.BasicTerrain.dll" />
61 <include name="../bin/OpenSim.Framework.Console.dll" /> 61 <include name="../bin/OpenSim.Framework.dll" />
62 <include name="../bin/OpenSim.GenericConfig.Xml.dll" /> 62 <include name="../bin/OpenSim.Framework.Console.dll" />
63 <include name="../bin/OpenSim.Physics.Manager.dll" /> 63 <include name="../bin/OpenSim.GenericConfig.Xml.dll" />
64 <include name="../bin/OpenSim.Servers.dll" /> 64 <include name="../bin/OpenSim.Physics.Manager.dll" />
65 </references> 65 <include name="../bin/OpenSim.Servers.dll" />
66 </csc> 66 </references>
67 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../bin/" /> 67 </csc>
68 <mkdir dir="${project::get-base-directory()}/../bin/"/> 68 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../bin/" />
69 <copy todir="${project::get-base-directory()}/../bin/"> 69 <mkdir dir="${project::get-base-directory()}/../bin/"/>
70 <fileset basedir="${project::get-base-directory()}/${build.dir}/" > 70 <copy todir="${project::get-base-directory()}/../bin/">
71 <include name="*.dll"/> 71 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
72 <include name="*.exe"/> 72 <include name="*.dll"/>
73 </fileset> 73 <include name="*.exe"/>
74 </copy> 74 </fileset>
75 </target> 75 </copy>
76 <target name="clean"> 76 </target>
77 <delete dir="${bin.dir}" failonerror="false" /> 77 <target name="clean">
78 <delete dir="${obj.dir}" failonerror="false" /> 78 <delete dir="${bin.dir}" failonerror="false" />
79 </target> 79 <delete dir="${obj.dir}" failonerror="false" />
80 <target name="doc" description="Creates documentation."> 80 </target>
81 </target> 81 <target name="doc" description="Creates documentation.">
82</project> 82 </target>
83</project>
diff --git a/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim.RegionServer/OpenSimMain.cs
index d36dbfc..fcc6512 100644
--- a/OpenSim.RegionServer/OpenSimMain.cs
+++ b/OpenSim.RegionServer/OpenSimMain.cs
@@ -39,7 +39,7 @@ using System.Collections.Generic;
39using libsecondlife; 39using libsecondlife;
40using libsecondlife.Packets; 40using libsecondlife.Packets;
41using OpenSim.world; 41using OpenSim.world;
42using OpenSim.Terrain; 42using OpenSim.Terrain;
43using OpenSim.Framework.Interfaces; 43using OpenSim.Framework.Interfaces;
44using OpenSim.UserServer; 44using OpenSim.UserServer;
45using OpenSim.Assets; 45using OpenSim.Assets;
diff --git a/OpenSim.RegionServer/world/World.cs b/OpenSim.RegionServer/world/World.cs
index c7c57d1..74325b0 100644
--- a/OpenSim.RegionServer/world/World.cs
+++ b/OpenSim.RegionServer/world/World.cs
@@ -18,7 +18,7 @@ using OpenSim.Terrain;
18 18
19namespace OpenSim.world 19namespace OpenSim.world
20{ 20{
21 public partial class World : ILocalStorageReceiver 21 public partial class World : ILocalStorageReceiver, IScriptAPI
22 { 22 {
23 public object LockPhysicsEngine = new object(); 23 public object LockPhysicsEngine = new object();
24 public Dictionary<libsecondlife.LLUUID, Entity> Entities; 24 public Dictionary<libsecondlife.LLUUID, Entity> Entities;
@@ -66,6 +66,7 @@ namespace OpenSim.world
66 // Scripts = new ScriptEngine(this); 66 // Scripts = new ScriptEngine(this);
67 Avatar.LoadAnims(); 67 Avatar.LoadAnims();
68 this.SetDefaultScripts(); 68 this.SetDefaultScripts();
69 this.LoadScriptEngines();
69 } 70 }
70 71
71 public void AddScript(Entity entity, Script script) 72 public void AddScript(Entity entity, Script script)
@@ -86,8 +87,28 @@ namespace OpenSim.world
86 //Console.WriteLine("searching for script to add: " + substring); 87 //Console.WriteLine("searching for script to add: " + substring);
87 88
88 ScriptFactory scriptFactory; 89 ScriptFactory scriptFactory;
89 90 Console.WriteLine("script string is " + substring);
90 if (this.m_scripts.TryGetValue(substring, out scriptFactory)) 91 if(substring.StartsWith("<ScriptEngine:"))
92 {
93 string substring1 = "";
94 string script = "";
95 Console.WriteLine("searching for script engine");
96 substring1 = substring.Remove(0, 14);
97 int dev = substring1.IndexOf(',');
98 string sEngine = substring1.Substring(0, dev);
99 substring1 = substring1.Remove(0, dev+1);
100 int end = substring1.IndexOf('>');
101 string sName = substring1.Substring(0, end);
102 Console.WriteLine(" script info : " + sEngine + " , " + sName);
103 int startscript = substring.IndexOf('>');
104 script = substring.Remove(0, startscript + 1);
105 Console.WriteLine("script data is " + script);
106 if (this.scriptEngines.ContainsKey(sEngine))
107 {
108 this.scriptEngines[sEngine].LoadScript(script, sName, entity.localid);
109 }
110 }
111 else if (this.m_scripts.TryGetValue(substring, out scriptFactory))
91 { 112 {
92 //Console.WriteLine("added script"); 113 //Console.WriteLine("added script");
93 this.AddScript(entity, scriptFactory()); 114 this.AddScript(entity, scriptFactory());
@@ -149,7 +170,10 @@ namespace OpenSim.world
149 { 170 {
150 scriptHandler.OnFrame(); 171 scriptHandler.OnFrame();
151 } 172 }
152 173 foreach (IScriptEngine scripteng in this.scriptEngines.Values)
174 {
175 //scripteng.OnFrame();
176 }
153 //backup world data 177 //backup world data
154 this.storageCount++; 178 this.storageCount++;
155 if (storageCount > 1200) //set to how often you want to backup 179 if (storageCount > 1200) //set to how often you want to backup
@@ -255,7 +279,9 @@ namespace OpenSim.world
255 float[] map = this.localStorage.LoadWorld(); 279 float[] map = this.localStorage.LoadWorld();
256 if (map == null) 280 if (map == null)
257 { 281 {
282 Console.WriteLine("creating new terrain");
258 this.Terrain.hills(); 283 this.Terrain.hills();
284
259 //this.localStorage.SaveMap(this.Terrain.map); 285 //this.localStorage.SaveMap(this.Terrain.map);
260 } 286 }
261 else 287 else