diff options
Diffstat (limited to '')
10 files changed, 115 insertions, 59 deletions
diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs index 5c37c33..ee2e568 100644 --- a/OpenSim/Services/AssetService/AssetService.cs +++ b/OpenSim/Services/AssetService/AssetService.cs | |||
@@ -82,7 +82,7 @@ namespace OpenSim.Services.AssetService | |||
82 | if (existingAsset == null || Util.SHA1Hash(existingAsset.Data) != Util.SHA1Hash(a.Data)) | 82 | if (existingAsset == null || Util.SHA1Hash(existingAsset.Data) != Util.SHA1Hash(a.Data)) |
83 | { | 83 | { |
84 | // m_log.DebugFormat("[ASSET]: Storing {0} {1}", a.Name, a.ID); | 84 | // m_log.DebugFormat("[ASSET]: Storing {0} {1}", a.Name, a.ID); |
85 | Store(a); | 85 | m_Database.StoreAsset(a); |
86 | } | 86 | } |
87 | }); | 87 | }); |
88 | } | 88 | } |
diff --git a/OpenSim/Services/AssetService/XAssetService.cs b/OpenSim/Services/AssetService/XAssetService.cs index 9490d55..de7223b 100644 --- a/OpenSim/Services/AssetService/XAssetService.cs +++ b/OpenSim/Services/AssetService/XAssetService.cs | |||
@@ -80,7 +80,7 @@ namespace OpenSim.Services.AssetService | |||
80 | if (existingAsset == null || Util.SHA1Hash(existingAsset.Data) != Util.SHA1Hash(a.Data)) | 80 | if (existingAsset == null || Util.SHA1Hash(existingAsset.Data) != Util.SHA1Hash(a.Data)) |
81 | { | 81 | { |
82 | // m_log.DebugFormat("[ASSET]: Storing {0} {1}", a.Name, a.ID); | 82 | // m_log.DebugFormat("[ASSET]: Storing {0} {1}", a.Name, a.ID); |
83 | Store(a); | 83 | m_Database.StoreAsset(a); |
84 | } | 84 | } |
85 | }); | 85 | }); |
86 | } | 86 | } |
diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 7e81be7..205426e 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | |||
@@ -29,6 +29,7 @@ using log4net; | |||
29 | using System; | 29 | using System; |
30 | using System.Threading; | 30 | using System.Threading; |
31 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
32 | using System.Collections.Concurrent; | ||
32 | using System.IO; | 33 | using System.IO; |
33 | using System.Reflection; | 34 | using System.Reflection; |
34 | using System.Timers; | 35 | using System.Timers; |
@@ -352,8 +353,7 @@ namespace OpenSim.Services.Connectors | |||
352 | public string id; | 353 | public string id; |
353 | } | 354 | } |
354 | 355 | ||
355 | private OpenSim.Framework.BlockingQueue<QueuedAssetRequest> m_requestQueue = | 356 | private BlockingCollection<QueuedAssetRequest> m_requestQueue = new BlockingCollection<QueuedAssetRequest>(); |
356 | new OpenSim.Framework.BlockingQueue<QueuedAssetRequest>(); | ||
357 | 357 | ||
358 | private void AssetRequestProcessor() | 358 | private void AssetRequestProcessor() |
359 | { | 359 | { |
@@ -361,10 +361,13 @@ namespace OpenSim.Services.Connectors | |||
361 | 361 | ||
362 | while (true) | 362 | while (true) |
363 | { | 363 | { |
364 | r = m_requestQueue.Dequeue(4500); | 364 | if(!m_requestQueue.TryTake(out r, 4500) || r == null) |
365 | Watchdog.UpdateThread(); | 365 | { |
366 | if(r== null) | 366 | Watchdog.UpdateThread(); |
367 | continue; | 367 | continue; |
368 | } | ||
369 | |||
370 | Watchdog.UpdateThread(); | ||
368 | string uri = r.uri; | 371 | string uri = r.uri; |
369 | string id = r.id; | 372 | string id = r.id; |
370 | 373 | ||
@@ -432,7 +435,7 @@ namespace OpenSim.Services.Connectors | |||
432 | QueuedAssetRequest request = new QueuedAssetRequest(); | 435 | QueuedAssetRequest request = new QueuedAssetRequest(); |
433 | request.id = id; | 436 | request.id = id; |
434 | request.uri = uri; | 437 | request.uri = uri; |
435 | m_requestQueue.Enqueue(request); | 438 | m_requestQueue.Add(request); |
436 | } | 439 | } |
437 | } | 440 | } |
438 | else | 441 | else |
diff --git a/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs b/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs index b9a6281..0971b38 100644 --- a/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs +++ b/OpenSim/Services/Connectors/Estate/EstateDataConnector.cs | |||
@@ -195,6 +195,14 @@ namespace OpenSim.Services.Connectors | |||
195 | string uri = m_ServerURI + string.Format("/estates/estate/?region={0}&create={1}", regionID, create); | 195 | string uri = m_ServerURI + string.Format("/estates/estate/?region={0}&create={1}", regionID, create); |
196 | 196 | ||
197 | reply = MakeRequest("GET", uri, string.Empty); | 197 | reply = MakeRequest("GET", uri, string.Empty); |
198 | if(reply == null) | ||
199 | { | ||
200 | // this is a fatal error | ||
201 | m_log.DebugFormat("[ESTATE CONNECTOR] connection to remote estates service failed"); | ||
202 | m_log.DebugFormat("[ESTATE CONNECTOR] simulator needs to terminate"); | ||
203 | Environment.Exit(-1); | ||
204 | } | ||
205 | |||
198 | if (String.IsNullOrEmpty(reply)) | 206 | if (String.IsNullOrEmpty(reply)) |
199 | return null; | 207 | return null; |
200 | 208 | ||
@@ -308,7 +316,8 @@ namespace OpenSim.Services.Connectors | |||
308 | string reply = string.Empty; | 316 | string reply = string.Empty; |
309 | try | 317 | try |
310 | { | 318 | { |
311 | reply = SynchronousRestFormsRequester.MakeRequest(verb, uri, formdata, m_Auth); | 319 | reply = SynchronousRestFormsRequester.MakeRequest(verb, uri, formdata, 30, m_Auth); |
320 | return reply; | ||
312 | } | 321 | } |
313 | catch (WebException e) | 322 | catch (WebException e) |
314 | { | 323 | { |
@@ -317,14 +326,17 @@ namespace OpenSim.Services.Connectors | |||
317 | if (hwr != null) | 326 | if (hwr != null) |
318 | { | 327 | { |
319 | if (hwr.StatusCode == HttpStatusCode.NotFound) | 328 | if (hwr.StatusCode == HttpStatusCode.NotFound) |
329 | { | ||
320 | m_log.Error(string.Format("[ESTATE CONNECTOR]: Resource {0} not found ", uri)); | 330 | m_log.Error(string.Format("[ESTATE CONNECTOR]: Resource {0} not found ", uri)); |
331 | return reply; | ||
332 | } | ||
321 | if (hwr.StatusCode == HttpStatusCode.Unauthorized) | 333 | if (hwr.StatusCode == HttpStatusCode.Unauthorized) |
322 | m_log.Error(string.Format("[ESTATE CONNECTOR]: Web request {0} requires authentication ", uri)); | 334 | m_log.Error(string.Format("[ESTATE CONNECTOR]: Web request {0} requires authentication ", uri)); |
323 | } | 335 | } |
324 | else | 336 | else |
325 | m_log.Error(string.Format( | 337 | m_log.Error(string.Format( |
326 | "[ESTATE CONNECTOR]: WebException for {0} {1} {2} {3}", | 338 | "[ESTATE CONNECTOR]: WebException for {0} {1} {2} {3}", |
327 | verb, uri, formdata, e)); | 339 | verb, uri, formdata, e.Message)); |
328 | } | 340 | } |
329 | } | 341 | } |
330 | catch (Exception e) | 342 | catch (Exception e) |
@@ -332,7 +344,7 @@ namespace OpenSim.Services.Connectors | |||
332 | m_log.DebugFormat("[ESTATE CONNECTOR]: Exception when contacting estate server at {0}: {1}", uri, e.Message); | 344 | m_log.DebugFormat("[ESTATE CONNECTOR]: Exception when contacting estate server at {0}: {1}", uri, e.Message); |
333 | } | 345 | } |
334 | 346 | ||
335 | return reply; | 347 | return null; |
336 | } | 348 | } |
337 | } | 349 | } |
338 | } | 350 | } |
diff --git a/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs b/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs index 84c4efe..762d2f7 100644 --- a/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs +++ b/OpenSim/Services/Connectors/MapImage/MapImageServicesConnector.cs | |||
@@ -229,6 +229,7 @@ namespace OpenSim.Services.Connectors | |||
229 | string reply = SynchronousRestFormsRequester.MakeRequest("POST", | 229 | string reply = SynchronousRestFormsRequester.MakeRequest("POST", |
230 | uri, | 230 | uri, |
231 | reqString, | 231 | reqString, |
232 | 30, | ||
232 | m_Auth); | 233 | m_Auth); |
233 | if (reply != string.Empty) | 234 | if (reply != string.Empty) |
234 | { | 235 | { |
@@ -271,7 +272,7 @@ namespace OpenSim.Services.Connectors | |||
271 | { | 272 | { |
272 | // This just dumps a warning for any operation that takes more than 100 ms | 273 | // This just dumps a warning for any operation that takes more than 100 ms |
273 | int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); | 274 | int tickdiff = Util.EnvironmentTickCountSubtract(tickstart); |
274 | m_log.DebugFormat("[MAP IMAGE CONNECTOR]: map tile uploaded in {0}ms", tickdiff); | 275 | m_log.DebugFormat("[MAP IMAGE CONNECTOR]: map tile upload time {0}ms", tickdiff); |
275 | } | 276 | } |
276 | 277 | ||
277 | return false; | 278 | return false; |
diff --git a/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs index 5f075ac..9f3b94c 100644 --- a/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs +++ b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs | |||
@@ -151,7 +151,8 @@ namespace OpenSim.Services.Connectors | |||
151 | os.Write(buffer, 0, strBuffer.Length); //Send it | 151 | os.Write(buffer, 0, strBuffer.Length); //Send it |
152 | //m_log.InfoFormat("[REST COMMS]: Posted HelloNeighbour request to remote sim {0}", uri); | 152 | //m_log.InfoFormat("[REST COMMS]: Posted HelloNeighbour request to remote sim {0}", uri); |
153 | } | 153 | } |
154 | catch (Exception e) | 154 | // catch (Exception e) |
155 | catch | ||
155 | { | 156 | { |
156 | // m_log.WarnFormat( | 157 | // m_log.WarnFormat( |
157 | // "[NEIGHBOUR SERVICE CONNCTOR]: Unable to send HelloNeighbour from {0} to {1}. Exception {2}{3}", | 158 | // "[NEIGHBOUR SERVICE CONNCTOR]: Unable to send HelloNeighbour from {0} to {1}. Exception {2}{3}", |
diff --git a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs index d1f2e70..9b33217 100644 --- a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs +++ b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs | |||
@@ -399,7 +399,7 @@ namespace OpenSim.Services.HypergridService | |||
399 | return false; | 399 | return false; |
400 | } | 400 | } |
401 | 401 | ||
402 | public new InventoryItemBase GetItem(InventoryItemBase item) | 402 | public InventoryItemBase GetItem(InventoryItemBase item) |
403 | { | 403 | { |
404 | InventoryItemBase it = base.GetItem(item.Owner, item.ID); | 404 | InventoryItemBase it = base.GetItem(item.Owner, item.ID); |
405 | if (it == null) | 405 | if (it == null) |
diff --git a/OpenSim/Services/Interfaces/ILibraryService.cs b/OpenSim/Services/Interfaces/ILibraryService.cs index 861cf0e..ea914da 100644 --- a/OpenSim/Services/Interfaces/ILibraryService.cs +++ b/OpenSim/Services/Interfaces/ILibraryService.cs | |||
@@ -38,6 +38,7 @@ namespace OpenSim.Services.Interfaces | |||
38 | InventoryFolderImpl LibraryRootFolder { get; } | 38 | InventoryFolderImpl LibraryRootFolder { get; } |
39 | 39 | ||
40 | Dictionary<UUID, InventoryFolderImpl> GetAllFolders(); | 40 | Dictionary<UUID, InventoryFolderImpl> GetAllFolders(); |
41 | InventoryItemBase GetItem(UUID itemID); | ||
42 | InventoryItemBase[] GetMultipleItems(UUID[] itemIDs); | ||
41 | } | 43 | } |
42 | |||
43 | } | 44 | } |
diff --git a/OpenSim/Services/InventoryService/LibraryService.cs b/OpenSim/Services/InventoryService/LibraryService.cs index c4a5572..de1c784 100644 --- a/OpenSim/Services/InventoryService/LibraryService.cs +++ b/OpenSim/Services/InventoryService/LibraryService.cs | |||
@@ -50,25 +50,40 @@ namespace OpenSim.Services.InventoryService | |||
50 | { | 50 | { |
51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
52 | 52 | ||
53 | private InventoryFolderImpl m_LibraryRootFolder; | 53 | static private InventoryFolderImpl m_LibraryRootFolder; |
54 | 54 | ||
55 | public InventoryFolderImpl LibraryRootFolder | 55 | public InventoryFolderImpl LibraryRootFolder |
56 | { | 56 | { |
57 | get { return m_LibraryRootFolder; } | 57 | get { return m_LibraryRootFolder; } |
58 | } | 58 | } |
59 | 59 | ||
60 | private UUID libOwner = new UUID("11111111-1111-0000-0000-000100bba000"); | 60 | static private UUID libOwner = new UUID("11111111-1111-0000-0000-000100bba000"); |
61 | 61 | ||
62 | /// <summary> | 62 | /// <summary> |
63 | /// Holds the root library folder and all its descendents. This is really only used during inventory | 63 | /// Holds the root library folder and all its descendents. This is really only used during inventory |
64 | /// setup so that we don't have to repeatedly search the tree of library folders. | 64 | /// setup so that we don't have to repeatedly search the tree of library folders. |
65 | /// </summary> | 65 | /// </summary> |
66 | protected Dictionary<UUID, InventoryFolderImpl> libraryFolders | 66 | static protected Dictionary<UUID, InventoryFolderImpl> libraryFolders |
67 | = new Dictionary<UUID, InventoryFolderImpl>(); | 67 | = new Dictionary<UUID, InventoryFolderImpl>(32); |
68 | 68 | ||
69 | public LibraryService(IConfigSource config) | 69 | static protected Dictionary<UUID, InventoryItemBase> m_items = new Dictionary<UUID, InventoryItemBase>(256); |
70 | : base(config) | 70 | static LibraryService m_root; |
71 | static object m_rootLock = new object(); | ||
72 | static readonly uint m_BasePermissions = (uint)PermissionMask.AllAndExport; | ||
73 | static readonly uint m_EveryOnePermissions = (uint)PermissionMask.AllAndExportNoMod; | ||
74 | static readonly uint m_CurrentPermissions = (uint)PermissionMask.AllAndExport; | ||
75 | static readonly uint m_NextPermissions = (uint)PermissionMask.AllAndExport; | ||
76 | static readonly uint m_GroupPermissions = 0; | ||
77 | |||
78 | public LibraryService(IConfigSource config):base(config) | ||
71 | { | 79 | { |
80 | lock(m_rootLock) | ||
81 | { | ||
82 | if(m_root != null) | ||
83 | return; | ||
84 | m_root = this; | ||
85 | } | ||
86 | |||
72 | string pLibrariesLocation = Path.Combine("inventory", "Libraries.xml"); | 87 | string pLibrariesLocation = Path.Combine("inventory", "Libraries.xml"); |
73 | string pLibName = "OpenSim Library"; | 88 | string pLibName = "OpenSim Library"; |
74 | 89 | ||
@@ -86,8 +101,8 @@ namespace OpenSim.Services.InventoryService | |||
86 | m_LibraryRootFolder.ID = new UUID("00000112-000f-0000-0000-000100bba000"); | 101 | m_LibraryRootFolder.ID = new UUID("00000112-000f-0000-0000-000100bba000"); |
87 | m_LibraryRootFolder.Name = pLibName; | 102 | m_LibraryRootFolder.Name = pLibName; |
88 | m_LibraryRootFolder.ParentID = UUID.Zero; | 103 | m_LibraryRootFolder.ParentID = UUID.Zero; |
89 | m_LibraryRootFolder.Type = (short)8; | 104 | m_LibraryRootFolder.Type = 8; |
90 | m_LibraryRootFolder.Version = (ushort)1; | 105 | m_LibraryRootFolder.Version = 1; |
91 | 106 | ||
92 | libraryFolders.Add(m_LibraryRootFolder.ID, m_LibraryRootFolder); | 107 | libraryFolders.Add(m_LibraryRootFolder.ID, m_LibraryRootFolder); |
93 | 108 | ||
@@ -107,10 +122,11 @@ namespace OpenSim.Services.InventoryService | |||
107 | item.AssetType = assetType; | 122 | item.AssetType = assetType; |
108 | item.InvType = invType; | 123 | item.InvType = invType; |
109 | item.Folder = parentFolderID; | 124 | item.Folder = parentFolderID; |
110 | item.BasePermissions = 0x7FFFFFFF; | 125 | item.BasePermissions = m_BasePermissions; |
111 | item.EveryOnePermissions = 0x7FFFFFFF; | 126 | item.EveryOnePermissions = m_EveryOnePermissions; |
112 | item.CurrentPermissions = 0x7FFFFFFF; | 127 | item.CurrentPermissions = m_CurrentPermissions; |
113 | item.NextPermissions = 0x7FFFFFFF; | 128 | item.NextPermissions = m_NextPermissions; |
129 | item.GroupPermissions = m_GroupPermissions; | ||
114 | return item; | 130 | return item; |
115 | } | 131 | } |
116 | 132 | ||
@@ -132,6 +148,7 @@ namespace OpenSim.Services.InventoryService | |||
132 | protected void ReadLibraryFromConfig(IConfig config, string path) | 148 | protected void ReadLibraryFromConfig(IConfig config, string path) |
133 | { | 149 | { |
134 | string basePath = Path.GetDirectoryName(path); | 150 | string basePath = Path.GetDirectoryName(path); |
151 | m_LibraryRootFolder.Version = (ushort)config.GetInt("RootVersion", 1); | ||
135 | string foldersPath | 152 | string foldersPath |
136 | = Path.Combine( | 153 | = Path.Combine( |
137 | basePath, config.GetString("foldersFile", String.Empty)); | 154 | basePath, config.GetString("foldersFile", String.Empty)); |
@@ -157,9 +174,8 @@ namespace OpenSim.Services.InventoryService | |||
157 | folderInfo.Name = config.GetString("name", "unknown"); | 174 | folderInfo.Name = config.GetString("name", "unknown"); |
158 | folderInfo.ParentID = new UUID(config.GetString("parentFolderID", m_LibraryRootFolder.ID.ToString())); | 175 | folderInfo.ParentID = new UUID(config.GetString("parentFolderID", m_LibraryRootFolder.ID.ToString())); |
159 | folderInfo.Type = (short)config.GetInt("type", 8); | 176 | folderInfo.Type = (short)config.GetInt("type", 8); |
160 | 177 | folderInfo.Version = (ushort)config.GetInt("version", 1); | |
161 | folderInfo.Owner = libOwner; | 178 | folderInfo.Owner = libOwner; |
162 | folderInfo.Version = 1; | ||
163 | 179 | ||
164 | if (libraryFolders.ContainsKey(folderInfo.ParentID)) | 180 | if (libraryFolders.ContainsKey(folderInfo.ParentID)) |
165 | { | 181 | { |
@@ -187,28 +203,30 @@ namespace OpenSim.Services.InventoryService | |||
187 | InventoryItemBase item = new InventoryItemBase(); | 203 | InventoryItemBase item = new InventoryItemBase(); |
188 | item.Owner = libOwner; | 204 | item.Owner = libOwner; |
189 | item.CreatorId = libOwner.ToString(); | 205 | item.CreatorId = libOwner.ToString(); |
190 | item.ID = new UUID(config.GetString("inventoryID", m_LibraryRootFolder.ID.ToString())); | 206 | UUID itID = new UUID(config.GetString("inventoryID", m_LibraryRootFolder.ID.ToString())); |
207 | item.ID = itID; | ||
191 | item.AssetID = new UUID(config.GetString("assetID", item.ID.ToString())); | 208 | item.AssetID = new UUID(config.GetString("assetID", item.ID.ToString())); |
192 | item.Folder = new UUID(config.GetString("folderID", m_LibraryRootFolder.ID.ToString())); | 209 | item.Folder = new UUID(config.GetString("folderID", m_LibraryRootFolder.ID.ToString())); |
193 | item.Name = config.GetString("name", String.Empty); | 210 | item.Name = config.GetString("name", String.Empty); |
194 | item.Description = config.GetString("description", item.Name); | 211 | item.Description = config.GetString("description", item.Name); |
195 | item.InvType = config.GetInt("inventoryType", 0); | 212 | item.InvType = config.GetInt("inventoryType", 0); |
196 | item.AssetType = config.GetInt("assetType", item.InvType); | 213 | item.AssetType = config.GetInt("assetType", item.InvType); |
197 | item.CurrentPermissions = (uint)config.GetLong("currentPermissions", (uint)PermissionMask.All); | 214 | item.CurrentPermissions = (uint)config.GetLong("currentPermissions", m_CurrentPermissions); |
198 | item.NextPermissions = (uint)config.GetLong("nextPermissions", (uint)PermissionMask.All); | 215 | item.NextPermissions = (uint)config.GetLong("nextPermissions", m_NextPermissions); |
199 | item.EveryOnePermissions | 216 | item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", m_EveryOnePermissions); |
200 | = (uint)config.GetLong("everyonePermissions", (uint)PermissionMask.All - (uint)PermissionMask.Modify); | 217 | item.BasePermissions = (uint)config.GetLong("basePermissions", m_BasePermissions); |
201 | item.BasePermissions = (uint)config.GetLong("basePermissions", (uint)PermissionMask.All); | 218 | item.GroupPermissions = (uint)config.GetLong("basePermissions", m_GroupPermissions);; |
202 | item.Flags = (uint)config.GetInt("flags", 0); | 219 | item.Flags = (uint)config.GetInt("flags", 0); |
203 | 220 | ||
204 | if (libraryFolders.ContainsKey(item.Folder)) | 221 | if (libraryFolders.ContainsKey(item.Folder)) |
205 | { | 222 | { |
206 | InventoryFolderImpl parentFolder = libraryFolders[item.Folder]; | 223 | InventoryFolderImpl parentFolder = libraryFolders[item.Folder]; |
207 | try | 224 | if(!parentFolder.Items.ContainsKey(itID)) |
208 | { | 225 | { |
209 | parentFolder.Items.Add(item.ID, item); | 226 | parentFolder.Items.Add(itID, item); |
227 | m_items[itID] = item; | ||
210 | } | 228 | } |
211 | catch (Exception) | 229 | else |
212 | { | 230 | { |
213 | m_log.WarnFormat("[LIBRARY INVENTORY] Item {1} [{0}] not added, duplicate item", item.ID, item.Name); | 231 | m_log.WarnFormat("[LIBRARY INVENTORY] Item {1} [{0}] not added, duplicate item", item.ID, item.Name); |
214 | } | 232 | } |
@@ -281,5 +299,26 @@ namespace OpenSim.Services.InventoryService | |||
281 | folders.AddRange(subs); | 299 | folders.AddRange(subs); |
282 | return folders; | 300 | return folders; |
283 | } | 301 | } |
302 | |||
303 | public InventoryItemBase GetItem(UUID itemID) | ||
304 | { | ||
305 | if(m_items.ContainsKey(itemID)) | ||
306 | return m_items[itemID]; | ||
307 | return null; | ||
308 | } | ||
309 | |||
310 | public InventoryItemBase[] GetMultipleItems(UUID[] ids) | ||
311 | { | ||
312 | List<InventoryItemBase> items = new List<InventoryItemBase>(); | ||
313 | foreach (UUID id in ids) | ||
314 | { | ||
315 | if(m_items.ContainsKey(id)) | ||
316 | items.Add(m_items[id]); | ||
317 | } | ||
318 | |||
319 | if(items.Count == 0) | ||
320 | return null; | ||
321 | return items.ToArray(); | ||
322 | } | ||
284 | } | 323 | } |
285 | } | 324 | } |
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index 48929ee..5561287 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs | |||
@@ -86,30 +86,29 @@ namespace OpenSim.Services.UserAccountService | |||
86 | 86 | ||
87 | m_CreateDefaultAvatarEntries = userConfig.GetBoolean("CreateDefaultAvatarEntries", false); | 87 | m_CreateDefaultAvatarEntries = userConfig.GetBoolean("CreateDefaultAvatarEntries", false); |
88 | 88 | ||
89 | // create a system grid god account | ||
90 | UserAccount ggod = GetUserAccount(UUID.Zero, UUID_GRID_GOD); | ||
91 | if(ggod == null) | ||
92 | { | ||
93 | UserAccountData d = new UserAccountData(); | ||
94 | |||
95 | d.FirstName = "GRID"; | ||
96 | d.LastName = "SERVICES"; | ||
97 | d.PrincipalID = UUID_GRID_GOD; | ||
98 | d.ScopeID = UUID.Zero; | ||
99 | d.Data = new Dictionary<string, string>(); | ||
100 | d.Data["Email"] = string.Empty; | ||
101 | d.Data["Created"] = Util.UnixTimeSinceEpoch().ToString(); | ||
102 | d.Data["UserLevel"] = "240"; | ||
103 | d.Data["UserFlags"] = "0"; | ||
104 | d.Data["ServiceURLs"] = string.Empty; | ||
105 | |||
106 | m_Database.Store(d); | ||
107 | } | ||
108 | |||
109 | if (m_RootInstance == null) | 89 | if (m_RootInstance == null) |
110 | { | 90 | { |
111 | m_RootInstance = this; | 91 | m_RootInstance = this; |
112 | 92 | ||
93 | // create a system grid god account | ||
94 | UserAccount ggod = GetUserAccount(UUID.Zero, UUID_GRID_GOD); | ||
95 | if(ggod == null) | ||
96 | { | ||
97 | UserAccountData d = new UserAccountData(); | ||
98 | d.FirstName = "GRID"; | ||
99 | d.LastName = "SERVICES"; | ||
100 | d.PrincipalID = UUID_GRID_GOD; | ||
101 | d.ScopeID = UUID.Zero; | ||
102 | d.Data = new Dictionary<string, string>(); | ||
103 | d.Data["Email"] = string.Empty; | ||
104 | d.Data["Created"] = Util.UnixTimeSinceEpoch().ToString(); | ||
105 | d.Data["UserLevel"] = "240"; | ||
106 | d.Data["UserFlags"] = "0"; | ||
107 | d.Data["ServiceURLs"] = string.Empty; | ||
108 | |||
109 | m_Database.Store(d); | ||
110 | } | ||
111 | |||
113 | // In case there are several instances of this class in the same process, | 112 | // In case there are several instances of this class in the same process, |
114 | // the console commands are only registered for the root instance | 113 | // the console commands are only registered for the root instance |
115 | if (MainConsole.Instance != null) | 114 | if (MainConsole.Instance != null) |