aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications
diff options
context:
space:
mode:
authorSean Dague2008-04-07 23:15:35 +0000
committerSean Dague2008-04-07 23:15:35 +0000
commitf43681510725f5b95fcb864a1f3e4b744fcaf992 (patch)
tree2d34caa75488d1c608d1a21b4888cb0f264a6cba /OpenSim/Framework/Communications
parentneeded to add 4 characters to support the dashes (diff)
downloadopensim-SC_OLD-f43681510725f5b95fcb864a1f3e4b744fcaf992.zip
opensim-SC_OLD-f43681510725f5b95fcb864a1f3e4b744fcaf992.tar.gz
opensim-SC_OLD-f43681510725f5b95fcb864a1f3e4b744fcaf992.tar.bz2
opensim-SC_OLD-f43681510725f5b95fcb864a1f3e4b744fcaf992.tar.xz
Refactor InventoryItemBase to do the following:
* wrap fields as Properties * rename some fields/properties to more sensible names * set style to PropName to match more standard C# approach
Diffstat (limited to 'OpenSim/Framework/Communications')
-rw-r--r--OpenSim/Framework/Communications/Cache/CachedUserInfo.cs14
-rw-r--r--OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs60
-rw-r--r--OpenSim/Framework/Communications/Capabilities/Caps.cs46
-rw-r--r--OpenSim/Framework/Communications/InventoryServiceBase.cs2
4 files changed, 61 insertions, 61 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
index f2dd2bf..cb1eb5a 100644
--- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
+++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
@@ -171,21 +171,21 @@ namespace OpenSim.Framework.Communications.Cache
171 { 171 {
172 if ((userID == UserProfile.UUID) && (RootFolder != null)) 172 if ((userID == UserProfile.UUID) && (RootFolder != null))
173 { 173 {
174 if (itemInfo.parentFolderID == RootFolder.folderID) 174 if (itemInfo.Folder == RootFolder.folderID)
175 { 175 {
176 if (!RootFolder.Items.ContainsKey(itemInfo.inventoryID)) 176 if (!RootFolder.Items.ContainsKey(itemInfo.ID))
177 { 177 {
178 RootFolder.Items.Add(itemInfo.inventoryID, itemInfo); 178 RootFolder.Items.Add(itemInfo.ID, itemInfo);
179 } 179 }
180 } 180 }
181 else 181 else
182 { 182 {
183 InventoryFolderImpl folder = RootFolder.HasSubFolder(itemInfo.parentFolderID); 183 InventoryFolderImpl folder = RootFolder.HasSubFolder(itemInfo.Folder);
184 if (folder != null) 184 if (folder != null)
185 { 185 {
186 if (!folder.Items.ContainsKey(itemInfo.inventoryID)) 186 if (!folder.Items.ContainsKey(itemInfo.ID))
187 { 187 {
188 folder.Items.Add(itemInfo.inventoryID, itemInfo); 188 folder.Items.Add(itemInfo.ID, itemInfo);
189 } 189 }
190 } 190 }
191 } 191 }
@@ -214,7 +214,7 @@ namespace OpenSim.Framework.Communications.Cache
214 bool result = false; 214 bool result = false;
215 if ((userID == UserProfile.UUID) && (RootFolder != null)) 215 if ((userID == UserProfile.UUID) && (RootFolder != null))
216 { 216 {
217 result = RootFolder.DeleteItem(item.inventoryID); 217 result = RootFolder.DeleteItem(item.ID);
218 if (result) 218 if (result)
219 { 219 {
220 m_parentCommsManager.InventoryService.DeleteInventoryItem(userID, item); 220 m_parentCommsManager.InventoryService.DeleteInventoryItem(userID, item);
diff --git a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
index b624b15..12a07eb 100644
--- a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
+++ b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
@@ -116,19 +116,19 @@ namespace OpenSim.Framework.Communications.Cache
116 int assetType, int invType, LLUUID parentFolderID) 116 int assetType, int invType, LLUUID parentFolderID)
117 { 117 {
118 InventoryItemBase item = new InventoryItemBase(); 118 InventoryItemBase item = new InventoryItemBase();
119 item.avatarID = libOwner; 119 item.Owner = libOwner;
120 item.creatorsID = libOwner; 120 item.Creator = libOwner;
121 item.inventoryID = inventoryID; 121 item.ID = inventoryID;
122 item.assetID = assetID; 122 item.AssetID = assetID;
123 item.inventoryDescription = description; 123 item.Description = description;
124 item.inventoryName = name; 124 item.Name = name;
125 item.assetType = assetType; 125 item.AssetType = assetType;
126 item.invType = invType; 126 item.InvType = invType;
127 item.parentFolderID = parentFolderID; 127 item.Folder = parentFolderID;
128 item.inventoryBasePermissions = 0x7FFFFFFF; 128 item.BasePermissions = 0x7FFFFFFF;
129 item.inventoryEveryOnePermissions = 0x7FFFFFFF; 129 item.EveryOnePermissions = 0x7FFFFFFF;
130 item.inventoryCurrentPermissions = 0x7FFFFFFF; 130 item.CurrentPermissions = 0x7FFFFFFF;
131 item.inventoryNextPermissions = 0x7FFFFFFF; 131 item.NextPermissions = 0x7FFFFFFF;
132 return item; 132 return item;
133 } 133 }
134 134
@@ -204,31 +204,31 @@ namespace OpenSim.Framework.Communications.Cache
204 private void ReadItemFromConfig(IConfig config) 204 private void ReadItemFromConfig(IConfig config)
205 { 205 {
206 InventoryItemBase item = new InventoryItemBase(); 206 InventoryItemBase item = new InventoryItemBase();
207 item.avatarID = libOwner; 207 item.Owner = libOwner;
208 item.creatorsID = libOwner; 208 item.Creator = libOwner;
209 item.inventoryID = new LLUUID(config.GetString("inventoryID", folderID.ToString())); 209 item.ID = new LLUUID(config.GetString("inventoryID", folderID.ToString()));
210 item.assetID = new LLUUID(config.GetString("assetID", LLUUID.Random().ToString())); 210 item.AssetID = new LLUUID(config.GetString("assetID", LLUUID.Random().ToString()));
211 item.parentFolderID = new LLUUID(config.GetString("folderID", folderID.ToString())); 211 item.Folder = new LLUUID(config.GetString("folderID", folderID.ToString()));
212 item.inventoryDescription = config.GetString("description", System.String.Empty); 212 item.Description = config.GetString("description", System.String.Empty);
213 item.inventoryName = config.GetString("name", System.String.Empty); 213 item.Name = config.GetString("name", System.String.Empty);
214 item.assetType = config.GetInt("assetType", 0); 214 item.AssetType = config.GetInt("assetType", 0);
215 item.invType = config.GetInt("inventoryType", 0); 215 item.InvType = config.GetInt("inventoryType", 0);
216 item.inventoryCurrentPermissions = (uint)config.GetLong("currentPermissions", 0x7FFFFFFF); 216 item.CurrentPermissions = (uint)config.GetLong("currentPermissions", 0x7FFFFFFF);
217 item.inventoryNextPermissions = (uint)config.GetLong("nextPermissions", 0x7FFFFFFF); 217 item.NextPermissions = (uint)config.GetLong("nextPermissions", 0x7FFFFFFF);
218 item.inventoryEveryOnePermissions = (uint)config.GetLong("everyonePermissions", 0x7FFFFFFF); 218 item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", 0x7FFFFFFF);
219 item.inventoryBasePermissions = (uint)config.GetLong("basePermissions", 0x7FFFFFFF); 219 item.BasePermissions = (uint)config.GetLong("basePermissions", 0x7FFFFFFF);
220 220
221 if (libraryFolders.ContainsKey(item.parentFolderID)) 221 if (libraryFolders.ContainsKey(item.Folder))
222 { 222 {
223 InventoryFolderImpl parentFolder = libraryFolders[item.parentFolderID]; 223 InventoryFolderImpl parentFolder = libraryFolders[item.Folder];
224 224
225 parentFolder.Items.Add(item.inventoryID, item); 225 parentFolder.Items.Add(item.ID, item);
226 } 226 }
227 else 227 else
228 { 228 {
229 m_log.WarnFormat( 229 m_log.WarnFormat(
230 "[LIBRARY INVENTORY]: Couldn't add item {0} ({1}) since parent folder with ID {2} does not exist!", 230 "[LIBRARY INVENTORY]: Couldn't add item {0} ({1}) since parent folder with ID {2} does not exist!",
231 item.inventoryName, item.inventoryID, item.parentFolderID); 231 item.Name, item.ID, item.Folder);
232 } 232 }
233 } 233 }
234 234
diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs
index 00de14d..315daab 100644
--- a/OpenSim/Framework/Communications/Capabilities/Caps.cs
+++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs
@@ -294,14 +294,14 @@ namespace OpenSim.Region.Capabilities
294 private LLSDInventoryItem ConvertInventoryItem(InventoryItemBase invItem) 294 private LLSDInventoryItem ConvertInventoryItem(InventoryItemBase invItem)
295 { 295 {
296 LLSDInventoryItem llsdItem = new LLSDInventoryItem(); 296 LLSDInventoryItem llsdItem = new LLSDInventoryItem();
297 llsdItem.asset_id = invItem.assetID; 297 llsdItem.asset_id = invItem.AssetID;
298 llsdItem.created_at = 1000; 298 llsdItem.created_at = 1000;
299 llsdItem.desc = invItem.inventoryDescription; 299 llsdItem.desc = invItem.Description;
300 llsdItem.flags = 0; 300 llsdItem.flags = 0;
301 llsdItem.item_id = invItem.inventoryID; 301 llsdItem.item_id = invItem.ID;
302 llsdItem.name = invItem.inventoryName; 302 llsdItem.name = invItem.Name;
303 llsdItem.parent_id = invItem.parentFolderID; 303 llsdItem.parent_id = invItem.Folder;
304 llsdItem.type = Enum.GetName(typeof(AssetType), invItem.assetType).ToLower(); 304 llsdItem.type = Enum.GetName(typeof(AssetType), invItem.AssetType).ToLower();
305 305
306 // XXX Temporary fix for 'objects not appearing in inventory' problem. The asset type from libsecondlife is 306 // XXX Temporary fix for 'objects not appearing in inventory' problem. The asset type from libsecondlife is
307 // returning "primitive" when it should returning "object"! It looks like this is fixed in the latest libsecondlife, 307 // returning "primitive" when it should returning "object"! It looks like this is fixed in the latest libsecondlife,
@@ -311,17 +311,17 @@ namespace OpenSim.Region.Capabilities
311 llsdItem.type = "object"; 311 llsdItem.type = "object";
312 } 312 }
313 313
314 llsdItem.inv_type = Enum.GetName(typeof(InventoryType), invItem.invType).ToLower(); 314 llsdItem.inv_type = Enum.GetName(typeof(InventoryType), invItem.InvType).ToLower();
315 llsdItem.permissions = new LLSDPermissions(); 315 llsdItem.permissions = new LLSDPermissions();
316 llsdItem.permissions.creator_id = invItem.creatorsID; 316 llsdItem.permissions.creator_id = invItem.Creator;
317 llsdItem.permissions.base_mask = (int)invItem.inventoryCurrentPermissions; 317 llsdItem.permissions.base_mask = (int)invItem.CurrentPermissions;
318 llsdItem.permissions.everyone_mask = (int)invItem.inventoryEveryOnePermissions; 318 llsdItem.permissions.everyone_mask = (int)invItem.EveryOnePermissions;
319 llsdItem.permissions.group_id = LLUUID.Zero; 319 llsdItem.permissions.group_id = LLUUID.Zero;
320 llsdItem.permissions.group_mask = 0; 320 llsdItem.permissions.group_mask = 0;
321 llsdItem.permissions.is_owner_group = false; 321 llsdItem.permissions.is_owner_group = false;
322 llsdItem.permissions.next_owner_mask = (int)invItem.inventoryNextPermissions; 322 llsdItem.permissions.next_owner_mask = (int)invItem.NextPermissions;
323 llsdItem.permissions.owner_id = m_agentID; // FixMe 323 llsdItem.permissions.owner_id = m_agentID; // FixMe
324 llsdItem.permissions.owner_mask = (int)invItem.inventoryCurrentPermissions; 324 llsdItem.permissions.owner_mask = (int)invItem.CurrentPermissions;
325 llsdItem.sale_info = new LLSDSaleInfo(); 325 llsdItem.sale_info = new LLSDSaleInfo();
326 llsdItem.sale_info.sale_price = 10; 326 llsdItem.sale_info.sale_price = 10;
327 llsdItem.sale_info.sale_type = "not"; 327 llsdItem.sale_info.sale_type = "not";
@@ -587,17 +587,17 @@ namespace OpenSim.Region.Capabilities
587 m_assetCache.AddAsset(asset); 587 m_assetCache.AddAsset(asset);
588 588
589 InventoryItemBase item = new InventoryItemBase(); 589 InventoryItemBase item = new InventoryItemBase();
590 item.avatarID = m_agentID; 590 item.Owner = m_agentID;
591 item.creatorsID = m_agentID; 591 item.Creator = m_agentID;
592 item.inventoryID = inventoryItem; 592 item.ID = inventoryItem;
593 item.assetID = asset.FullID; 593 item.AssetID = asset.FullID;
594 item.inventoryDescription = assetDescription; 594 item.Description = assetDescription;
595 item.inventoryName = assetName; 595 item.Name = assetName;
596 item.assetType = assType; 596 item.AssetType = assType;
597 item.invType = inType; 597 item.InvType = inType;
598 item.parentFolderID = parentFolder; 598 item.Folder = parentFolder;
599 item.inventoryCurrentPermissions = 2147483647; 599 item.CurrentPermissions = 2147483647;
600 item.inventoryNextPermissions = 2147483647; 600 item.NextPermissions = 2147483647;
601 601
602 if (AddNewInventoryItem != null) 602 if (AddNewInventoryItem != null)
603 { 603 {
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs
index feb0cca..f41bd27 100644
--- a/OpenSim/Framework/Communications/InventoryServiceBase.cs
+++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs
@@ -218,7 +218,7 @@ namespace OpenSim.Framework.Communications
218 { 218 {
219 foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) 219 foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
220 { 220 {
221 plugin.Value.deleteInventoryItem(item.inventoryID); 221 plugin.Value.deleteInventoryItem(item.ID);
222 } 222 }
223 } 223 }
224 224