OSDN Git Service

Skip non full permission items in the correct place.
authorLatif Khalifa <latifer@streamgrid.net>
Mon, 24 Aug 2009 21:51:20 +0000 (21:51 +0000)
committerLatif Khalifa <latifer@streamgrid.net>
Mon, 24 Aug 2009 21:51:20 +0000 (21:51 +0000)
git-svn-id: https://radegast.googlecode.com/svn/trunk@158 f7a694da-4d33-11de-9ad6-1127a62b9fcd

Radegast/GUI/Consoles/Inventory/InventoryBackup.cs

index a27517c..952d96a 100644 (file)
@@ -118,6 +118,10 @@ namespace Radegast
                 {\r
                     InventoryItem item = (InventoryItem)n.Data;\r
 \r
+                    PermissionMask fullPerm = PermissionMask.Modify | PermissionMask.Copy | PermissionMask.Transfer;\r
+                    if ((item.Permissions.OwnerMask & fullPerm) != fullPerm)\r
+                        continue;\r
+\r
                     if (item.AssetType == AssetType.LSLText || item.AssetType == AssetType.Notecard)\r
                     {\r
                         ListViewItem lvi = new ListViewItem();\r
@@ -184,11 +188,14 @@ namespace Radegast
                                         {\r
                                             File.WriteAllText(fullName, note.BodyText, System.Text.Encoding.UTF8);\r
                                         }\r
+                                        else\r
+                                        {\r
+                                            Logger.Log(string.Format("Falied to decode asset for '{0}' - {1}", item.Name, receivedAsset.AssetID), Helpers.LogLevel.Warning, client);\r
+                                        }\r
+\r
                                         break;\r
 \r
                                     case AssetType.LSLText:\r
-                                        if ((item.Permissions.OwnerMask & (PermissionMask.Modify | PermissionMask.Copy | PermissionMask.Transfer)) == 0)\r
-                                            break;\r
                                         fullName = folderName + filePartial + ".lsl";\r
                                         dirName = Path.GetDirectoryName(fullName);\r
 \r
@@ -202,6 +209,11 @@ namespace Radegast
                                         {\r
                                             File.WriteAllText(fullName, script.Source, System.Text.Encoding.UTF8);\r
                                         }\r
+                                        else\r
+                                        {\r
+                                            Logger.Log(string.Format("Falied to decode asset for '{0}' - {1}", item.Name, receivedAsset.AssetID), Helpers.LogLevel.Warning, client);\r
+                                        }\r
+\r
                                         break;\r
 \r
                                 }\r