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/world/World.cs | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'OpenSim.RegionServer/world/World.cs') 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