From a04602d9c136b882a6c72d4c3c09c3ca0d526c37 Mon Sep 17 00:00:00 2001 From: MW Date: Sat, 14 Jul 2007 13:18:02 +0000 Subject: Added AddPreCompiledScript method to ScriptManager. Done some work on lbsa71's simpleApp(hope he doesn't mind): now have the avatar showing up and the terrain and his pulsating box (well except its not a box, as there seems to be something wrong with our PrimitiveBaseShape..DefaultBox() settings). Also noticed a few other problems that I had to work around, so these need looking into. --- OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs | 1 + OpenSim/Region/Environment/Scenes/Scene.cs | 4 +++- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 5 +---- OpenSim/Region/Environment/Scenes/scripting/ScriptManager.cs | 8 ++++++++ 4 files changed, 13 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes') diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index f9b3145..bf98b0d 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs @@ -146,6 +146,7 @@ namespace OpenSim.Region.Environment.Scenes avatar = this.Avatars[fromAgentID]; fromPos = avatar.Pos; fromName = avatar.firstname + " " + avatar.lastname; + avatar = null; } m_clientManager.ForEachClient(delegate(IClientAPI client) diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 318b025..737e8fe 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -487,7 +487,7 @@ namespace OpenSim.Region.Environment.Scenes } - protected void CreateAndAddScenePresence(IClientAPI client) + protected ScenePresence CreateAndAddScenePresence(IClientAPI client) { ScenePresence newAvatar = null; @@ -524,6 +524,8 @@ namespace OpenSim.Region.Environment.Scenes this.Avatars.Add(client.AgentId, newAvatar); } } + newAvatar.OnSignificantClientMovement += parcelManager.handleSignificantClientMovement; + return newAvatar; } diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 8559caf..6966989 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -40,9 +40,6 @@ namespace OpenSim.Region.Environment.Scenes { public partial class ScenePresence : Entity { - - - public static bool PhysicsEngineFlying = false; public static AvatarAnimations Animations; public static byte[] DefaultTexture; @@ -151,7 +148,7 @@ namespace OpenSim.Region.Environment.Scenes // ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack); // ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); //ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); - OnSignificantClientMovement += new SignificantClientMovement(m_world.parcelManager.handleSignificantClientMovement); + Dir_Vectors[0] = new Vector3(1, 0, 0); //FOWARD Dir_Vectors[1] = new Vector3(-1, 0, 0); //BACK Dir_Vectors[2] = new Vector3(0, 1, 0); //LEFT diff --git a/OpenSim/Region/Environment/Scenes/scripting/ScriptManager.cs b/OpenSim/Region/Environment/Scenes/scripting/ScriptManager.cs index 736d18b..7a08735 100644 --- a/OpenSim/Region/Environment/Scenes/scripting/ScriptManager.cs +++ b/OpenSim/Region/Environment/Scenes/scripting/ScriptManager.cs @@ -89,6 +89,14 @@ namespace OpenSim.Region.Scripting break; } } + + public void AddPreCompiledScript(IScript script) + { + MainLog.Instance.Verbose("Loading script " + script.getName()); + ScriptInfo scriptInfo = new ScriptInfo(scene); // Since each script could potentially corrupt their access with a stray assignment, making a new one for each script. + script.Initialise(scriptInfo); + scripts.Add(script); + } } interface IScriptCompiler -- cgit v1.1