diff options
author | Melanie Thielker | 2009-05-12 23:49:42 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-05-12 23:49:42 +0000 |
commit | 88371e4f989152e38d7fc378f7da45114d34b436 (patch) | |
tree | 6dd67bad1c8b655d248e7f08214d66cb24b908a1 /OpenSim/Region/Framework/Scenes/SceneBase.cs | |
parent | Make the accet cache module actually register the interface (diff) | |
download | opensim-SC-88371e4f989152e38d7fc378f7da45114d34b436.zip opensim-SC-88371e4f989152e38d7fc378f7da45114d34b436.tar.gz opensim-SC-88371e4f989152e38d7fc378f7da45114d34b436.tar.bz2 opensim-SC-88371e4f989152e38d7fc378f7da45114d34b436.tar.xz |
Fix interface registration/deregistration mechanics
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneBase.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneBase.cs | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index 4efcb63..f49366a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs | |||
@@ -368,19 +368,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
368 | /// <param name="mod"></param> | 368 | /// <param name="mod"></param> |
369 | public void RegisterModuleInterface<M>(M mod) | 369 | public void RegisterModuleInterface<M>(M mod) |
370 | { | 370 | { |
371 | if (!ModuleInterfaces.ContainsKey(typeof(M))) | 371 | List<Object> l = null; |
372 | if (!ModuleInterfaces.TryGetValue(typeof(M), out l)) | ||
372 | { | 373 | { |
373 | List<Object> l = new List<Object>(); | 374 | l = new List<Object>(); |
374 | l.Add(mod); | ||
375 | ModuleInterfaces.Add(typeof(M), l); | 375 | ModuleInterfaces.Add(typeof(M), l); |
376 | } | ||
377 | |||
378 | if (l.Count > 0) | ||
379 | return; | ||
376 | 380 | ||
377 | if (mod is IEntityCreator) | 381 | l.Add(mod); |
382 | |||
383 | if (mod is IEntityCreator) | ||
384 | { | ||
385 | IEntityCreator entityCreator = (IEntityCreator)mod; | ||
386 | foreach (PCode pcode in entityCreator.CreationCapabilities) | ||
378 | { | 387 | { |
379 | IEntityCreator entityCreator = (IEntityCreator)mod; | 388 | m_entityCreators[pcode] = entityCreator; |
380 | foreach (PCode pcode in entityCreator.CreationCapabilities) | ||
381 | { | ||
382 | m_entityCreators[pcode] = entityCreator; | ||
383 | } | ||
384 | } | 389 | } |
385 | } | 390 | } |
386 | } | 391 | } |