aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorDr Scofield2009-01-22 16:43:28 +0000
committerDr Scofield2009-01-22 16:43:28 +0000
commit20359e8591751089e08915911fc575464e0e726c (patch)
tree75f5da2e143ec62d3572aacc034e486c20bf5aed /OpenSim/Region
parentFrom: Christopher Yeoh <yeohc@au1.ibm.com> (diff)
downloadopensim-SC_OLD-20359e8591751089e08915911fc575464e0e726c.zip
opensim-SC_OLD-20359e8591751089e08915911fc575464e0e726c.tar.gz
opensim-SC_OLD-20359e8591751089e08915911fc575464e0e726c.tar.bz2
opensim-SC_OLD-20359e8591751089e08915911fc575464e0e726c.tar.xz
white space & formatting cleanup
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs9
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs16
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs90
3 files changed, 57 insertions, 58 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index e15a232..862caa9 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -187,13 +187,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver
187 new FileStream(loadPath, FileMode.Open), CompressionMode.Decompress)); 187 new FileStream(loadPath, FileMode.Open), CompressionMode.Decompress));
188 188
189 byte[] data; 189 byte[] data;
190 TarArchiveReader.TarEntryType entryType; 190 TarArchiveReader.TarEntryType entryType;
191 while ((data = archive.ReadEntry(out filePath, out entryType)) != null) 191 while ((data = archive.ReadEntry(out filePath, out entryType)) != null)
192 { 192 {
193 if (entryType==TarArchiveReader.TarEntryType.TYPE_DIRECTORY) { 193 if (entryType == TarArchiveReader.TarEntryType.TYPE_DIRECTORY) {
194 m_log.WarnFormat("[ARCHIVER]: Ignoring directory entry {0}", 194 m_log.WarnFormat("[ARCHIVER]: Ignoring directory entry {0}", filePath);
195 filePath); 195 } else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
196 } else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
197 { 196 {
198 if (LoadAsset(filePath, data)) 197 if (LoadAsset(filePath, data))
199 successfulAssetRestores++; 198 successfulAssetRestores++;
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
index 73fd916..9a0f19a 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
@@ -88,15 +88,15 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
88 int failedAssetRestores = 0; 88 int failedAssetRestores = 0;
89 89
90 byte[] data; 90 byte[] data;
91 TarArchiveReader.TarEntryType entryType; 91 TarArchiveReader.TarEntryType entryType;
92 while ((data = archive.ReadEntry(out filePath, out entryType)) != null) 92 while ((data = archive.ReadEntry(out filePath, out entryType)) != null)
93 { 93 {
94 //m_log.DebugFormat( 94 //m_log.DebugFormat(
95 // "[ARCHIVER]: Successfully read {0} ({1} bytes)}", filePath, data.Length); 95 // "[ARCHIVER]: Successfully read {0} ({1} bytes)}", filePath, data.Length);
96 if (entryType==TarArchiveReader.TarEntryType.TYPE_DIRECTORY) { 96 if (entryType==TarArchiveReader.TarEntryType.TYPE_DIRECTORY) {
97 m_log.WarnFormat("[ARCHIVER]: Ignoring directory entry {0}", 97 m_log.WarnFormat("[ARCHIVER]: Ignoring directory entry {0}",
98 filePath); 98 filePath);
99 } 99 }
100 else if (filePath.StartsWith(ArchiveConstants.OBJECTS_PATH)) 100 else if (filePath.StartsWith(ArchiveConstants.OBJECTS_PATH))
101 { 101 {
102 serialisedSceneObjects.Add(m_asciiEncoding.GetString(data)); 102 serialisedSceneObjects.Add(m_asciiEncoding.GetString(data));
@@ -122,7 +122,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
122 LoadRegionSettings(filePath, data); 122 LoadRegionSettings(filePath, data);
123 } 123 }
124 } 124 }
125 125
126 //m_log.Debug("[ARCHIVER]: Reached end of archive"); 126 //m_log.Debug("[ARCHIVER]: Reached end of archive");
127 127
128 archive.Close(); 128 archive.Close();
@@ -131,10 +131,10 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
131 131
132 if (failedAssetRestores > 0) 132 if (failedAssetRestores > 0)
133 m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores); 133 m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores);
134 134
135 m_log.Info("[ARCHIVER]: Clearing all existing scene objects"); 135 m_log.Info("[ARCHIVER]: Clearing all existing scene objects");
136 m_scene.DeleteAllSceneObjects(); 136 m_scene.DeleteAllSceneObjects();
137 137
138 // Reload serialized prims 138 // Reload serialized prims
139 m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); 139 m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count);
140 140
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs
index 5d308f0..642e03c 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/TarArchiveReader.cs
@@ -39,18 +39,18 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
39 public class TarArchiveReader 39 public class TarArchiveReader
40 { 40 {
41 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 41 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
42 public enum TarEntryType 42 public enum TarEntryType
43 { 43 {
44 TYPE_UNKNOWN = 0, 44 TYPE_UNKNOWN = 0,
45 TYPE_NORMAL_FILE = 1, 45 TYPE_NORMAL_FILE = 1,
46 TYPE_HARD_LINK = 2, 46 TYPE_HARD_LINK = 2,
47 TYPE_SYMBOLIC_LINK = 3, 47 TYPE_SYMBOLIC_LINK = 3,
48 TYPE_CHAR_SPECIAL = 4, 48 TYPE_CHAR_SPECIAL = 4,
49 TYPE_BLOCK_SPECIAL = 5, 49 TYPE_BLOCK_SPECIAL = 5,
50 TYPE_DIRECTORY = 6, 50 TYPE_DIRECTORY = 6,
51 TYPE_FIFO = 7, 51 TYPE_FIFO = 7,
52 TYPE_CONTIGUOUS_FILE = 8, 52 TYPE_CONTIGUOUS_FILE = 8,
53 } 53 }
54 54
55 protected static ASCIIEncoding m_asciiEncoding = new ASCIIEncoding(); 55 protected static ASCIIEncoding m_asciiEncoding = new ASCIIEncoding();
56 56
@@ -81,13 +81,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
81 public byte[] ReadEntry(out string filePath, out TarEntryType entryType) 81 public byte[] ReadEntry(out string filePath, out TarEntryType entryType)
82 { 82 {
83 filePath = String.Empty; 83 filePath = String.Empty;
84 entryType = TarEntryType.TYPE_UNKNOWN; 84 entryType = TarEntryType.TYPE_UNKNOWN;
85 TarHeader header = ReadHeader(); 85 TarHeader header = ReadHeader();
86 86
87 if (null == header) 87 if (null == header)
88 return null; 88 return null;
89 89
90 entryType = header.EntryType; 90 entryType = header.EntryType;
91 filePath = header.FilePath; 91 filePath = header.FilePath;
92 byte[] data = m_br.ReadBytes(header.FileSize); 92 byte[] data = m_br.ReadBytes(header.FileSize);
93 93
@@ -125,36 +125,36 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
125 tarHeader.FilePath = tarHeader.FilePath.Trim(m_nullCharArray); 125 tarHeader.FilePath = tarHeader.FilePath.Trim(m_nullCharArray);
126 tarHeader.FileSize = ConvertOctalBytesToDecimal(header, 124, 11); 126 tarHeader.FileSize = ConvertOctalBytesToDecimal(header, 124, 11);
127 127
128 switch (header[156]) 128 switch (header[156])
129 { 129 {
130 case 0: 130 case 0:
131 tarHeader.EntryType = TarEntryType.TYPE_NORMAL_FILE; 131 tarHeader.EntryType = TarEntryType.TYPE_NORMAL_FILE;
132 break; 132 break;
133 case (byte)'0': 133 case (byte)'0':
134 tarHeader.EntryType = TarEntryType.TYPE_NORMAL_FILE; 134 tarHeader.EntryType = TarEntryType.TYPE_NORMAL_FILE;
135 break; 135 break;
136 case (byte)'1': 136 case (byte)'1':
137 tarHeader.EntryType = TarEntryType.TYPE_HARD_LINK; 137 tarHeader.EntryType = TarEntryType.TYPE_HARD_LINK;
138 break; 138 break;
139 case (byte)'2': 139 case (byte)'2':
140 tarHeader.EntryType = TarEntryType.TYPE_SYMBOLIC_LINK; 140 tarHeader.EntryType = TarEntryType.TYPE_SYMBOLIC_LINK;
141 break; 141 break;
142 case (byte)'3': 142 case (byte)'3':
143 tarHeader.EntryType = TarEntryType.TYPE_CHAR_SPECIAL; 143 tarHeader.EntryType = TarEntryType.TYPE_CHAR_SPECIAL;
144 break; 144 break;
145 case (byte)'4': 145 case (byte)'4':
146 tarHeader.EntryType = TarEntryType.TYPE_BLOCK_SPECIAL; 146 tarHeader.EntryType = TarEntryType.TYPE_BLOCK_SPECIAL;
147 break; 147 break;
148 case (byte)'5': 148 case (byte)'5':
149 tarHeader.EntryType = TarEntryType.TYPE_DIRECTORY; 149 tarHeader.EntryType = TarEntryType.TYPE_DIRECTORY;
150 break; 150 break;
151 case (byte)'6': 151 case (byte)'6':
152 tarHeader.EntryType = TarEntryType.TYPE_FIFO; 152 tarHeader.EntryType = TarEntryType.TYPE_FIFO;
153 break; 153 break;
154 case (byte)'7': 154 case (byte)'7':
155 tarHeader.EntryType = TarEntryType.TYPE_CONTIGUOUS_FILE; 155 tarHeader.EntryType = TarEntryType.TYPE_CONTIGUOUS_FILE;
156 break; 156 break;
157 } 157 }
158 return tarHeader; 158 return tarHeader;
159 } 159 }
160 160
@@ -188,6 +188,6 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
188 { 188 {
189 public string FilePath; 189 public string FilePath;
190 public int FileSize; 190 public int FileSize;
191 public TarArchiveReader.TarEntryType EntryType; 191 public TarArchiveReader.TarEntryType EntryType;
192 } 192 }
193} 193}