diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index 54136ac848..654b901ac0 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -39,7 +39,7 @@ namespace OpenSim.Framework.Interfaces public delegate void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 pos); public delegate void ModifyTerrain(float height, float seconds, byte size, byte action, float north, float west, IClientAPI remoteClient); public delegate void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam); - public delegate void StartAnim(LLUUID animID, int seq); + public delegate void StartAnim(IClientAPI remoteClient, LLUUID animID, int seq); public delegate void LinkObjects(uint parent, List children); public delegate void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY); public delegate void TeleportLocationRequest(IClientAPI remoteClient, ulong regionHandle, LLVector3 position, LLVector3 lookAt, uint flags); diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs index ade7a0dec4..5e185ede0c 100644 --- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs +++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs @@ -197,9 +197,10 @@ namespace OpenSim.Region.ClientStack { if (AgentAni.AnimationList[i].StartAnim) { + if (OnStartAnim != null) { - OnStartAnim(AgentAni.AnimationList[i].AnimID, 1); + OnStartAnim(this, AgentAni.AnimationList[i].AnimID, 1); } } } diff --git a/OpenSim/Region/Environment/Modules/XferModule.cs b/OpenSim/Region/Environment/Modules/XferModule.cs index b0d1bf65b2..a0327e9b14 100644 --- a/OpenSim/Region/Environment/Modules/XferModule.cs +++ b/OpenSim/Region/Environment/Modules/XferModule.cs @@ -27,7 +27,7 @@ namespace OpenSim.Region.Environment.Modules m_scene = scene; m_scene.EventManager.OnNewClient += NewClient; - m_scene.RegisterAPIMethod("API_AddXferFile", new ModuleAPIMethod(this.AddNewFile)); + m_scene.RegisterAPIMethod("API_AddXferFile", new ModuleAPIMethod2(this.AddNewFile)); } public void PostInitialise() diff --git a/OpenSim/Region/Environment/RegionManager.cs b/OpenSim/Region/Environment/RegionManager.cs index 0146b52cef..86a3626603 100644 --- a/OpenSim/Region/Environment/RegionManager.cs +++ b/OpenSim/Region/Environment/RegionManager.cs @@ -9,7 +9,8 @@ using OpenSim.Region.Environment.LandManagement; namespace OpenSim.Region.Environment { - public delegate TResult ModuleAPIMethod(TParam0 param0, TParam1 param1); + public delegate TResult ModuleAPIMethod1(TParam0 param0); + public delegate TResult ModuleAPIMethod2(TParam0 param0, TParam1 param1); public class RegionManager { diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index 568639fa97..a9ded3f5ff 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs @@ -554,6 +554,15 @@ namespace OpenSim.Region.Environment.Scenes } } + public void StartAnimation(IClientAPI client, LLUUID animID, int seq) + { + List avatars = this.RequestAvatarList(); + for (int i = 0; i < avatars.Count; i++) + { + avatars[i].ControllingClient.SendAnimation(animID, seq, client.AgentId); + } + } + public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) { this.EventManager.TriggerObjectGrab(localID, offsetPos, remoteClient); diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index ba9569ef73..92f26ef57b 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -90,7 +90,7 @@ namespace OpenSim.Region.Environment.Scenes //API method Delegates // this most likely shouldn't be handled as a API method like this, but doing it for testing purposes - public ModuleAPIMethodAddXferFile = null; + public ModuleAPIMethod2AddXferFile = null; #region Properties @@ -196,7 +196,7 @@ namespace OpenSim.Region.Environment.Scenes private void SetMethodDelegates() { - AddXferFile = (ModuleAPIMethod)this.RequestAPIMethod("API_AddXferFile"); + AddXferFile = (ModuleAPIMethod2)this.RequestAPIMethod("API_AddXferFile"); } #region Script Handling Methods @@ -267,7 +267,7 @@ namespace OpenSim.Region.Environment.Scenes //backup scene data storageCount++; - if (storageCount > 600) //set to how often you want to backup + if (storageCount > 1200) //set to how often you want to backup { Backup(); storageCount = 0; @@ -692,6 +692,7 @@ namespace OpenSim.Region.Environment.Scenes protected virtual void SubscribeToClientEvents(IClientAPI client) { + // client.OnStartAnim += StartAnimation; client.OnRegionHandShakeReply += SendLayerData; //remoteClient.OnRequestWearables += new GenericCall(this.GetInitialPrims); client.OnModifyTerrain += ModifyTerrain; diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs index 3a2fab2173..3740e1b031 100644 --- a/OpenSim/Region/Environment/Scenes/SceneBase.cs +++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs @@ -35,6 +35,7 @@ using OpenSim.Framework.Types; using OpenSim.Framework.Communications.Caches; using OpenSim.Region.Terrain; using OpenSim.Framework; +using OpenSim.Region.Environment.Interfaces; namespace OpenSim.Region.Environment.Scenes { diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 0eeea8969a..e094ac6852 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -157,7 +157,7 @@ namespace OpenSim.Region.Environment.Scenes this.m_lastname = ControllingClient.LastName; m_localId = m_scene.NextLocalId; AbsolutePosition = ControllingClient.StartPos; - + visualParams = new byte[218]; for (int i = 0; i < 218; i++) { diff --git a/OpenSim/Region/ExtensionsScriptModule/ScriptManager.cs b/OpenSim/Region/ExtensionsScriptModule/ScriptManager.cs index a97979f2dd..6cacf0c0cc 100644 --- a/OpenSim/Region/ExtensionsScriptModule/ScriptManager.cs +++ b/OpenSim/Region/ExtensionsScriptModule/ScriptManager.cs @@ -72,8 +72,8 @@ namespace OpenSim.Region.ExtensionsScriptModule System.Console.WriteLine("Initialising Extensions Scripting Module"); m_scene = scene; - m_scene.RegisterAPIMethod("API_CompileExtensionScript", new ModuleAPIMethod(Compile)); - m_scene.RegisterAPIMethod("API_AddExtensionScript", new ModuleAPIMethod(AddPreCompiledScript)); + m_scene.RegisterAPIMethod("API_CompileExtensionScript", new ModuleAPIMethod1(Compile)); + m_scene.RegisterAPIMethod("API_AddExtensionScript", new ModuleAPIMethod1(AddPreCompiledScript)); } public void PostInitialise() @@ -91,7 +91,7 @@ namespace OpenSim.Region.ExtensionsScriptModule return "ExtensionsScriptingModule"; } - public bool Compile(string filename, int dummyParam) + public bool Compile(string filename) { foreach (KeyValuePair compiler in compilers) { @@ -110,7 +110,7 @@ namespace OpenSim.Region.ExtensionsScriptModule switch (args[0]) { case "load": - Compile(args[1], 0); + Compile(args[1]); break; default: @@ -119,7 +119,7 @@ namespace OpenSim.Region.ExtensionsScriptModule } } - public bool AddPreCompiledScript(IScript script, int dummyParam) + public bool AddPreCompiledScript(IScript script) { MainLog.Instance.Verbose("Loading script " + script.Name); ScriptInfo scriptInfo = new ScriptInfo(m_scene); // Since each script could potentially corrupt their access with a stray assignment, making a new one for each script.