aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs26
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs36
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs16
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs36
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs20
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs46
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs16
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs4
-rw-r--r--OpenSim/Region/Environment/Modules/World/Estate/EstateTerrainXferHandler.cs28
-rw-r--r--OpenSim/Region/Environment/Scenes/Hypergrid/HGAssetMapper.cs68
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs184
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs120
12 files changed, 300 insertions, 300 deletions
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
index 689b4d5..7f4bb0b 100644
--- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AgentAssetsTransactions.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
72 } 72 }
73 73
74 public void HandleXfer(ulong xferID, uint packetID, byte[] data) 74 public void HandleXfer(ulong xferID, uint packetID, byte[] data)
75 { 75 {
76 lock (XferUploaders) 76 lock (XferUploaders)
77 { 77 {
78 foreach (AssetXferUploader uploader in XferUploaders.Values) 78 foreach (AssetXferUploader uploader in XferUploaders.Values)
@@ -97,8 +97,8 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
97 wearableType, nextOwnerMask); 97 wearableType, nextOwnerMask);
98 } 98 }
99 } 99 }
100 100
101 101
102 102
103 /// <summary> 103 /// <summary>
104 /// Get an uploaded asset. If the data is successfully retrieved, the transaction will be removed. 104 /// Get an uploaded asset. If the data is successfully retrieved, the transaction will be removed.
@@ -171,10 +171,10 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
171 "[ASSET TRANSACTIONS]: Updating task item {0} in {1} with asset in transaction {2}", 171 "[ASSET TRANSACTIONS]: Updating task item {0} in {1} with asset in transaction {2}",
172 item.Name, part.Name, transactionID); 172 item.Name, part.Name, transactionID);
173 173
174 asset.Name = item.Name; 174 asset.Metadata.Name = item.Name;
175 asset.Description = item.Description; 175 asset.Metadata.Description = item.Description;
176 asset.Type = (sbyte)item.Type; 176 asset.Metadata.Type = (sbyte)item.Type;
177 item.AssetID = asset.FullID; 177 item.AssetID = asset.Metadata.FullID;
178 178
179 Manager.MyScene.CommsManager.AssetCache.AddAsset(asset); 179 Manager.MyScene.CommsManager.AssetCache.AddAsset(asset);
180 180
@@ -206,14 +206,14 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
206 asset = GetTransactionAsset(transactionID); 206 asset = GetTransactionAsset(transactionID);
207 } 207 }
208 208
209 if (asset != null && asset.FullID == assetID) 209 if (asset != null && asset.Metadata.FullID == assetID)
210 { 210 {
211 // Assets never get updated, new ones get created 211 // Assets never get updated, new ones get created
212 asset.FullID = UUID.Random(); 212 asset.Metadata.FullID = UUID.Random();
213 asset.Name = item.Name; 213 asset.Metadata.Name = item.Name;
214 asset.Description = item.Description; 214 asset.Metadata.Description = item.Description;
215 asset.Type = (sbyte)item.AssetType; 215 asset.Metadata.Type = (sbyte)item.AssetType;
216 item.AssetID = asset.FullID; 216 item.AssetID = asset.Metadata.FullID;
217 217
218 Manager.MyScene.CommsManager.AssetCache.AddAsset(asset); 218 Manager.MyScene.CommsManager.AssetCache.AddAsset(asset);
219 } 219 }
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs
index 6dcbe83..5387165 100644
--- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetXferUploader.cs
@@ -113,17 +113,17 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
113 { 113 {
114 ourClient = remoteClient; 114 ourClient = remoteClient;
115 m_asset = new AssetBase(); 115 m_asset = new AssetBase();
116 m_asset.FullID = assetID; 116 m_asset.Metadata.FullID = assetID;
117 m_asset.Type = type; 117 m_asset.Metadata.Type = type;
118 m_asset.Data = data; 118 m_asset.Data = data;
119 m_asset.Name = "blank"; 119 m_asset.Metadata.Name = "blank";
120 m_asset.Description = "empty"; 120 m_asset.Metadata.Description = "empty";
121 m_asset.Local = storeLocal; 121 m_asset.Metadata.Local = storeLocal;
122 m_asset.Temporary = tempFile; 122 m_asset.Metadata.Temporary = tempFile;
123 123
124 TransactionID = transaction; 124 TransactionID = transaction;
125 m_storeLocal = storeLocal; 125 m_storeLocal = storeLocal;
126 126
127 if (m_asset.Data.Length > 2) 127 if (m_asset.Data.Length > 2)
128 { 128 {
129 SendCompleteMessage(); 129 SendCompleteMessage();
@@ -140,12 +140,12 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
140 protected void RequestStartXfer() 140 protected void RequestStartXfer()
141 { 141 {
142 XferID = Util.GetNextXferID(); 142 XferID = Util.GetNextXferID();
143 ourClient.SendXferRequest(XferID, m_asset.Type, m_asset.FullID, 0, new byte[0]); 143 ourClient.SendXferRequest(XferID, m_asset.Metadata.Type, m_asset.Metadata.FullID, 0, new byte[0]);
144 } 144 }
145 145
146 protected void SendCompleteMessage() 146 protected void SendCompleteMessage()
147 { 147 {
148 ourClient.SendAssetUploadCompleteMessage(m_asset.Type, true, m_asset.FullID); 148 ourClient.SendAssetUploadCompleteMessage(m_asset.Metadata.Type, true, m_asset.Metadata.FullID);
149 149
150 m_finished = true; 150 m_finished = true;
151 if (m_createItem) 151 if (m_createItem)
@@ -164,7 +164,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
164 DateTime now = DateTime.Now; 164 DateTime now = DateTime.Now;
165 string filename = 165 string filename =
166 String.Format("{6}_{7}_{0:d2}{1:d2}{2:d2}_{3:d2}{4:d2}{5:d2}.dat", now.Year, now.Month, now.Day, 166 String.Format("{6}_{7}_{0:d2}{1:d2}{2:d2}_{3:d2}{4:d2}{5:d2}.dat", now.Year, now.Month, now.Day,
167 now.Hour, now.Minute, now.Second, m_asset.Name, m_asset.Type); 167 now.Hour, now.Minute, now.Second, m_asset.Metadata.Name, m_asset.Metadata.Type);
168 SaveAssetToFile(filename, m_asset.Data); 168 SaveAssetToFile(filename, m_asset.Data);
169 } 169 }
170 } 170 }
@@ -196,9 +196,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
196 this.invType = invType; 196 this.invType = invType;
197 this.wearableType = wearableType; 197 this.wearableType = wearableType;
198 nextPerm = nextOwnerMask; 198 nextPerm = nextOwnerMask;
199 m_asset.Name = name; 199 m_asset.Metadata.Name = name;
200 m_asset.Description = description; 200 m_asset.Metadata.Description = description;
201 m_asset.Type = type; 201 m_asset.Metadata.Type = type;
202 202
203 if (m_finished) 203 if (m_finished)
204 { 204 {
@@ -211,7 +211,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
211 } 211 }
212 } 212 }
213 213
214 214
215 private void DoCreateItem() 215 private void DoCreateItem()
216 { 216 {
217 m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(m_asset); 217 m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(m_asset);
@@ -225,7 +225,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
225 item.Owner = ourClient.AgentId; 225 item.Owner = ourClient.AgentId;
226 item.Creator = ourClient.AgentId; 226 item.Creator = ourClient.AgentId;
227 item.ID = UUID.Random(); 227 item.ID = UUID.Random();
228 item.AssetID = m_asset.FullID; 228 item.AssetID = m_asset.Metadata.FullID;
229 item.Description = m_description; 229 item.Description = m_description;
230 item.Name = m_name; 230 item.Name = m_name;
231 item.AssetType = type; 231 item.AssetType = type;
@@ -245,9 +245,9 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
245 else 245 else
246 { 246 {
247 m_log.ErrorFormat( 247 m_log.ErrorFormat(
248 "[ASSET TRANSACTIONS]: Could not find user {0} for inventory item creation", 248 "[ASSET TRANSACTIONS]: Could not find user {0} for inventory item creation",
249 ourClient.AgentId); 249 ourClient.AgentId);
250 } 250 }
251 } 251 }
252 252
253 /// <summary> 253 /// <summary>
@@ -260,7 +260,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction
260 { 260 {
261 return m_asset; 261 return m_asset;
262 } 262 }
263 263
264 return null; 264 return null;
265 } 265 }
266 } 266 }
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs b/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs
index a6901b6..f9a10bf 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureSender/TextureSender.cs
@@ -55,7 +55,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
55 /// </summary> 55 /// </summary>
56 private AssetBase m_asset; 56 private AssetBase m_asset;
57 57
58 //public UUID assetID { get { return m_asset.FullID; } } 58 //public UUID assetID { get { return m_asset.Metadata.FullID; } }
59 59
60 // private bool m_cancel = false; 60 // private bool m_cancel = false;
61 61
@@ -93,7 +93,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
93 get { return false; } 93 get { return false; }
94 set 94 set
95 { 95 {
96 // m_cancel = value; 96 // m_cancel = value;
97 } 97 }
98 } 98 }
99 99
@@ -102,7 +102,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
102 get { return false; } 102 get { return false; }
103 set 103 set
104 { 104 {
105 // m_sending = value; 105 // m_sending = value;
106 } 106 }
107 } 107 }
108 108
@@ -117,7 +117,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
117 // See ITextureSender 117 // See ITextureSender
118 public bool SendTexturePacket() 118 public bool SendTexturePacket()
119 { 119 {
120 //m_log.DebugFormat("[TEXTURE SENDER]: Sending packet for {0}", m_asset.FullID); 120 //m_log.DebugFormat("[TEXTURE SENDER]: Sending packet for {0}", m_asset.Metadata.FullID);
121 121
122 SendPacket(); 122 SendPacket();
123 counter++; 123 counter++;
@@ -154,7 +154,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
154 { 154 {
155 if (NumPackets == 0) 155 if (NumPackets == 0)
156 { 156 {
157 RequestUser.SendImageFirstPart(1, m_asset.FullID, (uint)m_asset.Data.Length, m_asset.Data, 2); 157 RequestUser.SendImageFirstPart(1, m_asset.Metadata.FullID, (uint)m_asset.Data.Length, m_asset.Data, 2);
158 PacketCounter++; 158 PacketCounter++;
159 } 159 }
160 else 160 else
@@ -163,7 +163,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
163 Array.Copy(m_asset.Data, 0, ImageData1, 0, 600); 163 Array.Copy(m_asset.Data, 0, ImageData1, 0, 600);
164 164
165 RequestUser.SendImageFirstPart( 165 RequestUser.SendImageFirstPart(
166 (ushort)(NumPackets), m_asset.FullID, (uint)m_asset.Data.Length, ImageData1, 2); 166 (ushort)(NumPackets), m_asset.Metadata.FullID, (uint)m_asset.Data.Length, ImageData1, 2);
167 PacketCounter++; 167 PacketCounter++;
168 } 168 }
169 } 169 }
@@ -179,11 +179,11 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureSender
179 catch (ArgumentOutOfRangeException) 179 catch (ArgumentOutOfRangeException)
180 { 180 {
181 m_log.Error("[TEXTURE SENDER]: Unable to separate texture into multiple packets: Array bounds failure on asset:" + 181 m_log.Error("[TEXTURE SENDER]: Unable to separate texture into multiple packets: Array bounds failure on asset:" +
182 m_asset.FullID.ToString()); 182 m_asset.Metadata.ID);
183 return; 183 return;
184 } 184 }
185 185
186 RequestUser.SendImageNextPart((ushort)PacketCounter, m_asset.FullID, imageData); 186 RequestUser.SendImageNextPart((ushort)PacketCounter, m_asset.Metadata.FullID, imageData);
187 PacketCounter++; 187 PacketCounter++;
188 } 188 }
189 } 189 }
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index 862caa9..dcfcba3 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -46,7 +46,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver
46 public class InventoryArchiveReadRequest 46 public class InventoryArchiveReadRequest
47 { 47 {
48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49 49
50 protected Scene scene; 50 protected Scene scene;
51 protected TarArchiveReader archive; 51 protected TarArchiveReader archive;
52 private static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding(); 52 private static System.Text.ASCIIEncoding m_asciiEncoding = new System.Text.ASCIIEncoding();
@@ -65,7 +65,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver
65 InventoryItemBase item = new InventoryItemBase(); 65 InventoryItemBase item = new InventoryItemBase();
66 StringReader sr = new StringReader(contents); 66 StringReader sr = new StringReader(contents);
67 XmlTextReader reader = new XmlTextReader(sr); 67 XmlTextReader reader = new XmlTextReader(sr);
68 68
69 if (contents.Equals("")) return null; 69 if (contents.Equals("")) return null;
70 70
71 reader.ReadStartElement("InventoryObject"); 71 reader.ReadStartElement("InventoryObject");
@@ -79,7 +79,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver
79 item.InvType = System.Convert.ToInt32(reader.ReadString()); 79 item.InvType = System.Convert.ToInt32(reader.ReadString());
80 reader.ReadEndElement(); 80 reader.ReadEndElement();
81 reader.ReadStartElement("CreatorUUID"); 81 reader.ReadStartElement("CreatorUUID");
82 item.Creator = UUID.Parse(reader.ReadString()); 82 item.Creator = UUID.Parse(reader.ReadString());
83 reader.ReadEndElement(); 83 reader.ReadEndElement();
84 reader.ReadStartElement("CreationDate"); 84 reader.ReadStartElement("CreationDate");
85 item.CreationDate = System.Convert.ToInt32(reader.ReadString()); 85 item.CreationDate = System.Convert.ToInt32(reader.ReadString());
@@ -94,7 +94,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver
94 } 94 }
95 else 95 else
96 { 96 {
97 reader.ReadStartElement("Description"); 97 reader.ReadStartElement("Description");
98 item.Description = reader.ReadString(); 98 item.Description = reader.ReadString();
99 reader.ReadEndElement(); 99 reader.ReadEndElement();
100 } 100 }
@@ -145,7 +145,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver
145 int successfulAssetRestores = 0; 145 int successfulAssetRestores = 0;
146 int failedAssetRestores = 0; 146 int failedAssetRestores = 0;
147 int successfulItemRestores = 0; 147 int successfulItemRestores = 0;
148 148
149 UserProfileData userProfile = commsManager.UserService.GetUserProfile(firstName, lastName); 149 UserProfileData userProfile = commsManager.UserService.GetUserProfile(firstName, lastName);
150 if (null == userProfile) 150 if (null == userProfile)
151 { 151 {
@@ -157,28 +157,28 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver
157 if (null == userInfo) 157 if (null == userInfo)
158 { 158 {
159 m_log.ErrorFormat( 159 m_log.ErrorFormat(
160 "[CONSOLE]: Failed to find user info for {0} {1} {2}", 160 "[CONSOLE]: Failed to find user info for {0} {1} {2}",
161 firstName, lastName, userProfile.ID); 161 firstName, lastName, userProfile.ID);
162 162
163 return; 163 return;
164 } 164 }
165 165
166 if (!userInfo.HasReceivedInventory) 166 if (!userInfo.HasReceivedInventory)
167 { 167 {
168 m_log.ErrorFormat( 168 m_log.ErrorFormat(
169 "[CONSOLE]: Have not yet received inventory info for user {0} {1} {2}", 169 "[CONSOLE]: Have not yet received inventory info for user {0} {1} {2}",
170 firstName, lastName, userProfile.ID); 170 firstName, lastName, userProfile.ID);
171 171
172 return; 172 return;
173 } 173 }
174 174
175 InventoryFolderImpl inventoryFolder = userInfo.RootFolder.FindFolderByPath(invPath); 175 InventoryFolderImpl inventoryFolder = userInfo.RootFolder.FindFolderByPath(invPath);
176 176
177 if (null == inventoryFolder) 177 if (null == inventoryFolder)
178 { 178 {
179 // TODO: Later on, automatically create this folder if it does not exist 179 // TODO: Later on, automatically create this folder if it does not exist
180 m_log.ErrorFormat("[ARCHIVER]: Inventory path {0} does not exist", invPath); 180 m_log.ErrorFormat("[ARCHIVER]: Inventory path {0} does not exist", invPath);
181 181
182 return; 182 return;
183 } 183 }
184 184
@@ -202,17 +202,17 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver
202 else 202 else
203 { 203 {
204 InventoryItemBase item = loadInvItem(filePath, m_asciiEncoding.GetString(data)); 204 InventoryItemBase item = loadInvItem(filePath, m_asciiEncoding.GetString(data));
205 205
206 if (item != null) 206 if (item != null)
207 { 207 {
208 item.Creator = userProfile.ID; 208 item.Creator = userProfile.ID;
209 item.Owner = userProfile.ID; 209 item.Owner = userProfile.ID;
210 210
211 // Reset folder ID to the one in which we want to load it 211 // Reset folder ID to the one in which we want to load it
212 // TODO: Properly restore entire folder structure. At the moment all items are dumped in this 212 // TODO: Properly restore entire folder structure. At the moment all items are dumped in this
213 // single folder no matter where in the saved folder structure they are. 213 // single folder no matter where in the saved folder structure they are.
214 item.Folder = inventoryFolder.ID; 214 item.Folder = inventoryFolder.ID;
215 215
216 userInfo.AddItem(item); 216 userInfo.AddItem(item);
217 successfulItemRestores++; 217 successfulItemRestores++;
218 } 218 }
@@ -258,7 +258,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver
258 258
259 AssetBase asset = new AssetBase(new UUID(uuid), "RandomName"); 259 AssetBase asset = new AssetBase(new UUID(uuid), "RandomName");
260 260
261 asset.Type = assetType; 261 asset.Metadata.Type = assetType;
262 asset.Data = data; 262 asset.Data = data;
263 263
264 scene.AssetCache.AddAsset(asset); 264 scene.AssetCache.AddAsset(asset);
diff --git a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs
index 0974f02..bddf10d 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs
@@ -231,21 +231,21 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture
231 231
232 // Create a new asset for user 232 // Create a new asset for user
233 AssetBase asset = new AssetBase(); 233 AssetBase asset = new AssetBase();
234 asset.FullID = UUID.Random(); 234 asset.Metadata.FullID = UUID.Random();
235 asset.Data = assetData; 235 asset.Data = assetData;
236 asset.Name = "DynamicImage" + Util.RandomClass.Next(1, 10000); 236 asset.Metadata.Name = "DynamicImage" + Util.RandomClass.Next(1, 10000);
237 asset.Type = 0; 237 asset.Metadata.Type = 0;
238 asset.Description = "dynamic image"; 238 asset.Metadata.Description = "dynamic image";
239 asset.Local = false; 239 asset.Metadata.Local = false;
240 asset.Temporary = true; 240 asset.Metadata.Temporary = true;
241 scene.AssetCache.AddAsset(asset); 241 scene.AssetCache.AddAsset(asset);
242 242
243 LastAssetID = asset.FullID; 243 LastAssetID = asset.Metadata.FullID;
244 244
245 IJ2KDecoder cacheLayerDecode = scene.RequestModuleInterface<IJ2KDecoder>(); 245 IJ2KDecoder cacheLayerDecode = scene.RequestModuleInterface<IJ2KDecoder>();
246 if (cacheLayerDecode != null) 246 if (cacheLayerDecode != null)
247 { 247 {
248 cacheLayerDecode.syncdecode(asset.FullID, asset.Data); 248 cacheLayerDecode.syncdecode(asset.Metadata.FullID, asset.Data);
249 } 249 }
250 cacheLayerDecode = null; 250 cacheLayerDecode = null;
251 251
@@ -256,7 +256,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture
256 UUID oldID = tmptex.DefaultTexture.TextureID; 256 UUID oldID = tmptex.DefaultTexture.TextureID;
257 scene.AssetCache.ExpireAsset(oldID); 257 scene.AssetCache.ExpireAsset(oldID);
258 258
259 tmptex.DefaultTexture.TextureID = asset.FullID; 259 tmptex.DefaultTexture.TextureID = asset.Metadata.FullID;
260 // I'm pretty sure we always want to force this to true 260 // I'm pretty sure we always want to force this to true
261 tmptex.DefaultTexture.Fullbright = true; 261 tmptex.DefaultTexture.Fullbright = true;
262 262
@@ -287,7 +287,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture
287 try 287 try
288 { 288 {
289 result = OpenJPEG.EncodeFromImage(joint, true); 289 result = OpenJPEG.EncodeFromImage(joint, true);
290 } 290 }
291 catch (Exception) 291 catch (Exception)
292 { 292 {
293 Console.WriteLine( 293 Console.WriteLine(
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
index 4e9fcef..c860d01 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
@@ -66,12 +66,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
66 m_loadStream = new GZipStream(GetStream(loadPath), CompressionMode.Decompress); 66 m_loadStream = new GZipStream(GetStream(loadPath), CompressionMode.Decompress);
67 m_errorMessage = String.Empty; 67 m_errorMessage = String.Empty;
68 } 68 }
69 69
70 public ArchiveReadRequest(Scene scene, Stream loadStream) 70 public ArchiveReadRequest(Scene scene, Stream loadStream)
71 { 71 {
72 m_scene = scene; 72 m_scene = scene;
73 m_loadStream = loadStream; 73 m_loadStream = loadStream;
74 } 74 }
75 75
76 /// <summary> 76 /// <summary>
77 /// Dearchive the region embodied in this request. 77 /// Dearchive the region embodied in this request.
@@ -81,7 +81,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
81 // The same code can handle dearchiving 0.1 and 0.2 OpenSim Archive versions 81 // The same code can handle dearchiving 0.1 and 0.2 OpenSim Archive versions
82 DearchiveRegion0DotStar(); 82 DearchiveRegion0DotStar();
83 } 83 }
84 84
85 private void DearchiveRegion0DotStar() 85 private void DearchiveRegion0DotStar()
86 { 86 {
87 int successfulAssetRestores = 0; 87 int successfulAssetRestores = 0;
@@ -98,12 +98,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
98 98
99 byte[] data; 99 byte[] data;
100 TarArchiveReader.TarEntryType entryType; 100 TarArchiveReader.TarEntryType entryType;
101 101
102 while ((data = archive.ReadEntry(out filePath, out entryType)) != null) 102 while ((data = archive.ReadEntry(out filePath, out entryType)) != null)
103 { 103 {
104 //m_log.DebugFormat( 104 //m_log.DebugFormat(
105 // "[ARCHIVER]: Successfully read {0} ({1} bytes)}", filePath, data.Length); 105 // "[ARCHIVER]: Successfully read {0} ({1} bytes)}", filePath, data.Length);
106 if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY == entryType) 106 if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY == entryType)
107 { 107 {
108 m_log.WarnFormat("[ARCHIVER]: Ignoring directory entry {0}", 108 m_log.WarnFormat("[ARCHIVER]: Ignoring directory entry {0}",
109 filePath); 109 filePath);
@@ -133,7 +133,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
133 LoadRegionSettings(filePath, data); 133 LoadRegionSettings(filePath, data);
134 } 134 }
135 } 135 }
136 136
137 //m_log.Debug("[ARCHIVER]: Reached end of archive"); 137 //m_log.Debug("[ARCHIVER]: Reached end of archive");
138 138
139 archive.Close(); 139 archive.Close();
@@ -154,10 +154,10 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
154 m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores); 154 m_log.ErrorFormat("[ARCHIVER]: Failed to load {0} assets", failedAssetRestores);
155 m_errorMessage += String.Format("Failed to load {0} assets", failedAssetRestores); 155 m_errorMessage += String.Format("Failed to load {0} assets", failedAssetRestores);
156 } 156 }
157 157
158 m_log.Info("[ARCHIVER]: Clearing all existing scene objects"); 158 m_log.Info("[ARCHIVER]: Clearing all existing scene objects");
159 m_scene.DeleteAllSceneObjects(); 159 m_scene.DeleteAllSceneObjects();
160 160
161 // Reload serialized prims 161 // Reload serialized prims
162 m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count); 162 m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count);
163 163
@@ -176,10 +176,10 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
176 // Try to retain the original creator/owner/lastowner if their uuid is present on this grid 176 // Try to retain the original creator/owner/lastowner if their uuid is present on this grid
177 // otherwise, use the master avatar uuid instead 177 // otherwise, use the master avatar uuid instead
178 UUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID; 178 UUID masterAvatarId = m_scene.RegionInfo.MasterAvatarAssignedUUID;
179 179
180 if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) 180 if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero)
181 masterAvatarId = m_scene.RegionInfo.EstateSettings.EstateOwner; 181 masterAvatarId = m_scene.RegionInfo.EstateSettings.EstateOwner;
182 182
183 foreach (SceneObjectPart part in sceneObject.Children.Values) 183 foreach (SceneObjectPart part in sceneObject.Children.Values)
184 { 184 {
185 if (!resolveUserUuid(part.CreatorID)) 185 if (!resolveUserUuid(part.CreatorID))
@@ -233,7 +233,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
233 { 233 {
234 sceneObject.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 0); 234 sceneObject.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 0);
235 } 235 }
236 236
237 m_scene.EventManager.TriggerOarFileLoaded(m_errorMessage); 237 m_scene.EventManager.TriggerOarFileLoaded(m_errorMessage);
238 } 238 }
239 239
@@ -290,12 +290,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
290 //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); 290 //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType);
291 291
292 AssetBase asset = new AssetBase(new UUID(uuid), String.Empty); 292 AssetBase asset = new AssetBase(new UUID(uuid), String.Empty);
293 asset.Type = assetType; 293 asset.Metadata.Type = assetType;
294 asset.Data = data; 294 asset.Data = data;
295 295
296 m_scene.AssetCache.AddAsset(asset); 296 m_scene.AssetCache.AddAsset(asset);
297 297
298 /** 298 /**
299 * Create layers on decode for image assets. This is likely to significantly increase the time to load archives so 299 * Create layers on decode for image assets. This is likely to significantly increase the time to load archives so
300 * it might be best done when dearchive takes place on a separate thread 300 * it might be best done when dearchive takes place on a separate thread
301 if (asset.Type=AssetType.Texture) 301 if (asset.Type=AssetType.Texture)
@@ -317,7 +317,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
317 return false; 317 return false;
318 } 318 }
319 } 319 }
320 320
321 /// <summary> 321 /// <summary>
322 /// Load region settings data 322 /// Load region settings data
323 /// </summary> 323 /// </summary>
@@ -329,7 +329,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
329 private bool LoadRegionSettings(string settingsPath, byte[] data) 329 private bool LoadRegionSettings(string settingsPath, byte[] data)
330 { 330 {
331 RegionSettings loadedRegionSettings; 331 RegionSettings loadedRegionSettings;
332 332
333 try 333 try
334 { 334 {
335 loadedRegionSettings = RegionSettingsSerializer.Deserialize(data); 335 loadedRegionSettings = RegionSettingsSerializer.Deserialize(data);
@@ -337,13 +337,13 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
337 catch (Exception e) 337 catch (Exception e)
338 { 338 {
339 m_log.ErrorFormat( 339 m_log.ErrorFormat(
340 "[ARCHIVER]: Could not parse region settings file {0}. Ignoring. Exception was {1}", 340 "[ARCHIVER]: Could not parse region settings file {0}. Ignoring. Exception was {1}",
341 settingsPath, e); 341 settingsPath, e);
342 return false; 342 return false;
343 } 343 }
344 344
345 RegionSettings currentRegionSettings = m_scene.RegionInfo.RegionSettings; 345 RegionSettings currentRegionSettings = m_scene.RegionInfo.RegionSettings;
346 346
347 currentRegionSettings.AgentLimit = loadedRegionSettings.AgentLimit; 347 currentRegionSettings.AgentLimit = loadedRegionSettings.AgentLimit;
348 currentRegionSettings.AllowDamage = loadedRegionSettings.AllowDamage; 348 currentRegionSettings.AllowDamage = loadedRegionSettings.AllowDamage;
349 currentRegionSettings.AllowLandJoinDivide = loadedRegionSettings.AllowLandJoinDivide; 349 currentRegionSettings.AllowLandJoinDivide = loadedRegionSettings.AllowLandJoinDivide;
@@ -373,10 +373,10 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
373 currentRegionSettings.TerrainTexture4 = loadedRegionSettings.TerrainTexture4; 373 currentRegionSettings.TerrainTexture4 = loadedRegionSettings.TerrainTexture4;
374 currentRegionSettings.UseEstateSun = loadedRegionSettings.UseEstateSun; 374 currentRegionSettings.UseEstateSun = loadedRegionSettings.UseEstateSun;
375 currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight; 375 currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight;
376 376
377 IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>(); 377 IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>();
378 estateModule.sendRegionHandshakeToAll(); 378 estateModule.sendRegionHandshakeToAll();
379 379
380 return true; 380 return true;
381 } 381 }
382 382
@@ -411,11 +411,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
411 if (File.Exists(path)) 411 if (File.Exists(path))
412 { 412 {
413 return new FileStream(path, FileMode.Open); 413 return new FileStream(path, FileMode.Open);
414 } 414 }
415 else 415 else
416 { 416 {
417 Uri uri = new Uri(path); // throw exception if not valid URI 417 Uri uri = new Uri(path); // throw exception if not valid URI
418 if (uri.Scheme == "file") 418 if (uri.Scheme == "file")
419 { 419 {
420 return new FileStream(uri.AbsolutePath, FileMode.Open); 420 return new FileStream(uri.AbsolutePath, FileMode.Open);
421 } 421 }
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs
index 75ae474..36a60f3 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs
@@ -86,16 +86,16 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
86 86
87 string extension = string.Empty; 87 string extension = string.Empty;
88 88
89 if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) 89 if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Metadata.Type))
90 { 90 {
91 extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; 91 extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Metadata.Type];
92 } 92 }
93 93
94 xtw.WriteElementString("filename", uuid.ToString() + extension); 94 xtw.WriteElementString("filename", uuid.ToString() + extension);
95 95
96 xtw.WriteElementString("name", asset.Name); 96 xtw.WriteElementString("name", asset.Metadata.Name);
97 xtw.WriteElementString("description", asset.Description); 97 xtw.WriteElementString("description", asset.Metadata.Description);
98 xtw.WriteElementString("asset-type", asset.Type.ToString()); 98 xtw.WriteElementString("asset-type", asset.Metadata.Type.ToString());
99 99
100 xtw.WriteEndElement(); 100 xtw.WriteEndElement();
101 } 101 }
@@ -123,15 +123,15 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
123 123
124 string extension = string.Empty; 124 string extension = string.Empty;
125 125
126 if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) 126 if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Metadata.Type))
127 { 127 {
128 extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; 128 extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Metadata.Type];
129 } 129 }
130 else 130 else
131 { 131 {
132 m_log.ErrorFormat( 132 m_log.ErrorFormat(
133 "[ARCHIVER]: Unrecognized asset type {0} with uuid {1}. This asset will be saved but not reloaded", 133 "[ARCHIVER]: Unrecognized asset type {0} with uuid {1}. This asset will be saved but not reloaded",
134 asset.Type, asset.ID); 134 asset.Metadata.Type, asset.Metadata.ID);
135 } 135 }
136 136
137 archive.AddFile( 137 archive.AddFile(
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs
index b26fe4c..0ef1e1d 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsDearchiver.cs
@@ -157,8 +157,8 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
157 m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename); 157 m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename);
158 158
159 AssetBase asset = new AssetBase(new UUID(filename), metadata.Name); 159 AssetBase asset = new AssetBase(new UUID(filename), metadata.Name);
160 asset.Description = metadata.Description; 160 asset.Metadata.Description = metadata.Description;
161 asset.Type = metadata.AssetType; 161 asset.Metadata.Type = metadata.AssetType;
162 asset.Data = data; 162 asset.Data = data;
163 163
164 m_cache.AddAsset(asset); 164 m_cache.AddAsset(asset);
diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateTerrainXferHandler.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateTerrainXferHandler.cs
index 6d69443..2ba4e34 100644
--- a/OpenSim/Region/Environment/Modules/World/Estate/EstateTerrainXferHandler.cs
+++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateTerrainXferHandler.cs
@@ -37,13 +37,13 @@ using OpenSim.Region.Environment.Scenes;
37 37
38namespace OpenSim.Region.Environment.Modules.World.Estate 38namespace OpenSim.Region.Environment.Modules.World.Estate
39{ 39{
40 40
41 public class EstateTerrainXferHandler 41 public class EstateTerrainXferHandler
42 { 42 {
43 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 43 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
44 44
45 private AssetBase m_asset; 45 private AssetBase m_asset;
46 46
47 public delegate void TerrainUploadComplete(string name, byte[] filedata, IClientAPI remoteClient); 47 public delegate void TerrainUploadComplete(string name, byte[] filedata, IClientAPI remoteClient);
48 48
49 public event TerrainUploadComplete TerrainUploadDone; 49 public event TerrainUploadComplete TerrainUploadDone;
@@ -52,21 +52,21 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
52 //private string m_name = String.Empty; 52 //private string m_name = String.Empty;
53 //private UUID TransactionID = UUID.Zero; 53 //private UUID TransactionID = UUID.Zero;
54 private sbyte type = 0; 54 private sbyte type = 0;
55 55
56 public ulong mXferID; 56 public ulong mXferID;
57 private TerrainUploadComplete handlerTerrainUploadDone; 57 private TerrainUploadComplete handlerTerrainUploadDone;
58 58
59 public EstateTerrainXferHandler(IClientAPI pRemoteClient, string pClientFilename) 59 public EstateTerrainXferHandler(IClientAPI pRemoteClient, string pClientFilename)
60 { 60 {
61 61
62 m_asset = new AssetBase(); 62 m_asset = new AssetBase();
63 m_asset.FullID = UUID.Zero; 63 m_asset.Metadata.FullID = UUID.Zero;
64 m_asset.Type = type; 64 m_asset.Metadata.Type = type;
65 m_asset.Data = new byte[0]; 65 m_asset.Data = new byte[0];
66 m_asset.Name = pClientFilename; 66 m_asset.Metadata.Name = pClientFilename;
67 m_asset.Description = "empty"; 67 m_asset.Metadata.Description = "empty";
68 m_asset.Local = true; 68 m_asset.Metadata.Local = true;
69 m_asset.Temporary = true; 69 m_asset.Metadata.Temporary = true;
70 70
71 } 71 }
72 72
@@ -78,7 +78,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
78 public void RequestStartXfer(IClientAPI pRemoteClient) 78 public void RequestStartXfer(IClientAPI pRemoteClient)
79 { 79 {
80 mXferID = Util.GetNextXferID(); 80 mXferID = Util.GetNextXferID();
81 pRemoteClient.SendXferRequest(mXferID, m_asset.Type, m_asset.FullID, 0, Utils.StringToBytes(m_asset.Name)); 81 pRemoteClient.SendXferRequest(mXferID, m_asset.Metadata.Type, m_asset.Metadata.FullID, 0, Utils.StringToBytes(m_asset.Metadata.Name));
82 } 82 }
83 83
84 /// <summary> 84 /// <summary>
@@ -86,7 +86,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
86 /// </summary> 86 /// </summary>
87 /// <param name="xferID"></param> 87 /// <param name="xferID"></param>
88 /// <param name="packetID"></param> 88 /// <param name="packetID"></param>
89 /// <param name="data"></param> 89 /// <param name="data"></param>
90 public void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data) 90 public void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data)
91 { 91 {
92 if (mXferID == xferID) 92 if (mXferID == xferID)
@@ -110,7 +110,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
110 if ((packetID & 0x80000000) != 0) 110 if ((packetID & 0x80000000) != 0)
111 { 111 {
112 SendCompleteMessage(remoteClient); 112 SendCompleteMessage(remoteClient);
113 113
114 } 114 }
115 } 115 }
116 } 116 }
@@ -120,7 +120,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
120 handlerTerrainUploadDone = TerrainUploadDone; 120 handlerTerrainUploadDone = TerrainUploadDone;
121 if (handlerTerrainUploadDone != null) 121 if (handlerTerrainUploadDone != null)
122 { 122 {
123 handlerTerrainUploadDone(m_asset.Name,m_asset.Data, remoteClient); 123 handlerTerrainUploadDone(m_asset.Metadata.Name, m_asset.Data, remoteClient);
124 } 124 }
125 } 125 }
126 } 126 }
diff --git a/OpenSim/Region/Environment/Scenes/Hypergrid/HGAssetMapper.cs b/OpenSim/Region/Environment/Scenes/Hypergrid/HGAssetMapper.cs
index 3acaa21..73a5a3a 100644
--- a/OpenSim/Region/Environment/Scenes/Hypergrid/HGAssetMapper.cs
+++ b/OpenSim/Region/Environment/Scenes/Hypergrid/HGAssetMapper.cs
@@ -1,29 +1,29 @@
1/** 1/**
2 * Copyright (c) 2008, Contributors. All rights reserved. 2 * Copyright (c) 2008, Contributors. All rights reserved.
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without modification, 5 * Redistribution and use in source and binary forms, with or without modification,
6 * are permitted provided that the following conditions are met: 6 * are permitted provided that the following conditions are met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright notice, 8 * * Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright notice, 10 * * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation 11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution. 12 * and/or other materials provided with the distribution.
13 * * Neither the name of the Organizations nor the names of Individual 13 * * Neither the name of the Organizations nor the names of Individual
14 * Contributors may be used to endorse or promote products derived from 14 * Contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission. 15 * this software without specific prior written permission.
16 * 16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
20 * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
22 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 22 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 24 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
25 * OF THE POSSIBILITY OF SUCH DAMAGE. 25 * OF THE POSSIBILITY OF SUCH DAMAGE.
26 * 26 *
27 */ 27 */
28 28
29using System; 29using System;
@@ -48,7 +48,7 @@ using OpenSim.Region.Environment.Scenes;
48 48
49namespace OpenSim.Region.Environment.Scenes.Hypergrid 49namespace OpenSim.Region.Environment.Scenes.Hypergrid
50{ 50{
51 public class HGAssetMapper 51 public class HGAssetMapper
52 { 52 {
53 #region Fields 53 #region Fields
54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -128,12 +128,12 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
128 128
129 if (m_scene.CommsManager.AssetCache.TryGetCachedAsset(assetID, out asset) && (asset != null)) 129 if (m_scene.CommsManager.AssetCache.TryGetCachedAsset(assetID, out asset) && (asset != null))
130 { 130 {
131 m_log.Debug("[HGScene]: Asset made it to asset cache. " + asset.Name + " " + assetID); 131 m_log.Debug("[HGScene]: Asset made it to asset cache. " + asset.Metadata.Name + " " + assetID);
132 // I think I need to store it in the asset DB too. 132 // I think I need to store it in the asset DB too.
133 // For now, let me just do it for textures and scripts 133 // For now, let me just do it for textures and scripts
134 if (((AssetType)asset.Type == AssetType.Texture) || 134 if (((AssetType)asset.Metadata.Type == AssetType.Texture) ||
135 ((AssetType)asset.Type == AssetType.LSLBytecode) || 135 ((AssetType)asset.Metadata.Type == AssetType.LSLBytecode) ||
136 ((AssetType)asset.Type == AssetType.LSLText)) 136 ((AssetType)asset.Metadata.Type == AssetType.LSLText))
137 { 137 {
138 AssetBase asset1 = new AssetBase(); 138 AssetBase asset1 = new AssetBase();
139 Copy(asset, asset1); 139 Copy(asset, asset1);
@@ -157,9 +157,9 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
157 if (asset1 != null) 157 if (asset1 != null)
158 { 158 {
159 // See long comment in AssetCache.AddAsset 159 // See long comment in AssetCache.AddAsset
160 if (!asset1.Temporary || asset1.Local) 160 if (!asset1.Metadata.Temporary || asset1.Metadata.Local)
161 { 161 {
162 // The asset cache returns instances of subclasses of AssetBase: 162 // The asset cache returns instances of subclasses of AssetBase:
163 // TextureImage or AssetInfo. So in passing them to the remote 163 // TextureImage or AssetInfo. So in passing them to the remote
164 // server we first need to convert this to instances of AssetBase, 164 // server we first need to convert this to instances of AssetBase,
165 // which is the serializable class for assets. 165 // which is the serializable class for assets.
@@ -179,14 +179,14 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
179 private void Copy(AssetBase from, AssetBase to) 179 private void Copy(AssetBase from, AssetBase to)
180 { 180 {
181 to.Data = from.Data; 181 to.Data = from.Data;
182 to.Description = from.Description; 182 to.Metadata.Description = from.Metadata.Description;
183 to.FullID = from.FullID; 183 to.Metadata.FullID = from.Metadata.FullID;
184 to.ID = from.ID; 184 to.Metadata.ID = from.Metadata.ID;
185 to.Local = from.Local; 185 to.Metadata.Local = from.Metadata.Local;
186 to.Name = from.Name; 186 to.Metadata.Name = from.Metadata.Name;
187 to.Temporary = from.Temporary; 187 to.Metadata.Temporary = from.Metadata.Temporary;
188 to.Type = from.Type; 188 to.Metadata.Type = from.Metadata.Type;
189 189
190 } 190 }
191 191
192 private void _guardedAdd(Dictionary<UUID, bool> lst, UUID obj, bool val) 192 private void _guardedAdd(Dictionary<UUID, bool> lst, UUID obj, bool val)
@@ -243,7 +243,7 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
243 private Dictionary<UUID, bool> SniffUUIDs(AssetBase asset) 243 private Dictionary<UUID, bool> SniffUUIDs(AssetBase asset)
244 { 244 {
245 Dictionary<UUID, bool> uuids = new Dictionary<UUID, bool>(); 245 Dictionary<UUID, bool> uuids = new Dictionary<UUID, bool>();
246 if ((asset != null) && ((AssetType)asset.Type == AssetType.Object)) 246 if ((asset != null) && ((AssetType)asset.Metadata.Type == AssetType.Object))
247 { 247 {
248 string ass_str = Utils.BytesToString(asset.Data); 248 string ass_str = Utils.BytesToString(asset.Data);
249 SceneObjectGroup sog = new SceneObjectGroup(ass_str, true); 249 SceneObjectGroup sog = new SceneObjectGroup(ass_str, true);
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 58ab058..cb9aee2 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -42,12 +42,12 @@ namespace OpenSim.Region.Environment.Scenes
42 public partial class Scene 42 public partial class Scene
43 { 43 {
44 private static readonly ILog m_log 44 private static readonly ILog m_log
45 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 46
47 /// <summary> 47 /// <summary>
48 /// Allows asynchronous derezzing of objects from the scene into a client's inventory. 48 /// Allows asynchronous derezzing of objects from the scene into a client's inventory.
49 /// </summary> 49 /// </summary>
50 protected AsyncSceneObjectGroupDeleter m_asyncSceneObjectDeleter; 50 protected AsyncSceneObjectGroupDeleter m_asyncSceneObjectDeleter;
51 51
52 /// <summary> 52 /// <summary>
53 /// Start all the scripts in the scene which should be started. 53 /// Start all the scripts in the scene which should be started.
@@ -145,9 +145,9 @@ namespace OpenSim.Region.Environment.Scenes
145 else 145 else
146 { 146 {
147 m_log.ErrorFormat( 147 m_log.ErrorFormat(
148 "[AGENT INVENTORY]: Could not resolve user {0} for adding an inventory item", 148 "[AGENT INVENTORY]: Could not resolve user {0} for adding an inventory item",
149 remoteClient.AgentId); 149 remoteClient.AgentId);
150 } 150 }
151 } 151 }
152 152
153 /// <summary> 153 /// <summary>
@@ -175,7 +175,7 @@ namespace OpenSim.Region.Environment.Scenes
175 remoteClient.SendAgentAlertMessage("Insufficient permissions to edit notecard", false); 175 remoteClient.SendAgentAlertMessage("Insufficient permissions to edit notecard", false);
176 return UUID.Zero; 176 return UUID.Zero;
177 } 177 }
178 178
179 remoteClient.SendAgentAlertMessage("Notecard saved", false); 179 remoteClient.SendAgentAlertMessage("Notecard saved", false);
180 } 180 }
181 else if ((InventoryType)item.InvType == InventoryType.LSL) 181 else if ((InventoryType)item.InvType == InventoryType.LSL)
@@ -185,7 +185,7 @@ namespace OpenSim.Region.Environment.Scenes
185 remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false); 185 remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false);
186 return UUID.Zero; 186 return UUID.Zero;
187 } 187 }
188 188
189 remoteClient.SendAgentAlertMessage("Script saved", false); 189 remoteClient.SendAgentAlertMessage("Script saved", false);
190 } 190 }
191 191
@@ -193,21 +193,21 @@ namespace OpenSim.Region.Environment.Scenes
193 CreateAsset(item.Name, item.Description, (sbyte)item.AssetType, data); 193 CreateAsset(item.Name, item.Description, (sbyte)item.AssetType, data);
194 AssetCache.AddAsset(asset); 194 AssetCache.AddAsset(asset);
195 195
196 item.AssetID = asset.FullID; 196 item.AssetID = asset.Metadata.FullID;
197 userInfo.UpdateItem(item); 197 userInfo.UpdateItem(item);
198 198
199 // remoteClient.SendInventoryItemCreateUpdate(item); 199 // remoteClient.SendInventoryItemCreateUpdate(item);
200 return (asset.FullID); 200 return (asset.Metadata.FullID);
201 } 201 }
202 } 202 }
203 } 203 }
204 else 204 else
205 { 205 {
206 m_log.ErrorFormat( 206 m_log.ErrorFormat(
207 "[AGENT INVENTORY]: Could not resolve user {0} for caps inventory update", 207 "[AGENT INVENTORY]: Could not resolve user {0} for caps inventory update",
208 remoteClient.AgentId); 208 remoteClient.AgentId);
209 } 209 }
210 210
211 return UUID.Zero; 211 return UUID.Zero;
212 } 212 }
213 213
@@ -283,9 +283,9 @@ namespace OpenSim.Region.Environment.Scenes
283 { 283 {
284 part.Inventory.RemoveScriptInstance(item.ItemID); 284 part.Inventory.RemoveScriptInstance(item.ItemID);
285 } 285 }
286 286
287 // Update item with new asset 287 // Update item with new asset
288 item.AssetID = asset.FullID; 288 item.AssetID = asset.Metadata.FullID;
289 group.UpdateInventoryItem(item); 289 group.UpdateInventoryItem(item);
290 part.GetProperties(remoteClient); 290 part.GetProperties(remoteClient);
291 291
@@ -406,7 +406,7 @@ namespace OpenSim.Region.Environment.Scenes
406 /// </summary> 406 /// </summary>
407 /// <param name="recipientClient"></param> 407 /// <param name="recipientClient"></param>
408 /// <param name="senderId">ID of the sender of the item</param> 408 /// <param name="senderId">ID of the sender of the item</param>
409 /// <param name="itemId"></param> 409 /// <param name="itemId"></param>
410 public virtual void GiveInventoryItem(IClientAPI recipientClient, UUID senderId, UUID itemId) 410 public virtual void GiveInventoryItem(IClientAPI recipientClient, UUID senderId, UUID itemId)
411 { 411 {
412 InventoryItemBase itemCopy = GiveInventoryItem(recipientClient.AgentId, senderId, itemId); 412 InventoryItemBase itemCopy = GiveInventoryItem(recipientClient.AgentId, senderId, itemId);
@@ -420,19 +420,19 @@ namespace OpenSim.Region.Environment.Scenes
420 /// </summary> 420 /// </summary>
421 /// <param name="recipient"></param> 421 /// <param name="recipient"></param>
422 /// <param name="senderId">ID of the sender of the item</param> 422 /// <param name="senderId">ID of the sender of the item</param>
423 /// <param name="itemId"></param> 423 /// <param name="itemId"></param>
424 /// <returns>The inventory item copy given, null if the give was unsuccessful</returns> 424 /// <returns>The inventory item copy given, null if the give was unsuccessful</returns>
425 public virtual InventoryItemBase GiveInventoryItem(UUID recipient, UUID senderId, UUID itemId) 425 public virtual InventoryItemBase GiveInventoryItem(UUID recipient, UUID senderId, UUID itemId)
426 { 426 {
427 return GiveInventoryItem(recipient, senderId, itemId, UUID.Zero); 427 return GiveInventoryItem(recipient, senderId, itemId, UUID.Zero);
428 } 428 }
429 429
430 /// <summary> 430 /// <summary>
431 /// Give an inventory item from one user to another 431 /// Give an inventory item from one user to another
432 /// </summary> 432 /// </summary>
433 /// <param name="recipient"></param> 433 /// <param name="recipient"></param>
434 /// <param name="senderId">ID of the sender of the item</param> 434 /// <param name="senderId">ID of the sender of the item</param>
435 /// <param name="itemId"></param> 435 /// <param name="itemId"></param>
436 /// <param name="recipientFolderId"> 436 /// <param name="recipientFolderId">
437 /// The id of the folder in which the copy item should go. If UUID.Zero then the item is placed in the most 437 /// The id of the folder in which the copy item should go. If UUID.Zero then the item is placed in the most
438 /// appropriate default folder. 438 /// appropriate default folder.
@@ -485,7 +485,7 @@ namespace OpenSim.Region.Environment.Scenes
485 itemCopy.AssetType = item.AssetType; 485 itemCopy.AssetType = item.AssetType;
486 itemCopy.InvType = item.InvType; 486 itemCopy.InvType = item.InvType;
487 itemCopy.Folder = recipientFolderId; 487 itemCopy.Folder = recipientFolderId;
488 488
489 if (Permissions.PropagatePermissions()) 489 if (Permissions.PropagatePermissions())
490 { 490 {
491 if (item.InvType == 6) 491 if (item.InvType == 6)
@@ -557,19 +557,19 @@ namespace OpenSim.Region.Environment.Scenes
557 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemId.ToString() + ", no root folder"); 557 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemId.ToString() + ", no root folder");
558 return null; 558 return null;
559 } 559 }
560 560
561 return null; 561 return null;
562 } 562 }
563 563
564 /// <summary> 564 /// <summary>
565 /// Give an entire inventory folder from one user to another. The entire contents (including all descendent 565 /// Give an entire inventory folder from one user to another. The entire contents (including all descendent
566 /// folders) is given. 566 /// folders) is given.
567 /// </summary> 567 /// </summary>
568 /// <param name="recipientId"></param> 568 /// <param name="recipientId"></param>
569 /// <param name="senderId">ID of the sender of the item</param> 569 /// <param name="senderId">ID of the sender of the item</param>
570 /// <param name="folderId"></param> 570 /// <param name="folderId"></param>
571 /// <param name="recipientParentFolderId"> 571 /// <param name="recipientParentFolderId">
572 /// The id of the receipient folder in which the send folder should be placed. If UUID.Zero then the 572 /// The id of the receipient folder in which the send folder should be placed. If UUID.Zero then the
573 /// recipient folder is the root folder 573 /// recipient folder is the root folder
574 /// </param> 574 /// </param>
575 /// <returns> 575 /// <returns>
@@ -588,24 +588,24 @@ namespace OpenSim.Region.Environment.Scenes
588 588
589 return null; 589 return null;
590 } 590 }
591 591
592 if (!senderUserInfo.HasReceivedInventory) 592 if (!senderUserInfo.HasReceivedInventory)
593 { 593 {
594 m_log.DebugFormat( 594 m_log.DebugFormat(
595 "[AGENT INVENTORY]: Could not give inventory folder - have not yet received inventory for {0}", 595 "[AGENT INVENTORY]: Could not give inventory folder - have not yet received inventory for {0}",
596 senderId); 596 senderId);
597 597
598 return null; 598 return null;
599 } 599 }
600 600
601 InventoryFolderImpl folder = senderUserInfo.RootFolder.FindFolder(folderId); 601 InventoryFolderImpl folder = senderUserInfo.RootFolder.FindFolder(folderId);
602 602
603 if (null == folder) 603 if (null == folder)
604 { 604 {
605 m_log.ErrorFormat( 605 m_log.ErrorFormat(
606 "[AGENT INVENTORY]: Could not find inventory folder {0} to give", folderId); 606 "[AGENT INVENTORY]: Could not find inventory folder {0} to give", folderId);
607 607
608 return null; 608 return null;
609 } 609 }
610 610
611 CachedUserInfo recipientUserInfo 611 CachedUserInfo recipientUserInfo
@@ -618,30 +618,30 @@ namespace OpenSim.Region.Environment.Scenes
618 618
619 return null; 619 return null;
620 } 620 }
621 621
622 if (recipientParentFolderId == UUID.Zero) 622 if (recipientParentFolderId == UUID.Zero)
623 recipientParentFolderId = recipientUserInfo.RootFolder.ID; 623 recipientParentFolderId = recipientUserInfo.RootFolder.ID;
624 624
625 UUID newFolderId = UUID.Random(); 625 UUID newFolderId = UUID.Random();
626 recipientUserInfo.CreateFolder(folder.Name, newFolderId, (ushort)folder.Type, recipientParentFolderId); 626 recipientUserInfo.CreateFolder(folder.Name, newFolderId, (ushort)folder.Type, recipientParentFolderId);
627 627
628 // XXX: Messy - we should really get this back in the CreateFolder call 628 // XXX: Messy - we should really get this back in the CreateFolder call
629 InventoryFolderImpl copiedFolder = recipientUserInfo.RootFolder.FindFolder(newFolderId); 629 InventoryFolderImpl copiedFolder = recipientUserInfo.RootFolder.FindFolder(newFolderId);
630 630
631 // Give all the subfolders 631 // Give all the subfolders
632 List<InventoryFolderImpl> subFolders = folder.RequestListOfFolderImpls(); 632 List<InventoryFolderImpl> subFolders = folder.RequestListOfFolderImpls();
633 foreach (InventoryFolderImpl childFolder in subFolders) 633 foreach (InventoryFolderImpl childFolder in subFolders)
634 { 634 {
635 GiveInventoryFolder(recipientId, senderId, childFolder.ID, copiedFolder.ID); 635 GiveInventoryFolder(recipientId, senderId, childFolder.ID, copiedFolder.ID);
636 } 636 }
637 637
638 // Give all the items 638 // Give all the items
639 List<InventoryItemBase> items = folder.RequestListOfItems(); 639 List<InventoryItemBase> items = folder.RequestListOfItems();
640 foreach (InventoryItemBase item in items) 640 foreach (InventoryItemBase item in items)
641 { 641 {
642 GiveInventoryItem(recipientId, senderId, item.ID, copiedFolder.ID); 642 GiveInventoryItem(recipientId, senderId, item.ID, copiedFolder.ID);
643 } 643 }
644 644
645 return copiedFolder; 645 return copiedFolder;
646 } 646 }
647 647
@@ -688,7 +688,7 @@ namespace OpenSim.Region.Environment.Scenes
688 { 688 {
689 if (newName != String.Empty) 689 if (newName != String.Empty)
690 { 690 {
691 asset.Name = newName; 691 asset.Metadata.Name = newName;
692 } 692 }
693 else 693 else
694 { 694 {
@@ -728,10 +728,10 @@ namespace OpenSim.Region.Environment.Scenes
728 private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data) 728 private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data)
729 { 729 {
730 AssetBase asset = new AssetBase(); 730 AssetBase asset = new AssetBase();
731 asset.Name = name; 731 asset.Metadata.Name = name;
732 asset.Description = description; 732 asset.Metadata.Description = description;
733 asset.Type = assetType; 733 asset.Metadata.Type = assetType;
734 asset.FullID = UUID.Random(); 734 asset.Metadata.FullID = UUID.Random();
735 asset.Data = (data == null) ? new byte[1] : data; 735 asset.Data = (data == null) ? new byte[1] : data;
736 736
737 return asset; 737 return asset;
@@ -831,11 +831,11 @@ namespace OpenSim.Region.Environment.Scenes
831 item.Owner = remoteClient.AgentId; 831 item.Owner = remoteClient.AgentId;
832 item.Creator = remoteClient.AgentId; 832 item.Creator = remoteClient.AgentId;
833 item.ID = UUID.Random(); 833 item.ID = UUID.Random();
834 item.AssetID = asset.FullID; 834 item.AssetID = asset.Metadata.FullID;
835 item.Description = asset.Description; 835 item.Description = asset.Metadata.Description;
836 item.Name = name; 836 item.Name = name;
837 item.Flags = flags; 837 item.Flags = flags;
838 item.AssetType = asset.Type; 838 item.AssetType = asset.Metadata.Type;
839 item.InvType = invType; 839 item.InvType = invType;
840 item.Folder = folderID; 840 item.Folder = folderID;
841 item.CurrentPermissions = currentMask; 841 item.CurrentPermissions = currentMask;
@@ -879,7 +879,7 @@ namespace OpenSim.Region.Environment.Scenes
879 879
880 if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId)) 880 if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId))
881 return; 881 return;
882 882
883 if (transactionID == UUID.Zero) 883 if (transactionID == UUID.Zero)
884 { 884 {
885 CachedUserInfo userInfo 885 CachedUserInfo userInfo
@@ -890,7 +890,7 @@ namespace OpenSim.Region.Environment.Scenes
890 ScenePresence presence; 890 ScenePresence presence;
891 TryGetAvatar(remoteClient.AgentId, out presence); 891 TryGetAvatar(remoteClient.AgentId, out presence);
892 byte[] data = null; 892 byte[] data = null;
893 893
894 if (invType == 3 && presence != null) // OpenMetaverse.asset.assettype.landmark = 3 - needs to be turned into an enum 894 if (invType == 3 && presence != null) // OpenMetaverse.asset.assettype.landmark = 3 - needs to be turned into an enum
895 { 895 {
896 Vector3 pos = presence.AbsolutePosition; 896 Vector3 pos = presence.AbsolutePosition;
@@ -905,7 +905,7 @@ namespace OpenSim.Region.Environment.Scenes
905 AssetBase asset = CreateAsset(name, description, assetType, data); 905 AssetBase asset = CreateAsset(name, description, assetType, data);
906 AssetCache.AddAsset(asset); 906 AssetCache.AddAsset(asset);
907 907
908 CreateNewInventoryItem(remoteClient, folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate); 908 CreateNewInventoryItem(remoteClient, folderID, asset.Metadata.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate);
909 } 909 }
910 else 910 else
911 { 911 {
@@ -1429,7 +1429,7 @@ namespace OpenSim.Region.Environment.Scenes
1429 } 1429 }
1430 } 1430 }
1431 else // Updating existing item with new perms etc 1431 else // Updating existing item with new perms etc
1432 { 1432 {
1433 IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>(); 1433 IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>();
1434 if (agentTransactions != null) 1434 if (agentTransactions != null)
1435 { 1435 {
@@ -1511,7 +1511,7 @@ namespace OpenSim.Region.Environment.Scenes
1511 } 1511 }
1512 } 1512 }
1513 else // script has been rezzed directly into a prim's inventory 1513 else // script has been rezzed directly into a prim's inventory
1514 { 1514 {
1515 SceneObjectPart part = GetSceneObjectPart(itemBase.Folder); 1515 SceneObjectPart part = GetSceneObjectPart(itemBase.Folder);
1516 if (part == null) 1516 if (part == null)
1517 return; 1517 return;
@@ -1521,10 +1521,10 @@ namespace OpenSim.Region.Environment.Scenes
1521 1521
1522 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) 1522 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
1523 return; 1523 return;
1524 1524
1525 if (!Permissions.CanCreateObjectInventory( 1525 if (!Permissions.CanCreateObjectInventory(
1526 itemBase.InvType, part.UUID, remoteClient.AgentId)) 1526 itemBase.InvType, part.UUID, remoteClient.AgentId))
1527 return; 1527 return;
1528 1528
1529 AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType, Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}")); 1529 AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType, Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"));
1530 AssetCache.AddAsset(asset); 1530 AssetCache.AddAsset(asset);
@@ -1550,7 +1550,7 @@ namespace OpenSim.Region.Environment.Scenes
1550 taskItem.Flags = itemBase.Flags; 1550 taskItem.Flags = itemBase.Flags;
1551 taskItem.PermsGranter = UUID.Zero; 1551 taskItem.PermsGranter = UUID.Zero;
1552 taskItem.PermsMask = 0; 1552 taskItem.PermsMask = 0;
1553 taskItem.AssetID = asset.FullID; 1553 taskItem.AssetID = asset.Metadata.FullID;
1554 1554
1555 part.Inventory.AddInventoryItem(taskItem, false); 1555 part.Inventory.AddInventoryItem(taskItem, false);
1556 part.GetProperties(remoteClient); 1556 part.GetProperties(remoteClient);
@@ -1737,7 +1737,7 @@ namespace OpenSim.Region.Environment.Scenes
1737 grp.UUID, 1737 grp.UUID,
1738 remoteClient.AgentId); 1738 remoteClient.AgentId);
1739 permissionToDelete = permissionToTake; 1739 permissionToDelete = permissionToTake;
1740 1740
1741 if (permissionToDelete) 1741 if (permissionToDelete)
1742 { 1742 {
1743 AddReturn(grp.OwnerID, grp.Name, grp.AbsolutePosition, "parcel owner return"); 1743 AddReturn(grp.OwnerID, grp.Name, grp.AbsolutePosition, "parcel owner return");
@@ -1794,8 +1794,8 @@ namespace OpenSim.Region.Environment.Scenes
1794 /// </summary> 1794 /// </summary>
1795 /// <param name="action"></param> 1795 /// <param name="action"></param>
1796 /// <param name="folderID"></param> 1796 /// <param name="folderID"></param>
1797 /// <param name="objectGroup"></param> 1797 /// <param name="objectGroup"></param>
1798 /// <param name="remoteClient"> </param> 1798 /// <param name="remoteClient"> </param>
1799 public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, 1799 public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID,
1800 SceneObjectGroup objectGroup, IClientAPI remoteClient) 1800 SceneObjectGroup objectGroup, IClientAPI remoteClient)
1801 { 1801 {
@@ -1807,7 +1807,7 @@ namespace OpenSim.Region.Environment.Scenes
1807 // 1807 //
1808 CachedUserInfo userInfo; 1808 CachedUserInfo userInfo;
1809 1809
1810 if (action == DeRezAction.Take || action == DeRezAction.TakeCopy || 1810 if (action == DeRezAction.Take || action == DeRezAction.TakeCopy ||
1811 action == DeRezAction.SaveToExistingUserInventoryItem) 1811 action == DeRezAction.SaveToExistingUserInventoryItem)
1812 { 1812 {
1813 // Take or take copy require a taker 1813 // Take or take copy require a taker
@@ -1850,25 +1850,25 @@ namespace OpenSim.Region.Environment.Scenes
1850 // 1850 //
1851 1851
1852 InventoryFolderBase folder = null; 1852 InventoryFolderBase folder = null;
1853 InventoryItemBase item = null; 1853 InventoryItemBase item = null;
1854 1854
1855 if (DeRezAction.SaveToExistingUserInventoryItem == action) 1855 if (DeRezAction.SaveToExistingUserInventoryItem == action)
1856 { 1856 {
1857 item = userInfo.RootFolder.FindItem( 1857 item = userInfo.RootFolder.FindItem(
1858 objectGroup.RootPart.FromUserInventoryItemID); 1858 objectGroup.RootPart.FromUserInventoryItemID);
1859 1859
1860 if (null == item) 1860 if (null == item)
1861 { 1861 {
1862 m_log.DebugFormat( 1862 m_log.DebugFormat(
1863 "[AGENT INVENTORY]: Object {0} {1} scheduled for save to inventory has already been deleted.", 1863 "[AGENT INVENTORY]: Object {0} {1} scheduled for save to inventory has already been deleted.",
1864 objectGroup.Name, objectGroup.UUID); 1864 objectGroup.Name, objectGroup.UUID);
1865 return UUID.Zero; 1865 return UUID.Zero;
1866 } 1866 }
1867 } 1867 }
1868 else 1868 else
1869 { 1869 {
1870 // Folder magic 1870 // Folder magic
1871 // 1871 //
1872 if (action == DeRezAction.Delete) 1872 if (action == DeRezAction.Delete)
1873 { 1873 {
1874 // Deleting someone else's item 1874 // Deleting someone else's item
@@ -1940,7 +1940,7 @@ namespace OpenSim.Region.Environment.Scenes
1940 item.InvType = (int)InventoryType.Object; 1940 item.InvType = (int)InventoryType.Object;
1941 item.Folder = folder.ID; 1941 item.Folder = folder.ID;
1942 item.Owner = userInfo.UserProfile.ID; 1942 item.Owner = userInfo.UserProfile.ID;
1943 1943
1944 } 1944 }
1945 1945
1946 AssetBase asset = CreateAsset( 1946 AssetBase asset = CreateAsset(
@@ -1949,16 +1949,16 @@ namespace OpenSim.Region.Environment.Scenes
1949 (sbyte)AssetType.Object, 1949 (sbyte)AssetType.Object,
1950 Utils.StringToBytes(sceneObjectXml)); 1950 Utils.StringToBytes(sceneObjectXml));
1951 AssetCache.AddAsset(asset); 1951 AssetCache.AddAsset(asset);
1952 assetID = asset.FullID; 1952 assetID = asset.Metadata.FullID;
1953 1953
1954 if (DeRezAction.SaveToExistingUserInventoryItem == action) 1954 if (DeRezAction.SaveToExistingUserInventoryItem == action)
1955 { 1955 {
1956 item.AssetID = asset.FullID; 1956 item.AssetID = asset.Metadata.FullID;
1957 userInfo.UpdateItem(item); 1957 userInfo.UpdateItem(item);
1958 } 1958 }
1959 else 1959 else
1960 { 1960 {
1961 item.AssetID = asset.FullID; 1961 item.AssetID = asset.Metadata.FullID;
1962 1962
1963 if (remoteClient != null && (remoteClient.AgentId != objectGroup.RootPart.OwnerID) && Permissions.PropagatePermissions()) 1963 if (remoteClient != null && (remoteClient.AgentId != objectGroup.RootPart.OwnerID) && Permissions.PropagatePermissions())
1964 { 1964 {
@@ -1991,12 +1991,12 @@ namespace OpenSim.Region.Environment.Scenes
1991 1991
1992 // TODO: add the new fields (Flags, Sale info, etc) 1992 // TODO: add the new fields (Flags, Sale info, etc)
1993 item.CreationDate = Util.UnixTimeSinceEpoch(); 1993 item.CreationDate = Util.UnixTimeSinceEpoch();
1994 item.Description = asset.Description; 1994 item.Description = asset.Metadata.Description;
1995 item.Name = asset.Name; 1995 item.Name = asset.Metadata.Name;
1996 item.AssetType = asset.Type; 1996 item.AssetType = asset.Metadata.Type;
1997 1997
1998 userInfo.AddItem(item); 1998 userInfo.AddItem(item);
1999 1999
2000 if (remoteClient != null && item.Owner == remoteClient.AgentId) 2000 if (remoteClient != null && item.Owner == remoteClient.AgentId)
2001 { 2001 {
2002 remoteClient.SendInventoryItemCreateUpdate(item); 2002 remoteClient.SendInventoryItemCreateUpdate(item);
@@ -2008,10 +2008,10 @@ namespace OpenSim.Region.Environment.Scenes
2008 { 2008 {
2009 notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item); 2009 notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item);
2010 } 2010 }
2011 } 2011 }
2012 } 2012 }
2013 } 2013 }
2014 2014
2015 return assetID; 2015 return assetID;
2016 } 2016 }
2017 2017
@@ -2025,11 +2025,11 @@ namespace OpenSim.Region.Environment.Scenes
2025 m_log.InfoFormat("[ATTACHMENT]: Save request for {0} which is unchanged", grp.UUID); 2025 m_log.InfoFormat("[ATTACHMENT]: Save request for {0} which is unchanged", grp.UUID);
2026 return; 2026 return;
2027 } 2027 }
2028 2028
2029 m_log.InfoFormat( 2029 m_log.InfoFormat(
2030 "[ATTACHMENT]: Updating asset for attachment {0}, attachpoint {1}", 2030 "[ATTACHMENT]: Updating asset for attachment {0}, attachpoint {1}",
2031 grp.UUID, grp.GetAttachmentPoint()); 2031 grp.UUID, grp.GetAttachmentPoint());
2032 2032
2033 string sceneObjectXml = objectGroup.ToXmlString(); 2033 string sceneObjectXml = objectGroup.ToXmlString();
2034 2034
2035 CachedUserInfo userInfo = 2035 CachedUserInfo userInfo =
@@ -2077,10 +2077,10 @@ namespace OpenSim.Region.Environment.Scenes
2077 Utils.StringToBytes(sceneObjectXml)); 2077 Utils.StringToBytes(sceneObjectXml));
2078 AssetCache.AddAsset(asset); 2078 AssetCache.AddAsset(asset);
2079 2079
2080 item.AssetID = asset.FullID; 2080 item.AssetID = asset.Metadata.FullID;
2081 item.Description = asset.Description; 2081 item.Description = asset.Metadata.Description;
2082 item.Name = asset.Name; 2082 item.Name = asset.Metadata.Name;
2083 item.AssetType = asset.Type; 2083 item.AssetType = asset.Metadata.Type;
2084 item.InvType = (int)InventoryType.Object; 2084 item.InvType = (int)InventoryType.Object;
2085 item.Folder = foundFolder; 2085 item.Folder = foundFolder;
2086 2086
@@ -2118,10 +2118,10 @@ namespace OpenSim.Region.Environment.Scenes
2118 item.Creator = grp.RootPart.CreatorID; 2118 item.Creator = grp.RootPart.CreatorID;
2119 item.Owner = remoteClient.AgentId; 2119 item.Owner = remoteClient.AgentId;
2120 item.ID = UUID.Random(); 2120 item.ID = UUID.Random();
2121 item.AssetID = asset.FullID; 2121 item.AssetID = asset.Metadata.FullID;
2122 item.Description = asset.Description; 2122 item.Description = asset.Metadata.Description;
2123 item.Name = asset.Name; 2123 item.Name = asset.Metadata.Name;
2124 item.AssetType = asset.Type; 2124 item.AssetType = asset.Metadata.Type;
2125 item.InvType = (int)InventoryType.Object; 2125 item.InvType = (int)InventoryType.Object;
2126 2126
2127 item.Folder = UUID.Zero; // Objects folder! 2127 item.Folder = UUID.Zero; // Objects folder!
@@ -2241,20 +2241,20 @@ namespace OpenSim.Region.Environment.Scenes
2241 if (rezAsset != null) 2241 if (rezAsset != null)
2242 { 2242 {
2243 UUID itemId = UUID.Zero; 2243 UUID itemId = UUID.Zero;
2244 2244
2245 // If we have permission to copy then link the rezzed object back to the user inventory 2245 // If we have permission to copy then link the rezzed object back to the user inventory
2246 // item that it came from. This allows us to enable 'save object to inventory' 2246 // item that it came from. This allows us to enable 'save object to inventory'
2247 if (!Permissions.BypassPermissions()) 2247 if (!Permissions.BypassPermissions())
2248 { 2248 {
2249 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == (uint)PermissionMask.Copy) 2249 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == (uint)PermissionMask.Copy)
2250 { 2250 {
2251 itemId = item.ID; 2251 itemId = item.ID;
2252 } 2252 }
2253 } 2253 }
2254 2254
2255 string xmlData = Utils.BytesToString(rezAsset.Data); 2255 string xmlData = Utils.BytesToString(rezAsset.Data);
2256 SceneObjectGroup group = new SceneObjectGroup(itemId, xmlData, true); 2256 SceneObjectGroup group = new SceneObjectGroup(itemId, xmlData, true);
2257 2257
2258 if (!Permissions.CanRezObject( 2258 if (!Permissions.CanRezObject(
2259 group.Children.Count, remoteClient.AgentId, pos) 2259 group.Children.Count, remoteClient.AgentId, pos)
2260 && !attachment) 2260 && !attachment)
@@ -2351,12 +2351,12 @@ namespace OpenSim.Region.Environment.Scenes
2351 group.ClearPartAttachmentData(); 2351 group.ClearPartAttachmentData();
2352 } 2352 }
2353 } 2353 }
2354 2354
2355 if (!attachment) 2355 if (!attachment)
2356 { 2356 {
2357 // Fire on_rez 2357 // Fire on_rez
2358 group.CreateScriptInstances(0, true, DefaultScriptEngine, 0); 2358 group.CreateScriptInstances(0, true, DefaultScriptEngine, 0);
2359 2359
2360 rootPart.ScheduleFullUpdate(); 2360 rootPart.ScheduleFullUpdate();
2361 } 2361 }
2362 2362
@@ -2500,7 +2500,7 @@ namespace OpenSim.Region.Environment.Scenes
2500 DeRezObject(null, grp.RootPart.LocalId, 2500 DeRezObject(null, grp.RootPart.LocalId,
2501 grp.RootPart.GroupID, DeRezAction.Return, UUID.Zero); 2501 grp.RootPart.GroupID, DeRezAction.Return, UUID.Zero);
2502 } 2502 }
2503 2503
2504 return true; 2504 return true;
2505 } 2505 }
2506 2506
@@ -2632,7 +2632,7 @@ namespace OpenSim.Region.Environment.Scenes
2632 } 2632 }
2633 2633
2634 } 2634 }
2635 2635
2636 m_sceneGraph.DetachSingleAttachmentToInv(itemID, remoteClient); 2636 m_sceneGraph.DetachSingleAttachmentToInv(itemID, remoteClient);
2637 } 2637 }
2638 2638
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 33dae66..32bd9aa 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -115,18 +115,18 @@ namespace OpenSim.Region.Environment.Scenes
115 115
116 /// <value> 116 /// <value>
117 /// All the region modules attached to this scene. 117 /// All the region modules attached to this scene.
118 /// </value> 118 /// </value>
119 public Dictionary<string, IRegionModule> Modules 119 public Dictionary<string, IRegionModule> Modules
120 { 120 {
121 get { return m_modules; } 121 get { return m_modules; }
122 } 122 }
123 protected Dictionary<string, IRegionModule> m_modules = new Dictionary<string, IRegionModule>(); 123 protected Dictionary<string, IRegionModule> m_modules = new Dictionary<string, IRegionModule>();
124 124
125 /// <value> 125 /// <value>
126 /// The module interfaces available from this scene. 126 /// The module interfaces available from this scene.
127 /// </value> 127 /// </value>
128 protected Dictionary<Type, List<object> > ModuleInterfaces = new Dictionary<Type, List<object> >(); 128 protected Dictionary<Type, List<object> > ModuleInterfaces = new Dictionary<Type, List<object> >();
129 129
130 protected Dictionary<string, object> ModuleAPIMethods = new Dictionary<string, object>(); 130 protected Dictionary<string, object> ModuleAPIMethods = new Dictionary<string, object>();
131 protected Dictionary<string, ICommander> m_moduleCommanders = new Dictionary<string, ICommander>(); 131 protected Dictionary<string, ICommander> m_moduleCommanders = new Dictionary<string, ICommander>();
132 132
@@ -143,7 +143,7 @@ namespace OpenSim.Region.Environment.Scenes
143 protected IInterregionCommsIn m_interregionCommsIn; 143 protected IInterregionCommsIn m_interregionCommsIn;
144 protected IDialogModule m_dialogModule; 144 protected IDialogModule m_dialogModule;
145 protected internal ICapabilitiesModule CapsModule; 145 protected internal ICapabilitiesModule CapsModule;
146 146
147 // Central Update Loop 147 // Central Update Loop
148 148
149 protected int m_fps = 10; 149 protected int m_fps = 10;
@@ -280,10 +280,10 @@ namespace OpenSim.Region.Environment.Scenes
280 } 280 }
281 281
282 public int objectCapacity = 45000; 282 public int objectCapacity = 45000;
283 283
284 /// <value> 284 /// <value>
285 /// Registered classes that are capable of creating entities. 285 /// Registered classes that are capable of creating entities.
286 /// </value> 286 /// </value>
287 protected Dictionary<PCode, IEntityCreator> m_entityCreators = new Dictionary<PCode, IEntityCreator>(); 287 protected Dictionary<PCode, IEntityCreator> m_entityCreators = new Dictionary<PCode, IEntityCreator>();
288 288
289 #endregion 289 #endregion
@@ -316,7 +316,7 @@ namespace OpenSim.Region.Environment.Scenes
316 316
317 m_eventManager = new EventManager(); 317 m_eventManager = new EventManager();
318 m_permissions = new ScenePermissions(this); 318 m_permissions = new ScenePermissions(this);
319 319
320 m_asyncSceneObjectDeleter = new AsyncSceneObjectGroupDeleter(this); 320 m_asyncSceneObjectDeleter = new AsyncSceneObjectGroupDeleter(this);
321 m_asyncSceneObjectDeleter.Enabled = true; 321 m_asyncSceneObjectDeleter.Enabled = true;
322 322
@@ -421,7 +421,7 @@ namespace OpenSim.Region.Environment.Scenes
421 protected virtual void RegisterDefaultSceneEvents() 421 protected virtual void RegisterDefaultSceneEvents()
422 { 422 {
423 IDialogModule dm = RequestModuleInterface<IDialogModule>(); 423 IDialogModule dm = RequestModuleInterface<IDialogModule>();
424 424
425 if (dm != null) 425 if (dm != null)
426 m_eventManager.OnPermissionError += dm.SendAlertToUser; 426 m_eventManager.OnPermissionError += dm.SendAlertToUser;
427 } 427 }
@@ -564,7 +564,7 @@ namespace OpenSim.Region.Environment.Scenes
564 m_incrementsof15seconds = (int)seconds / 15; 564 m_incrementsof15seconds = (int)seconds / 15;
565 m_RestartTimerCounter = 0; 565 m_RestartTimerCounter = 0;
566 m_restartTimer.AutoReset = true; 566 m_restartTimer.AutoReset = true;
567 m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed); 567 m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed);
568 m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes"); 568 m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes");
569 m_restartTimer.Start(); 569 m_restartTimer.Start();
570 m_dialogModule.SendNotificationToUsersInRegion( 570 m_dialogModule.SendNotificationToUsersInRegion(
@@ -583,8 +583,8 @@ namespace OpenSim.Region.Environment.Scenes
583 { 583 {
584 if (m_RestartTimerCounter == 4 || m_RestartTimerCounter == 6 || m_RestartTimerCounter == 7) 584 if (m_RestartTimerCounter == 4 || m_RestartTimerCounter == 6 || m_RestartTimerCounter == 7)
585 m_dialogModule.SendNotificationToUsersInRegion( 585 m_dialogModule.SendNotificationToUsersInRegion(
586 UUID.Random(), 586 UUID.Random(),
587 String.Empty, 587 String.Empty,
588 RegionInfo.RegionName + ": Restarting in " + ((8 - m_RestartTimerCounter) * 15) + " seconds"); 588 RegionInfo.RegionName + ": Restarting in " + ((8 - m_RestartTimerCounter) * 15) + " seconds");
589 } 589 }
590 else 590 else
@@ -717,7 +717,7 @@ namespace OpenSim.Region.Environment.Scenes
717 717
718 // Stop all client threads. 718 // Stop all client threads.
719 ForEachScenePresence(delegate(ScenePresence avatar) { avatar.ControllingClient.Close(true); }); 719 ForEachScenePresence(delegate(ScenePresence avatar) { avatar.ControllingClient.Close(true); });
720 720
721 // Stop updating the scene objects and agents. 721 // Stop updating the scene objects and agents.
722 //m_heartbeatTimer.Close(); 722 //m_heartbeatTimer.Close();
723 shuttingdown = true; 723 shuttingdown = true;
@@ -733,7 +733,7 @@ namespace OpenSim.Region.Environment.Scenes
733 } 733 }
734 734
735 m_sceneGraph.Close(); 735 m_sceneGraph.Close();
736 736
737 // De-register with region communications (events cleanup) 737 // De-register with region communications (events cleanup)
738 UnRegisterRegionWithComms(); 738 UnRegisterRegionWithComms();
739 739
@@ -1400,7 +1400,7 @@ namespace OpenSim.Region.Environment.Scenes
1400 //tc = System.Environment.TickCount - tc; 1400 //tc = System.Environment.TickCount - tc;
1401 //m_log.Info("[MAPTILE]: Completed One row in " + tc + " ms"); 1401 //m_log.Info("[MAPTILE]: Completed One row in " + tc + " ms");
1402 } 1402 }
1403 1403
1404 m_log.Info("[MAPTILE]: Generating Maptile Step 1: Done in " + (System.Environment.TickCount - tc) + " ms"); 1404 m_log.Info("[MAPTILE]: Generating Maptile Step 1: Done in " + (System.Environment.TickCount - tc) + " ms");
1405 1405
1406 bool drawPrimVolume = true; 1406 bool drawPrimVolume = true;
@@ -1644,13 +1644,13 @@ namespace OpenSim.Region.Environment.Scenes
1644 m_regInfo.RegionSettings.TerrainImageID = TerrainImageUUID; 1644 m_regInfo.RegionSettings.TerrainImageID = TerrainImageUUID;
1645 1645
1646 AssetBase asset = new AssetBase(); 1646 AssetBase asset = new AssetBase();
1647 asset.FullID = m_regInfo.RegionSettings.TerrainImageID; 1647 asset.Metadata.FullID = m_regInfo.RegionSettings.TerrainImageID;
1648 asset.Data = data; 1648 asset.Data = data;
1649 asset.Name = "terrainImage_" + m_regInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString(); 1649 asset.Metadata.Name = "terrainImage_" + m_regInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString();
1650 asset.Description = RegionInfo.RegionName; 1650 asset.Metadata.Description = RegionInfo.RegionName;
1651 1651
1652 asset.Type = 0; 1652 asset.Metadata.Type = 0;
1653 asset.Temporary = temporary; 1653 asset.Metadata.Temporary = temporary;
1654 AssetCache.AddAsset(asset); 1654 AssetCache.AddAsset(asset);
1655 } 1655 }
1656 1656
@@ -1699,7 +1699,7 @@ namespace OpenSim.Region.Environment.Scenes
1699 m_log.ErrorFormat("[SCENE] Found a SceneObjectGroup with m_rootPart == null and {0} children", 1699 m_log.ErrorFormat("[SCENE] Found a SceneObjectGroup with m_rootPart == null and {0} children",
1700 group.Children == null ? 0 : group.Children.Count); 1700 group.Children == null ? 0 : group.Children.Count);
1701 } 1701 }
1702 1702
1703 AddRestoredSceneObject(group, true, true); 1703 AddRestoredSceneObject(group, true, true);
1704 SceneObjectPart rootPart = group.GetChildPart(group.UUID); 1704 SceneObjectPart rootPart = group.GetChildPart(group.UUID);
1705 rootPart.ObjectFlags &= ~(uint)PrimFlags.Scripted; 1705 rootPart.ObjectFlags &= ~(uint)PrimFlags.Scripted;
@@ -1814,7 +1814,7 @@ namespace OpenSim.Region.Environment.Scenes
1814 { 1814 {
1815 //m_log.DebugFormat( 1815 //m_log.DebugFormat(
1816 // "[SCENE]: Scene.AddNewPrim() pcode {0} called for {1} in {2}", shape.PCode, ownerID, RegionInfo.RegionName); 1816 // "[SCENE]: Scene.AddNewPrim() pcode {0} called for {1} in {2}", shape.PCode, ownerID, RegionInfo.RegionName);
1817 1817
1818 // If an entity creator has been registered for this prim type then use that 1818 // If an entity creator has been registered for this prim type then use that
1819 if (m_entityCreators.ContainsKey((PCode)shape.PCode)) 1819 if (m_entityCreators.ContainsKey((PCode)shape.PCode))
1820 return m_entityCreators[(PCode)shape.PCode].CreateEntity(ownerID, groupID, pos, rot, shape); 1820 return m_entityCreators[(PCode)shape.PCode].CreateEntity(ownerID, groupID, pos, rot, shape);
@@ -2094,7 +2094,7 @@ namespace OpenSim.Region.Environment.Scenes
2094 /// <returns></returns> 2094 /// <returns></returns>
2095 public bool IncomingInterRegionPrimGroup(UUID primID, string objXMLData, int XMLMethod) 2095 public bool IncomingInterRegionPrimGroup(UUID primID, string objXMLData, int XMLMethod)
2096 { 2096 {
2097 2097
2098 if (XMLMethod == 0) 2098 if (XMLMethod == 0)
2099 { 2099 {
2100 m_log.DebugFormat("[INTERREGION]: A new prim {0} arrived from a neighbor", primID); 2100 m_log.DebugFormat("[INTERREGION]: A new prim {0} arrived from a neighbor", primID);
@@ -2308,7 +2308,7 @@ namespace OpenSim.Region.Environment.Scenes
2308 2308
2309 CreateAndAddScenePresence(client); 2309 CreateAndAddScenePresence(client);
2310 } 2310 }
2311 2311
2312 m_LastLogin = System.Environment.TickCount; 2312 m_LastLogin = System.Environment.TickCount;
2313 EventManager.TriggerOnNewClient(client); 2313 EventManager.TriggerOnNewClient(client);
2314 } 2314 }
@@ -2390,7 +2390,7 @@ namespace OpenSim.Region.Environment.Scenes
2390 client.OnUnackedTerrain += TerrainUnAcked; 2390 client.OnUnackedTerrain += TerrainUnAcked;
2391 2391
2392 client.OnObjectOwner += ObjectOwner; 2392 client.OnObjectOwner += ObjectOwner;
2393 2393
2394 if (StatsReporter != null) 2394 if (StatsReporter != null)
2395 client.OnNetworkStatsUpdate += StatsReporter.AddPacketsFromClientStats; 2395 client.OnNetworkStatsUpdate += StatsReporter.AddPacketsFromClientStats;
2396 2396
@@ -2561,7 +2561,7 @@ namespace OpenSim.Region.Environment.Scenes
2561 m_log.ErrorFormat("[APPEARANCE]: Problem fetching appearance for avatar {0}, {1}", 2561 m_log.ErrorFormat("[APPEARANCE]: Problem fetching appearance for avatar {0}, {1}",
2562 client.Name, e); 2562 client.Name, e);
2563 } 2563 }
2564 2564
2565 m_log.Warn("[APPEARANCE]: Appearance not found, returning default"); 2565 m_log.Warn("[APPEARANCE]: Appearance not found, returning default");
2566 } 2566 }
2567 2567
@@ -2770,21 +2770,21 @@ namespace OpenSim.Region.Environment.Scenes
2770 2770
2771 ScenePresence sp = m_sceneGraph.GetScenePresence(agent.AgentID); 2771 ScenePresence sp = m_sceneGraph.GetScenePresence(agent.AgentID);
2772 if (sp != null) 2772 if (sp != null)
2773 { 2773 {
2774 m_log.DebugFormat( 2774 m_log.DebugFormat(
2775 "[SCENE]: Adjusting known seeds for existing agent {0} in {1}", 2775 "[SCENE]: Adjusting known seeds for existing agent {0} in {1}",
2776 agent.AgentID, RegionInfo.RegionName); 2776 agent.AgentID, RegionInfo.RegionName);
2777 2777
2778 sp.AdjustKnownSeeds(); 2778 sp.AdjustKnownSeeds();
2779 2779
2780 return; 2780 return;
2781 } 2781 }
2782 2782
2783 // Don't disable this log message - it's too helpful 2783 // Don't disable this log message - it's too helpful
2784 m_log.DebugFormat( 2784 m_log.DebugFormat(
2785 "[CONNECTION BEGIN]: Region {0} told of incoming client {1} {2} {3} (circuit code {4})", 2785 "[CONNECTION BEGIN]: Region {0} told of incoming client {1} {2} {3} (circuit code {4})",
2786 RegionInfo.RegionName, agent.firstname, agent.lastname, agent.AgentID, agent.circuitcode); 2786 RegionInfo.RegionName, agent.firstname, agent.lastname, agent.AgentID, agent.circuitcode);
2787 2787
2788 if (m_regInfo.EstateSettings.IsBanned(agent.AgentID)) 2788 if (m_regInfo.EstateSettings.IsBanned(agent.AgentID))
2789 { 2789 {
2790 m_log.WarnFormat( 2790 m_log.WarnFormat(
@@ -2808,10 +2808,10 @@ namespace OpenSim.Region.Environment.Scenes
2808 } 2808 }
2809 2809
2810 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); 2810 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent);
2811 2811
2812 // rewrite session_id 2812 // rewrite session_id
2813 CachedUserInfo userinfo = CommsManager.UserProfileCacheService.GetUserDetails(agent.AgentID); 2813 CachedUserInfo userinfo = CommsManager.UserProfileCacheService.GetUserDetails(agent.AgentID);
2814 2814
2815 if (userinfo != null) 2815 if (userinfo != null)
2816 { 2816 {
2817 userinfo.SessionID = agent.SessionID; 2817 userinfo.SessionID = agent.SessionID;
@@ -2873,12 +2873,12 @@ namespace OpenSim.Region.Environment.Scenes
2873 public virtual void AgentCrossing(UUID agentID, Vector3 position, bool isFlying) 2873 public virtual void AgentCrossing(UUID agentID, Vector3 position, bool isFlying)
2874 { 2874 {
2875 ScenePresence presence; 2875 ScenePresence presence;
2876 2876
2877 lock (m_scenePresences) 2877 lock (m_scenePresences)
2878 { 2878 {
2879 m_scenePresences.TryGetValue(agentID, out presence); 2879 m_scenePresences.TryGetValue(agentID, out presence);
2880 } 2880 }
2881 2881
2882 if (presence != null) 2882 if (presence != null)
2883 { 2883 {
2884 try 2884 try
@@ -2902,14 +2902,14 @@ namespace OpenSim.Region.Environment.Scenes
2902 { 2902 {
2903// m_log.DebugFormat( 2903// m_log.DebugFormat(
2904// "[SCENE]: Incoming child agent update for {0} in {1}", cAgentData.AgentID, RegionInfo.RegionName); 2904// "[SCENE]: Incoming child agent update for {0} in {1}", cAgentData.AgentID, RegionInfo.RegionName);
2905 2905
2906 ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); 2906 ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID);
2907 if (childAgentUpdate != null) 2907 if (childAgentUpdate != null)
2908 { 2908 {
2909 childAgentUpdate.ChildAgentDataUpdate(cAgentData); 2909 childAgentUpdate.ChildAgentDataUpdate(cAgentData);
2910 return true; 2910 return true;
2911 } 2911 }
2912 2912
2913 return false; 2913 return false;
2914 } 2914 }
2915 2915
@@ -2932,10 +2932,10 @@ namespace OpenSim.Region.Environment.Scenes
2932 // Not Implemented: 2932 // Not Implemented:
2933 //TODO: Do we need to pass the message on to one of our neighbors? 2933 //TODO: Do we need to pass the message on to one of our neighbors?
2934 } 2934 }
2935 2935
2936 return true; 2936 return true;
2937 } 2937 }
2938 2938
2939 return false; 2939 return false;
2940 } 2940 }
2941 2941
@@ -2957,7 +2957,7 @@ namespace OpenSim.Region.Environment.Scenes
2957 public bool IncomingCloseAgent(UUID agentID) 2957 public bool IncomingCloseAgent(UUID agentID)
2958 { 2958 {
2959 //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID); 2959 //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID);
2960 2960
2961 ScenePresence presence = m_sceneGraph.GetScenePresence(agentID); 2961 ScenePresence presence = m_sceneGraph.GetScenePresence(agentID);
2962 if (presence != null) 2962 if (presence != null)
2963 { 2963 {
@@ -2972,7 +2972,7 @@ namespace OpenSim.Region.Environment.Scenes
2972 } 2972 }
2973 2973
2974 // Don't do this to root agents on logout, it's not nice for the viewer 2974 // Don't do this to root agents on logout, it's not nice for the viewer
2975 if (presence.IsChildAgent) 2975 if (presence.IsChildAgent)
2976 { 2976 {
2977 // Tell a single agent to disconnect from the region. 2977 // Tell a single agent to disconnect from the region.
2978 IEventQueue eq = RequestModuleInterface<IEventQueue>(); 2978 IEventQueue eq = RequestModuleInterface<IEventQueue>();
@@ -2984,11 +2984,11 @@ namespace OpenSim.Region.Environment.Scenes
2984 else 2984 else
2985 presence.ControllingClient.SendShutdownConnectionNotice(); 2985 presence.ControllingClient.SendShutdownConnectionNotice();
2986 } 2986 }
2987 2987
2988 presence.ControllingClient.Close(true); 2988 presence.ControllingClient.Close(true);
2989 return true; 2989 return true;
2990 } 2990 }
2991 2991
2992 // Agent not here 2992 // Agent not here
2993 return false; 2993 return false;
2994 } 2994 }
@@ -3059,7 +3059,7 @@ namespace OpenSim.Region.Environment.Scenes
3059 remoteClient.SendTeleportFailed("The region '" + regionName + "' could not be found."); 3059 remoteClient.SendTeleportFailed("The region '" + regionName + "' could not be found.");
3060 return; 3060 return;
3061 } 3061 }
3062 3062
3063 RequestTeleportLocation(remoteClient, regionInfo.RegionHandle, position, lookat, teleportFlags); 3063 RequestTeleportLocation(remoteClient, regionInfo.RegionHandle, position, lookat, teleportFlags);
3064 } 3064 }
3065 3065
@@ -3080,7 +3080,7 @@ namespace OpenSim.Region.Environment.Scenes
3080 if (m_scenePresences.ContainsKey(remoteClient.AgentId)) 3080 if (m_scenePresences.ContainsKey(remoteClient.AgentId))
3081 sp = m_scenePresences[remoteClient.AgentId]; 3081 sp = m_scenePresences[remoteClient.AgentId];
3082 } 3082 }
3083 3083
3084 if (sp != null) 3084 if (sp != null)
3085 { 3085 {
3086 m_sceneGridService.RequestTeleportToLocation(sp, regionHandle, 3086 m_sceneGridService.RequestTeleportToLocation(sp, regionHandle,
@@ -3211,7 +3211,7 @@ namespace OpenSim.Region.Environment.Scenes
3211 return; 3211 return;
3212 3212
3213 l.Add(mod); 3213 l.Add(mod);
3214 3214
3215 if (mod is IEntityCreator) 3215 if (mod is IEntityCreator)
3216 { 3216 {
3217 IEntityCreator entityCreator = (IEntityCreator)mod; 3217 IEntityCreator entityCreator = (IEntityCreator)mod;
@@ -3220,7 +3220,7 @@ namespace OpenSim.Region.Environment.Scenes
3220 m_entityCreators[pcode] = entityCreator; 3220 m_entityCreators[pcode] = entityCreator;
3221 } 3221 }
3222 } 3222 }
3223 3223
3224 ModuleInterfaces[typeof(M)] = l; 3224 ModuleInterfaces[typeof(M)] = l;
3225 } 3225 }
3226 3226
@@ -3243,7 +3243,7 @@ namespace OpenSim.Region.Environment.Scenes
3243 /// <summary> 3243 /// <summary>
3244 /// For the given interface, retrieve an array of region modules that implement it. 3244 /// For the given interface, retrieve an array of region modules that implement it.
3245 /// </summary> 3245 /// </summary>
3246 /// <returns>an empty array if there are no registered modules implementing that interface</returns> 3246 /// <returns>an empty array if there are no registered modules implementing that interface</returns>
3247 public override T[] RequestModuleInterfaces<T>() 3247 public override T[] RequestModuleInterfaces<T>()
3248 { 3248 {
3249 if (ModuleInterfaces.ContainsKey(typeof(T))) 3249 if (ModuleInterfaces.ContainsKey(typeof(T)))
@@ -3383,7 +3383,7 @@ namespace OpenSim.Region.Environment.Scenes
3383 else 3383 else
3384 { 3384 {
3385 m_dialogModule.SendAlertToUser(agentID, "Request for god powers denied"); 3385 m_dialogModule.SendAlertToUser(agentID, "Request for god powers denied");
3386 } 3386 }
3387 } 3387 }
3388 } 3388 }
3389 3389
@@ -3855,14 +3855,14 @@ namespace OpenSim.Region.Environment.Scenes
3855 public override bool PresenceChildStatus(UUID avatarID) 3855 public override bool PresenceChildStatus(UUID avatarID)
3856 { 3856 {
3857 ScenePresence cp = GetScenePresence(avatarID); 3857 ScenePresence cp = GetScenePresence(avatarID);
3858 3858
3859 // FIXME: This is really crap - some logout code is relying on a NullReferenceException to halt its processing 3859 // FIXME: This is really crap - some logout code is relying on a NullReferenceException to halt its processing
3860 // This needs to be fixed properly by cleaning up the logout code. 3860 // This needs to be fixed properly by cleaning up the logout code.
3861 //if (cp != null) 3861 //if (cp != null)
3862 // return cp.IsChildAgent; 3862 // return cp.IsChildAgent;
3863 3863
3864 //return false; 3864 //return false;
3865 3865
3866 return cp.IsChildAgent; 3866 return cp.IsChildAgent;
3867 } 3867 }
3868 3868
@@ -4140,10 +4140,10 @@ namespace OpenSim.Region.Environment.Scenes
4140 4140
4141 item.ID = UUID.Random(); 4141 item.ID = UUID.Random();
4142 item.Owner = remoteClient.AgentId; 4142 item.Owner = remoteClient.AgentId;
4143 item.AssetID = asset.FullID; 4143 item.AssetID = asset.Metadata.FullID;
4144 item.Description = asset.Description; 4144 item.Description = asset.Metadata.Description;
4145 item.Name = asset.Name; 4145 item.Name = asset.Metadata.Name;
4146 item.AssetType = asset.Type; 4146 item.AssetType = asset.Metadata.Type;
4147 item.InvType = (int)InventoryType.Object; 4147 item.InvType = (int)InventoryType.Object;
4148 item.Folder = categoryID; 4148 item.Folder = categoryID;
4149 4149
@@ -4194,7 +4194,7 @@ namespace OpenSim.Region.Environment.Scenes
4194 if (!okToSell) 4194 if (!okToSell)
4195 { 4195 {
4196 m_dialogModule.SendAlertToUser( 4196 m_dialogModule.SendAlertToUser(
4197 remoteClient, "This item's inventory doesn't appear to be for sale"); 4197 remoteClient, "This item's inventory doesn't appear to be for sale");
4198 return false; 4198 return false;
4199 } 4199 }
4200 4200
@@ -4252,7 +4252,7 @@ namespace OpenSim.Region.Environment.Scenes
4252 4252
4253 // This routine is normally called from within a lock (OdeLock) from within the OdePhysicsScene 4253 // This routine is normally called from within a lock (OdeLock) from within the OdePhysicsScene
4254 // WARNING: be careful of deadlocks here if you manipulate the scene. Remember you are being called 4254 // WARNING: be careful of deadlocks here if you manipulate the scene. Remember you are being called
4255 // from within the OdePhysicsScene. 4255 // from within the OdePhysicsScene.
4256 4256
4257 protected internal void jointMoved(PhysicsJoint joint) 4257 protected internal void jointMoved(PhysicsJoint joint)
4258 { 4258 {
@@ -4348,7 +4348,7 @@ namespace OpenSim.Region.Environment.Scenes
4348 // FIXME: this causes a sequential lookup of all objects in the scene; use a dictionary 4348 // FIXME: this causes a sequential lookup of all objects in the scene; use a dictionary
4349 if (joint != null) 4349 if (joint != null)
4350 { 4350 {
4351 if (joint.ErrorMessageCount > PhysicsJoint.maxErrorMessages) 4351 if (joint.ErrorMessageCount > PhysicsJoint.maxErrorMessages)
4352 return; 4352 return;
4353 4353
4354 SceneObjectPart jointProxyObject = GetSceneObjectPart(joint.ObjectNameInScene); 4354 SceneObjectPart jointProxyObject = GetSceneObjectPart(joint.ObjectNameInScene);