aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/World
diff options
context:
space:
mode:
authorJeff Ames2008-06-18 03:50:39 +0000
committerJeff Ames2008-06-18 03:50:39 +0000
commita728417eda4a2cb2d8e301de9ccb7d0d4d8be8b2 (patch)
tree09057d5714526ab3df816432673bbef9a4da6f05 /OpenSim/Region/Environment/Modules/World
parentmake neb happy. I found where we initialized the dynamic textures to (diff)
downloadopensim-SC_OLD-a728417eda4a2cb2d8e301de9ccb7d0d4d8be8b2.zip
opensim-SC_OLD-a728417eda4a2cb2d8e301de9ccb7d0d4d8be8b2.tar.gz
opensim-SC_OLD-a728417eda4a2cb2d8e301de9ccb7d0d4d8be8b2.tar.bz2
opensim-SC_OLD-a728417eda4a2cb2d8e301de9ccb7d0d4d8be8b2.tar.xz
Minor formatting cleanup.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs14
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs40
2 files changed, 27 insertions, 27 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs
index 3d7273e..199539b 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -37,7 +37,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
37 /// Method called when all the necessary assets for an archive request have been received. 37 /// Method called when all the necessary assets for an archive request have been received.
38 /// </summary> 38 /// </summary>
39 public delegate void AssetsRequestCallback(IDictionary<LLUUID, AssetBase> assets); 39 public delegate void AssetsRequestCallback(IDictionary<LLUUID, AssetBase> assets);
40 40
41 /// <summary> 41 /// <summary>
42 /// Execute the write of an archive once we have received all the necessary data 42 /// Execute the write of an archive once we have received all the necessary data
43 /// </summary> 43 /// </summary>
@@ -46,14 +46,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 47
48 protected string m_savePath; 48 protected string m_savePath;
49 protected string m_serializedEntities; 49 protected string m_serializedEntities;
50 50
51 public ArchiveWriteRequestExecution(string serializedEntities, string savePath) 51 public ArchiveWriteRequestExecution(string serializedEntities, string savePath)
52 { 52 {
53 m_serializedEntities = serializedEntities; 53 m_serializedEntities = serializedEntities;
54 m_savePath = savePath; 54 m_savePath = savePath;
55 } 55 }
56 56
57 protected internal void ReceivedAllAssets(IDictionary<LLUUID, AssetBase> assets) 57 protected internal void ReceivedAllAssets(IDictionary<LLUUID, AssetBase> assets)
58 { 58 {
59 m_log.DebugFormat("[ARCHIVER]: Received all {0} assets required", assets.Count); 59 m_log.DebugFormat("[ARCHIVER]: Received all {0} assets required", assets.Count);
@@ -61,13 +61,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
61 TarArchiveWriter archive = new TarArchiveWriter(); 61 TarArchiveWriter archive = new TarArchiveWriter();
62 62
63 archive.AddFile(ArchiveConstants.PRIMS_PATH, m_serializedEntities); 63 archive.AddFile(ArchiveConstants.PRIMS_PATH, m_serializedEntities);
64 64
65 AssetsArchiver assetsArchiver = new AssetsArchiver(assets); 65 AssetsArchiver assetsArchiver = new AssetsArchiver(assets);
66 assetsArchiver.Archive(archive); 66 assetsArchiver.Archive(archive);
67 67
68 archive.WriteTar(m_savePath); 68 archive.WriteTar(m_savePath);
69 69
70 m_log.InfoFormat("[ARCHIVER]: Wrote out OpenSimulator archive {0}", m_savePath); 70 m_log.InfoFormat("[ARCHIVER]: Wrote out OpenSimulator archive {0}", m_savePath);
71 } 71 }
72 } 72 }
73} 73}
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs
index 5ff435c..a0c6dbf 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -47,14 +47,14 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 48
49 protected Scene m_scene; 49 protected Scene m_scene;
50 protected string m_savePath; 50 protected string m_savePath;
51 51
52 /// <summary> 52 /// <summary>
53 /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate 53 /// Used as a temporary store of an asset which represents an object. This can be a null if no appropriate
54 /// asset was found by the asset service. 54 /// asset was found by the asset service.
55 /// </summary> 55 /// </summary>
56 protected AssetBase m_requestedObjectAsset; 56 protected AssetBase m_requestedObjectAsset;
57 57
58 /// <summary> 58 /// <summary>
59 /// Signal whether we are currently waiting for the asset service to deliver an asset. 59 /// Signal whether we are currently waiting for the asset service to deliver an asset.
60 /// </summary> 60 /// </summary>
@@ -68,7 +68,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
68 m_scene = scene; 68 m_scene = scene;
69 m_savePath = savePath; 69 m_savePath = savePath;
70 } 70 }
71 71
72 /// <summary> 72 /// <summary>
73 /// The callback made when we request the asset for an object from the asset service. 73 /// The callback made when we request the asset for an object from the asset service.
74 /// </summary> 74 /// </summary>
@@ -81,7 +81,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
81 Monitor.Pulse(this); 81 Monitor.Pulse(this);
82 } 82 }
83 } 83 }
84 84
85 /// <summary> 85 /// <summary>
86 /// Get all the asset uuids associated with a given object. This includes both those directly associated with 86 /// Get all the asset uuids associated with a given object. This includes both those directly associated with
87 /// it (e.g. face textures) and recursively, those of items within it's inventory (e.g. objects contained 87 /// it (e.g. face textures) and recursively, those of items within it's inventory (e.g. objects contained
@@ -93,17 +93,17 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
93 { 93 {
94 m_log.DebugFormat( 94 m_log.DebugFormat(
95 "[ARCHIVER]: Getting assets for object {0}, {1}", sceneObject.RootPart.Name, sceneObject.UUID); 95 "[ARCHIVER]: Getting assets for object {0}, {1}", sceneObject.RootPart.Name, sceneObject.UUID);
96 96
97 foreach (SceneObjectPart part in sceneObject.GetParts()) 97 foreach (SceneObjectPart part in sceneObject.GetParts())
98 { 98 {
99 m_log.DebugFormat( 99 m_log.DebugFormat(
100 "[ARCHIVER]: Getting part {0}, {1} for object {2}", part.Name, part.UUID, sceneObject.UUID); 100 "[ARCHIVER]: Getting part {0}, {1} for object {2}", part.Name, part.UUID, sceneObject.UUID);
101 101
102 LLObject.TextureEntry textureEntry = part.Shape.Textures; 102 LLObject.TextureEntry textureEntry = part.Shape.Textures;
103 103
104 // Get the prim's default texture. This will be used for faces which don't have their own texture 104 // Get the prim's default texture. This will be used for faces which don't have their own texture
105 assetUuids[textureEntry.DefaultTexture.TextureID] = 1; 105 assetUuids[textureEntry.DefaultTexture.TextureID] = 1;
106 106
107 // XXX: Not a great way to iterate through face textures, but there's no 107 // XXX: Not a great way to iterate through face textures, but there's no
108 // other method available to tell how many faces there actually are 108 // other method available to tell how many faces there actually are
109 int i = 0; 109 int i = 0;
@@ -114,26 +114,26 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
114 m_log.DebugFormat("[ARCHIVER]: Got face {0}", i++); 114 m_log.DebugFormat("[ARCHIVER]: Got face {0}", i++);
115 assetUuids[texture.TextureID] = 1; 115 assetUuids[texture.TextureID] = 1;
116 } 116 }
117 } 117 }
118 118
119 foreach (TaskInventoryItem tii in part.TaskInventory.Values) 119 foreach (TaskInventoryItem tii in part.TaskInventory.Values)
120 { 120 {
121 if (!assetUuids.ContainsKey(tii.AssetID)) 121 if (!assetUuids.ContainsKey(tii.AssetID))
122 { 122 {
123 assetUuids[tii.AssetID] = 1; 123 assetUuids[tii.AssetID] = 1;
124 124
125 if (tii.Type != (int)InventoryType.Object) 125 if (tii.Type != (int)InventoryType.Object)
126 { 126 {
127 m_log.DebugFormat("[ARCHIVER]: Recording asset {0} in object {1}", tii.AssetID, part.UUID); 127 m_log.DebugFormat("[ARCHIVER]: Recording asset {0} in object {1}", tii.AssetID, part.UUID);
128 } 128 }
129 else 129 else
130 { 130 {
131 m_waitingForObjectAsset = true; 131 m_waitingForObjectAsset = true;
132 m_scene.AssetCache.GetAsset(tii.AssetID, AssetRequestCallback, true); 132 m_scene.AssetCache.GetAsset(tii.AssetID, AssetRequestCallback, true);
133 133
134 // The asset cache callback can either 134 // The asset cache callback can either
135 // 135 //
136 // 1. Complete on the same thread (if the asset is already in the cache) or 136 // 1. Complete on the same thread (if the asset is already in the cache) or
137 // 2. Come in via a different thread (if we need to go fetch it). 137 // 2. Come in via a different thread (if we need to go fetch it).
138 // 138 //
139 // The code below handles both these alternatives. 139 // The code below handles both these alternatives.
@@ -141,11 +141,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
141 { 141 {
142 if (m_waitingForObjectAsset) 142 if (m_waitingForObjectAsset)
143 { 143 {
144 Monitor.Wait(this); 144 Monitor.Wait(this);
145 m_waitingForObjectAsset = false; 145 m_waitingForObjectAsset = false;
146 } 146 }
147 } 147 }
148 148
149 if (null != m_requestedObjectAsset) 149 if (null != m_requestedObjectAsset)
150 { 150 {
151 string xml = Helpers.FieldToUTF8String(m_requestedObjectAsset.Data); 151 string xml = Helpers.FieldToUTF8String(m_requestedObjectAsset.Data);
@@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
156 } 156 }
157 } 157 }
158 } 158 }
159 } 159 }
160 160
161 public void ArchiveRegion() 161 public void ArchiveRegion()
162 { 162 {
@@ -180,7 +180,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
180 m_log.DebugFormat("[ARCHIVER]: Requiring save of {0} assets", assetUuids.Count); 180 m_log.DebugFormat("[ARCHIVER]: Requiring save of {0} assets", assetUuids.Count);
181 181
182 // Asynchronously request all the assets required to perform this archive operation 182 // Asynchronously request all the assets required to perform this archive operation
183 ArchiveWriteRequestExecution awre = new ArchiveWriteRequestExecution(serializedEntities, m_savePath); 183 ArchiveWriteRequestExecution awre = new ArchiveWriteRequestExecution(serializedEntities, m_savePath);
184 new AssetsRequest(assetUuids.Keys, m_scene.AssetCache, awre.ReceivedAllAssets).Execute(); 184 new AssetsRequest(assetUuids.Keys, m_scene.AssetCache, awre.ReceivedAllAssets).Execute();
185 } 185 }
186 } 186 }