aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2012-11-17 02:03:24 +0000
committerMelanie2012-11-17 02:03:24 +0000
commite4659a83f15acc85a7207a1ff60460cae0b86b78 (patch)
treed0fc79b1cbdb15ce9296f05aacf696c9ad43bc41 /OpenSim
parentMerge branch 'master' into careminster (diff)
parentRemove old InventoryService, which has for a long time been replaced by XInve... (diff)
downloadopensim-SC_OLD-e4659a83f15acc85a7207a1ff60460cae0b86b78.zip
opensim-SC_OLD-e4659a83f15acc85a7207a1ff60460cae0b86b78.tar.gz
opensim-SC_OLD-e4659a83f15acc85a7207a1ff60460cae0b86b78.tar.bz2
opensim-SC_OLD-e4659a83f15acc85a7207a1ff60460cae0b86b78.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs4
-rw-r--r--OpenSim/Data/MSSQL/MSSQLXInventoryData.cs47
-rw-r--r--OpenSim/Data/MySQL/MySQLXInventoryData.cs51
-rw-r--r--OpenSim/Data/SQLite/SQLiteXInventoryData.cs42
-rw-r--r--OpenSim/Framework/InventoryItemBase.cs22
-rw-r--r--OpenSim/Framework/Monitoring/Stats/PercentageStat.cs (renamed from OpenSim/Services/InventoryService/InventoryServiceBase.cs)82
-rw-r--r--OpenSim/Framework/Monitoring/Stats/Stat.cs238
-rw-r--r--OpenSim/Framework/Monitoring/StatsManager.cs185
-rw-r--r--OpenSim/Framework/Monitoring/Watchdog.cs4
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs1
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs5
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs4
-rw-r--r--OpenSim/Server/Properties/AssemblyInfo.cs33
-rw-r--r--OpenSim/Services/AssetService/Properties/AssemblyInfo.cs33
-rw-r--r--OpenSim/Services/AuthenticationService/Properties/AssemblyInfo.cs33
-rw-r--r--OpenSim/Services/AuthorizationService/Properties/AssemblyInfo.cs33
-rw-r--r--OpenSim/Services/AvatarService/Properties/AssemblyInfo.cs33
-rw-r--r--OpenSim/Services/Base/Properties/AssemblyInfo.cs33
-rw-r--r--OpenSim/Services/Connectors/Properties/AssemblyInfo.cs33
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs1
-rw-r--r--OpenSim/Services/FreeswitchService/Properties/AssemblyInfo.cs33
-rw-r--r--OpenSim/Services/Friends/Properties/AssemblyInfo.cs33
-rw-r--r--OpenSim/Services/GridService/Properties/AssemblyInfo.cs33
-rw-r--r--OpenSim/Services/HypergridService/Properties/AssemblyInfo.cs33
-rw-r--r--OpenSim/Services/Interfaces/Properties/AssemblyInfo.cs33
-rw-r--r--OpenSim/Services/InventoryService/InventoryService.cs700
-rw-r--r--OpenSim/Services/InventoryService/Properties/AssemblyInfo.cs33
-rw-r--r--OpenSim/Services/InventoryService/Tests/XInventoryServiceTests.cs177
-rw-r--r--OpenSim/Services/InventoryService/XInventoryService.cs40
-rw-r--r--OpenSim/Services/LLLoginService/Properties/AssemblyInfo.cs33
-rw-r--r--OpenSim/Services/MapImageService/Properties/AssemblyInfo.cs33
-rw-r--r--OpenSim/Services/PresenceService/Properties/AssemblyInfo.cs33
-rw-r--r--OpenSim/Services/UserAccountService/Properties/AssemblyInfo.cs33
-rw-r--r--OpenSim/Tools/Compiler/Properties/AssemblyInfo.cs33
-rw-r--r--OpenSim/Tools/Configger/Properties/AssemblyInfo.cs33
-rw-r--r--OpenSim/Tools/pCampBot/Properties/AssemblyInfo.cs33
36 files changed, 1229 insertions, 1034 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index 9c933ee..3d80eb6 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -2448,7 +2448,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2448 destinationItem.Description = item.Description; 2448 destinationItem.Description = item.Description;
2449 destinationItem.InvType = item.InvType; 2449 destinationItem.InvType = item.InvType;
2450 destinationItem.CreatorId = item.CreatorId; 2450 destinationItem.CreatorId = item.CreatorId;
2451 destinationItem.CreatorIdAsUuid = item.CreatorIdAsUuid;
2452 destinationItem.CreatorData = item.CreatorData; 2451 destinationItem.CreatorData = item.CreatorData;
2453 destinationItem.NextPermissions = item.NextPermissions; 2452 destinationItem.NextPermissions = item.NextPermissions;
2454 destinationItem.CurrentPermissions = item.CurrentPermissions; 2453 destinationItem.CurrentPermissions = item.CurrentPermissions;
@@ -2503,7 +2502,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2503 destinationItem.Description = item.Description; 2502 destinationItem.Description = item.Description;
2504 destinationItem.InvType = item.InvType; 2503 destinationItem.InvType = item.InvType;
2505 destinationItem.CreatorId = item.CreatorId; 2504 destinationItem.CreatorId = item.CreatorId;
2506 destinationItem.CreatorIdAsUuid = item.CreatorIdAsUuid;
2507 destinationItem.CreatorData = item.CreatorData; 2505 destinationItem.CreatorData = item.CreatorData;
2508 destinationItem.NextPermissions = item.NextPermissions; 2506 destinationItem.NextPermissions = item.NextPermissions;
2509 destinationItem.CurrentPermissions = item.CurrentPermissions; 2507 destinationItem.CurrentPermissions = item.CurrentPermissions;
@@ -2616,7 +2614,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2616 destinationItem.Description = item.Description; 2614 destinationItem.Description = item.Description;
2617 destinationItem.InvType = item.InvType; 2615 destinationItem.InvType = item.InvType;
2618 destinationItem.CreatorId = item.CreatorId; 2616 destinationItem.CreatorId = item.CreatorId;
2619 destinationItem.CreatorIdAsUuid = item.CreatorIdAsUuid;
2620 destinationItem.CreatorData = item.CreatorData; 2617 destinationItem.CreatorData = item.CreatorData;
2621 destinationItem.NextPermissions = item.NextPermissions; 2618 destinationItem.NextPermissions = item.NextPermissions;
2622 destinationItem.CurrentPermissions = item.CurrentPermissions; 2619 destinationItem.CurrentPermissions = item.CurrentPermissions;
@@ -2922,7 +2919,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2922 inventoryItem.Description = GetStringAttribute(item,"desc",""); 2919 inventoryItem.Description = GetStringAttribute(item,"desc","");
2923 inventoryItem.InvType = GetIntegerAttribute(item,"invtype",-1); 2920 inventoryItem.InvType = GetIntegerAttribute(item,"invtype",-1);
2924 inventoryItem.CreatorId = GetStringAttribute(item,"creatorid",""); 2921 inventoryItem.CreatorId = GetStringAttribute(item,"creatorid","");
2925 inventoryItem.CreatorIdAsUuid = (UUID)GetStringAttribute(item,"creatoruuid","");
2926 inventoryItem.CreatorData = GetStringAttribute(item, "creatordata", ""); 2922 inventoryItem.CreatorData = GetStringAttribute(item, "creatordata", "");
2927 inventoryItem.NextPermissions = GetUnsignedAttribute(perms, "next", 0x7fffffff); 2923 inventoryItem.NextPermissions = GetUnsignedAttribute(perms, "next", 0x7fffffff);
2928 inventoryItem.CurrentPermissions = GetUnsignedAttribute(perms,"current",0x7fffffff); 2924 inventoryItem.CurrentPermissions = GetUnsignedAttribute(perms,"current",0x7fffffff);
diff --git a/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs b/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs
index eb636cf..e261aba 100644
--- a/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs
@@ -122,7 +122,7 @@ namespace OpenSim.Data.MSSQL
122 } 122 }
123 } 123 }
124 124
125 public class MSSQLItemHandler : MSSQLGenericTableHandler<XInventoryItem> 125 public class MSSQLItemHandler : MSSQLInventoryHandler<XInventoryItem>
126 { 126 {
127 public MSSQLItemHandler(string c, string t, string m) : 127 public MSSQLItemHandler(string c, string t, string m) :
128 base(c, t, m) 128 base(c, t, m)
@@ -213,43 +213,9 @@ namespace OpenSim.Data.MSSQL
213 213
214 return true; 214 return true;
215 } 215 }
216
217 private bool IncrementFolderVersion(UUID folderID)
218 {
219 return IncrementFolderVersion(folderID.ToString());
220 }
221
222 private bool IncrementFolderVersion(string folderID)
223 {
224// m_log.DebugFormat("[MYSQL ITEM HANDLER]: Incrementing version on folder {0}", folderID);
225// Util.PrintCallStack();
226
227 string sql = "update inventoryfolders set version=version+1 where folderID = ?folderID";
228
229 using (SqlConnection conn = new SqlConnection(m_ConnectionString))
230 {
231 using (SqlCommand cmd = new SqlCommand(sql, conn))
232 {
233 conn.Open();
234
235 cmd.Parameters.AddWithValue("@folderID", folderID);
236
237 try
238 {
239 cmd.ExecuteNonQuery();
240 }
241 catch (Exception)
242 {
243 return false;
244 }
245 }
246 }
247
248 return true;
249 }
250 } 216 }
251 217
252 public class MSSQLFolderHandler : MSSQLGenericTableHandler<XInventoryFolder> 218 public class MSSQLFolderHandler : MSSQLInventoryHandler<XInventoryFolder>
253 { 219 {
254 public MSSQLFolderHandler(string c, string t, string m) : 220 public MSSQLFolderHandler(string c, string t, string m) :
255 base(c, t, m) 221 base(c, t, m)
@@ -296,13 +262,18 @@ namespace OpenSim.Data.MSSQL
296 262
297 return true; 263 return true;
298 } 264 }
265 }
266
267 public class MSSQLInventoryHandler<T> : MSSQLGenericTableHandler<T> where T: class, new()
268 {
269 public MSSQLInventoryHandler(string c, string t, string m) : base(c, t, m) {}
299 270
300 private bool IncrementFolderVersion(UUID folderID) 271 protected bool IncrementFolderVersion(UUID folderID)
301 { 272 {
302 return IncrementFolderVersion(folderID.ToString()); 273 return IncrementFolderVersion(folderID.ToString());
303 } 274 }
304 275
305 private bool IncrementFolderVersion(string folderID) 276 protected bool IncrementFolderVersion(string folderID)
306 { 277 {
307// m_log.DebugFormat("[MYSQL ITEM HANDLER]: Incrementing version on folder {0}", folderID); 278// m_log.DebugFormat("[MYSQL ITEM HANDLER]: Incrementing version on folder {0}", folderID);
308// Util.PrintCallStack(); 279// Util.PrintCallStack();
diff --git a/OpenSim/Data/MySQL/MySQLXInventoryData.cs b/OpenSim/Data/MySQL/MySQLXInventoryData.cs
index 7a3b5b4..c74033e 100644
--- a/OpenSim/Data/MySQL/MySQLXInventoryData.cs
+++ b/OpenSim/Data/MySQL/MySQLXInventoryData.cs
@@ -122,7 +122,7 @@ namespace OpenSim.Data.MySQL
122 } 122 }
123 } 123 }
124 124
125 public class MySqlItemHandler : MySQLGenericTableHandler<XInventoryItem> 125 public class MySqlItemHandler : MySqlInventoryHandler<XInventoryItem>
126 { 126 {
127// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 127// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
128 128
@@ -241,47 +241,9 @@ namespace OpenSim.Data.MySQL
241 241
242 return true; 242 return true;
243 } 243 }
244
245 private bool IncrementFolderVersion(UUID folderID)
246 {
247 return IncrementFolderVersion(folderID.ToString());
248 }
249
250 private bool IncrementFolderVersion(string folderID)
251 {
252// m_log.DebugFormat("[MYSQL ITEM HANDLER]: Incrementing version on folder {0}", folderID);
253// Util.PrintCallStack();
254
255 using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
256 {
257 dbcon.Open();
258
259 using (MySqlCommand cmd = new MySqlCommand())
260 {
261 cmd.Connection = dbcon;
262
263 cmd.CommandText = String.Format("update inventoryfolders set version=version+1 where folderID = ?folderID");
264 cmd.Parameters.AddWithValue("?folderID", folderID);
265
266 try
267 {
268 cmd.ExecuteNonQuery();
269 }
270 catch (Exception)
271 {
272 return false;
273 }
274 cmd.Dispose();
275 }
276
277 dbcon.Close();
278 }
279
280 return true;
281 }
282 } 244 }
283 245
284 public class MySqlFolderHandler : MySQLGenericTableHandler<XInventoryFolder> 246 public class MySqlFolderHandler : MySqlInventoryHandler<XInventoryFolder>
285 { 247 {
286// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 248// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
287 249
@@ -326,13 +288,18 @@ namespace OpenSim.Data.MySQL
326 288
327 return true; 289 return true;
328 } 290 }
291 }
292
293 public class MySqlInventoryHandler<T> : MySQLGenericTableHandler<T> where T: class, new()
294 {
295 public MySqlInventoryHandler(string c, string t, string m) : base(c, t, m) {}
329 296
330 private bool IncrementFolderVersion(UUID folderID) 297 protected bool IncrementFolderVersion(UUID folderID)
331 { 298 {
332 return IncrementFolderVersion(folderID.ToString()); 299 return IncrementFolderVersion(folderID.ToString());
333 } 300 }
334 301
335 private bool IncrementFolderVersion(string folderID) 302 protected bool IncrementFolderVersion(string folderID)
336 { 303 {
337// m_log.DebugFormat("[MYSQL FOLDER HANDLER]: Incrementing version on folder {0}", folderID); 304// m_log.DebugFormat("[MYSQL FOLDER HANDLER]: Incrementing version on folder {0}", folderID);
338// Util.PrintCallStack(); 305// Util.PrintCallStack();
diff --git a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
index 87eb31e..2a0a8f6 100644
--- a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
+++ b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
@@ -130,7 +130,7 @@ namespace OpenSim.Data.SQLite
130 } 130 }
131 } 131 }
132 132
133 public class SqliteItemHandler : SQLiteGenericTableHandler<XInventoryItem> 133 public class SqliteItemHandler : SqliteInventoryHandler<XInventoryItem>
134 { 134 {
135 public SqliteItemHandler(string c, string t, string m) : 135 public SqliteItemHandler(string c, string t, string m) :
136 base(c, t, m) 136 base(c, t, m)
@@ -243,37 +243,9 @@ namespace OpenSim.Data.SQLite
243 243
244 return perms; 244 return perms;
245 } 245 }
246
247 private bool IncrementFolderVersion(UUID folderID)
248 {
249 return IncrementFolderVersion(folderID.ToString());
250 }
251
252 private bool IncrementFolderVersion(string folderID)
253 {
254// m_log.DebugFormat("[MYSQL ITEM HANDLER]: Incrementing version on folder {0}", folderID);
255// Util.PrintCallStack();
256
257 using (SqliteCommand cmd = new SqliteCommand())
258 {
259 cmd.CommandText = "update inventoryfolders set version=version+1 where folderID = ?folderID";
260 cmd.Parameters.Add(new SqliteParameter(":folderID", folderID));
261
262 try
263 {
264 cmd.ExecuteNonQuery();
265 }
266 catch (Exception)
267 {
268 return false;
269 }
270 }
271
272 return true;
273 }
274 } 246 }
275 247
276 public class SqliteFolderHandler : SQLiteGenericTableHandler<XInventoryFolder> 248 public class SqliteFolderHandler : SqliteInventoryHandler<XInventoryFolder>
277 { 249 {
278 public SqliteFolderHandler(string c, string t, string m) : 250 public SqliteFolderHandler(string c, string t, string m) :
279 base(c, t, m) 251 base(c, t, m)
@@ -315,12 +287,18 @@ namespace OpenSim.Data.SQLite
315 return true; 287 return true;
316 } 288 }
317 289
318 private bool IncrementFolderVersion(UUID folderID) 290 }
291
292 public class SqliteInventoryHandler<T> : SQLiteGenericTableHandler<T> where T: class, new()
293 {
294 public SqliteInventoryHandler(string c, string t, string m) : base(c, t, m) {}
295
296 protected bool IncrementFolderVersion(UUID folderID)
319 { 297 {
320 return IncrementFolderVersion(folderID.ToString()); 298 return IncrementFolderVersion(folderID.ToString());
321 } 299 }
322 300
323 private bool IncrementFolderVersion(string folderID) 301 protected bool IncrementFolderVersion(string folderID)
324 { 302 {
325// m_log.DebugFormat("[MYSQL ITEM HANDLER]: Incrementing version on folder {0}", folderID); 303// m_log.DebugFormat("[MYSQL ITEM HANDLER]: Incrementing version on folder {0}", folderID);
326// Util.PrintCallStack(); 304// Util.PrintCallStack();
diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs
index a663680..3d45e76 100644
--- a/OpenSim/Framework/InventoryItemBase.cs
+++ b/OpenSim/Framework/InventoryItemBase.cs
@@ -87,16 +87,7 @@ namespace OpenSim.Framework
87 protected string m_creatorId; 87 protected string m_creatorId;
88 88
89 /// <value> 89 /// <value>
90 /// The UUID for the creator. This may be different from the canonical CreatorId. This property is used 90 /// The CreatorId expressed as a UUID.tely
91 /// for communication with the client over the Second Life protocol, since that protocol can only understand
92 /// UUIDs. As this is a basic framework class, this means that both the string creator id and the uuid
93 /// reference have to be settable separately
94 ///
95 /// Database plugins don't need to set this, it will be set by
96 /// upstream code (or set by the get accessor if left unset).
97 ///
98 /// XXX: An alternative to having a separate uuid property would be to hash the CreatorId appropriately
99 /// every time there was communication with a UUID-only client. This may be much more expensive.
100 /// </value> 91 /// </value>
101 public UUID CreatorIdAsUuid 92 public UUID CreatorIdAsUuid
102 { 93 {
@@ -109,20 +100,18 @@ namespace OpenSim.Framework
109 100
110 return m_creatorIdAsUuid; 101 return m_creatorIdAsUuid;
111 } 102 }
112
113 set
114 {
115 m_creatorIdAsUuid = value;
116 }
117 } 103 }
118 protected UUID m_creatorIdAsUuid = UUID.Zero; 104 protected UUID m_creatorIdAsUuid = UUID.Zero;
119 105
120 protected string m_creatorData = string.Empty; 106 /// <summary>
107 /// Extended creator information of the form <profile url>;<name>
108 /// </summary>
121 public string CreatorData // = <profile url>;<name> 109 public string CreatorData // = <profile url>;<name>
122 { 110 {
123 get { return m_creatorData; } 111 get { return m_creatorData; }
124 set { m_creatorData = value; } 112 set { m_creatorData = value; }
125 } 113 }
114 protected string m_creatorData = string.Empty;
126 115
127 /// <summary> 116 /// <summary>
128 /// Used by the DB layer to retrieve / store the entire user identification. 117 /// Used by the DB layer to retrieve / store the entire user identification.
@@ -162,7 +151,6 @@ namespace OpenSim.Framework
162 name = parts[2]; 151 name = parts[2];
163 152
164 m_creatorData += ';' + name; 153 m_creatorData += ';' + name;
165
166 } 154 }
167 } 155 }
168 } 156 }
diff --git a/OpenSim/Services/InventoryService/InventoryServiceBase.cs b/OpenSim/Framework/Monitoring/Stats/PercentageStat.cs
index 456e455..60bed55 100644
--- a/OpenSim/Services/InventoryService/InventoryServiceBase.cs
+++ b/OpenSim/Framework/Monitoring/Stats/PercentageStat.cs
@@ -27,56 +27,62 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection; 30using System.Text;
31using Nini.Config;
32using OpenSim.Framework;
33using OpenSim.Data;
34using OpenSim.Services.Interfaces;
35using OpenSim.Services.Base;
36 31
37namespace OpenSim.Services.InventoryService 32namespace OpenSim.Framework.Monitoring
38{ 33{
39 public class InventoryServiceBase : ServiceBase 34 public class PercentageStat : Stat
40 { 35 {
41 protected IInventoryDataPlugin m_Database = null; 36 public long Antecedent { get; set; }
37 public long Consequent { get; set; }
42 38
43 public InventoryServiceBase(IConfigSource config) : base(config) 39 public override double Value
44 { 40 {
45 string dllName = String.Empty; 41 get
46 string connString = String.Empty;
47
48 //
49 // Try reading the [DatabaseService] section first, if it exists
50 //
51 IConfig dbConfig = config.Configs["DatabaseService"];
52 if (dbConfig != null)
53 { 42 {
54 dllName = dbConfig.GetString("StorageProvider", String.Empty); 43 // Asking for an update here means that the updater cannot access this value without infinite recursion.
55 connString = dbConfig.GetString("ConnectionString", String.Empty); 44 // XXX: A slightly messy but simple solution may be to flick a flag so we can tell if this is being
45 // called by the pull action and just return the value.
46 if (StatType == StatType.Pull)
47 PullAction(this);
48
49 long c = Consequent;
50
51 // Avoid any chance of a multi-threaded divide-by-zero
52 if (c == 0)
53 return 0;
54
55 return (double)Antecedent / c * 100;
56 } 56 }
57 57
58 // 58 set
59 // Try reading the more specific [InventoryService] section, if it exists
60 //
61 IConfig inventoryConfig = config.Configs["InventoryService"];
62 if (inventoryConfig != null)
63 { 59 {
64 dllName = inventoryConfig.GetString("StorageProvider", dllName); 60 throw new InvalidOperationException("Cannot set value on a PercentageStat");
65 connString = inventoryConfig.GetString("ConnectionString", connString);
66 } 61 }
62 }
67 63
68 // 64 public PercentageStat(
69 // We tried, but this doesn't exist. We can't proceed. 65 string shortName,
70 // 66 string name,
71 if (dllName.Equals(String.Empty)) 67 string description,
72 throw new Exception("No InventoryService configuration"); 68 string category,
69 string container,
70 StatType type,
71 Action<Stat> pullAction,
72 StatVerbosity verbosity)
73 : base(shortName, name, description, "%", category, container, type, pullAction, verbosity) {}
73 74
74 m_Database = LoadPlugin<IInventoryDataPlugin>(dllName); 75 public override string ToConsoleString()
75 if (m_Database == null) 76 {
76 throw new Exception("Could not find a storage interface in the given module"); 77 StringBuilder sb = new StringBuilder();
77 78
78 m_Database.Initialise(connString); 79 sb.AppendFormat(
79 } 80 "{0}.{1}.{2} : {3:0.##}{4} ({5}/{6})",
81 Category, Container, ShortName, Value, UnitName, Antecedent, Consequent);
80 82
83 AppendMeasuresOfInterest(sb);
84
85 return sb.ToString();
86 }
81 } 87 }
82} 88} \ No newline at end of file
diff --git a/OpenSim/Framework/Monitoring/Stats/Stat.cs b/OpenSim/Framework/Monitoring/Stats/Stat.cs
new file mode 100644
index 0000000..f91251b
--- /dev/null
+++ b/OpenSim/Framework/Monitoring/Stats/Stat.cs
@@ -0,0 +1,238 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Text;
31
32namespace OpenSim.Framework.Monitoring
33{
34 /// <summary>
35 /// Holds individual statistic details
36 /// </summary>
37 public class Stat
38 {
39 /// <summary>
40 /// Category of this stat (e.g. cache, scene, etc).
41 /// </summary>
42 public string Category { get; private set; }
43
44 /// <summary>
45 /// Containing name for this stat.
46 /// FIXME: In the case of a scene, this is currently the scene name (though this leaves
47 /// us with a to-be-resolved problem of non-unique region names).
48 /// </summary>
49 /// <value>
50 /// The container.
51 /// </value>
52 public string Container { get; private set; }
53
54 public StatType StatType { get; private set; }
55
56 public MeasuresOfInterest MeasuresOfInterest { get; private set; }
57
58 /// <summary>
59 /// Action used to update this stat when the value is requested if it's a pull type.
60 /// </summary>
61 public Action<Stat> PullAction { get; private set; }
62
63 public StatVerbosity Verbosity { get; private set; }
64 public string ShortName { get; private set; }
65 public string Name { get; private set; }
66 public string Description { get; private set; }
67 public virtual string UnitName { get; private set; }
68
69 public virtual double Value
70 {
71 get
72 {
73 // Asking for an update here means that the updater cannot access this value without infinite recursion.
74 // XXX: A slightly messy but simple solution may be to flick a flag so we can tell if this is being
75 // called by the pull action and just return the value.
76 if (StatType == StatType.Pull)
77 PullAction(this);
78
79 return m_value;
80 }
81
82 set
83 {
84 m_value = value;
85 }
86 }
87
88 private double m_value;
89
90 /// <summary>
91 /// Historical samples for calculating measures of interest average.
92 /// </summary>
93 /// <remarks>
94 /// Will be null if no measures of interest require samples.
95 /// </remarks>
96 private static Queue<double> m_samples;
97
98 /// <summary>
99 /// Maximum number of statistical samples.
100 /// </summary>
101 /// <remarks>
102 /// At the moment this corresponds to 1 minute since the sampling rate is every 2.5 seconds as triggered from
103 /// the main Watchdog.
104 /// </remarks>
105 private static int m_maxSamples = 24;
106
107 public Stat(
108 string shortName,
109 string name,
110 string description,
111 string unitName,
112 string category,
113 string container,
114 StatType type,
115 Action<Stat> pullAction,
116 StatVerbosity verbosity)
117 : this(
118 shortName,
119 name,
120 description,
121 unitName,
122 category,
123 container,
124 type,
125 MeasuresOfInterest.None,
126 pullAction,
127 verbosity)
128 {
129 }
130
131 /// <summary>
132 /// Constructor
133 /// </summary>
134 /// <param name='shortName'>Short name for the stat. Must not contain spaces. e.g. "LongFrames"</param>
135 /// <param name='name'>Human readable name for the stat. e.g. "Long frames"</param>
136 /// <param name='description'>Description of stat</param>
137 /// <param name='unitName'>
138 /// Unit name for the stat. Should be preceeded by a space if the unit name isn't normally appeneded immediately to the value.
139 /// e.g. " frames"
140 /// </param>
141 /// <param name='category'>Category under which this stat should appear, e.g. "scene". Do not capitalize.</param>
142 /// <param name='container'>Entity to which this stat relates. e.g. scene name if this is a per scene stat.</param>
143 /// <param name='type'>Push or pull</param>
144 /// <param name='pullAction'>Pull stats need an action to update the stat on request. Push stats should set null here.</param>
145 /// <param name='moi'>Measures of interest</param>
146 /// <param name='verbosity'>Verbosity of stat. Controls whether it will appear in short stat display or only full display.</param>
147 public Stat(
148 string shortName,
149 string name,
150 string description,
151 string unitName,
152 string category,
153 string container,
154 StatType type,
155 MeasuresOfInterest moi,
156 Action<Stat> pullAction,
157 StatVerbosity verbosity)
158 {
159 if (StatsManager.SubCommands.Contains(category))
160 throw new Exception(
161 string.Format("Stat cannot be in category '{0}' since this is reserved for a subcommand", category));
162
163 ShortName = shortName;
164 Name = name;
165 Description = description;
166 UnitName = unitName;
167 Category = category;
168 Container = container;
169 StatType = type;
170
171 if (StatType == StatType.Push && pullAction != null)
172 throw new Exception("A push stat cannot have a pull action");
173 else
174 PullAction = pullAction;
175
176 MeasuresOfInterest = moi;
177
178 if ((moi & MeasuresOfInterest.AverageChangeOverTime) == MeasuresOfInterest.AverageChangeOverTime)
179 m_samples = new Queue<double>(m_maxSamples);
180
181 Verbosity = verbosity;
182 }
183
184 /// <summary>
185 /// Record a value in the sample set.
186 /// </summary>
187 /// <remarks>
188 /// Do not call this if MeasuresOfInterest.None
189 /// </remarks>
190 public void RecordValue()
191 {
192 double newValue = Value;
193
194 lock (m_samples)
195 {
196 if (m_samples.Count >= m_maxSamples)
197 m_samples.Dequeue();
198
199 m_samples.Enqueue(newValue);
200 }
201 }
202
203 public virtual string ToConsoleString()
204 {
205 StringBuilder sb = new StringBuilder();
206 sb.AppendFormat("{0}.{1}.{2} : {3}{4}", Category, Container, ShortName, Value, UnitName);
207
208 AppendMeasuresOfInterest(sb);
209
210 return sb.ToString();
211 }
212
213 protected void AppendMeasuresOfInterest(StringBuilder sb)
214 {
215 if ((MeasuresOfInterest & MeasuresOfInterest.AverageChangeOverTime)
216 == MeasuresOfInterest.AverageChangeOverTime)
217 {
218 double totalChange = 0;
219 double? lastSample = null;
220
221 lock (m_samples)
222 {
223 foreach (double s in m_samples)
224 {
225 if (lastSample != null)
226 totalChange += s - (double)lastSample;
227
228 lastSample = s;
229 }
230 }
231
232 int divisor = m_samples.Count <= 1 ? 1 : m_samples.Count - 1;
233
234 sb.AppendFormat(", {0:0.##}{1}/s", totalChange / divisor / (Watchdog.WATCHDOG_INTERVAL_MS / 1000), UnitName);
235 }
236 }
237 }
238} \ No newline at end of file
diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs
index cebe905..0762b01 100644
--- a/OpenSim/Framework/Monitoring/StatsManager.cs
+++ b/OpenSim/Framework/Monitoring/StatsManager.cs
@@ -27,6 +27,7 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Text;
30 31
31namespace OpenSim.Framework.Monitoring 32namespace OpenSim.Framework.Monitoring
32{ 33{
@@ -246,6 +247,24 @@ namespace OpenSim.Framework.Monitoring
246 247
247 return false; 248 return false;
248 } 249 }
250
251 public static void RecordStats()
252 {
253 lock (RegisteredStats)
254 {
255 foreach (Dictionary<string, Dictionary<string, Stat>> category in RegisteredStats.Values)
256 {
257 foreach (Dictionary<string, Stat> container in category.Values)
258 {
259 foreach (Stat stat in container.Values)
260 {
261 if (stat.MeasuresOfInterest != MeasuresOfInterest.None)
262 stat.RecordValue();
263 }
264 }
265 }
266 }
267 }
249 } 268 }
250 269
251 /// <summary> 270 /// <summary>
@@ -262,6 +281,16 @@ namespace OpenSim.Framework.Monitoring
262 } 281 }
263 282
264 /// <summary> 283 /// <summary>
284 /// Measures of interest for this stat.
285 /// </summary>
286 [Flags]
287 public enum MeasuresOfInterest
288 {
289 None,
290 AverageChangeOverTime
291 }
292
293 /// <summary>
265 /// Verbosity of stat. 294 /// Verbosity of stat.
266 /// </summary> 295 /// </summary>
267 /// <remarks> 296 /// <remarks>
@@ -272,160 +301,4 @@ namespace OpenSim.Framework.Monitoring
272 Debug, 301 Debug,
273 Info 302 Info
274 } 303 }
275
276 /// <summary>
277 /// Holds individual static details
278 /// </summary>
279 public class Stat
280 {
281 /// <summary>
282 /// Category of this stat (e.g. cache, scene, etc).
283 /// </summary>
284 public string Category { get; private set; }
285
286 /// <summary>
287 /// Containing name for this stat.
288 /// FIXME: In the case of a scene, this is currently the scene name (though this leaves
289 /// us with a to-be-resolved problem of non-unique region names).
290 /// </summary>
291 /// <value>
292 /// The container.
293 /// </value>
294 public string Container { get; private set; }
295
296 public StatType StatType { get; private set; }
297
298 /// <summary>
299 /// Action used to update this stat when the value is requested if it's a pull type.
300 /// </summary>
301 public Action<Stat> PullAction { get; private set; }
302
303 public StatVerbosity Verbosity { get; private set; }
304 public string ShortName { get; private set; }
305 public string Name { get; private set; }
306 public string Description { get; private set; }
307 public virtual string UnitName { get; private set; }
308
309 public virtual double Value
310 {
311 get
312 {
313 // Asking for an update here means that the updater cannot access this value without infinite recursion.
314 // XXX: A slightly messy but simple solution may be to flick a flag so we can tell if this is being
315 // called by the pull action and just return the value.
316 if (StatType == StatType.Pull)
317 PullAction(this);
318
319 return m_value;
320 }
321
322 set
323 {
324 m_value = value;
325 }
326 }
327
328 private double m_value;
329
330 /// <summary>
331 /// Constructor
332 /// </summary>
333 /// <param name='shortName'>Short name for the stat. Must not contain spaces. e.g. "LongFrames"</param>
334 /// <param name='name'>Human readable name for the stat. e.g. "Long frames"</param>
335 /// <param name='description'>Description of stat</param>
336 /// <param name='unitName'>
337 /// Unit name for the stat. Should be preceeded by a space if the unit name isn't normally appeneded immediately to the value.
338 /// e.g. " frames"
339 /// </param>
340 /// <param name='category'>Category under which this stat should appear, e.g. "scene". Do not capitalize.</param>
341 /// <param name='container'>Entity to which this stat relates. e.g. scene name if this is a per scene stat.</param>
342 /// <param name='type'>Push or pull</param>
343 /// <param name='pullAction'>Pull stats need an action to update the stat on request. Push stats should set null here.</param>
344 /// <param name='verbosity'>Verbosity of stat. Controls whether it will appear in short stat display or only full display.</param>
345 public Stat(
346 string shortName,
347 string name,
348 string description,
349 string unitName,
350 string category,
351 string container,
352 StatType type,
353 Action<Stat> pullAction,
354 StatVerbosity verbosity)
355 {
356 if (StatsManager.SubCommands.Contains(category))
357 throw new Exception(
358 string.Format("Stat cannot be in category '{0}' since this is reserved for a subcommand", category));
359
360 ShortName = shortName;
361 Name = name;
362 Description = description;
363 UnitName = unitName;
364 Category = category;
365 Container = container;
366 StatType = type;
367
368 if (StatType == StatType.Push && pullAction != null)
369 throw new Exception("A push stat cannot have a pull action");
370 else
371 PullAction = pullAction;
372
373 Verbosity = verbosity;
374 }
375
376 public virtual string ToConsoleString()
377 {
378 return string.Format(
379 "{0}.{1}.{2} : {3}{4}", Category, Container, ShortName, Value, UnitName);
380 }
381 }
382
383 public class PercentageStat : Stat
384 {
385 public long Antecedent { get; set; }
386 public long Consequent { get; set; }
387
388 public override double Value
389 {
390 get
391 {
392 // Asking for an update here means that the updater cannot access this value without infinite recursion.
393 // XXX: A slightly messy but simple solution may be to flick a flag so we can tell if this is being
394 // called by the pull action and just return the value.
395 if (StatType == StatType.Pull)
396 PullAction(this);
397
398 long c = Consequent;
399
400 // Avoid any chance of a multi-threaded divide-by-zero
401 if (c == 0)
402 return 0;
403
404 return (double)Antecedent / c * 100;
405 }
406
407 set
408 {
409 throw new InvalidOperationException("Cannot set value on a PercentageStat");
410 }
411 }
412
413 public PercentageStat(
414 string shortName,
415 string name,
416 string description,
417 string category,
418 string container,
419 StatType type,
420 Action<Stat> pullAction,
421 StatVerbosity verbosity)
422 : base(shortName, name, description, "%", category, container, type, pullAction, verbosity) {}
423
424 public override string ToConsoleString()
425 {
426 return string.Format(
427 "{0}.{1}.{2} : {3:0.##}{4} ({5}/{6})",
428 Category, Container, ShortName, Value, UnitName, Antecedent, Consequent);
429 }
430 }
431} \ No newline at end of file 304} \ No newline at end of file
diff --git a/OpenSim/Framework/Monitoring/Watchdog.cs b/OpenSim/Framework/Monitoring/Watchdog.cs
index 28d6d5c..69d2db5 100644
--- a/OpenSim/Framework/Monitoring/Watchdog.cs
+++ b/OpenSim/Framework/Monitoring/Watchdog.cs
@@ -39,7 +39,7 @@ namespace OpenSim.Framework.Monitoring
39 public static class Watchdog 39 public static class Watchdog
40 { 40 {
41 /// <summary>Timer interval in milliseconds for the watchdog timer</summary> 41 /// <summary>Timer interval in milliseconds for the watchdog timer</summary>
42 const double WATCHDOG_INTERVAL_MS = 2500.0d; 42 public const double WATCHDOG_INTERVAL_MS = 2500.0d;
43 43
44 /// <summary>Default timeout in milliseconds before a thread is considered dead</summary> 44 /// <summary>Default timeout in milliseconds before a thread is considered dead</summary>
45 public const int DEFAULT_WATCHDOG_TIMEOUT_MS = 5000; 45 public const int DEFAULT_WATCHDOG_TIMEOUT_MS = 5000;
@@ -380,6 +380,8 @@ namespace OpenSim.Framework.Monitoring
380 if (MemoryWatchdog.Enabled) 380 if (MemoryWatchdog.Enabled)
381 MemoryWatchdog.Update(); 381 MemoryWatchdog.Update();
382 382
383 StatsManager.RecordStats();
384
383 m_watchdogTimer.Start(); 385 m_watchdogTimer.Start();
384 } 386 }
385 } 387 }
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index 1ed6a74..9a4abd4 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -80,6 +80,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
80 "clientstack", 80 "clientstack",
81 scene.Name, 81 scene.Name,
82 StatType.Pull, 82 StatType.Pull,
83 MeasuresOfInterest.AverageChangeOverTime,
83 stat => stat.Value = m_udpServer.IncomingPacketsProcessed, 84 stat => stat.Value = m_udpServer.IncomingPacketsProcessed,
84 StatVerbosity.Debug)); 85 StatVerbosity.Debug));
85 } 86 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index 0833154..dc2b0e0 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -411,18 +411,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
411 { 411 {
412// m_log.DebugFormat("[INVENTORY ARCHIVER]: Found creator {0} via OSPA resolution", ospResolvedId); 412// m_log.DebugFormat("[INVENTORY ARCHIVER]: Found creator {0} via OSPA resolution", ospResolvedId);
413 413
414 item.CreatorIdAsUuid = ospResolvedId; 414// item.CreatorIdAsUuid = ospResolvedId;
415 415
416 // Don't preserve the OSPA in the creator id (which actually gets persisted to the 416 // Don't preserve the OSPA in the creator id (which actually gets persisted to the
417 // database). Instead, replace with the UUID that we found. 417 // database). Instead, replace with the UUID that we found.
418 item.CreatorId = ospResolvedId.ToString(); 418 item.CreatorId = ospResolvedId.ToString();
419
420 item.CreatorData = string.Empty; 419 item.CreatorData = string.Empty;
421 } 420 }
422 else if (item.CreatorData == null || item.CreatorData == String.Empty) 421 else if (item.CreatorData == null || item.CreatorData == String.Empty)
423 { 422 {
424 item.CreatorId = m_userInfo.PrincipalID.ToString(); 423 item.CreatorId = m_userInfo.PrincipalID.ToString();
425 item.CreatorIdAsUuid = new UUID(item.CreatorId); 424// item.CreatorIdAsUuid = new UUID(item.CreatorId);
426 } 425 }
427 426
428 item.Owner = m_userInfo.PrincipalID; 427 item.Owner = m_userInfo.PrincipalID;
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
index 00727a4..db78da9 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
@@ -134,7 +134,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
134 item1.ID = UUID.Parse("00000000-0000-0000-0000-000000000020"); 134 item1.ID = UUID.Parse("00000000-0000-0000-0000-000000000020");
135 item1.AssetID = asset1.FullID; 135 item1.AssetID = asset1.FullID;
136 item1.GroupID = UUID.Random(); 136 item1.GroupID = UUID.Random();
137 item1.CreatorIdAsUuid = m_uaLL1.PrincipalID; 137 item1.CreatorId = m_uaLL1.PrincipalID.ToString();
138 item1.Owner = m_uaLL1.PrincipalID; 138 item1.Owner = m_uaLL1.PrincipalID;
139 item1.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID; 139 item1.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID;
140 scene.AddInventoryItem(item1); 140 scene.AddInventoryItem(item1);
@@ -157,7 +157,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
157 coaItem.ID = UUID.Parse("00000000-0000-0000-0000-000000000180"); 157 coaItem.ID = UUID.Parse("00000000-0000-0000-0000-000000000180");
158 coaItem.AssetID = coaAsset.FullID; 158 coaItem.AssetID = coaAsset.FullID;
159 coaItem.GroupID = UUID.Random(); 159 coaItem.GroupID = UUID.Random();
160 coaItem.CreatorIdAsUuid = m_uaLL1.PrincipalID; 160 coaItem.CreatorId = m_uaLL1.PrincipalID.ToString();
161 coaItem.Owner = m_uaLL1.PrincipalID; 161 coaItem.Owner = m_uaLL1.PrincipalID;
162 coaItem.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID; 162 coaItem.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID;
163 scene.AddInventoryItem(coaItem); 163 scene.AddInventoryItem(coaItem);
diff --git a/OpenSim/Server/Properties/AssemblyInfo.cs b/OpenSim/Server/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..ebc10fb
--- /dev/null
+++ b/OpenSim/Server/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("Robust")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("http://opensimulator.org")]
12[assembly: AssemblyProduct("OpenSim")]
13[assembly: AssemblyCopyright("OpenSimulator developers")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("d347c5cb-baf8-4566-a221-35d948e1776f")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("0.7.5.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Services/AssetService/Properties/AssemblyInfo.cs b/OpenSim/Services/AssetService/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..1509400
--- /dev/null
+++ b/OpenSim/Services/AssetService/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Services.AssetService")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("http://opensimulator.org")]
12[assembly: AssemblyProduct("OpenSim")]
13[assembly: AssemblyCopyright("OpenSimulator developers")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("fe57c0df-6101-4c23-ae1a-7b3e937843f9")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("0.7.5.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Services/AuthenticationService/Properties/AssemblyInfo.cs b/OpenSim/Services/AuthenticationService/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..0eb2ba7
--- /dev/null
+++ b/OpenSim/Services/AuthenticationService/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Services.AuthenticationService")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("http://opensimulator.org")]
12[assembly: AssemblyProduct("OpenSim")]
13[assembly: AssemblyCopyright("Copyright © 2012")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("74497b6f-8844-4ed4-8f0d-2caf7f42b760")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("0.7.5.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Services/AuthorizationService/Properties/AssemblyInfo.cs b/OpenSim/Services/AuthorizationService/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..6d6b11e
--- /dev/null
+++ b/OpenSim/Services/AuthorizationService/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Services.AuthorizationService")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("http://opensimulator.org")]
12[assembly: AssemblyProduct("OpenSim")]
13[assembly: AssemblyCopyright("OpenSimulator developers")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("822586bb-cf25-4a2a-ac3e-59edaf147be3")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("0.7.5.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Services/AvatarService/Properties/AssemblyInfo.cs b/OpenSim/Services/AvatarService/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..0944149
--- /dev/null
+++ b/OpenSim/Services/AvatarService/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Services.AvatarService")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("http://opensimulator.org")]
12[assembly: AssemblyProduct("OpenSim")]
13[assembly: AssemblyCopyright("OpenSimulator developers")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("0c9462ad-a5f3-46d1-ae9e-d6901fa33aa4")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("0.7.5.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Services/Base/Properties/AssemblyInfo.cs b/OpenSim/Services/Base/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..306b699
--- /dev/null
+++ b/OpenSim/Services/Base/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Services.Base")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("http://opensimulator.org")]
12[assembly: AssemblyProduct("OpenSim")]
13[assembly: AssemblyCopyright("OpenSimulator developers")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("db9f6f73-3a56-497f-a465-4bea9cb86062")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("0.7.5.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Services/Connectors/Properties/AssemblyInfo.cs b/OpenSim/Services/Connectors/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..bfb681b
--- /dev/null
+++ b/OpenSim/Services/Connectors/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Services.Connectors")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("http://opensimulator.org")]
12[assembly: AssemblyProduct("OpenSim")]
13[assembly: AssemblyCopyright("OpenSimulator developers")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("3ab0a9a1-3f45-4c07-a892-3848df8c0173")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("0.7.5.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
index 4d7841b..a391275 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
@@ -781,7 +781,6 @@ namespace OpenSim.Services.Connectors.SimianGrid
781 invItem.CreationDate = item["CreationDate"].AsInteger(); 781 invItem.CreationDate = item["CreationDate"].AsInteger();
782 invItem.CreatorId = item["CreatorID"].AsString(); 782 invItem.CreatorId = item["CreatorID"].AsString();
783 invItem.CreatorData = item["CreatorData"].AsString(); 783 invItem.CreatorData = item["CreatorData"].AsString();
784 invItem.CreatorIdAsUuid = item["CreatorID"].AsUUID();
785 invItem.Description = item["Description"].AsString(); 784 invItem.Description = item["Description"].AsString();
786 invItem.Folder = item["ParentID"].AsUUID(); 785 invItem.Folder = item["ParentID"].AsUUID();
787 invItem.ID = item["ID"].AsUUID(); 786 invItem.ID = item["ID"].AsUUID();
diff --git a/OpenSim/Services/FreeswitchService/Properties/AssemblyInfo.cs b/OpenSim/Services/FreeswitchService/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..58c7283
--- /dev/null
+++ b/OpenSim/Services/FreeswitchService/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Services.FreeswitchService")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("http://opensimulator.org")]
12[assembly: AssemblyProduct("OpenSim")]
13[assembly: AssemblyCopyright("OpenSimulator developers")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("af7d2401-cfd9-4ba5-8d6c-8af629984123")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("0.7.5.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Services/Friends/Properties/AssemblyInfo.cs b/OpenSim/Services/Friends/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..dddb091
--- /dev/null
+++ b/OpenSim/Services/Friends/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Services.FriendsService")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("http://opensimulator.org")]
12[assembly: AssemblyProduct("OpenSim")]
13[assembly: AssemblyCopyright("OpenSimulator developers")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("a265d071-e152-42cc-9674-3ddd053977f5")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("0.7.5.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Services/GridService/Properties/AssemblyInfo.cs b/OpenSim/Services/GridService/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..5c0c8f4
--- /dev/null
+++ b/OpenSim/Services/GridService/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Services.GridService")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("http://opensimulator.org")]
12[assembly: AssemblyProduct("OpenSim")]
13[assembly: AssemblyCopyright("OpenSimulator developers")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("96526d7b-4943-4b8e-9f0f-5908af621090")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("0.7.5.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Services/HypergridService/Properties/AssemblyInfo.cs b/OpenSim/Services/HypergridService/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..49f2176
--- /dev/null
+++ b/OpenSim/Services/HypergridService/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Services.HypergridService")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("http://opensimulator.org")]
12[assembly: AssemblyProduct("OpenSim")]
13[assembly: AssemblyCopyright("OpenSimulator developers")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("8584f3c1-26dd-4d95-86f4-cd8f0110a18f")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("0.7.5.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Services/Interfaces/Properties/AssemblyInfo.cs b/OpenSim/Services/Interfaces/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..4723553
--- /dev/null
+++ b/OpenSim/Services/Interfaces/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Services.Interfaces")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("http://opensimulator.org")]
12[assembly: AssemblyProduct("OpenSim")]
13[assembly: AssemblyCopyright("OpenSimulator developers")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("39091de1-1c4c-4ebe-bb01-31551ec1749d")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("0.7.5.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Services/InventoryService/InventoryService.cs b/OpenSim/Services/InventoryService/InventoryService.cs
deleted file mode 100644
index 73dd06a..0000000
--- a/OpenSim/Services/InventoryService/InventoryService.cs
+++ /dev/null
@@ -1,700 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Reflection;
31using log4net;
32using Nini.Config;
33using OpenMetaverse;
34using OpenSim.Data;
35using OpenSim.Framework;
36using OpenSim.Services.Interfaces;
37
38namespace OpenSim.Services.InventoryService
39{
40 /// <summary>
41 /// The Inventory service reference implementation
42 /// </summary>
43 public class InventoryService : InventoryServiceBase, IInventoryService
44 {
45 private static readonly ILog m_log
46 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47
48 public InventoryService(IConfigSource config) : base(config)
49 {
50 m_log.Debug("[INVENTORY SERVICE]: Initialized.");
51 }
52
53 #region IInventoryServices methods
54
55 public string Host
56 {
57 get { return "default"; }
58 }
59
60 public List<InventoryFolderBase> GetInventorySkeleton(UUID userId)
61 {
62 m_log.DebugFormat("[INVENTORY SERVICE]: Getting inventory skeleton for {0}", userId);
63
64 InventoryFolderBase rootFolder = GetRootFolder(userId);
65
66 // Agent has no inventory structure yet.
67 if (null == rootFolder)
68 {
69 m_log.DebugFormat("[INVENTORY SERVICE]: No root folder");
70 return null;
71 }
72
73 List<InventoryFolderBase> userFolders = new List<InventoryFolderBase>();
74
75 userFolders.Add(rootFolder);
76
77 IList<InventoryFolderBase> folders = m_Database.getFolderHierarchy(rootFolder.ID);
78 userFolders.AddRange(folders);
79
80// m_log.DebugFormat("[INVENTORY SERVICE]: Got folder {0} {1}", folder.name, folder.folderID);
81
82 return userFolders;
83 }
84
85 public virtual bool HasInventoryForUser(UUID userID)
86 {
87 return false;
88 }
89
90 // See IInventoryServices
91 public virtual InventoryFolderBase GetRootFolder(UUID userID)
92 {
93 //m_log.DebugFormat("[INVENTORY SERVICE]: Getting root folder for {0}", userID);
94
95 // Retrieve the first root folder we get from the DB.
96 InventoryFolderBase rootFolder = m_Database.getUserRootFolder(userID);
97 if (rootFolder != null)
98 return rootFolder;
99
100 // Return nothing if the plugin was unable to supply a root folder
101 return null;
102 }
103
104 // See IInventoryServices
105 public bool CreateUserInventory(UUID user)
106 {
107 InventoryFolderBase existingRootFolder;
108 try
109 {
110 existingRootFolder = GetRootFolder(user);
111 }
112 catch /*(Exception e)*/
113 {
114 // Munch the exception, it has already been reported
115 //
116 return false;
117 }
118
119 if (null != existingRootFolder)
120 {
121 m_log.WarnFormat(
122 "[INVENTORY SERVICE]: Did not create a new inventory for user {0} since they already have "
123 + "a root inventory folder with id {1}",
124 user, existingRootFolder.ID);
125 }
126 else
127 {
128 UsersInventory inven = new UsersInventory();
129 inven.CreateNewInventorySet(user);
130 AddNewInventorySet(inven);
131
132 return true;
133 }
134
135 return false;
136 }
137
138 // See IInventoryServices
139
140 /// <summary>
141 /// Return a user's entire inventory synchronously
142 /// </summary>
143 /// <param name="rawUserID"></param>
144 /// <returns>The user's inventory. If an inventory cannot be found then an empty collection is returned.</returns>
145 public InventoryCollection GetUserInventory(UUID userID)
146 {
147 m_log.InfoFormat("[INVENTORY SERVICE]: Processing request for inventory of {0}", userID);
148
149 // Uncomment me to simulate a slow responding inventory server
150 //Thread.Sleep(16000);
151
152 InventoryCollection invCollection = new InventoryCollection();
153
154 List<InventoryFolderBase> allFolders = GetInventorySkeleton(userID);
155
156 if (null == allFolders)
157 {
158 m_log.WarnFormat("[INVENTORY SERVICE]: No inventory found for user {0}", userID);
159
160 return invCollection;
161 }
162
163 List<InventoryItemBase> allItems = new List<InventoryItemBase>();
164
165 foreach (InventoryFolderBase folder in allFolders)
166 {
167 List<InventoryItemBase> items = GetFolderItems(userID, folder.ID);
168
169 if (items != null)
170 {
171 allItems.InsertRange(0, items);
172 }
173 }
174
175 invCollection.UserID = userID;
176 invCollection.Folders = allFolders;
177 invCollection.Items = allItems;
178
179 // foreach (InventoryFolderBase folder in invCollection.Folders)
180 // {
181 // m_log.DebugFormat("[GRID INVENTORY SERVICE]: Sending back folder {0} {1}", folder.Name, folder.ID);
182 // }
183 //
184 // foreach (InventoryItemBase item in invCollection.Items)
185 // {
186 // m_log.DebugFormat("[GRID INVENTORY SERVICE]: Sending back item {0} {1}, folder {2}", item.Name, item.ID, item.Folder);
187 // }
188
189 m_log.InfoFormat(
190 "[INVENTORY SERVICE]: Sending back inventory response to user {0} containing {1} folders and {2} items",
191 invCollection.UserID, invCollection.Folders.Count, invCollection.Items.Count);
192
193 return invCollection;
194 }
195
196 /// <summary>
197 /// Asynchronous inventory fetch.
198 /// </summary>
199 /// <param name="userID"></param>
200 /// <param name="callback"></param>
201 public void GetUserInventory(UUID userID, InventoryReceiptCallback callback)
202 {
203 m_log.InfoFormat("[INVENTORY SERVICE]: Requesting inventory for user {0}", userID);
204
205 List<InventoryFolderImpl> folders = new List<InventoryFolderImpl>();
206 List<InventoryItemBase> items = new List<InventoryItemBase>();
207
208 List<InventoryFolderBase> skeletonFolders = GetInventorySkeleton(userID);
209
210 if (skeletonFolders != null)
211 {
212 InventoryFolderImpl rootFolder = null;
213
214 // Need to retrieve the root folder on the first pass
215 foreach (InventoryFolderBase folder in skeletonFolders)
216 {
217 if (folder.ParentID == UUID.Zero)
218 {
219 rootFolder = new InventoryFolderImpl(folder);
220 folders.Add(rootFolder);
221 items.AddRange(GetFolderItems(userID, rootFolder.ID));
222 break; // Only 1 root folder per user
223 }
224 }
225
226 if (rootFolder != null)
227 {
228 foreach (InventoryFolderBase folder in skeletonFolders)
229 {
230 if (folder.ID != rootFolder.ID)
231 {
232 folders.Add(new InventoryFolderImpl(folder));
233 items.AddRange(GetFolderItems(userID, folder.ID));
234 }
235 }
236 }
237
238 m_log.InfoFormat(
239 "[INVENTORY SERVICE]: Received inventory response for user {0} containing {1} folders and {2} items",
240 userID, folders.Count, items.Count);
241 }
242 else
243 {
244 m_log.WarnFormat("[INVENTORY SERVICE]: User {0} inventory not available", userID);
245 }
246
247 Util.FireAndForget(delegate { callback(folders, items); });
248 }
249
250 public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
251 {
252 // Uncomment me to simulate a slow responding inventory server
253 //Thread.Sleep(16000);
254
255 InventoryCollection invCollection = new InventoryCollection();
256
257 List<InventoryItemBase> items = GetFolderItems(userID, folderID);
258 List<InventoryFolderBase> folders = RequestSubFolders(folderID);
259
260 invCollection.UserID = userID;
261 invCollection.Folders = folders;
262 invCollection.Items = items;
263
264 m_log.DebugFormat("[INVENTORY SERVICE]: Found {0} items and {1} folders in folder {2}", items.Count, folders.Count, folderID);
265
266 return invCollection;
267 }
268
269 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
270 {
271// m_log.DebugFormat("[INVENTORY SERVICE]: Looking for folder type {0} for user {1}", type, userID);
272
273 InventoryFolderBase root = m_Database.getUserRootFolder(userID);
274 if (root != null)
275 {
276 List<InventoryFolderBase> folders = RequestSubFolders(root.ID);
277
278 foreach (InventoryFolderBase folder in folders)
279 {
280 if (folder.Type == (short)type)
281 {
282// m_log.DebugFormat(
283// "[INVENTORY SERVICE]: Found folder {0} type {1}", folder.Name, (AssetType)folder.Type);
284
285 return folder;
286 }
287 }
288 }
289
290 // we didn't find any folder of that type. Return the root folder
291 // hopefully the root folder is not null. If it is, too bad
292 return root;
293 }
294
295 public Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID)
296 {
297 InventoryFolderBase root = GetRootFolder(userID);
298 if (root != null)
299 {
300 InventoryCollection content = GetFolderContent(userID, root.ID);
301 if (content != null)
302 {
303 Dictionary<AssetType, InventoryFolderBase> folders = new Dictionary<AssetType, InventoryFolderBase>();
304 foreach (InventoryFolderBase folder in content.Folders)
305 {
306 if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown))
307 folders[(AssetType)folder.Type] = folder;
308 }
309 m_log.DebugFormat("[INVENTORY SERVICE]: Got {0} system folders for {1}", folders.Count, userID);
310 return folders;
311 }
312 }
313 m_log.WarnFormat("[INVENTORY SERVICE]: System folders for {0} not found", userID);
314 return new Dictionary<AssetType, InventoryFolderBase>();
315 }
316
317 public List<InventoryItemBase> GetActiveGestures(UUID userId)
318 {
319 List<InventoryItemBase> activeGestures = new List<InventoryItemBase>();
320 activeGestures.AddRange(m_Database.fetchActiveGestures(userId));
321
322 return activeGestures;
323 }
324
325 #endregion
326
327 #region Methods used by GridInventoryService
328
329 public List<InventoryFolderBase> RequestSubFolders(UUID parentFolderID)
330 {
331 List<InventoryFolderBase> inventoryList = new List<InventoryFolderBase>();
332
333 inventoryList.AddRange(m_Database.getInventoryFolders(parentFolderID));
334
335 return inventoryList;
336 }
337
338 public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
339 {
340 List<InventoryItemBase> itemsList = new List<InventoryItemBase>();
341
342 itemsList.AddRange(m_Database.getInventoryInFolder(folderID));
343
344// m_log.DebugFormat(
345// "[INVENTORY SERVICE]: Found {0} items in folder {1} for {2}", itemsList.Count, folderID, userID);
346
347 return itemsList;
348 }
349
350 #endregion
351
352 // See IInventoryServices
353 public virtual bool AddFolder(InventoryFolderBase folder)
354 {
355 m_log.DebugFormat(
356 "[INVENTORY SERVICE]: Adding folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID);
357
358 m_Database.addInventoryFolder(folder);
359
360 // FIXME: Should return false on failure
361 return true;
362 }
363
364 // See IInventoryServices
365 public virtual bool UpdateFolder(InventoryFolderBase folder)
366 {
367 m_log.DebugFormat(
368 "[INVENTORY SERVICE]: Updating folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID);
369
370 m_Database.updateInventoryFolder(folder);
371
372 // FIXME: Should return false on failure
373 return true;
374 }
375
376 // See IInventoryServices
377 public virtual bool MoveFolder(InventoryFolderBase folder)
378 {
379 m_log.DebugFormat(
380 "[INVENTORY SERVICE]: Moving folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID);
381
382 m_Database.moveInventoryFolder(folder);
383
384 // FIXME: Should return false on failure
385 return true;
386 }
387
388 // See IInventoryServices
389 public virtual bool AddItem(InventoryItemBase item)
390 {
391// m_log.DebugFormat(
392// "[INVENTORY SERVICE]: Adding item {0} {1} to folder {2} for {3}",
393// item.Name, item.ID, item.Folder, item.Owner);
394
395 m_Database.addInventoryItem(item);
396
397 // FIXME: Should return false on failure
398 return true;
399 }
400
401 // See IInventoryServices
402 public virtual bool UpdateItem(InventoryItemBase item)
403 {
404 m_log.InfoFormat(
405 "[INVENTORY SERVICE]: Updating item {0} {1} in folder {2}", item.Name, item.ID, item.Folder);
406
407 m_Database.updateInventoryItem(item);
408
409 // FIXME: Should return false on failure
410 return true;
411 }
412
413 public virtual bool MoveItems(UUID ownerID, List<InventoryItemBase> items)
414 {
415 m_log.InfoFormat(
416 "[INVENTORY SERVICE]: Moving {0} items from user {1}", items.Count, ownerID);
417
418 InventoryItemBase itm = null;
419 foreach (InventoryItemBase item in items)
420 {
421 itm = GetInventoryItem(item.ID);
422 itm.Folder = item.Folder;
423 if ((item.Name != null) && !item.Name.Equals(string.Empty))
424 itm.Name = item.Name;
425 m_Database.updateInventoryItem(itm);
426 }
427
428 return true;
429 }
430
431 // See IInventoryServices
432 public virtual bool DeleteItems(UUID owner, List<UUID> itemIDs)
433 {
434 m_log.InfoFormat(
435 "[INVENTORY SERVICE]: Deleting {0} items from user {1}", itemIDs.Count, owner);
436
437 // uhh.....
438 foreach (UUID uuid in itemIDs)
439 m_Database.deleteInventoryItem(uuid);
440
441 // FIXME: Should return false on failure
442 return true;
443 }
444
445 public virtual InventoryItemBase GetItem(InventoryItemBase item)
446 {
447 InventoryItemBase result = m_Database.getInventoryItem(item.ID);
448 if (result != null)
449 return result;
450 m_log.DebugFormat("[INVENTORY SERVICE]: GetItem failed to find item {0}", item.ID);
451 return null;
452 }
453
454 public virtual InventoryFolderBase GetFolder(InventoryFolderBase folder)
455 {
456 InventoryFolderBase result = m_Database.getInventoryFolder(folder.ID);
457 if (result != null)
458 return result;
459
460 m_log.DebugFormat("[INVENTORY SERVICE]: GetFolder failed to find folder {0}", folder.ID);
461 return null;
462 }
463
464 public virtual bool DeleteFolders(UUID ownerID, List<UUID> folderIDs)
465 {
466 m_log.InfoFormat("[INVENTORY SERVICE]: Deleting {0} folders from user {1}", folderIDs.Count, ownerID);
467 foreach (UUID id in folderIDs)
468 {
469 InventoryFolderBase folder = new InventoryFolderBase(id, ownerID);
470 PurgeFolder(folder);
471 m_Database.deleteInventoryFolder(id);
472 }
473 return true;
474 }
475
476 /// <summary>
477 /// Purge a folder of all items items and subfolders.
478 ///
479 /// FIXME: Really nasty in a sense, because we have to query the database to get information we may
480 /// already know... Needs heavy refactoring.
481 /// </summary>
482 /// <param name="folder"></param>
483 public virtual bool PurgeFolder(InventoryFolderBase folder)
484 {
485 m_log.DebugFormat(
486 "[INVENTORY SERVICE]: Purging folder {0} {1} of its contents", folder.Name, folder.ID);
487
488 List<InventoryFolderBase> subFolders = RequestSubFolders(folder.ID);
489
490 foreach (InventoryFolderBase subFolder in subFolders)
491 {
492// m_log.DebugFormat("[INVENTORY SERVICE]: Deleting folder {0} {1}", subFolder.Name, subFolder.ID);
493
494 m_Database.deleteInventoryFolder(subFolder.ID);
495 }
496
497 List<InventoryItemBase> items = GetFolderItems(folder.Owner, folder.ID);
498
499 List<UUID> uuids = new List<UUID>();
500 foreach (InventoryItemBase item in items)
501 {
502 uuids.Add(item.ID);
503 }
504 DeleteItems(folder.Owner, uuids);
505
506 // FIXME: Should return false on failure
507 return true;
508 }
509
510 private void AddNewInventorySet(UsersInventory inventory)
511 {
512 foreach (InventoryFolderBase folder in inventory.Folders.Values)
513 {
514 AddFolder(folder);
515 }
516 }
517
518 public InventoryItemBase GetInventoryItem(UUID itemID)
519 {
520 InventoryItemBase item = m_Database.getInventoryItem(itemID);
521 if (item != null)
522 return item;
523
524 return null;
525 }
526
527 public int GetAssetPermissions(UUID userID, UUID assetID)
528 {
529 InventoryFolderBase parent = GetRootFolder(userID);
530 return FindAssetPerms(parent, assetID);
531 }
532
533 private int FindAssetPerms(InventoryFolderBase folder, UUID assetID)
534 {
535 InventoryCollection contents = GetFolderContent(folder.Owner, folder.ID);
536
537 int perms = 0;
538 foreach (InventoryItemBase item in contents.Items)
539 {
540 if (item.AssetID == assetID)
541 perms = (int)item.CurrentPermissions | perms;
542 }
543
544 foreach (InventoryFolderBase subfolder in contents.Folders)
545 perms = perms | FindAssetPerms(subfolder, assetID);
546
547 return perms;
548 }
549
550 /// <summary>
551 /// Used to create a new user inventory.
552 /// </summary>
553 private class UsersInventory
554 {
555 public Dictionary<UUID, InventoryFolderBase> Folders = new Dictionary<UUID, InventoryFolderBase>();
556 public Dictionary<UUID, InventoryItemBase> Items = new Dictionary<UUID, InventoryItemBase>();
557
558 public virtual void CreateNewInventorySet(UUID user)
559 {
560 InventoryFolderBase folder = new InventoryFolderBase();
561
562 folder.ParentID = UUID.Zero;
563 folder.Owner = user;
564 folder.ID = UUID.Random();
565 folder.Name = "My Inventory";
566 folder.Type = (short)AssetType.Folder;
567 folder.Version = 1;
568 Folders.Add(folder.ID, folder);
569
570 UUID rootFolder = folder.ID;
571
572 folder = new InventoryFolderBase();
573 folder.ParentID = rootFolder;
574 folder.Owner = user;
575 folder.ID = UUID.Random();
576 folder.Name = "Animations";
577 folder.Type = (short)AssetType.Animation;
578 folder.Version = 1;
579 Folders.Add(folder.ID, folder);
580
581 folder = new InventoryFolderBase();
582 folder.ParentID = rootFolder;
583 folder.Owner = user;
584 folder.ID = UUID.Random();
585 folder.Name = "Body Parts";
586 folder.Type = (short)AssetType.Bodypart;
587 folder.Version = 1;
588 Folders.Add(folder.ID, folder);
589
590 folder = new InventoryFolderBase();
591 folder.ParentID = rootFolder;
592 folder.Owner = user;
593 folder.ID = UUID.Random();
594 folder.Name = "Calling Cards";
595 folder.Type = (short)AssetType.CallingCard;
596 folder.Version = 1;
597 Folders.Add(folder.ID, folder);
598
599 folder = new InventoryFolderBase();
600 folder.ParentID = rootFolder;
601 folder.Owner = user;
602 folder.ID = UUID.Random();
603 folder.Name = "Clothing";
604 folder.Type = (short)AssetType.Clothing;
605 folder.Version = 1;
606 Folders.Add(folder.ID, folder);
607
608 folder = new InventoryFolderBase();
609 folder.ParentID = rootFolder;
610 folder.Owner = user;
611 folder.ID = UUID.Random();
612 folder.Name = "Gestures";
613 folder.Type = (short)AssetType.Gesture;
614 folder.Version = 1;
615 Folders.Add(folder.ID, folder);
616
617 folder = new InventoryFolderBase();
618 folder.ParentID = rootFolder;
619 folder.Owner = user;
620 folder.ID = UUID.Random();
621 folder.Name = "Landmarks";
622 folder.Type = (short)AssetType.Landmark;
623 folder.Version = 1;
624 Folders.Add(folder.ID, folder);
625
626 folder = new InventoryFolderBase();
627 folder.ParentID = rootFolder;
628 folder.Owner = user;
629 folder.ID = UUID.Random();
630 folder.Name = "Lost And Found";
631 folder.Type = (short)AssetType.LostAndFoundFolder;
632 folder.Version = 1;
633 Folders.Add(folder.ID, folder);
634
635 folder = new InventoryFolderBase();
636 folder.ParentID = rootFolder;
637 folder.Owner = user;
638 folder.ID = UUID.Random();
639 folder.Name = "Notecards";
640 folder.Type = (short)AssetType.Notecard;
641 folder.Version = 1;
642 Folders.Add(folder.ID, folder);
643
644 folder = new InventoryFolderBase();
645 folder.ParentID = rootFolder;
646 folder.Owner = user;
647 folder.ID = UUID.Random();
648 folder.Name = "Objects";
649 folder.Type = (short)AssetType.Object;
650 folder.Version = 1;
651 Folders.Add(folder.ID, folder);
652
653 folder = new InventoryFolderBase();
654 folder.ParentID = rootFolder;
655 folder.Owner = user;
656 folder.ID = UUID.Random();
657 folder.Name = "Photo Album";
658 folder.Type = (short)AssetType.SnapshotFolder;
659 folder.Version = 1;
660 Folders.Add(folder.ID, folder);
661
662 folder = new InventoryFolderBase();
663 folder.ParentID = rootFolder;
664 folder.Owner = user;
665 folder.ID = UUID.Random();
666 folder.Name = "Scripts";
667 folder.Type = (short)AssetType.LSLText;
668 folder.Version = 1;
669 Folders.Add(folder.ID, folder);
670
671 folder = new InventoryFolderBase();
672 folder.ParentID = rootFolder;
673 folder.Owner = user;
674 folder.ID = UUID.Random();
675 folder.Name = "Sounds";
676 folder.Type = (short)AssetType.Sound;
677 folder.Version = 1;
678 Folders.Add(folder.ID, folder);
679
680 folder = new InventoryFolderBase();
681 folder.ParentID = rootFolder;
682 folder.Owner = user;
683 folder.ID = UUID.Random();
684 folder.Name = "Textures";
685 folder.Type = (short)AssetType.Texture;
686 folder.Version = 1;
687 Folders.Add(folder.ID, folder);
688
689 folder = new InventoryFolderBase();
690 folder.ParentID = rootFolder;
691 folder.Owner = user;
692 folder.ID = UUID.Random();
693 folder.Name = "Trash";
694 folder.Type = (short)AssetType.TrashFolder;
695 folder.Version = 1;
696 Folders.Add(folder.ID, folder);
697 }
698 }
699 }
700}
diff --git a/OpenSim/Services/InventoryService/Properties/AssemblyInfo.cs b/OpenSim/Services/InventoryService/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..41ad9f8
--- /dev/null
+++ b/OpenSim/Services/InventoryService/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Services.InventoryService")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("http://opensimulator.org")]
12[assembly: AssemblyProduct("OpenSim")]
13[assembly: AssemblyCopyright("OpenSimulator developers")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("d96d6d8c-9769-47e7-88dc-dbeb8fe7105a")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("0.7.5.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Services/InventoryService/Tests/XInventoryServiceTests.cs b/OpenSim/Services/InventoryService/Tests/XInventoryServiceTests.cs
new file mode 100644
index 0000000..9e3fa69
--- /dev/null
+++ b/OpenSim/Services/InventoryService/Tests/XInventoryServiceTests.cs
@@ -0,0 +1,177 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using Nini.Config;
30using NUnit.Framework;
31using OpenMetaverse;
32using OpenSim.Framework;
33using OpenSim.Server.Base;
34using OpenSim.Services.Interfaces;
35using OpenSim.Tests.Common;
36
37namespace OpenSim.Services.InventoryService.Tests
38{
39 /// <summary>
40 /// Tests for the XInventoryService
41 /// </summary>
42 /// <remarks>
43 /// TODO: Fill out more tests.
44 /// </remarks>
45 [TestFixture]
46 public class XInventoryServiceTests : OpenSimTestCase
47 {
48 private IInventoryService CreateXInventoryService()
49 {
50 IConfigSource config = new IniConfigSource();
51 config.AddConfig("InventoryService");
52 config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
53
54 return ServerUtils.LoadPlugin<IInventoryService>(
55 "OpenSim.Services.InventoryService.dll:XInventoryService", new Object[] { config });
56 }
57
58 /// <summary>
59 /// Tests add item operation.
60 /// </summary>
61 /// <remarks>
62 /// TODO: Test all operations.
63 /// </remarks>
64 [Test]
65 public void TestAddItem()
66 {
67 TestHelpers.InMethod();
68
69 string creatorId = TestHelpers.ParseTail(0x1).ToString();
70 UUID ownerId = TestHelpers.ParseTail(0x2);
71 UUID itemId = TestHelpers.ParseTail(0x10);
72 UUID assetId = TestHelpers.ParseTail(0x20);
73 UUID folderId = TestHelpers.ParseTail(0x30);
74 int invType = (int)InventoryType.Animation;
75 int assetType = (int)AssetType.Animation;
76 string itemName = "item1";
77
78 IInventoryService xis = CreateXInventoryService();
79
80 InventoryItemBase itemToStore
81 = new InventoryItemBase(itemId, ownerId)
82 {
83 CreatorIdentification = creatorId.ToString(),
84 AssetID = assetId,
85 Name = itemName,
86 Folder = folderId,
87 InvType = invType,
88 AssetType = assetType
89 };
90
91 Assert.That(xis.AddItem(itemToStore), Is.True);
92
93 InventoryItemBase itemRetrieved = new InventoryItemBase(itemId);
94 itemRetrieved = xis.GetItem(itemRetrieved);
95
96 Assert.That(itemRetrieved, Is.Not.Null);
97 Assert.That(itemRetrieved.CreatorId, Is.EqualTo(creatorId));
98 Assert.That(itemRetrieved.Owner, Is.EqualTo(ownerId));
99 Assert.That(itemRetrieved.AssetID, Is.EqualTo(assetId));
100 Assert.That(itemRetrieved.Folder, Is.EqualTo(folderId));
101 Assert.That(itemRetrieved.InvType, Is.EqualTo(invType));
102 Assert.That(itemRetrieved.AssetType, Is.EqualTo(assetType));
103 Assert.That(itemRetrieved.Name, Is.EqualTo(itemName));
104 }
105
106 [Test]
107 public void TestUpdateItem()
108 {
109 TestHelpers.InMethod();
110// TestHelpers.EnableLogging();
111
112 string creatorId = TestHelpers.ParseTail(0x1).ToString();
113 UUID ownerId = TestHelpers.ParseTail(0x2);
114 UUID itemId = TestHelpers.ParseTail(0x10);
115 UUID assetId = TestHelpers.ParseTail(0x20);
116 UUID folderId = TestHelpers.ParseTail(0x30);
117 int invType = (int)InventoryType.Animation;
118 int assetType = (int)AssetType.Animation;
119 string itemName = "item1";
120 string itemName2 = "item2";
121
122 IInventoryService xis = CreateXInventoryService();
123
124 InventoryItemBase itemToStore
125 = new InventoryItemBase(itemId, ownerId)
126 {
127 CreatorIdentification = creatorId.ToString(),
128 AssetID = assetId,
129 Name = itemName,
130 Folder = folderId,
131 InvType = invType,
132 AssetType = assetType
133 };
134
135 Assert.That(xis.AddItem(itemToStore), Is.True);
136
137 // Normal update
138 itemToStore.Name = itemName2;
139
140 Assert.That(xis.UpdateItem(itemToStore), Is.True);
141
142 InventoryItemBase itemRetrieved = new InventoryItemBase(itemId);
143 itemRetrieved = xis.GetItem(itemRetrieved);
144
145 Assert.That(itemRetrieved, Is.Not.Null);
146 Assert.That(itemRetrieved.Name, Is.EqualTo(itemName2));
147
148 // Attempt to update properties that should never change
149 string creatorId2 = TestHelpers.ParseTail(0x7).ToString();
150 UUID ownerId2 = TestHelpers.ParseTail(0x8);
151 UUID folderId2 = TestHelpers.ParseTail(0x70);
152 int invType2 = (int)InventoryType.CallingCard;
153 int assetType2 = (int)AssetType.CallingCard;
154 string itemName3 = "item3";
155
156 itemToStore.CreatorIdentification = creatorId2.ToString();
157 itemToStore.Owner = ownerId2;
158 itemToStore.Folder = folderId2;
159 itemToStore.InvType = invType2;
160 itemToStore.AssetType = assetType2;
161 itemToStore.Name = itemName3;
162
163 Assert.That(xis.UpdateItem(itemToStore), Is.True);
164
165 itemRetrieved = xis.GetItem(itemRetrieved);
166
167 Assert.That(itemRetrieved, Is.Not.Null);
168 Assert.That(itemRetrieved.CreatorId, Is.EqualTo(creatorId));
169 Assert.That(itemRetrieved.Owner, Is.EqualTo(ownerId));
170 Assert.That(itemRetrieved.AssetID, Is.EqualTo(assetId));
171 Assert.That(itemRetrieved.Folder, Is.EqualTo(folderId));
172 Assert.That(itemRetrieved.InvType, Is.EqualTo(invType));
173 Assert.That(itemRetrieved.AssetType, Is.EqualTo(assetType));
174 Assert.That(itemRetrieved.Name, Is.EqualTo(itemName3));
175 }
176 }
177} \ No newline at end of file
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs
index 9abc5e4..00faa44 100644
--- a/OpenSim/Services/InventoryService/XInventoryService.cs
+++ b/OpenSim/Services/InventoryService/XInventoryService.cs
@@ -476,6 +476,46 @@ namespace OpenSim.Services.InventoryService
476// m_log.InfoFormat( 476// m_log.InfoFormat(
477// "[XINVENTORY SERVICE]: Updating item {0} {1} in folder {2}", item.Name, item.ID, item.Folder); 477// "[XINVENTORY SERVICE]: Updating item {0} {1} in folder {2}", item.Name, item.ID, item.Folder);
478 478
479 InventoryItemBase retrievedItem = GetItem(item);
480
481 if (retrievedItem == null)
482 {
483 m_log.WarnFormat(
484 "[XINVENTORY SERVICE]: Tried to update item {0} {1}, owner {2} but no existing item found.",
485 item.Name, item.ID, item.Owner);
486
487 return false;
488 }
489
490 // Do not allow invariants to change. Changes to folder ID occur in MoveItems()
491 if (retrievedItem.InvType != item.InvType
492 || retrievedItem.AssetType != item.AssetType
493 || retrievedItem.Folder != item.Folder
494 || retrievedItem.CreatorIdentification != item.CreatorIdentification
495 || retrievedItem.Owner != item.Owner)
496 {
497 m_log.WarnFormat(
498 "[XINVENTORY SERVICE]: Caller to UpdateItem() for {0} {1} tried to alter property(s) that should be invariant, (InvType, AssetType, Folder, CreatorIdentification, Owner), existing ({2}, {3}, {4}, {5}, {6}), update ({7}, {8}, {9}, {10}, {11})",
499 retrievedItem.Name,
500 retrievedItem.ID,
501 retrievedItem.InvType,
502 retrievedItem.AssetType,
503 retrievedItem.Folder,
504 retrievedItem.CreatorIdentification,
505 retrievedItem.Owner,
506 item.InvType,
507 item.AssetType,
508 item.Folder,
509 item.CreatorIdentification,
510 item.Owner);
511
512 item.InvType = retrievedItem.InvType;
513 item.AssetType = retrievedItem.AssetType;
514 item.Folder = retrievedItem.Folder;
515 item.CreatorIdentification = retrievedItem.CreatorIdentification;
516 item.Owner = retrievedItem.Owner;
517 }
518
479 return m_Database.StoreItem(ConvertFromOpenSim(item)); 519 return m_Database.StoreItem(ConvertFromOpenSim(item));
480 } 520 }
481 521
diff --git a/OpenSim/Services/LLLoginService/Properties/AssemblyInfo.cs b/OpenSim/Services/LLLoginService/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..62c6e0f
--- /dev/null
+++ b/OpenSim/Services/LLLoginService/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Services.LLLoginService")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("http://opensimulator.org")]
12[assembly: AssemblyProduct("OpenSim")]
13[assembly: AssemblyCopyright("OpenSimulator developers")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("cbeb8f23-3896-4076-97fd-f955b0af6a93")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("0.7.5.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Services/MapImageService/Properties/AssemblyInfo.cs b/OpenSim/Services/MapImageService/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..23eb664
--- /dev/null
+++ b/OpenSim/Services/MapImageService/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Services.MapImageService")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("http://opensimulator.org")]
12[assembly: AssemblyProduct("OpenSim")]
13[assembly: AssemblyCopyright("OpenSimulator developers")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("5e679df7-1d2a-401a-8966-b93677bb5839")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("0.7.5.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Services/PresenceService/Properties/AssemblyInfo.cs b/OpenSim/Services/PresenceService/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..8c03dd7
--- /dev/null
+++ b/OpenSim/Services/PresenceService/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Services.PresenceService")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("http://opensimulator.org")]
12[assembly: AssemblyProduct("OpenSim")]
13[assembly: AssemblyCopyright("OpenSimulator developers")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("a875a0bd-eab0-40a2-b5c4-3afddc3b4d2d")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("0.7.5.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Services/UserAccountService/Properties/AssemblyInfo.cs b/OpenSim/Services/UserAccountService/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..24e1d16
--- /dev/null
+++ b/OpenSim/Services/UserAccountService/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Services.UserAccountService")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("http://opensimulator.org")]
12[assembly: AssemblyProduct("OpenSim")]
13[assembly: AssemblyCopyright("OpenSimulator developers")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("fdb4771d-9928-4db4-aeb5-90cac2976584")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("0.7.5.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Tools/Compiler/Properties/AssemblyInfo.cs b/OpenSim/Tools/Compiler/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..e1a1fda
--- /dev/null
+++ b/OpenSim/Tools/Compiler/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Tools.lslc")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("http://opensimulator.org")]
12[assembly: AssemblyProduct("OpenSim")]
13[assembly: AssemblyCopyright("OpenSimulator developers")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("002864e7-b2a2-41d2-add8-82f653663160")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("0.7.5.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Tools/Configger/Properties/AssemblyInfo.cs b/OpenSim/Tools/Configger/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..62a2f2d
--- /dev/null
+++ b/OpenSim/Tools/Configger/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.Tools.Configger")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("http://opensimulator.org")]
12[assembly: AssemblyProduct("OpenSim")]
13[assembly: AssemblyCopyright("OpenSimulator developers")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("67d7fdf2-554c-40f0-8f9d-f71373c20926")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("0.7.5.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/OpenSim/Tools/pCampBot/Properties/AssemblyInfo.cs b/OpenSim/Tools/pCampBot/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..20598f1
--- /dev/null
+++ b/OpenSim/Tools/pCampBot/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("pCampBot")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("http://opensimulator.org")]
12[assembly: AssemblyProduct("OpenSim")]
13[assembly: AssemblyCopyright("OpenSimulator developers")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("84a69c60-76d3-4846-bd5b-0e1083774039")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("0.7.5.*")]
33[assembly: AssemblyFileVersion("1.0.0.0")]