diff options
author | Sean Dague | 2009-08-06 14:03:16 -0400 |
---|---|---|
committer | Sean Dague | 2009-08-06 14:03:16 -0400 |
commit | 4078a331e2e851c051293472776ebebcc5dbaecc (patch) | |
tree | c172fb9173821f9a30d37ee336f6592ccaf4510f | |
parent | skip sqlite tests on z linux, as sqlite doesn't work right on the platform (diff) | |
parent | Add the config-include statement to OpenSim.ini.example. (diff) | |
download | opensim-SC-4078a331e2e851c051293472776ebebcc5dbaecc.zip opensim-SC-4078a331e2e851c051293472776ebebcc5dbaecc.tar.gz opensim-SC-4078a331e2e851c051293472776ebebcc5dbaecc.tar.bz2 opensim-SC-4078a331e2e851c051293472776ebebcc5dbaecc.tar.xz |
Merge branch 'master' of git://opensimulator.org/git/opensim
-rw-r--r-- | OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs | 103 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 74 | ||||
-rw-r--r-- | OpenSim/Framework/Util.cs | 51 | ||||
-rw-r--r-- | OpenSim/Region/Application/ConfigurationLoader.cs | 7 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | 33 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs | 3 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | 45 | ||||
-rw-r--r-- | OpenSim/Tests/Common/TestHelper.cs | 2 | ||||
-rw-r--r-- | README.txt | 2 | ||||
-rw-r--r-- | addon-modules/README | 5 | ||||
-rw-r--r-- | bin/OpenSim.ini.example | 8 | ||||
-rw-r--r-- | prebuild.xml | 2 |
13 files changed, 292 insertions, 44 deletions
diff --git a/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs b/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs index 9f7abd0..6331519 100644 --- a/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs +++ b/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs | |||
@@ -149,21 +149,68 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController | |||
149 | 149 | ||
150 | public void AddRegionToModules (Scene scene) | 150 | public void AddRegionToModules (Scene scene) |
151 | { | 151 | { |
152 | Dictionary<Type, ISharedRegionModule> deferredSharedModules = | ||
153 | new Dictionary<Type, ISharedRegionModule>(); | ||
154 | Dictionary<Type, INonSharedRegionModule> deferredNonSharedModules = | ||
155 | new Dictionary<Type, INonSharedRegionModule>(); | ||
156 | |||
157 | Type s = scene.GetType(); | ||
158 | MethodInfo mi = s.GetMethod("RequestModuleInterface"); | ||
159 | |||
160 | List<ISharedRegionModule> sharedlist = new List<ISharedRegionModule>(); | ||
152 | foreach (ISharedRegionModule module in m_sharedInstances) | 161 | foreach (ISharedRegionModule module in m_sharedInstances) |
153 | { | 162 | { |
163 | Type replaceableInterface = module.ReplacableInterface; | ||
164 | if (replaceableInterface != null) | ||
165 | { | ||
166 | MethodInfo mii = mi.MakeGenericMethod(replaceableInterface); | ||
167 | |||
168 | if (mii.Invoke(scene, new object[0]) != null) | ||
169 | { | ||
170 | m_log.DebugFormat("[REGIONMODULE]: Not loading {0} because another module has registered {1}", module.Name, replaceableInterface.ToString()); | ||
171 | continue; | ||
172 | } | ||
173 | |||
174 | deferredSharedModules[replaceableInterface] = module; | ||
175 | m_log.DebugFormat("[REGIONMODULE]: Deferred load of {0}", module.Name); | ||
176 | continue; | ||
177 | } | ||
178 | |||
154 | m_log.DebugFormat("[REGIONMODULE]: Adding scene {0} to shared module {1}", | 179 | m_log.DebugFormat("[REGIONMODULE]: Adding scene {0} to shared module {1}", |
155 | scene.RegionInfo.RegionName, module.Name); | 180 | scene.RegionInfo.RegionName, module.Name); |
181 | |||
156 | module.AddRegion(scene); | 182 | module.AddRegion(scene); |
157 | scene.AddRegionModule(module.Name, module); | 183 | scene.AddRegionModule(module.Name, module); |
184 | |||
185 | sharedlist.Add(module); | ||
158 | } | 186 | } |
159 | 187 | ||
160 | List<INonSharedRegionModule> list = new List<INonSharedRegionModule>(); | 188 | List<INonSharedRegionModule> list = new List<INonSharedRegionModule>(); |
161 | foreach (Type type in m_nonSharedModules) | 189 | foreach (Type type in m_nonSharedModules) |
162 | { | 190 | { |
163 | INonSharedRegionModule module = (INonSharedRegionModule)Activator.CreateInstance(type); | 191 | INonSharedRegionModule module = (INonSharedRegionModule)Activator.CreateInstance(type); |
192 | |||
193 | Type replaceableInterface = module.ReplacableInterface; | ||
194 | if (replaceableInterface != null) | ||
195 | { | ||
196 | MethodInfo mii = mi.MakeGenericMethod(replaceableInterface); | ||
197 | |||
198 | if (mii.Invoke(scene, new object[0]) != null) | ||
199 | { | ||
200 | m_log.DebugFormat("[REGIONMODULE]: Not loading {0} because another module has registered {1}", module.Name, replaceableInterface.ToString()); | ||
201 | continue; | ||
202 | } | ||
203 | |||
204 | deferredNonSharedModules[replaceableInterface] = module; | ||
205 | m_log.DebugFormat("[REGIONMODULE]: Deferred load of {0}", module.Name); | ||
206 | continue; | ||
207 | } | ||
208 | |||
164 | m_log.DebugFormat("[REGIONMODULE]: Adding scene {0} to non-shared module {1}", | 209 | m_log.DebugFormat("[REGIONMODULE]: Adding scene {0} to non-shared module {1}", |
165 | scene.RegionInfo.RegionName, module.Name); | 210 | scene.RegionInfo.RegionName, module.Name); |
211 | |||
166 | module.Initialise(m_openSim.ConfigSource.Source); | 212 | module.Initialise(m_openSim.ConfigSource.Source); |
213 | |||
167 | list.Add(module); | 214 | list.Add(module); |
168 | } | 215 | } |
169 | 216 | ||
@@ -173,6 +220,60 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController | |||
173 | scene.AddRegionModule(module.Name, module); | 220 | scene.AddRegionModule(module.Name, module); |
174 | } | 221 | } |
175 | 222 | ||
223 | // Now all modules without a replaceable base interface are loaded | ||
224 | // Replaceable modules have either been skipped, or omitted. | ||
225 | // Now scan the deferred modules here | ||
226 | |||
227 | foreach (ISharedRegionModule module in deferredSharedModules.Values) | ||
228 | { | ||
229 | Type replaceableInterface = module.ReplacableInterface; | ||
230 | MethodInfo mii = mi.MakeGenericMethod(replaceableInterface); | ||
231 | |||
232 | if (mii.Invoke(scene, new object[0]) != null) | ||
233 | { | ||
234 | m_log.DebugFormat("[REGIONMODULE]: Not loading {0} because another module has registered {1}", module.Name, replaceableInterface.ToString()); | ||
235 | continue; | ||
236 | } | ||
237 | |||
238 | m_log.DebugFormat("[REGIONMODULE]: Adding scene {0} to shared module {1} (deferred)", | ||
239 | scene.RegionInfo.RegionName, module.Name); | ||
240 | |||
241 | module.AddRegion(scene); | ||
242 | scene.AddRegionModule(module.Name, module); | ||
243 | |||
244 | sharedlist.Add(module); | ||
245 | } | ||
246 | |||
247 | List<INonSharedRegionModule> deferredlist = new List<INonSharedRegionModule>(); | ||
248 | foreach (INonSharedRegionModule module in deferredNonSharedModules.Values) | ||
249 | { | ||
250 | Type replaceableInterface = module.ReplacableInterface; | ||
251 | if (replaceableInterface != null) | ||
252 | { | ||
253 | MethodInfo mii = mi.MakeGenericMethod(replaceableInterface); | ||
254 | |||
255 | if (mii.Invoke(scene, new object[0]) != null) | ||
256 | { | ||
257 | m_log.DebugFormat("[REGIONMODULE]: Not loading {0} because another module has registered {1}", module.Name, replaceableInterface.ToString()); | ||
258 | continue; | ||
259 | } | ||
260 | } | ||
261 | |||
262 | m_log.DebugFormat("[REGIONMODULE]: Adding scene {0} to non-shared module {1} (deferred)", | ||
263 | scene.RegionInfo.RegionName, module.Name); | ||
264 | |||
265 | module.Initialise(m_openSim.ConfigSource.Source); | ||
266 | |||
267 | list.Add(module); | ||
268 | deferredlist.Add(module); | ||
269 | } | ||
270 | |||
271 | foreach (INonSharedRegionModule module in deferredlist) | ||
272 | { | ||
273 | module.AddRegion(scene); | ||
274 | scene.AddRegionModule(module.Name, module); | ||
275 | } | ||
276 | |||
176 | // This is needed for all module types. Modules will register | 277 | // This is needed for all module types. Modules will register |
177 | // Interfaces with scene in AddScene, and will also need a means | 278 | // Interfaces with scene in AddScene, and will also need a means |
178 | // to access interfaces registered by other modules. Without | 279 | // to access interfaces registered by other modules. Without |
@@ -183,7 +284,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController | |||
183 | // and unneccessary caching logic repeated in all modules. | 284 | // and unneccessary caching logic repeated in all modules. |
184 | // The extra function stub is just that much cleaner | 285 | // The extra function stub is just that much cleaner |
185 | // | 286 | // |
186 | foreach (ISharedRegionModule module in m_sharedInstances) | 287 | foreach (ISharedRegionModule module in sharedlist) |
187 | { | 288 | { |
188 | module.RegionLoaded(scene); | 289 | module.RegionLoaded(scene); |
189 | } | 290 | } |
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 98e7f0e..878e2fd 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -457,6 +457,10 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
457 | // This has to be here to prevent a Linux/Mono crash | 457 | // This has to be here to prevent a Linux/Mono crash |
458 | m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); | 458 | m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); |
459 | } | 459 | } |
460 | catch (IOException e) | ||
461 | { | ||
462 | m_log.Warn("[BASE HTTP SERVER] XmlRpcRequest issue: " + e.Message); | ||
463 | } | ||
460 | return; | 464 | return; |
461 | } | 465 | } |
462 | 466 | ||
@@ -464,7 +468,8 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
464 | { | 468 | { |
465 | foreach (string strAccept in request.AcceptTypes) | 469 | foreach (string strAccept in request.AcceptTypes) |
466 | { | 470 | { |
467 | if (strAccept.Contains("application/llsd+xml")) | 471 | if (strAccept.Contains("application/llsd+xml") || |
472 | strAccept.Contains("application/llsd+json")) | ||
468 | { | 473 | { |
469 | //m_log.Info("[Debug BASE HTTP SERVER]: Found an application/llsd+xml accept header"); | 474 | //m_log.Info("[Debug BASE HTTP SERVER]: Found an application/llsd+xml accept header"); |
470 | HandleLLSDRequests(request, response); | 475 | HandleLLSDRequests(request, response); |
@@ -483,12 +488,14 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
483 | 488 | ||
484 | case "application/llsd+xml": | 489 | case "application/llsd+xml": |
485 | case "application/xml+llsd": | 490 | case "application/xml+llsd": |
491 | case "application/llsd+json": | ||
486 | //m_log.Info("[Debug BASE HTTP SERVER]: found a application/llsd+xml content type"); | 492 | //m_log.Info("[Debug BASE HTTP SERVER]: found a application/llsd+xml content type"); |
487 | HandleLLSDRequests(request, response); | 493 | HandleLLSDRequests(request, response); |
488 | return; | 494 | return; |
489 | 495 | ||
490 | case "text/xml": | 496 | case "text/xml": |
491 | case "application/xml": | 497 | case "application/xml": |
498 | case "application/json": | ||
492 | default: | 499 | default: |
493 | //m_log.Info("[Debug BASE HTTP SERVER]: in default handler"); | 500 | //m_log.Info("[Debug BASE HTTP SERVER]: in default handler"); |
494 | // Point of note.. the DoWeHaveA methods check for an EXACT path | 501 | // Point of note.. the DoWeHaveA methods check for an EXACT path |
@@ -529,9 +536,9 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
529 | // with the minimum first | 536 | // with the minimum first |
530 | m_log.WarnFormat("[BASE HTTP SERVER]: HandleRequest threw {0}.\nNOTE: this may be spurious on Linux", e); | 537 | m_log.WarnFormat("[BASE HTTP SERVER]: HandleRequest threw {0}.\nNOTE: this may be spurious on Linux", e); |
531 | } | 538 | } |
532 | catch (EndOfStreamException e) | 539 | catch (IOException e) |
533 | { | 540 | { |
534 | m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}", e); | 541 | m_log.ErrorFormat("[BASE HTTP SERVER] HandleRequest() threw ", e); |
535 | } | 542 | } |
536 | catch (InvalidOperationException e) | 543 | catch (InvalidOperationException e) |
537 | { | 544 | { |
@@ -760,6 +767,10 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
760 | // This has to be here to prevent a Linux/Mono crash | 767 | // This has to be here to prevent a Linux/Mono crash |
761 | m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); | 768 | m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); |
762 | } | 769 | } |
770 | catch (IOException e) | ||
771 | { | ||
772 | m_log.Warn("[BASE HTTP SERVER] XmlRpcRequest issue: " + e.Message); | ||
773 | } | ||
763 | } | 774 | } |
764 | return; | 775 | return; |
765 | //responseString = "Error"; | 776 | //responseString = "Error"; |
@@ -793,6 +804,10 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
793 | // This has to be here to prevent a Linux/Mono crash | 804 | // This has to be here to prevent a Linux/Mono crash |
794 | m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); | 805 | m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); |
795 | } | 806 | } |
807 | catch (IOException e) | ||
808 | { | ||
809 | m_log.Warn("[BASE HTTP SERVER] XmlRpcRequest issue: " + e.Message); | ||
810 | } | ||
796 | } | 811 | } |
797 | } | 812 | } |
798 | 813 | ||
@@ -823,7 +838,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
823 | } | 838 | } |
824 | try | 839 | try |
825 | { | 840 | { |
826 | llsdRequest = OSDParser.DeserializeLLSDXml(requestBody); | 841 | llsdRequest = OSDParser.Deserialize(requestBody); |
827 | } | 842 | } |
828 | catch (Exception ex) | 843 | catch (Exception ex) |
829 | { | 844 | { |
@@ -873,10 +888,10 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
873 | } | 888 | } |
874 | else | 889 | else |
875 | { | 890 | { |
876 | response.ContentType = "application/llsd+xml"; | 891 | // Select an appropriate response format |
877 | //m_log.Info("[Debug BASE HTTP SERVER]: Response: " + llsdResponse.ToString()); | 892 | buffer = BuildLLSDResponse(request, response, llsdResponse); |
878 | buffer = OSDParser.SerializeLLSDXmlBytes(llsdResponse); | ||
879 | } | 893 | } |
894 | |||
880 | response.SendChunked = false; | 895 | response.SendChunked = false; |
881 | response.ContentLength64 = buffer.Length; | 896 | response.ContentLength64 = buffer.Length; |
882 | response.ContentEncoding = Encoding.UTF8; | 897 | response.ContentEncoding = Encoding.UTF8; |
@@ -912,6 +927,47 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
912 | } | 927 | } |
913 | } | 928 | } |
914 | 929 | ||
930 | private byte[] BuildLLSDResponse(OSHttpRequest request, OSHttpResponse response, OSD llsdResponse) | ||
931 | { | ||
932 | if (request.AcceptTypes != null && request.AcceptTypes.Length > 0) | ||
933 | { | ||
934 | foreach (string strAccept in request.AcceptTypes) | ||
935 | { | ||
936 | switch (strAccept) | ||
937 | { | ||
938 | case "application/llsd+xml": | ||
939 | case "application/xml": | ||
940 | case "text/xml": | ||
941 | response.ContentType = strAccept; | ||
942 | return OSDParser.SerializeLLSDXmlBytes(llsdResponse); | ||
943 | case "application/llsd+json": | ||
944 | case "application/json": | ||
945 | response.ContentType = strAccept; | ||
946 | return Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(llsdResponse)); | ||
947 | } | ||
948 | } | ||
949 | } | ||
950 | |||
951 | if (!String.IsNullOrEmpty(request.ContentType)) | ||
952 | { | ||
953 | switch (request.ContentType) | ||
954 | { | ||
955 | case "application/llsd+xml": | ||
956 | case "application/xml": | ||
957 | case "text/xml": | ||
958 | response.ContentType = request.ContentType; | ||
959 | return OSDParser.SerializeLLSDXmlBytes(llsdResponse); | ||
960 | case "application/llsd+json": | ||
961 | case "application/json": | ||
962 | response.ContentType = request.ContentType; | ||
963 | return Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(llsdResponse)); | ||
964 | } | ||
965 | } | ||
966 | |||
967 | response.ContentType = "application/llsd+json"; | ||
968 | return Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(llsdResponse)); | ||
969 | } | ||
970 | |||
915 | /// <summary> | 971 | /// <summary> |
916 | /// Checks if we have an Exact path in the LLSD handlers for the path provided | 972 | /// Checks if we have an Exact path in the LLSD handlers for the path provided |
917 | /// </summary> | 973 | /// </summary> |
@@ -1404,6 +1460,10 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1404 | // This has to be here to prevent a Linux/Mono crash | 1460 | // This has to be here to prevent a Linux/Mono crash |
1405 | m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); | 1461 | m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); |
1406 | } | 1462 | } |
1463 | catch (IOException e) | ||
1464 | { | ||
1465 | m_log.Warn("[BASE HTTP SERVER] XmlRpcRequest issue: " + e.Message); | ||
1466 | } | ||
1407 | } | 1467 | } |
1408 | } | 1468 | } |
1409 | 1469 | ||
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 0a9b67d..65d4f4d 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -1111,5 +1111,56 @@ namespace OpenSim.Framework | |||
1111 | return null; | 1111 | return null; |
1112 | } | 1112 | } |
1113 | 1113 | ||
1114 | public static string[] Glob(string path) | ||
1115 | { | ||
1116 | string vol=String.Empty; | ||
1117 | |||
1118 | if (Path.VolumeSeparatorChar != Path.DirectorySeparatorChar) | ||
1119 | { | ||
1120 | string[] vcomps = path.Split(new char[] {Path.VolumeSeparatorChar}, 2, StringSplitOptions.RemoveEmptyEntries); | ||
1121 | |||
1122 | if (vcomps.Length > 1) | ||
1123 | { | ||
1124 | path = vcomps[1]; | ||
1125 | vol = vcomps[0]; | ||
1126 | } | ||
1127 | } | ||
1128 | |||
1129 | string[] comps = path.Split(new char[] {Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar}, StringSplitOptions.RemoveEmptyEntries); | ||
1130 | |||
1131 | // Glob | ||
1132 | |||
1133 | path = vol; | ||
1134 | if (vol != String.Empty) | ||
1135 | path += new String(new char[] {Path.VolumeSeparatorChar, Path.DirectorySeparatorChar}); | ||
1136 | else | ||
1137 | path = new String(new char[] {Path.DirectorySeparatorChar}); | ||
1138 | |||
1139 | List<string> paths = new List<string>(); | ||
1140 | List<string> found = new List<string>(); | ||
1141 | paths.Add(path); | ||
1142 | |||
1143 | foreach (string c in comps) | ||
1144 | { | ||
1145 | List<string> addpaths = new List<string>(); | ||
1146 | foreach (string p in paths) | ||
1147 | { | ||
1148 | string[] dirs = Directory.GetDirectories(p, c); | ||
1149 | |||
1150 | if (dirs.Length != 0) | ||
1151 | { | ||
1152 | foreach (string dir in dirs) | ||
1153 | addpaths.Add(Path.Combine(path, dir)); | ||
1154 | } | ||
1155 | |||
1156 | string[] files = Directory.GetFiles(p, c); | ||
1157 | foreach (string f in files) | ||
1158 | found.Add(f); | ||
1159 | } | ||
1160 | paths = addpaths; | ||
1161 | } | ||
1162 | |||
1163 | return found.ToArray(); | ||
1164 | } | ||
1114 | } | 1165 | } |
1115 | } | 1166 | } |
diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index 1be36ca..7bb8864 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs | |||
@@ -188,10 +188,11 @@ namespace OpenSim | |||
188 | { | 188 | { |
189 | string path = Path.GetFullPath( | 189 | string path = Path.GetFullPath( |
190 | Path.Combine(Util.configDir(), file)); | 190 | Path.Combine(Util.configDir(), file)); |
191 | if (File.Exists(path)) | 191 | string[] paths = Util.Glob(path); |
192 | foreach (string p in paths) | ||
192 | { | 193 | { |
193 | if (!sources.Contains(path)) | 194 | if (!sources.Contains(p)) |
194 | sources.Add(path); | 195 | sources.Add(p); |
195 | } | 196 | } |
196 | } | 197 | } |
197 | } | 198 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 4928ede..14cee36 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |||
@@ -202,19 +202,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
202 | /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where | 202 | /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where |
203 | /// an account exists with the creator name. | 203 | /// an account exists with the creator name. |
204 | /// </summary> | 204 | /// </summary> |
205 | //[Test] | 205 | [Test] |
206 | public void TestLoadIarV0_1ExistingUsers() | 206 | public void TestLoadIarV0_1ExistingUsers() |
207 | { | 207 | { |
208 | TestHelper.InMethod(); | 208 | TestHelper.InMethod(); |
209 | 209 | ||
210 | //log4net.Config.XmlConfigurator.Configure(); | 210 | log4net.Config.XmlConfigurator.Configure(); |
211 | 211 | ||
212 | string userFirstName = "Mr"; | 212 | string userFirstName = "Mr"; |
213 | string userLastName = "Tiddles"; | 213 | string userLastName = "Tiddles"; |
214 | UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000555"); | 214 | UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000555"); |
215 | string user2FirstName = "Lord"; | 215 | string userItemCreatorFirstName = "Lord"; |
216 | string user2LastName = "Lucan"; | 216 | string userItemCreatorLastName = "Lucan"; |
217 | UUID user2Uuid = UUID.Parse("00000000-0000-0000-0000-000000000666"); | 217 | UUID userItemCreatorUuid = UUID.Parse("00000000-0000-0000-0000-000000000666"); |
218 | 218 | ||
219 | string itemName = "b.lsl"; | 219 | string itemName = "b.lsl"; |
220 | string archiveItemName | 220 | string archiveItemName |
@@ -227,7 +227,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
227 | item1.Name = itemName; | 227 | item1.Name = itemName; |
228 | item1.AssetID = UUID.Random(); | 228 | item1.AssetID = UUID.Random(); |
229 | item1.GroupID = UUID.Random(); | 229 | item1.GroupID = UUID.Random(); |
230 | item1.CreatorId = OspResolver.MakeOspa(user2FirstName, user2LastName); | 230 | item1.CreatorId = OspResolver.MakeOspa(userItemCreatorFirstName, userItemCreatorLastName); |
231 | //item1.CreatorId = userUuid.ToString(); | 231 | //item1.CreatorId = userUuid.ToString(); |
232 | //item1.CreatorId = "00000000-0000-0000-0000-000000000444"; | 232 | //item1.CreatorId = "00000000-0000-0000-0000-000000000444"; |
233 | item1.Owner = UUID.Zero; | 233 | item1.Owner = UUID.Zero; |
@@ -249,13 +249,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
249 | userAdminService.AddUser( | 249 | userAdminService.AddUser( |
250 | userFirstName, userLastName, "meowfood", String.Empty, 1000, 1000, userUuid); | 250 | userFirstName, userLastName, "meowfood", String.Empty, 1000, 1000, userUuid); |
251 | userAdminService.AddUser( | 251 | userAdminService.AddUser( |
252 | user2FirstName, user2LastName, "hampshire", String.Empty, 1000, 1000, user2Uuid); | 252 | userItemCreatorFirstName, userItemCreatorLastName, "hampshire", |
253 | String.Empty, 1000, 1000, userItemCreatorUuid); | ||
253 | 254 | ||
254 | archiverModule.DearchiveInventory(userFirstName, userLastName, "/", archiveReadStream); | 255 | archiverModule.DearchiveInventory(userFirstName, userLastName, "/", archiveReadStream); |
255 | 256 | ||
256 | CachedUserInfo userInfo | 257 | CachedUserInfo userInfo |
257 | = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); | 258 | = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); |
258 | userInfo.FetchInventory(); | 259 | //userInfo.FetchInventory(); |
260 | /* | ||
259 | for (int i = 0 ; i < 50 ; i++) | 261 | for (int i = 0 ; i < 50 ; i++) |
260 | { | 262 | { |
261 | if (userInfo.HasReceivedInventory == true) | 263 | if (userInfo.HasReceivedInventory == true) |
@@ -263,18 +265,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
263 | Thread.Sleep(200); | 265 | Thread.Sleep(200); |
264 | } | 266 | } |
265 | Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)"); | 267 | Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)"); |
268 | */ | ||
266 | InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName); | 269 | InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName); |
267 | Assert.That(foundItem, Is.Not.Null, "Didn't find loaded item"); | 270 | Assert.That(foundItem, Is.Not.Null, "Didn't find loaded item"); |
268 | Assert.That( | 271 | Assert.That( |
269 | foundItem.CreatorId, Is.EqualTo(item1.CreatorId), | 272 | foundItem.CreatorId, Is.EqualTo(item1.CreatorId), |
270 | "Loaded item non-uuid creator doesn't match original"); | 273 | "Loaded item non-uuid creator doesn't match original"); |
271 | Assert.That( | 274 | Assert.That( |
272 | foundItem.CreatorIdAsUuid, Is.EqualTo(user2Uuid), | 275 | foundItem.CreatorIdAsUuid, Is.EqualTo(userItemCreatorUuid), |
273 | "Loaded item uuid creator doesn't match original"); | 276 | "Loaded item uuid creator doesn't match original"); |
274 | Assert.That(foundItem.Owner, Is.EqualTo(userUuid), | 277 | Assert.That(foundItem.Owner, Is.EqualTo(userUuid), |
275 | "Loaded item owner doesn't match inventory reciever"); | 278 | "Loaded item owner doesn't match inventory reciever"); |
276 | |||
277 | Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod()); | ||
278 | } | 279 | } |
279 | 280 | ||
280 | /// <summary> | 281 | /// <summary> |
@@ -367,6 +368,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
367 | 368 | ||
368 | CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager); | 369 | CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager); |
369 | userInfo.FetchInventory(); | 370 | userInfo.FetchInventory(); |
371 | /* | ||
370 | for (int i = 0 ; i < 50 ; i++) | 372 | for (int i = 0 ; i < 50 ; i++) |
371 | { | 373 | { |
372 | if (userInfo.HasReceivedInventory == true) | 374 | if (userInfo.HasReceivedInventory == true) |
@@ -374,6 +376,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
374 | Thread.Sleep(200); | 376 | Thread.Sleep(200); |
375 | } | 377 | } |
376 | Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)"); | 378 | Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)"); |
379 | */ | ||
380 | |||
381 | Console.WriteLine("userInfo.RootFolder 1: {0}", userInfo.RootFolder); | ||
382 | |||
377 | Dictionary <string, InventoryFolderImpl> foldersCreated = new Dictionary<string, InventoryFolderImpl>(); | 383 | Dictionary <string, InventoryFolderImpl> foldersCreated = new Dictionary<string, InventoryFolderImpl>(); |
378 | List<InventoryNodeBase> nodesLoaded = new List<InventoryNodeBase>(); | 384 | List<InventoryNodeBase> nodesLoaded = new List<InventoryNodeBase>(); |
379 | 385 | ||
@@ -391,10 +397,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
391 | = string.Format( | 397 | = string.Format( |
392 | "{0}{1}/{2}/{3}", | 398 | "{0}{1}/{2}/{3}", |
393 | ArchiveConstants.INVENTORY_PATH, folder1ArchiveName, folder2ArchiveName, itemName); | 399 | ArchiveConstants.INVENTORY_PATH, folder1ArchiveName, folder2ArchiveName, itemName); |
400 | |||
401 | Console.WriteLine("userInfo.RootFolder 2: {0}", userInfo.RootFolder); | ||
394 | 402 | ||
395 | new InventoryArchiveReadRequest(userInfo, null, (Stream)null, null, null) | 403 | new InventoryArchiveReadRequest(userInfo, null, (Stream)null, null, null) |
396 | .ReplicateArchivePathToUserInventory(itemArchivePath, false, userInfo.RootFolder, foldersCreated, nodesLoaded); | 404 | .ReplicateArchivePathToUserInventory(itemArchivePath, false, userInfo.RootFolder, foldersCreated, nodesLoaded); |
397 | 405 | ||
406 | Console.WriteLine("userInfo.RootFolder 3: {0}", userInfo.RootFolder); | ||
398 | InventoryFolderImpl folder1 = userInfo.RootFolder.FindFolderByPath("a"); | 407 | InventoryFolderImpl folder1 = userInfo.RootFolder.FindFolderByPath("a"); |
399 | Assert.That(folder1, Is.Not.Null, "Could not find folder a"); | 408 | Assert.That(folder1, Is.Not.Null, "Could not find folder a"); |
400 | InventoryFolderImpl folder2 = folder1.FindFolderByPath("b"); | 409 | InventoryFolderImpl folder2 = folder1.FindFolderByPath("b"); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index a304357..e70d985 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -39,7 +39,6 @@ using OpenSim.Region.Framework.Scenes; | |||
39 | using OpenSim.Services.Interfaces; | 39 | using OpenSim.Services.Interfaces; |
40 | using OpenMetaverse; | 40 | using OpenMetaverse; |
41 | 41 | ||
42 | |||
43 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | 42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory |
44 | { | 43 | { |
45 | public class LocalInventoryServicesConnector : ISharedRegionModule, IInventoryService | 44 | public class LocalInventoryServicesConnector : ISharedRegionModule, IInventoryService |
diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index 5471f9e..696f915 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs | |||
@@ -41,9 +41,6 @@ using OpenSim.Framework.Servers.HttpServer; | |||
41 | using OpenSim.Region.Framework.Interfaces; | 41 | using OpenSim.Region.Framework.Interfaces; |
42 | using OpenSim.Region.Framework.Scenes; | 42 | using OpenSim.Region.Framework.Scenes; |
43 | 43 | ||
44 | [assembly: Addin("SampleMoneyModule", "0.1")] | ||
45 | [assembly: AddinDependency("OpenSim", "0.5")] | ||
46 | |||
47 | namespace OpenSim.Region.OptionalModules.World.MoneyModule | 44 | namespace OpenSim.Region.OptionalModules.World.MoneyModule |
48 | { | 45 | { |
49 | /// <summary> | 46 | /// <summary> |
diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index 442ff06..1b14abb 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs | |||
@@ -39,12 +39,17 @@ namespace OpenSim.Tests.Common.Mock | |||
39 | /// tests are single threaded. | 39 | /// tests are single threaded. |
40 | /// </summary> | 40 | /// </summary> |
41 | public class TestInventoryDataPlugin : IInventoryDataPlugin | 41 | public class TestInventoryDataPlugin : IInventoryDataPlugin |
42 | { | 42 | { |
43 | /// <value> | 43 | /// <value> |
44 | /// Known inventory folders | 44 | /// Inventory folders |
45 | /// </value> | 45 | /// </value> |
46 | private Dictionary<UUID, InventoryFolderBase> m_folders = new Dictionary<UUID, InventoryFolderBase>(); | 46 | private Dictionary<UUID, InventoryFolderBase> m_folders = new Dictionary<UUID, InventoryFolderBase>(); |
47 | 47 | ||
48 | //// <value> | ||
49 | /// Inventory items | ||
50 | /// </value> | ||
51 | private Dictionary<UUID, InventoryItemBase> m_items = new Dictionary<UUID, InventoryItemBase>(); | ||
52 | |||
48 | /// <value> | 53 | /// <value> |
49 | /// User root folders | 54 | /// User root folders |
50 | /// </value> | 55 | /// </value> |
@@ -99,9 +104,7 @@ namespace OpenSim.Tests.Common.Mock | |||
99 | } | 104 | } |
100 | 105 | ||
101 | return folders; | 106 | return folders; |
102 | } | 107 | } |
103 | |||
104 | public InventoryItemBase getInventoryItem(UUID item) { return null; } | ||
105 | 108 | ||
106 | public InventoryFolderBase getInventoryFolder(UUID folderId) | 109 | public InventoryFolderBase getInventoryFolder(UUID folderId) |
107 | { | 110 | { |
@@ -111,15 +114,6 @@ namespace OpenSim.Tests.Common.Mock | |||
111 | return folder; | 114 | return folder; |
112 | } | 115 | } |
113 | 116 | ||
114 | public void addInventoryItem(InventoryItemBase item) {} | ||
115 | public void updateInventoryItem(InventoryItemBase item) {} | ||
116 | public void deleteInventoryItem(UUID item) {} | ||
117 | |||
118 | public InventoryItemBase queryInventoryItem(UUID item) | ||
119 | { | ||
120 | return null; | ||
121 | } | ||
122 | |||
123 | public InventoryFolderBase queryInventoryFolder(UUID folderID) | 117 | public InventoryFolderBase queryInventoryFolder(UUID folderID) |
124 | { | 118 | { |
125 | return getInventoryFolder(folderID); | 119 | return getInventoryFolder(folderID); |
@@ -150,6 +144,29 @@ namespace OpenSim.Tests.Common.Mock | |||
150 | m_folders.Remove(folderId); | 144 | m_folders.Remove(folderId); |
151 | } | 145 | } |
152 | 146 | ||
147 | public void addInventoryItem(InventoryItemBase item) { m_items[item.ID] = item; } | ||
148 | |||
149 | public void updateInventoryItem(InventoryItemBase item) { addInventoryItem(item); } | ||
150 | |||
151 | public void deleteInventoryItem(UUID itemId) | ||
152 | { | ||
153 | if (m_items.ContainsKey(itemId)) | ||
154 | m_items.Remove(itemId); | ||
155 | } | ||
156 | |||
157 | public InventoryItemBase getInventoryItem(UUID itemId) | ||
158 | { | ||
159 | if (m_items.ContainsKey(itemId)) | ||
160 | return m_items[itemId]; | ||
161 | else | ||
162 | return null; | ||
163 | } | ||
164 | |||
165 | public InventoryItemBase queryInventoryItem(UUID item) | ||
166 | { | ||
167 | return null; | ||
168 | } | ||
169 | |||
153 | public List<InventoryItemBase> fetchActiveGestures(UUID avatarID) { return null; } | 170 | public List<InventoryItemBase> fetchActiveGestures(UUID avatarID) { return null; } |
154 | } | 171 | } |
155 | } | 172 | } |
diff --git a/OpenSim/Tests/Common/TestHelper.cs b/OpenSim/Tests/Common/TestHelper.cs index f0b3376..4abf2e3 100644 --- a/OpenSim/Tests/Common/TestHelper.cs +++ b/OpenSim/Tests/Common/TestHelper.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Tests.Common | |||
54 | public static void InMethod() | 54 | public static void InMethod() |
55 | { | 55 | { |
56 | StackTrace stackTrace = new StackTrace(); | 56 | StackTrace stackTrace = new StackTrace(); |
57 | Console.WriteLine("==> In Test Method : {0}", stackTrace.GetFrame(1).GetMethod().Name); | 57 | Console.WriteLine("===> In Test Method : {0} <===", stackTrace.GetFrame(1).GetMethod().Name); |
58 | } | 58 | } |
59 | } | 59 | } |
60 | } | 60 | } |
@@ -89,5 +89,3 @@ OpenSim, as well as how to report bugs, and participate in the OpenSim | |||
89 | project can always be found at http://opensimulator.org. | 89 | project can always be found at http://opensimulator.org. |
90 | 90 | ||
91 | Thanks for trying OpenSim, we hope it is a pleasant experience. | 91 | Thanks for trying OpenSim, we hope it is a pleasant experience. |
92 | |||
93 | |||
diff --git a/addon-modules/README b/addon-modules/README new file mode 100644 index 0000000..19f268f --- /dev/null +++ b/addon-modules/README | |||
@@ -0,0 +1,5 @@ | |||
1 | In this directory you can place addon modules for OpenSim | ||
2 | |||
3 | Each module should be in it's own tree and the root of the tree | ||
4 | should contain a file named "prebuild.xml", which will be included in the | ||
5 | main prebuild file. | ||
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 6ae6a95..bd03652 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example | |||
@@ -1362,3 +1362,11 @@ | |||
1362 | ; config-include/GridCommon.ini.example (if you're connected to a grid) | 1362 | ; config-include/GridCommon.ini.example (if you're connected to a grid) |
1363 | ; Copy to your own .ini there (without .example extension) and edit it | 1363 | ; Copy to your own .ini there (without .example extension) and edit it |
1364 | ; to customize your data | 1364 | ; to customize your data |
1365 | |||
1366 | |||
1367 | |||
1368 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
1369 | ;; The below pulls in optional module config files | ||
1370 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
1371 | [Modules] | ||
1372 | Include-modules = "addon-modules/*/config/*.ini" | ||
diff --git a/prebuild.xml b/prebuild.xml index 07b9398..a34661c 100644 --- a/prebuild.xml +++ b/prebuild.xml | |||
@@ -3877,6 +3877,8 @@ | |||
3877 | 3877 | ||
3878 | <!-- /////////////////// END OF INSERTION ///////////////////////////// --> | 3878 | <!-- /////////////////// END OF INSERTION ///////////////////////////// --> |
3879 | 3879 | ||
3880 | <?include file="addon-modules/*/prebuild.xml" ?> | ||
3881 | |||
3880 | </Solution> | 3882 | </Solution> |
3881 | 3883 | ||
3882 | <!-- Prebuild tool --> | 3884 | <!-- Prebuild tool --> |