diff options
-rw-r--r-- | OpenSim/Region/Environment/ModuleLoader.cs | 57 |
1 files changed, 49 insertions, 8 deletions
diff --git a/OpenSim/Region/Environment/ModuleLoader.cs b/OpenSim/Region/Environment/ModuleLoader.cs index fcf0f72..13e7261 100644 --- a/OpenSim/Region/Environment/ModuleLoader.cs +++ b/OpenSim/Region/Environment/ModuleLoader.cs | |||
@@ -76,23 +76,64 @@ namespace OpenSim.Region.Environment | |||
76 | public void LoadDefaultSharedModules() | 76 | public void LoadDefaultSharedModules() |
77 | { | 77 | { |
78 | DynamicTextureModule dynamicModule = new DynamicTextureModule(); | 78 | DynamicTextureModule dynamicModule = new DynamicTextureModule(); |
79 | m_loadedSharedModules.Add(dynamicModule.Name, dynamicModule); | 79 | if (m_loadedSharedModules.ContainsKey(dynamicModule.Name)) |
80 | { | ||
81 | m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", dynamicModule.Name, "DynamicTextureModule"); | ||
82 | } | ||
83 | else | ||
84 | { | ||
85 | m_loadedSharedModules.Add(dynamicModule.Name, dynamicModule); | ||
86 | } | ||
80 | 87 | ||
81 | ChatModule chat = new ChatModule(); | 88 | ChatModule chat = new ChatModule(); |
82 | m_loadedSharedModules.Add(chat.Name, chat); | 89 | if (m_loadedSharedModules.ContainsKey(chat.Name)) |
90 | { | ||
91 | m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", chat.Name, "ChatModule"); | ||
92 | } | ||
93 | else | ||
94 | { | ||
95 | m_loadedSharedModules.Add(chat.Name, chat); | ||
96 | } | ||
83 | 97 | ||
84 | InstantMessageModule imMod = new InstantMessageModule(); | 98 | InstantMessageModule imMod = new InstantMessageModule(); |
85 | m_loadedSharedModules.Add(imMod.Name, imMod); | 99 | if (m_loadedSharedModules.ContainsKey(imMod.Name)) |
100 | { | ||
101 | m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", imMod.Name, "InstantMessageModule"); | ||
102 | } | ||
103 | else | ||
104 | { | ||
105 | m_loadedSharedModules.Add(imMod.Name, imMod); | ||
106 | } | ||
86 | 107 | ||
87 | LoadImageURLModule loadMod = new LoadImageURLModule(); | 108 | LoadImageURLModule loadMod = new LoadImageURLModule(); |
88 | m_loadedSharedModules.Add(loadMod.Name, loadMod); | 109 | if (m_loadedSharedModules.ContainsKey(loadMod.Name)) |
110 | { | ||
111 | m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", loadMod.Name, "LoadImageURLModule"); | ||
112 | } | ||
113 | else | ||
114 | { | ||
115 | m_loadedSharedModules.Add(loadMod.Name, loadMod); | ||
116 | } | ||
89 | 117 | ||
90 | AvatarFactoryModule avatarFactory = new AvatarFactoryModule(); | 118 | AvatarFactoryModule avatarFactory = new AvatarFactoryModule(); |
91 | m_loadedSharedModules.Add(avatarFactory.Name, avatarFactory); | 119 | if (m_loadedSharedModules.ContainsKey(avatarFactory.Name)) |
120 | { | ||
121 | m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", avatarFactory.Name, "AvarFactoryModule"); | ||
122 | } | ||
123 | else | ||
124 | { | ||
125 | m_loadedSharedModules.Add(avatarFactory.Name, avatarFactory); | ||
126 | } | ||
92 | 127 | ||
93 | XMLRPCModule xmlRpcMod = new XMLRPCModule(); | 128 | XMLRPCModule xmlRpcMod = new XMLRPCModule(); |
94 | m_loadedSharedModules.Add(xmlRpcMod.Name, xmlRpcMod); | 129 | if (m_loadedSharedModules.ContainsKey(xmlRpcMod.Name)) |
95 | 130 | { | |
131 | m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", xmlRpcMod.Name, "XMLRPCModule"); | ||
132 | } | ||
133 | else | ||
134 | { | ||
135 | m_loadedSharedModules.Add(xmlRpcMod.Name, xmlRpcMod); | ||
136 | } | ||
96 | //TextureDownloadModule textureModule = new TextureDownloadModule(); | 137 | //TextureDownloadModule textureModule = new TextureDownloadModule(); |
97 | //LoadedSharedModules.Add(textureModule.Name, textureModule); | 138 | //LoadedSharedModules.Add(textureModule.Name, textureModule); |
98 | } | 139 | } |
@@ -220,7 +261,7 @@ namespace OpenSim.Region.Environment | |||
220 | { | 261 | { |
221 | if (pluginType.GetInterface("IRegionModule") != null) | 262 | if (pluginType.GetInterface("IRegionModule") != null) |
222 | { | 263 | { |
223 | modules.Add((IRegionModule) Activator.CreateInstance(pluginType)); | 264 | modules.Add((IRegionModule)Activator.CreateInstance(pluginType)); |
224 | } | 265 | } |
225 | } | 266 | } |
226 | } | 267 | } |