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 | |
parent | Make the accet cache module actually register the interface (diff) | |
download | opensim-SC_OLD-88371e4f989152e38d7fc378f7da45114d34b436.zip opensim-SC_OLD-88371e4f989152e38d7fc378f7da45114d34b436.tar.gz opensim-SC_OLD-88371e4f989152e38d7fc378f7da45114d34b436.tar.bz2 opensim-SC_OLD-88371e4f989152e38d7fc378f7da45114d34b436.tar.xz |
Fix interface registration/deregistration mechanics
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectors/User/LocalUserServiceConnector.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneBase.cs | 23 |
2 files changed, 16 insertions, 9 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectors/User/LocalUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectors/User/LocalUserServiceConnector.cs index 637931e..37286bd 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectors/User/LocalUserServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectors/User/LocalUserServiceConnector.cs | |||
@@ -107,6 +107,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectors.User | |||
107 | { | 107 | { |
108 | if (!m_Enabled) | 108 | if (!m_Enabled) |
109 | return; | 109 | return; |
110 | |||
111 | scene.RegisterModuleInterface<IUserService>(m_UserService); | ||
110 | } | 112 | } |
111 | 113 | ||
112 | public void RemoveRegion(Scene scene) | 114 | public void RemoveRegion(Scene scene) |
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 | } |