diff options
author | Justin Clark-Casey (justincc) | 2011-08-03 04:33:45 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-03 04:33:45 +0100 |
commit | 797def8aa4a009ba3bc44d6b73e063e4bb61ba97 (patch) | |
tree | 7a664006c501c0a500b6cb413646675bb06accc7 /OpenSim/Region/OptionalModules | |
parent | Do a partial fix/implementation of OSSL osNpcMoveTo() (diff) | |
download | opensim-SC-797def8aa4a009ba3bc44d6b73e063e4bb61ba97.zip opensim-SC-797def8aa4a009ba3bc44d6b73e063e4bb61ba97.tar.gz opensim-SC-797def8aa4a009ba3bc44d6b73e063e4bb61ba97.tar.bz2 opensim-SC-797def8aa4a009ba3bc44d6b73e063e4bb61ba97.tar.xz |
Put config to enable disable [NPC] module.
Default is disabled. You will need to explicitly enable to toy with this.
Diffstat (limited to 'OpenSim/Region/OptionalModules')
-rw-r--r-- | OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index fcfacc6..d139b25 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -44,15 +44,18 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
44 | { | 44 | { |
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | // private const bool m_enabled = false; | ||
48 | |||
49 | private Dictionary<UUID, NPCAvatar> m_avatars = new Dictionary<UUID, NPCAvatar>(); | 47 | private Dictionary<UUID, NPCAvatar> m_avatars = new Dictionary<UUID, NPCAvatar>(); |
50 | private Dictionary<UUID, AvatarAppearance> m_appearanceCache = new Dictionary<UUID, AvatarAppearance>(); | 48 | private Dictionary<UUID, AvatarAppearance> m_appearanceCache = new Dictionary<UUID, AvatarAppearance>(); |
51 | 49 | ||
52 | public void Initialise(Scene scene, IConfigSource source) | 50 | public void Initialise(Scene scene, IConfigSource source) |
53 | { | 51 | { |
54 | scene.RegisterModuleInterface<INPCModule>(this); | 52 | IConfig config = source.Configs["NPC"]; |
55 | scene.EventManager.OnSignificantClientMovement += HandleOnSignificantClientMovement; | 53 | |
54 | if (config != null && config.GetBoolean("Enabled", false)) | ||
55 | { | ||
56 | scene.RegisterModuleInterface<INPCModule>(this); | ||
57 | scene.EventManager.OnSignificantClientMovement += HandleOnSignificantClientMovement; | ||
58 | } | ||
56 | } | 59 | } |
57 | 60 | ||
58 | public void HandleOnSignificantClientMovement(ScenePresence presence) | 61 | public void HandleOnSignificantClientMovement(ScenePresence presence) |