From ffd7a6b8c22cd21e355f77fea20b145424e3d912 Mon Sep 17 00:00:00 2001
From: MW
Date: Wed, 11 Apr 2007 09:45:48 +0000
Subject: Changed so that a bin\ScriptEngines\ directory will be searched for
scripting Engines. Added the work in progress JVM scripting engine.
---
OpenSim.RegionServer/OpenSim.RegionServer.csproj | 3 +
.../OpenSim.RegionServer.dll.build | 165 +++++++++++----------
OpenSim.RegionServer/OpenSimMain.cs | 2 +-
OpenSim.RegionServer/world/World.cs | 34 ++++-
4 files changed, 117 insertions(+), 87 deletions(-)
(limited to 'OpenSim.RegionServer')
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 @@
Code
+
+ Code
+
Code
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 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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;
using libsecondlife;
using libsecondlife.Packets;
using OpenSim.world;
-using OpenSim.Terrain;
+using OpenSim.Terrain;
using OpenSim.Framework.Interfaces;
using OpenSim.UserServer;
using 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;
namespace OpenSim.world
{
- public partial class World : ILocalStorageReceiver
+ public partial class World : ILocalStorageReceiver, IScriptAPI
{
public object LockPhysicsEngine = new object();
public Dictionary Entities;
@@ -66,6 +66,7 @@ namespace OpenSim.world
// Scripts = new ScriptEngine(this);
Avatar.LoadAnims();
this.SetDefaultScripts();
+ this.LoadScriptEngines();
}
public void AddScript(Entity entity, Script script)
@@ -86,8 +87,28 @@ namespace OpenSim.world
//Console.WriteLine("searching for script to add: " + substring);
ScriptFactory scriptFactory;
-
- if (this.m_scripts.TryGetValue(substring, out scriptFactory))
+ Console.WriteLine("script string is " + substring);
+ if(substring.StartsWith("');
+ string sName = substring1.Substring(0, end);
+ Console.WriteLine(" script info : " + sEngine + " , " + sName);
+ int startscript = substring.IndexOf('>');
+ script = substring.Remove(0, startscript + 1);
+ Console.WriteLine("script data is " + script);
+ if (this.scriptEngines.ContainsKey(sEngine))
+ {
+ this.scriptEngines[sEngine].LoadScript(script, sName, entity.localid);
+ }
+ }
+ else if (this.m_scripts.TryGetValue(substring, out scriptFactory))
{
//Console.WriteLine("added script");
this.AddScript(entity, scriptFactory());
@@ -149,7 +170,10 @@ namespace OpenSim.world
{
scriptHandler.OnFrame();
}
-
+ foreach (IScriptEngine scripteng in this.scriptEngines.Values)
+ {
+ //scripteng.OnFrame();
+ }
//backup world data
this.storageCount++;
if (storageCount > 1200) //set to how often you want to backup
@@ -255,7 +279,9 @@ namespace OpenSim.world
float[] map = this.localStorage.LoadWorld();
if (map == null)
{
+ Console.WriteLine("creating new terrain");
this.Terrain.hills();
+
//this.localStorage.SaveMap(this.Terrain.map);
}
else
--
cgit v1.1