From fadd19f3140107d7c09e7a82a97dfb490146ccb9 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 30 Mar 2008 09:03:38 +0000 Subject: **Big ass update warning** * Renamed plugin console message, to send a message to a plugin, use either "plugin ", or any unrecognised message will be sent ("plugin" sends explicitly) This replaces the old "script ". * Terrain commands - "terrain " now works again. "Script terrain " does not. Many of the commands have now been reimplemented, eg load-tile. However some have new syntax. * New console command handler, you can now use things like "terrain help" or "terrain save help". See TerrainModule.cs for an example of how to use the new "Commander" class. * Commander class - advanced processing of console input and also enables a script API to be generated from registered console commands. --- OpenSim/Region/Environment/Scenes/Scene.cs | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 819815b..2f277f9 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -40,10 +40,8 @@ using OpenSim.Framework.Communications; using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Servers; using OpenSim.Region.Environment.Interfaces; -using OpenSim.Region.Environment.Modules; using OpenSim.Region.Environment.Scenes.Scripting; using OpenSim.Region.Physics.Manager; -using OpenSim.Region.Terrain; using Caps = OpenSim.Region.Capabilities.Caps; using Image = System.Drawing.Image; using Timer = System.Timers.Timer; @@ -75,7 +73,6 @@ namespace OpenSim.Region.Environment.Scenes private readonly Mutex _primAllocateMutex = new Mutex(false); private int m_timePhase = 24; - private int m_timeUpdateCount; private readonly Mutex updateLock; public bool m_physicalPrim; @@ -104,6 +101,7 @@ namespace OpenSim.Region.Environment.Scenes protected Dictionary Modules = new Dictionary(); public Dictionary ModuleInterfaces = new Dictionary(); protected Dictionary ModuleAPIMethods = new Dictionary(); + public Dictionary m_moduleCommanders = new Dictionary(); //API module interfaces @@ -1949,6 +1947,27 @@ namespace OpenSim.Region.Environment.Scenes } } + public void RegisterModuleCommander(string name, ICommander commander) + { + lock (m_moduleCommanders) + { + m_moduleCommanders.Add(name, commander); + } + } + + public ICommander GetCommander(string name) + { + lock (m_moduleCommanders) + { + return m_moduleCommanders[name]; + } + } + + public Dictionary GetCommanders() + { + return m_moduleCommanders; + } + /// /// /// -- cgit v1.1