aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2011-04-21 16:28:29 +0100
committerMelanie2011-04-21 16:28:29 +0100
commit09b6d717bf7c43b3dc60aba27c1ac085da26e36d (patch)
tree9346746bd392b679a35fbc969c1e46d9c9862745 /OpenSim
parentMerge branch 'master' into careminster-presence-refactor (diff)
parentfix meshing failure on sculpt maps smaller than 64x64 (diff)
downloadopensim-SC_OLD-09b6d717bf7c43b3dc60aba27c1ac085da26e36d.zip
opensim-SC_OLD-09b6d717bf7c43b3dc60aba27c1ac085da26e36d.tar.gz
opensim-SC_OLD-09b6d717bf7c43b3dc60aba27c1ac085da26e36d.tar.bz2
opensim-SC_OLD-09b6d717bf7c43b3dc60aba27c1ac085da26e36d.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs7
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs7
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs27
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs29
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs562
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs9
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs18
-rw-r--r--OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs18
-rw-r--r--OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs3
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs99
-rw-r--r--OpenSim/Region/Physics/Meshing/SculptMap.cs13
-rw-r--r--OpenSim/Services/FreeswitchService/FreeswitchService.cs29
-rw-r--r--OpenSim/Services/FreeswitchService/FreeswitchServiceBase.cs2
16 files changed, 487 insertions, 344 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index ccec9b7..ba89e21 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -430,7 +430,7 @@ namespace OpenSim.Framework.Servers.HttpServer
430 string path = request.RawUrl; 430 string path = request.RawUrl;
431 string handlerKey = GetHandlerKey(request.HttpMethod, path); 431 string handlerKey = GetHandlerKey(request.HttpMethod, path);
432 432
433 //m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path); 433// m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path);
434 434
435 if (TryGetStreamHandler(handlerKey, out requestHandler)) 435 if (TryGetStreamHandler(handlerKey, out requestHandler))
436 { 436 {
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs
index d2278bc..deec444 100644
--- a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs
@@ -66,12 +66,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
66 66
67 public void Initialise(IConfigSource source) 67 public void Initialise(IConfigSource source)
68 { 68 {
69 IConfig startupConfig = source.Configs["Startup"]; 69 IConfig meshConfig = source.Configs["Mesh"];
70 if (startupConfig == null) 70 if (meshConfig == null)
71 return; 71 return;
72 72
73 if (!startupConfig.GetBoolean("ColladaMesh",true)) 73 m_enabled = meshConfig.GetBoolean("ColladaMesh", true);
74 m_enabled = false;
75 } 74 }
76 75
77 public void AddRegion(Scene pScene) 76 public void AddRegion(Scene pScene)
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs
index fb07cc9..d651cb2 100644
--- a/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs
@@ -68,12 +68,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
68 68
69 public void Initialise(IConfigSource source) 69 public void Initialise(IConfigSource source)
70 { 70 {
71 IConfig startupConfig = source.Configs["Startup"]; 71 IConfig meshConfig = source.Configs["Mesh"];
72 if (startupConfig == null) 72 if (meshConfig == null)
73 return; 73 return;
74 74
75 if (!startupConfig.GetBoolean("ColladaMesh",true)) 75 m_enabled = meshConfig.GetBoolean("ColladaMesh", true);
76 m_enabled = false;
77 } 76 }
78 77
79 public void AddRegion(Scene pScene) 78 public void AddRegion(Scene pScene)
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index 2fff533..a19bbfd 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -77,7 +77,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
77 /// </value> 77 /// </value>
78 private Stream m_loadStream; 78 private Stream m_loadStream;
79 79
80 protected bool m_controlFileLoaded; 80 /// <summary>
81 /// Has the control file been loaded for this archive?
82 /// </summary>
83 public bool ControlFileLoaded { get; private set; }
84
85 /// <summary>
86 /// Do we want to enforce the check. IAR versions before 0.2 and 1.1 do not guarantee this order, so we can't
87 /// enforce.
88 /// </summary>
89 public bool EnforceControlFileCheck { get; private set; }
90
81 protected bool m_assetsLoaded; 91 protected bool m_assetsLoaded;
82 protected bool m_inventoryNodesLoaded; 92 protected bool m_inventoryNodesLoaded;
83 93
@@ -126,6 +136,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
126 m_userInfo = userInfo; 136 m_userInfo = userInfo;
127 m_invPath = invPath; 137 m_invPath = invPath;
128 m_loadStream = loadStream; 138 m_loadStream = loadStream;
139
140 // FIXME: Do not perform this check since older versions of OpenSim do save the control file after other things
141 // (I thought they weren't). We will need to bump the version number and perform this check on all
142 // subsequent IAR versions only
143 ControlFileLoaded = true;
129 } 144 }
130 145
131 /// <summary> 146 /// <summary>
@@ -517,7 +532,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
517 /// </summary> 532 /// </summary>
518 /// <param name="path"></param> 533 /// <param name="path"></param>
519 /// <param name="data"></param> 534 /// <param name="data"></param>
520 protected void LoadControlFile(string path, byte[] data) 535 public void LoadControlFile(string path, byte[] data)
521 { 536 {
522 XDocument doc = XDocument.Parse(Encoding.ASCII.GetString(data)); 537 XDocument doc = XDocument.Parse(Encoding.ASCII.GetString(data));
523 XElement archiveElement = doc.Element("archive"); 538 XElement archiveElement = doc.Element("archive");
@@ -533,7 +548,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
533 majorVersion, MAX_MAJOR_VERSION)); 548 majorVersion, MAX_MAJOR_VERSION));
534 } 549 }
535 550
536 m_controlFileLoaded = true; 551 ControlFileLoaded = true;
537 m_log.InfoFormat("[INVENTORY ARCHIVER]: Loading IAR with version {0}", version); 552 m_log.InfoFormat("[INVENTORY ARCHIVER]: Loading IAR with version {0}", version);
538 } 553 }
539 554
@@ -545,7 +560,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
545 /// <param name="data"></param> 560 /// <param name="data"></param>
546 protected void LoadInventoryFile(string path, TarArchiveReader.TarEntryType entryType, byte[] data) 561 protected void LoadInventoryFile(string path, TarArchiveReader.TarEntryType entryType, byte[] data)
547 { 562 {
548 if (!m_controlFileLoaded) 563 if (!ControlFileLoaded)
549 throw new Exception( 564 throw new Exception(
550 string.Format( 565 string.Format(
551 "The IAR you are trying to load does not list {0} before {1}. Aborting load", 566 "The IAR you are trying to load does not list {0} before {1}. Aborting load",
@@ -592,7 +607,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
592 /// <param name="data"></param> 607 /// <param name="data"></param>
593 protected void LoadAssetFile(string path, byte[] data) 608 protected void LoadAssetFile(string path, byte[] data)
594 { 609 {
595 if (!m_controlFileLoaded) 610 if (!ControlFileLoaded)
596 throw new Exception( 611 throw new Exception(
597 string.Format( 612 string.Format(
598 "The IAR you are trying to load does not list {0} before {1}. Aborting load", 613 "The IAR you are trying to load does not list {0} before {1}. Aborting load",
@@ -617,4 +632,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
617 m_assetsLoaded = true; 632 m_assetsLoaded = true;
618 } 633 }
619 } 634 }
620} \ No newline at end of file 635}
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
index 5e5f6c0..dd16bfe 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
@@ -388,12 +388,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
388 if (options.ContainsKey("profile")) 388 if (options.ContainsKey("profile"))
389 { 389 {
390 majorVersion = 1; 390 majorVersion = 1;
391 minorVersion = 0; 391 minorVersion = 1;
392 } 392 }
393 else 393 else
394 { 394 {
395 majorVersion = 0; 395 majorVersion = 0;
396 minorVersion = 1; 396 minorVersion = 2;
397 } 397 }
398 398
399 m_log.InfoFormat("[INVENTORY ARCHIVER]: Creating version {0}.{1} IAR", majorVersion, minorVersion); 399 m_log.InfoFormat("[INVENTORY ARCHIVER]: Creating version {0}.{1} IAR", majorVersion, minorVersion);
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index d03f6da..52232a0 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -94,7 +94,34 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
94 94
95 Assert.That(coaObjects[1].UUID, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000140"))); 95 Assert.That(coaObjects[1].UUID, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000140")));
96 Assert.That(coaObjects[1].AbsolutePosition, Is.EqualTo(new Vector3(25, 50, 75))); 96 Assert.That(coaObjects[1].AbsolutePosition, Is.EqualTo(new Vector3(25, 50, 75)));
97 } 97 }
98
99 /// <summary>
100 /// Test that the IAR has the required files in the right order.
101 /// </summary>
102 /// <remarks>
103 /// At the moment, the only thing that matters is that the control file is the very first one.
104 /// </remarks>
105 [Test]
106 public void TestOrder()
107 {
108 TestHelper.InMethod();
109// log4net.Config.XmlConfigurator.Configure();
110
111 MemoryStream archiveReadStream = new MemoryStream(m_iarStreamBytes);
112 TarArchiveReader tar = new TarArchiveReader(archiveReadStream);
113 string filePath;
114 TarArchiveReader.TarEntryType tarEntryType;
115
116 byte[] data = tar.ReadEntry(out filePath, out tarEntryType);
117 Assert.That(filePath, Is.EqualTo(ArchiveConstants.CONTROL_FILE_PATH));
118
119 InventoryArchiveReadRequest iarr
120 = new InventoryArchiveReadRequest(null, null, null, (Stream)null, false);
121 iarr.LoadControlFile(filePath, data);
122
123 Assert.That(iarr.ControlFileLoaded, Is.True);
124 }
98 125
99 /// <summary> 126 /// <summary>
100 /// Test saving a single inventory item to a V0.1 OpenSim Inventory Archive 127 /// Test saving a single inventory item to a V0.1 OpenSim Inventory Archive
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 6d40e12..a165bbd 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -213,19 +213,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
213 213
214 return UUID.Zero; 214 return UUID.Zero;
215 } 215 }
216 216
217 /// <summary> 217 public virtual UUID CopyToInventory(DeRezAction action, UUID folderID,
218 /// Delete a scene object from a scene and place in the given avatar's inventory.
219 /// Returns the UUID of the newly created asset.
220 /// </summary>
221 /// <param name="action"></param>
222 /// <param name="folderID"></param>
223 /// <param name="objectGroup"></param>
224 /// <param name="remoteClient"> </param>
225 public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID,
226 List<SceneObjectGroup> objectGroups, IClientAPI remoteClient) 218 List<SceneObjectGroup> objectGroups, IClientAPI remoteClient)
227 { 219 {
228 Dictionary<UUID, List<SceneObjectGroup>> deletes = new Dictionary<UUID, List<SceneObjectGroup>>(); 220 Dictionary<UUID, List<SceneObjectGroup>> bundlesToCopy = new Dictionary<UUID, List<SceneObjectGroup>>();
229 221
230 if (CoalesceMultipleObjectsToInventory) 222 if (CoalesceMultipleObjectsToInventory)
231 { 223 {
@@ -234,10 +226,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
234 // reasons. 226 // reasons.
235 foreach (SceneObjectGroup g in objectGroups) 227 foreach (SceneObjectGroup g in objectGroups)
236 { 228 {
237 if (!deletes.ContainsKey(g.OwnerID)) 229 if (!bundlesToCopy.ContainsKey(g.OwnerID))
238 deletes[g.OwnerID] = new List<SceneObjectGroup>(); 230 bundlesToCopy[g.OwnerID] = new List<SceneObjectGroup>();
239 231
240 deletes[g.OwnerID].Add(g); 232 bundlesToCopy[g.OwnerID].Add(g);
241 } 233 }
242 } 234 }
243 else 235 else
@@ -247,7 +239,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
247 { 239 {
248 List<SceneObjectGroup> bundle = new List<SceneObjectGroup>(); 240 List<SceneObjectGroup> bundle = new List<SceneObjectGroup>();
249 bundle.Add(g); 241 bundle.Add(g);
250 deletes[g.UUID] = bundle; 242 bundlesToCopy[g.UUID] = bundle;
251 } 243 }
252 } 244 }
253 245
@@ -257,328 +249,348 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
257 249
258 // Each iteration is really a separate asset being created, 250 // Each iteration is really a separate asset being created,
259 // with distinct destinations as well. 251 // with distinct destinations as well.
260 foreach (List<SceneObjectGroup> objlist in deletes.Values) 252 foreach (List<SceneObjectGroup> bundle in bundlesToCopy.Values)
253 assetID = CopyBundleToInventory(action, folderID, bundle, remoteClient);
254
255 return assetID;
256 }
257
258 /// <summary>
259 /// Copy a bundle of objects to inventory. If there is only one object, then this will create an object
260 /// item. If there are multiple objects then these will be saved as a single coalesced item.
261 /// </summary>
262 /// <param name="action"></param>
263 /// <param name="folderID"></param>
264 /// <param name="objlist"></param>
265 /// <param name="remoteClient"></param>
266 /// <returns></returns>
267 protected UUID CopyBundleToInventory(
268 DeRezAction action, UUID folderID, List<SceneObjectGroup> objlist, IClientAPI remoteClient)
269 {
270 UUID assetID = UUID.Zero;
271
272 CoalescedSceneObjects coa = new CoalescedSceneObjects(UUID.Zero);
273 Dictionary<UUID, Vector3> originalPositions = new Dictionary<UUID, Vector3>();
274
275 Dictionary<UUID, string> xmlStrings =
276 new Dictionary<UUID, string>();
277
278 foreach (SceneObjectGroup objectGroup in objlist)
261 { 279 {
262 Dictionary<UUID, string> xmlStrings = 280 Vector3 inventoryStoredPosition = new Vector3
263 new Dictionary<UUID, string>(); 281 (((objectGroup.AbsolutePosition.X > (int)Constants.RegionSize)
282 ? 250
283 : objectGroup.AbsolutePosition.X)
284 ,
285 (objectGroup.AbsolutePosition.Y > (int)Constants.RegionSize)
286 ? 250
287 : objectGroup.AbsolutePosition.Y,
288 objectGroup.AbsolutePosition.Z);
289
290 Vector3 originalPosition = objectGroup.AbsolutePosition;
291
292 // Restore attachment data after trip through the sim
293 if (objectGroup.RootPart.AttachPoint > 0)
294 inventoryStoredPosition = objectGroup.RootPart.AttachOffset;
295 objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint;
296
297 objectGroup.AbsolutePosition = inventoryStoredPosition;
298
299 // Make sure all bits but the ones we want are clear
300 // on take.
301 // This will be applied to the current perms, so
302 // it will do what we want.
303 objectGroup.RootPart.NextOwnerMask &=
304 ((uint)PermissionMask.Copy |
305 (uint)PermissionMask.Transfer |
306 (uint)PermissionMask.Modify);
307 objectGroup.RootPart.NextOwnerMask |=
308 (uint)PermissionMask.Move;
309
310 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup);
311
312 objectGroup.AbsolutePosition = originalPosition;
313
314 xmlStrings[objectGroup.UUID] = sceneObjectXml;
315 }
264 316
265 foreach (SceneObjectGroup objectGroup in objlist) 317 string itemXml;
266 {
267 Vector3 inventoryStoredPosition = new Vector3
268 (((objectGroup.AbsolutePosition.X > (int)Constants.RegionSize)
269 ? 250
270 : objectGroup.AbsolutePosition.X)
271 ,
272 (objectGroup.AbsolutePosition.Y > (int)Constants.RegionSize)
273 ? 250
274 : objectGroup.AbsolutePosition.Y,
275 objectGroup.AbsolutePosition.Z);
276
277 Vector3 originalPosition = objectGroup.AbsolutePosition;
278
279 // Restore attachment data after trip through the sim
280 if (objectGroup.RootPart.AttachPoint > 0)
281 inventoryStoredPosition = objectGroup.RootPart.AttachOffset;
282 objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint;
283
284 objectGroup.AbsolutePosition = inventoryStoredPosition;
285
286 // Make sure all bits but the ones we want are clear
287 // on take.
288 // This will be applied to the current perms, so
289 // it will do what we want.
290 objectGroup.RootPart.NextOwnerMask &=
291 ((uint)PermissionMask.Copy |
292 (uint)PermissionMask.Transfer |
293 (uint)PermissionMask.Modify);
294 objectGroup.RootPart.NextOwnerMask |=
295 (uint)PermissionMask.Move;
296 318
297 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup); 319 if (objlist.Count > 1)
320 {
321 float minX, minY, minZ;
322 float maxX, maxY, maxZ;
323
324 Vector3[] offsets = Scene.GetCombinedBoundingBox(objlist,
325 out minX, out maxX, out minY, out maxY,
326 out minZ, out maxZ);
298 327
299 objectGroup.AbsolutePosition = originalPosition; 328 // CreateWrapper
329 XmlDocument itemDoc = new XmlDocument();
330 XmlElement root = itemDoc.CreateElement("", "CoalescedObject", "");
331 itemDoc.AppendChild(root);
300 332
301 xmlStrings[objectGroup.UUID] = sceneObjectXml; 333 // Embed the offsets into the group XML
334 for ( int i = 0 ; i < objlist.Count ; i++ )
335 {
336 XmlDocument doc = new XmlDocument();
337 SceneObjectGroup g = objlist[i];
338 doc.LoadXml(xmlStrings[g.UUID]);
339 XmlElement e = (XmlElement)doc.SelectSingleNode("/SceneObjectGroup");
340 e.SetAttribute("offsetx", offsets[i].X.ToString());
341 e.SetAttribute("offsety", offsets[i].Y.ToString());
342 e.SetAttribute("offsetz", offsets[i].Z.ToString());
343
344 XmlNode objectNode = itemDoc.ImportNode(e, true);
345 root.AppendChild(objectNode);
302 } 346 }
303 347
304 string itemXml; 348 float sizeX = maxX - minX;
349 float sizeY = maxY - minY;
350 float sizeZ = maxZ - minZ;
305 351
306 if (objlist.Count > 1) 352 root.SetAttribute("x", sizeX.ToString());
307 { 353 root.SetAttribute("y", sizeY.ToString());
308 float minX, minY, minZ; 354 root.SetAttribute("z", sizeZ.ToString());
309 float maxX, maxY, maxZ;
310 355
311 Vector3[] offsets = Scene.GetCombinedBoundingBox(objlist, 356 itemXml = itemDoc.InnerXml;
312 out minX, out maxX, out minY, out maxY, 357 }
313 out minZ, out maxZ); 358 else
359 {
360 itemXml = xmlStrings[objlist[0].UUID];
361 }
314 362
315 // CreateWrapper 363 // Get the user info of the item destination
316 XmlDocument itemDoc = new XmlDocument(); 364 //
317 XmlElement root = itemDoc.CreateElement("", "CoalescedObject", ""); 365 UUID userID = UUID.Zero;
318 itemDoc.AppendChild(root);
319 366
320 // Embed the offsets into the group XML 367 if (action == DeRezAction.Take || action == DeRezAction.TakeCopy ||
321 for ( int i = 0 ; i < objlist.Count ; i++ ) 368 action == DeRezAction.SaveToExistingUserInventoryItem)
322 { 369 {
323 XmlDocument doc = new XmlDocument(); 370 // Take or take copy require a taker
324 SceneObjectGroup g = objlist[i]; 371 // Saving changes requires a local user
325 doc.LoadXml(xmlStrings[g.UUID]); 372 //
326 XmlElement e = (XmlElement)doc.SelectSingleNode("/SceneObjectGroup"); 373 if (remoteClient == null)
327 e.SetAttribute("offsetx", offsets[i].X.ToString()); 374 return UUID.Zero;
328 e.SetAttribute("offsety", offsets[i].Y.ToString());
329 e.SetAttribute("offsetz", offsets[i].Z.ToString());
330
331 XmlNode objectNode = itemDoc.ImportNode(e, true);
332 root.AppendChild(objectNode);
333 }
334 375
335 float sizeX = maxX - minX; 376 userID = remoteClient.AgentId;
336 float sizeY = maxY - minY; 377 }
337 float sizeZ = maxZ - minZ; 378 else
379 {
380 // All returns / deletes go to the object owner
381 //
338 382
339 root.SetAttribute("x", sizeX.ToString()); 383 userID = objlist[0].RootPart.OwnerID;
340 root.SetAttribute("y", sizeY.ToString()); 384 }
341 root.SetAttribute("z", sizeZ.ToString());
342 385
343 itemXml = itemDoc.InnerXml; 386 if (userID == UUID.Zero) // Can't proceed
344 } 387 {
345 else 388 return UUID.Zero;
346 { 389 }
347 itemXml = xmlStrings[objlist[0].UUID];
348 }
349 390
350 // Get the user info of the item destination 391 // If we're returning someone's item, it goes back to the
351 // 392 // owner's Lost And Found folder.
352 UUID userID = UUID.Zero; 393 // Delete is treated like return in this case
394 // Deleting your own items makes them go to trash
395 //
353 396
354 if (action == DeRezAction.Take || action == DeRezAction.TakeCopy || 397 InventoryFolderBase folder = null;
355 action == DeRezAction.SaveToExistingUserInventoryItem) 398 InventoryItemBase item = null;
356 {
357 // Take or take copy require a taker
358 // Saving changes requires a local user
359 //
360 if (remoteClient == null)
361 return UUID.Zero;
362 399
363 userID = remoteClient.AgentId; 400 if (DeRezAction.SaveToExistingUserInventoryItem == action)
364 } 401 {
365 else 402 item = new InventoryItemBase(objlist[0].RootPart.FromUserInventoryItemID, userID);
366 { 403 item = m_Scene.InventoryService.GetItem(item);
367 // All returns / deletes go to the object owner
368 //
369 404
370 userID = objlist[0].RootPart.OwnerID; 405 //item = userInfo.RootFolder.FindItem(
371 } 406 // objectGroup.RootPart.FromUserInventoryItemID);
372 407
373 if (userID == UUID.Zero) // Can't proceed 408 if (null == item)
374 { 409 {
410 m_log.DebugFormat(
411 "[AGENT INVENTORY]: Object {0} {1} scheduled for save to inventory has already been deleted.",
412 objlist[0].Name, objlist[0].UUID);
375 return UUID.Zero; 413 return UUID.Zero;
376 } 414 }
377 415 }
378 // If we're returning someone's item, it goes back to the 416 else
379 // owner's Lost And Found folder. 417 {
380 // Delete is treated like return in this case 418 // Folder magic
381 // Deleting your own items makes them go to trash
382 // 419 //
383 420 if (action == DeRezAction.Delete)
384 InventoryFolderBase folder = null;
385 InventoryItemBase item = null;
386
387 if (DeRezAction.SaveToExistingUserInventoryItem == action)
388 { 421 {
389 item = new InventoryItemBase(objlist[0].RootPart.FromUserInventoryItemID, userID); 422 // Deleting someone else's item
390 item = m_Scene.InventoryService.GetItem(item); 423 //
391 424 if (remoteClient == null ||
392 //item = userInfo.RootFolder.FindItem( 425 objlist[0].OwnerID != remoteClient.AgentId)
393 // objectGroup.RootPart.FromUserInventoryItemID); 426 {
394 427
395 if (null == item) 428 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
429 }
430 else
396 { 431 {
397 m_log.DebugFormat( 432 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder);
398 "[AGENT INVENTORY]: Object {0} {1} scheduled for save to inventory has already been deleted.",
399 objlist[0].Name, objlist[0].UUID);
400 return UUID.Zero;
401 } 433 }
402 } 434 }
403 else 435 else if (action == DeRezAction.Return)
404 { 436 {
405 // Folder magic 437
438 // Dump to lost + found unconditionally
406 // 439 //
440 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
441 }
442
443 if (folderID == UUID.Zero && folder == null)
444 {
407 if (action == DeRezAction.Delete) 445 if (action == DeRezAction.Delete)
408 { 446 {
409 // Deleting someone else's item 447 // Deletes go to trash by default
410 // 448 //
449 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder);
450 }
451 else
452 {
411 if (remoteClient == null || 453 if (remoteClient == null ||
412 objlist[0].OwnerID != remoteClient.AgentId) 454 objlist[0].OwnerID != remoteClient.AgentId)
413 { 455 {
414 456 // Taking copy of another person's item. Take to
415 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder); 457 // Objects folder.
458 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.Object);
416 } 459 }
417 else 460 else
418 { 461 {
419 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder); 462 // Catch all. Use lost & found
420 }
421 }
422 else if (action == DeRezAction.Return)
423 {
424
425 // Dump to lost + found unconditionally
426 //
427 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
428 }
429
430 if (folderID == UUID.Zero && folder == null)
431 {
432 if (action == DeRezAction.Delete)
433 {
434 // Deletes go to trash by default
435 // 463 //
436 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder);
437 }
438 else
439 {
440 if (remoteClient == null ||
441 objlist[0].OwnerID != remoteClient.AgentId)
442 {
443 // Taking copy of another person's item. Take to
444 // Objects folder.
445 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.Object);
446 }
447 else
448 {
449 // Catch all. Use lost & found
450 //
451 464
452 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder); 465 folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
453 }
454 } 466 }
455 } 467 }
468 }
456 469
457 // Override and put into where it came from, if it came 470 // Override and put into where it came from, if it came
458 // from anywhere in inventory 471 // from anywhere in inventory
459 // 472 //
460 if (action == DeRezAction.Take || action == DeRezAction.TakeCopy) 473 if (action == DeRezAction.Take || action == DeRezAction.TakeCopy)
474 {
475 if (objlist[0].RootPart.FromFolderID != UUID.Zero && objlist[0].OwnerID == remoteClient.AgentId)
461 { 476 {
462 if (objlist[0].RootPart.FromFolderID != UUID.Zero && objlist[0].OwnerID == remoteClient.AgentId) 477 InventoryFolderBase f = new InventoryFolderBase(objlist[0].RootPart.FromFolderID, userID);
463 { 478 folder = m_Scene.InventoryService.GetFolder(f);
464 InventoryFolderBase f = new InventoryFolderBase(objlist[0].RootPart.FromFolderID, userID);
465 folder = m_Scene.InventoryService.GetFolder(f);
466 }
467 } 479 }
480 }
468 481
469 if (folder == null) // None of the above 482 if (folder == null) // None of the above
470 { 483 {
471 folder = new InventoryFolderBase(folderID); 484 folder = new InventoryFolderBase(folderID);
472
473 if (folder == null) // Nowhere to put it
474 {
475 return UUID.Zero;
476 }
477 }
478 485
479 item = new InventoryItemBase(); 486 if (folder == null) // Nowhere to put it
480 // Can't know creator is the same, so null it in inventory
481 if (objlist.Count > 1)
482 { 487 {
483 item.CreatorId = UUID.Zero.ToString(); 488 return UUID.Zero;
484 item.CreatorData = String.Empty;
485 }
486 else
487 {
488 item.CreatorId = objlist[0].RootPart.CreatorID.ToString();
489 item.CreatorData = objlist[0].RootPart.CreatorData;
490 }
491 item.ID = UUID.Random();
492 item.InvType = (int)InventoryType.Object;
493 item.Folder = folder.ID;
494 item.Owner = userID;
495 if (objlist.Count > 1)
496 {
497 item.Flags = (uint)InventoryItemFlags.ObjectHasMultipleItems;
498 }
499 else
500 {
501 item.SaleType = objlist[0].RootPart.ObjectSaleType;
502 item.SalePrice = objlist[0].RootPart.SalePrice;
503 } 489 }
504 } 490 }
505 491
506 AssetBase asset = CreateAsset( 492 item = new InventoryItemBase();
507 objlist[0].GetPartName(objlist[0].RootPart.LocalId), 493 // Can't know creator is the same, so null it in inventory
508 objlist[0].GetPartDescription(objlist[0].RootPart.LocalId), 494 if (objlist.Count > 1)
509 (sbyte)AssetType.Object,
510 Utils.StringToBytes(itemXml),
511 objlist[0].OwnerID.ToString());
512 m_Scene.AssetService.Store(asset);
513 assetID = asset.FullID;
514
515 if (DeRezAction.SaveToExistingUserInventoryItem == action)
516 { 495 {
517 item.AssetID = asset.FullID; 496 item.CreatorId = UUID.Zero.ToString();
518 m_Scene.InventoryService.UpdateItem(item); 497 item.CreatorData = String.Empty;
519 } 498 }
520 else 499 else
521 { 500 {
522 item.AssetID = asset.FullID; 501 item.CreatorId = objlist[0].RootPart.CreatorID.ToString();
502 item.CreatorData = objlist[0].RootPart.CreatorData;
503 }
504 item.ID = UUID.Random();
505 item.InvType = (int)InventoryType.Object;
506 item.Folder = folder.ID;
507 item.Owner = userID;
508 if (objlist.Count > 1)
509 {
510 item.Flags = (uint)InventoryItemFlags.ObjectHasMultipleItems;
511 }
512 else
513 {
514 item.SaleType = objlist[0].RootPart.ObjectSaleType;
515 item.SalePrice = objlist[0].RootPart.SalePrice;
516 }
517 }
523 518
524 uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move) | 7; 519 AssetBase asset = CreateAsset(
525 foreach (SceneObjectGroup grp in objlist) 520 objlist[0].GetPartName(objlist[0].RootPart.LocalId),
526 effectivePerms &= grp.GetEffectivePermissions(); 521 objlist[0].GetPartDescription(objlist[0].RootPart.LocalId),
527 effectivePerms |= (uint)PermissionMask.Move; 522 (sbyte)AssetType.Object,
523 Utils.StringToBytes(itemXml),
524 objlist[0].OwnerID.ToString());
525 m_Scene.AssetService.Store(asset);
526 assetID = asset.FullID;
528 527
529 if (remoteClient != null && (remoteClient.AgentId != objlist[0].RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions()) 528 if (DeRezAction.SaveToExistingUserInventoryItem == action)
530 { 529 {
531 uint perms = effectivePerms; 530 item.AssetID = asset.FullID;
532 uint nextPerms = (perms & 7) << 13; 531 m_Scene.InventoryService.UpdateItem(item);
533 if ((nextPerms & (uint)PermissionMask.Copy) == 0) 532 }
534 perms &= ~(uint)PermissionMask.Copy; 533 else
535 if ((nextPerms & (uint)PermissionMask.Transfer) == 0) 534 {
536 perms &= ~(uint)PermissionMask.Transfer; 535 item.AssetID = asset.FullID;
537 if ((nextPerms & (uint)PermissionMask.Modify) == 0)
538 perms &= ~(uint)PermissionMask.Modify;
539
540 item.BasePermissions = perms & objlist[0].RootPart.NextOwnerMask;
541 item.CurrentPermissions = item.BasePermissions;
542 item.NextPermissions = perms & objlist[0].RootPart.NextOwnerMask;
543 item.EveryOnePermissions = objlist[0].RootPart.EveryoneMask & objlist[0].RootPart.NextOwnerMask;
544 item.GroupPermissions = objlist[0].RootPart.GroupMask & objlist[0].RootPart.NextOwnerMask;
545
546 item.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
547 }
548 else
549 {
550 item.BasePermissions = effectivePerms;
551 item.CurrentPermissions = effectivePerms;
552 item.NextPermissions = objlist[0].RootPart.NextOwnerMask & effectivePerms;
553 item.EveryOnePermissions = objlist[0].RootPart.EveryoneMask & effectivePerms;
554 item.GroupPermissions = objlist[0].RootPart.GroupMask & effectivePerms;
555
556 item.CurrentPermissions &=
557 ((uint)PermissionMask.Copy |
558 (uint)PermissionMask.Transfer |
559 (uint)PermissionMask.Modify |
560 (uint)PermissionMask.Move |
561 7); // Preserve folded permissions
562 }
563 536
564 item.CreationDate = Util.UnixTimeSinceEpoch(); 537 uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move) | 7;
565 item.Description = asset.Description; 538 foreach (SceneObjectGroup grp in objlist)
566 item.Name = asset.Name; 539 effectivePerms &= grp.GetEffectivePermissions();
567 item.AssetType = asset.Type; 540 effectivePerms |= (uint)PermissionMask.Move;
568 541
569 m_Scene.AddInventoryItem(item); 542 if (remoteClient != null && (remoteClient.AgentId != objlist[0].RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions())
543 {
544 uint perms = effectivePerms;
545 uint nextPerms = (perms & 7) << 13;
546 if ((nextPerms & (uint)PermissionMask.Copy) == 0)
547 perms &= ~(uint)PermissionMask.Copy;
548 if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
549 perms &= ~(uint)PermissionMask.Transfer;
550 if ((nextPerms & (uint)PermissionMask.Modify) == 0)
551 perms &= ~(uint)PermissionMask.Modify;
552
553 item.BasePermissions = perms & objlist[0].RootPart.NextOwnerMask;
554 item.CurrentPermissions = item.BasePermissions;
555 item.NextPermissions = perms & objlist[0].RootPart.NextOwnerMask;
556 item.EveryOnePermissions = objlist[0].RootPart.EveryoneMask & objlist[0].RootPart.NextOwnerMask;
557 item.GroupPermissions = objlist[0].RootPart.GroupMask & objlist[0].RootPart.NextOwnerMask;
558
559 item.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
560 }
561 else
562 {
563 item.BasePermissions = effectivePerms;
564 item.CurrentPermissions = effectivePerms;
565 item.NextPermissions = objlist[0].RootPart.NextOwnerMask & effectivePerms;
566 item.EveryOnePermissions = objlist[0].RootPart.EveryoneMask & effectivePerms;
567 item.GroupPermissions = objlist[0].RootPart.GroupMask & effectivePerms;
570 568
571 if (remoteClient != null && item.Owner == remoteClient.AgentId) 569 item.CurrentPermissions &=
572 { 570 ((uint)PermissionMask.Copy |
573 remoteClient.SendInventoryItemCreateUpdate(item, 0); 571 (uint)PermissionMask.Transfer |
574 } 572 (uint)PermissionMask.Modify |
575 else 573 (uint)PermissionMask.Move |
574 7); // Preserve folded permissions
575 }
576
577 item.CreationDate = Util.UnixTimeSinceEpoch();
578 item.Description = asset.Description;
579 item.Name = asset.Name;
580 item.AssetType = asset.Type;
581
582 m_Scene.AddInventoryItem(item);
583
584 if (remoteClient != null && item.Owner == remoteClient.AgentId)
585 {
586 remoteClient.SendInventoryItemCreateUpdate(item, 0);
587 }
588 else
589 {
590 ScenePresence notifyUser = m_Scene.GetScenePresence(item.Owner);
591 if (notifyUser != null)
576 { 592 {
577 ScenePresence notifyUser = m_Scene.GetScenePresence(item.Owner); 593 notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item, 0);
578 if (notifyUser != null)
579 {
580 notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item, 0);
581 }
582 } 594 }
583 } 595 }
584 } 596 }
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index b1dec4c..930a117 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -57,6 +57,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver
57 /// bumps here should be compatible. 57 /// bumps here should be compatible.
58 /// </summary> 58 /// </summary>
59 public static int MAX_MAJOR_VERSION = 1; 59 public static int MAX_MAJOR_VERSION = 1;
60
61 /// <summary>
62 /// Has the control file been loaded for this archive?
63 /// </summary>
64 public bool ControlFileLoaded { get; private set; }
60 65
61 protected Scene m_scene; 66 protected Scene m_scene;
62 protected Stream m_loadStream; 67 protected Stream m_loadStream;
@@ -545,7 +550,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
545 /// </summary> 550 /// </summary>
546 /// <param name="path"></param> 551 /// <param name="path"></param>
547 /// <param name="data"></param> 552 /// <param name="data"></param>
548 protected void LoadControlFile(string path, byte[] data) 553 public void LoadControlFile(string path, byte[] data)
549 { 554 {
550 XmlNamespaceManager nsmgr = new XmlNamespaceManager(new NameTable()); 555 XmlNamespaceManager nsmgr = new XmlNamespaceManager(new NameTable());
551 XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None); 556 XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None);
@@ -591,6 +596,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
591 } 596 }
592 597
593 currentRegionSettings.Save(); 598 currentRegionSettings.Save();
599
600 ControlFileLoaded = true;
594 } 601 }
595 } 602 }
596} \ No newline at end of file 603} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
index f2d487e..597b780 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
@@ -206,7 +206,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
206 /// <returns></returns> 206 /// <returns></returns>
207 public static string CreateControlFile(Dictionary<string, object> options) 207 public static string CreateControlFile(Dictionary<string, object> options)
208 { 208 {
209 int majorVersion = MAX_MAJOR_VERSION, minorVersion = 5; 209 int majorVersion = MAX_MAJOR_VERSION, minorVersion = 6;
210// 210//
211// if (options.ContainsKey("version")) 211// if (options.ContainsKey("version"))
212// { 212// {
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
index e2760a2..2307c8e 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
@@ -171,7 +171,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
171 MemoryStream archiveReadStream = new MemoryStream(archive); 171 MemoryStream archiveReadStream = new MemoryStream(archive);
172 TarArchiveReader tar = new TarArchiveReader(archiveReadStream); 172 TarArchiveReader tar = new TarArchiveReader(archiveReadStream);
173 173
174 bool gotControlFile = false;
175 bool gotNcAssetFile = false; 174 bool gotNcAssetFile = false;
176 175
177 string expectedNcAssetFileName = string.Format("{0}_{1}", ncAssetUuid, "notecard.txt"); 176 string expectedNcAssetFileName = string.Format("{0}_{1}", ncAssetUuid, "notecard.txt");
@@ -182,15 +181,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
182 expectedPaths.Add(ArchiveHelpers.CreateObjectPath(sog2)); 181 expectedPaths.Add(ArchiveHelpers.CreateObjectPath(sog2));
183 182
184 string filePath; 183 string filePath;
185 TarArchiveReader.TarEntryType tarEntryType; 184 TarArchiveReader.TarEntryType tarEntryType;
186 185
186 byte[] data = tar.ReadEntry(out filePath, out tarEntryType);
187 Assert.That(filePath, Is.EqualTo(ArchiveConstants.CONTROL_FILE_PATH));
188
189 ArchiveReadRequest arr = new ArchiveReadRequest(m_scene, (Stream)null, false, false, Guid.Empty);
190 arr.LoadControlFile(filePath, data);
191
192 Assert.That(arr.ControlFileLoaded, Is.True);
193
187 while (tar.ReadEntry(out filePath, out tarEntryType) != null) 194 while (tar.ReadEntry(out filePath, out tarEntryType) != null)
188 { 195 {
189 if (ArchiveConstants.CONTROL_FILE_PATH == filePath) 196 if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
190 {
191 gotControlFile = true;
192 }
193 else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
194 { 197 {
195 string fileName = filePath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); 198 string fileName = filePath.Remove(0, ArchiveConstants.ASSETS_PATH.Length);
196 199
@@ -203,7 +206,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
203 } 206 }
204 } 207 }
205 208
206 Assert.That(gotControlFile, Is.True, "No control file in archive");
207 Assert.That(gotNcAssetFile, Is.True, "No notecard asset file in archive"); 209 Assert.That(gotNcAssetFile, Is.True, "No notecard asset file in archive");
208 Assert.That(foundPaths, Is.EquivalentTo(expectedPaths)); 210 Assert.That(foundPaths, Is.EquivalentTo(expectedPaths));
209 211
diff --git a/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs b/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs
index 05fc2ad..305975e 100644
--- a/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs
@@ -38,7 +38,23 @@ namespace OpenSim.Region.Framework.Interfaces
38 public interface IInventoryAccessModule 38 public interface IInventoryAccessModule
39 { 39 {
40 UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data); 40 UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data);
41 UUID DeleteToInventory(DeRezAction action, UUID folderID, List<SceneObjectGroup> objectGroups, IClientAPI remoteClient); 41
42 /// <summary>
43 /// Copy objects to a user's inventory.
44 /// </summary>
45 /// <remarks>
46 /// Is it left to the caller to delete them from the scene if required.
47 /// </remarks>
48 /// <param name="action"></param>
49 /// <param name="folderID"></param>
50 /// <param name="objectGroups"></param>
51 /// <param name="remoteClient"></param>
52 /// <returns>
53 /// Returns the UUID of the newly created item asset (not the item itself).
54 /// FIXME: This is not very useful. It would be far more useful to return a list of items instead.
55 /// </returns>
56 UUID CopyToInventory(DeRezAction action, UUID folderID, List<SceneObjectGroup> objectGroups, IClientAPI remoteClient);
57
42 SceneObjectGroup RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart, 58 SceneObjectGroup RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart,
43 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, 59 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
44 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment); 60 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment);
diff --git a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
index a8d24fd..088839d 100644
--- a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
+++ b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
@@ -150,7 +150,8 @@ namespace OpenSim.Region.Framework.Scenes
150 { 150 {
151 IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>(); 151 IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>();
152 if (invAccess != null) 152 if (invAccess != null)
153 invAccess.DeleteToInventory(x.action, x.folderID, x.objectGroups, x.remoteClient); 153 invAccess.CopyToInventory(x.action, x.folderID, x.objectGroups, x.remoteClient);
154
154 if (x.permissionToDelete) 155 if (x.permissionToDelete)
155 { 156 {
156 foreach (SceneObjectGroup g in x.objectGroups) 157 foreach (SceneObjectGroup g in x.objectGroups)
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
index 0e679a9..b59f6e1 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
@@ -118,7 +118,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
118 118
119 if (serviceDll == String.Empty) 119 if (serviceDll == String.Empty)
120 { 120 {
121 m_log.Error("[FreeSwitchVoice]: No LocalServiceModule named in section FreeSwitchVoice"); 121 m_log.Error("[FreeSwitchVoice]: No LocalServiceModule named in section FreeSwitchVoice. Not starting.");
122 return; 122 return;
123 } 123 }
124 124
@@ -143,8 +143,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
143 if (String.IsNullOrEmpty(m_freeSwitchRealm) || 143 if (String.IsNullOrEmpty(m_freeSwitchRealm) ||
144 String.IsNullOrEmpty(m_freeSwitchAPIPrefix)) 144 String.IsNullOrEmpty(m_freeSwitchAPIPrefix))
145 { 145 {
146 m_log.Error("[FreeSwitchVoice] plugin mis-configured"); 146 m_log.Error("[FreeSwitchVoice]: Freeswitch service mis-configured. Not starting.");
147 m_log.Info("[FreeSwitchVoice] plugin disabled: incomplete configuration");
148 return; 147 return;
149 } 148 }
150 149
@@ -164,24 +163,24 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
164 // String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix), FreeSwitchSLVoiceGetPreloginHTTPHandler); 163 // String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix), FreeSwitchSLVoiceGetPreloginHTTPHandler);
165 // MainServer.Instance.AddStreamHandler(h); 164 // MainServer.Instance.AddStreamHandler(h);
166 165
167
168
169 MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_signin.php", m_freeSwitchAPIPrefix), 166 MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_signin.php", m_freeSwitchAPIPrefix),
170 FreeSwitchSLVoiceSigninHTTPHandler); 167 FreeSwitchSLVoiceSigninHTTPHandler);
171 168
172 MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_buddy.php", m_freeSwitchAPIPrefix), 169 MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_buddy.php", m_freeSwitchAPIPrefix),
173 FreeSwitchSLVoiceBuddyHTTPHandler); 170 FreeSwitchSLVoiceBuddyHTTPHandler);
171
172 MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_watcher.php", m_freeSwitchAPIPrefix),
173 FreeSwitchSLVoiceWatcherHTTPHandler);
174 174
175 m_log.InfoFormat("[FreeSwitchVoice] using FreeSwitch server {0}", m_freeSwitchRealm); 175 m_log.InfoFormat("[FreeSwitchVoice]: using FreeSwitch server {0}", m_freeSwitchRealm);
176 176
177 m_Enabled = true; 177 m_Enabled = true;
178 178
179 m_log.Info("[FreeSwitchVoice] plugin enabled"); 179 m_log.Info("[FreeSwitchVoice]: plugin enabled");
180 } 180 }
181 catch (Exception e) 181 catch (Exception e)
182 { 182 {
183 m_log.ErrorFormat("[FreeSwitchVoice] plugin initialization failed: {0}", e.Message); 183 m_log.ErrorFormat("[FreeSwitchVoice]: plugin initialization failed: {0} {1}", e.Message, e.StackTrace);
184 m_log.DebugFormat("[FreeSwitchVoice] plugin initialization failed: {0}", e.ToString());
185 return; 184 return;
186 } 185 }
187 186
@@ -240,7 +239,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
240 { 239 {
241 if (m_Enabled) 240 if (m_Enabled)
242 { 241 {
243 m_log.Info("[FreeSwitchVoice] registering IVoiceModule with the scene"); 242 m_log.Info("[FreeSwitchVoice]: registering IVoiceModule with the scene");
244 243
245 // register the voice interface for this module, so the script engine can call us 244 // register the voice interface for this module, so the script engine can call us
246 scene.RegisterModuleInterface<IVoiceModule>(this); 245 scene.RegisterModuleInterface<IVoiceModule>(this);
@@ -302,7 +301,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
302 // </summary> 301 // </summary>
303 public void OnRegisterCaps(Scene scene, UUID agentID, Caps caps) 302 public void OnRegisterCaps(Scene scene, UUID agentID, Caps caps)
304 { 303 {
305 m_log.DebugFormat("[FreeSwitchVoice] OnRegisterCaps: agentID {0} caps {1}", agentID, caps); 304 m_log.DebugFormat(
305 "[FreeSwitchVoice]: OnRegisterCaps() called with agentID {0} caps {1} in scene {2}",
306 agentID, caps, scene.RegionInfo.RegionName);
306 307
307 string capsBase = "/CAPS/" + caps.CapsObjectPath; 308 string capsBase = "/CAPS/" + caps.CapsObjectPath;
308 caps.RegisterHandler("ProvisionVoiceAccountRequest", 309 caps.RegisterHandler("ProvisionVoiceAccountRequest",
@@ -344,6 +345,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
344 public string ProvisionVoiceAccountRequest(Scene scene, string request, string path, string param, 345 public string ProvisionVoiceAccountRequest(Scene scene, string request, string path, string param,
345 UUID agentID, Caps caps) 346 UUID agentID, Caps caps)
346 { 347 {
348 m_log.DebugFormat(
349 "[FreeSwitchVoice][PROVISIONVOICE]: ProvisionVoiceAccountRequest() request: {0}, path: {1}, param: {2}", request, path, param);
350
347 ScenePresence avatar = scene.GetScenePresence(agentID); 351 ScenePresence avatar = scene.GetScenePresence(agentID);
348 if (avatar == null) 352 if (avatar == null)
349 { 353 {
@@ -357,9 +361,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
357 361
358 try 362 try
359 { 363 {
360 //m_log.DebugFormat("[FreeSwitchVoice][PROVISIONVOICE]: request: {0}, path: {1}, param: {2}",
361 // request, path, param);
362
363 //XmlElement resp; 364 //XmlElement resp;
364 string agentname = "x" + Convert.ToBase64String(agentID.GetBytes()); 365 string agentname = "x" + Convert.ToBase64String(agentID.GetBytes());
365 string password = "1234";//temp hack//new UUID(Guid.NewGuid()).ToString().Replace('-','Z').Substring(0,16); 366 string password = "1234";//temp hack//new UUID(Guid.NewGuid()).ToString().Replace('-','Z').Substring(0,16);
@@ -416,6 +417,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
416 public string ParcelVoiceInfoRequest(Scene scene, string request, string path, string param, 417 public string ParcelVoiceInfoRequest(Scene scene, string request, string path, string param,
417 UUID agentID, Caps caps) 418 UUID agentID, Caps caps)
418 { 419 {
420// m_log.DebugFormat(
421// "[FreeSwitchVoice][PARCELVOICE]: ParcelVoiceInfoRequest() on {0} for {1}",
422// scene.RegionInfo.RegionName, agentID);
423
419 ScenePresence avatar = scene.GetScenePresence(agentID); 424 ScenePresence avatar = scene.GetScenePresence(agentID);
420 string avatarName = avatar.Name; 425 string avatarName = avatar.Name;
421 426
@@ -502,6 +507,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
502 507
503 m_log.DebugFormat("[FreeSwitchVoice][CHATSESSION]: avatar \"{0}\": request: {1}, path: {2}, param: {3}", 508 m_log.DebugFormat("[FreeSwitchVoice][CHATSESSION]: avatar \"{0}\": request: {1}, path: {2}, param: {3}",
504 avatarName, request, path, param); 509 avatarName, request, path, param);
510
505 return "<llsd>true</llsd>"; 511 return "<llsd>true</llsd>";
506 } 512 }
507 513
@@ -555,7 +561,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
555 return response; 561 return response;
556 } 562 }
557 563
558
559 public Hashtable FreeSwitchSLVoiceGetPreloginHTTPHandler(Hashtable request) 564 public Hashtable FreeSwitchSLVoiceGetPreloginHTTPHandler(Hashtable request)
560 { 565 {
561// m_log.Debug("[FreeSwitchVoice] FreeSwitchSLVoiceGetPreloginHTTPHandler called"); 566// m_log.Debug("[FreeSwitchVoice] FreeSwitchSLVoiceGetPreloginHTTPHandler called");
@@ -592,6 +597,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
592 597
593 public Hashtable FreeSwitchSLVoiceBuddyHTTPHandler(Hashtable request) 598 public Hashtable FreeSwitchSLVoiceBuddyHTTPHandler(Hashtable request)
594 { 599 {
600 m_log.Debug("[FreeSwitchVoice]: FreeSwitchSLVoiceBuddyHTTPHandler called");
601
595 Hashtable response = new Hashtable(); 602 Hashtable response = new Hashtable();
596 response["int_response_code"] = 200; 603 response["int_response_code"] = 200;
597 response["str_response_string"] = string.Empty; 604 response["str_response_string"] = string.Empty;
@@ -650,18 +657,61 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
650 <bdy_status>A</bdy_status> 657 <bdy_status>A</bdy_status>
651 <modified_ts>{3}</modified_ts> 658 <modified_ts>{3}</modified_ts>
652 <b2g_group_id></b2g_group_id> 659 <b2g_group_id></b2g_group_id>
653 </level3>", ids[i],i,m_freeSwitchRealm,dt)); 660 </level3>", ids[i], i ,m_freeSwitchRealm, dt));
654 } 661 }
655 662
656 resp.Append("</buddies><groups></groups></body></level0></response>"); 663 resp.Append("</buddies><groups></groups></body></level0></response>");
657 664
658 response["str_response_string"] = resp.ToString(); 665 response["str_response_string"] = resp.ToString();
659// Regex normalizeEndLines = new Regex(@"\r\n", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.Multiline); 666// Regex normalizeEndLines = new Regex(@"(\r\n|\n)", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.Multiline);
660 667//
661 //m_log.DebugFormat("[FREESWITCH]: {0}", normalizeEndLines.Replace((string)response["str_response_string"],"")); 668// m_log.DebugFormat(
669// "[FREESWITCH]: FreeSwitchSLVoiceBuddyHTTPHandler() response {0}",
670// normalizeEndLines.Replace((string)response["str_response_string"],""));
671
662 return response; 672 return response;
663 } 673 }
664 674
675 public Hashtable FreeSwitchSLVoiceWatcherHTTPHandler(Hashtable request)
676 {
677 m_log.Debug("[FreeSwitchVoice]: FreeSwitchSLVoiceWatcherHTTPHandler called");
678
679 Hashtable response = new Hashtable();
680 response["int_response_code"] = 200;
681 response["content-type"] = "text/xml";
682
683 Hashtable requestBody = ParseRequestBody((string)request["body"]);
684
685 string auth_token = (string)requestBody["auth_token"];
686 //string[] auth_tokenvals = auth_token.Split(':');
687 //string username = auth_tokenvals[0];
688
689 StringBuilder resp = new StringBuilder();
690 resp.Append("<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?><response xmlns=\"http://www.vivox.com\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation= \"/xsd/buddy_list.xsd\">");
691
692 // FIXME: This is enough of a response to stop viewer 2 complaining about a login failure and get voice to work. If we don't
693 // give an OK response, then viewer 2 engages in an continuous viv_signin.php, viv_buddy.php, viv_watcher.php loop
694 // Viewer 1 appeared happy to ignore the lack of reply and still works with this reply.
695 //
696 // However, really we need to fill in whatever watcher data should be here (whatever that is).
697 resp.Append(string.Format(@"<level0>
698 <status>OK</status>
699 <cookie_name>lib_session</cookie_name>
700 <cookie>{0}</cookie>
701 <auth_token>{0}</auth_token>
702 <body/></level0></response>", auth_token));
703
704 response["str_response_string"] = resp.ToString();
705
706// Regex normalizeEndLines = new Regex(@"(\r\n|\n)", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.Multiline);
707//
708// m_log.DebugFormat(
709// "[FREESWITCH]: FreeSwitchSLVoiceWatcherHTTPHandler() response {0}",
710// normalizeEndLines.Replace((string)response["str_response_string"],""));
711
712 return response;
713 }
714
665 public Hashtable FreeSwitchSLVoiceSigninHTTPHandler(Hashtable request) 715 public Hashtable FreeSwitchSLVoiceSigninHTTPHandler(Hashtable request)
666 { 716 {
667 //m_log.Debug("[FreeSwitchVoice] FreeSwitchSLVoiceSigninHTTPHandler called"); 717 //m_log.Debug("[FreeSwitchVoice] FreeSwitchSLVoiceSigninHTTPHandler called");
@@ -709,7 +759,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
709 </level0> 759 </level0>
710 </response>", userid, pos, avatarName); 760 </response>", userid, pos, avatarName);
711 761
712 response["int_response_code"] = 200; 762 response["int_response_code"] = 200;
763
764// m_log.DebugFormat("[FreeSwitchVoice]: Sending FreeSwitchSLVoiceSigninHTTPHandler response");
765
713 return response; 766 return response;
714 } 767 }
715 768
@@ -795,16 +848,18 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
795 response["keepalive"] = false; 848 response["keepalive"] = false;
796 response["int_response_code"] = 500; 849 response["int_response_code"] = 500;
797 850
798 Hashtable requestBody = ParseRequestBody((string) request["body"]); 851 Hashtable requestBody = ParseRequestBody((string)request["body"]);
799 852
800 string section = (string) requestBody["section"]; 853 string section = (string) requestBody["section"];
854
855 m_log.DebugFormat("[FreeSwitchVoice]: Received request for config section {0}", section);
801 856
802 if (section == "directory") 857 if (section == "directory")
803 response = m_FreeswitchService.HandleDirectoryRequest(requestBody); 858 response = m_FreeswitchService.HandleDirectoryRequest(requestBody);
804 else if (section == "dialplan") 859 else if (section == "dialplan")
805 response = m_FreeswitchService.HandleDialplanRequest(requestBody); 860 response = m_FreeswitchService.HandleDialplanRequest(requestBody);
806 else 861 else
807 m_log.WarnFormat("[FreeSwitchVoice]: section was {0}", section); 862 m_log.WarnFormat("[FreeSwitchVoice]: Unknown section {0} was requested.", section);
808 863
809 return response; 864 return response;
810 } 865 }
diff --git a/OpenSim/Region/Physics/Meshing/SculptMap.cs b/OpenSim/Region/Physics/Meshing/SculptMap.cs
index d2d71de..740424e 100644
--- a/OpenSim/Region/Physics/Meshing/SculptMap.cs
+++ b/OpenSim/Region/Physics/Meshing/SculptMap.cs
@@ -62,6 +62,8 @@ namespace PrimMesher
62 62
63 bool needsScaling = false; 63 bool needsScaling = false;
64 64
65 bool smallMap = bmW * bmH <= lod * lod;
66
65 width = bmW; 67 width = bmW;
66 height = bmH; 68 height = bmH;
67 while (width * height > numLodPixels) 69 while (width * height > numLodPixels)
@@ -104,9 +106,14 @@ namespace PrimMesher
104 { 106 {
105 for (int x = 0; x <= width; x++) 107 for (int x = 0; x <= width; x++)
106 { 108 {
107 int bmY = y < height ? y * 2 : y * 2 - 1; 109 Color c;
108 int bmX = x < width ? x * 2 : x * 2 - 1; 110
109 Color c = bm.GetPixel(bmX, bmY); 111 if (smallMap)
112 c = bm.GetPixel(x < width ? x : x - 1,
113 y < height ? y : y - 1);
114 else
115 c = bm.GetPixel(x < width ? x * 2 : x * 2 - 1,
116 y < height ? y * 2 : y * 2 - 1);
110 117
111 redBytes[byteNdx] = c.R; 118 redBytes[byteNdx] = c.R;
112 greenBytes[byteNdx] = c.G; 119 greenBytes[byteNdx] = c.G;
diff --git a/OpenSim/Services/FreeswitchService/FreeswitchService.cs b/OpenSim/Services/FreeswitchService/FreeswitchService.cs
index fe6f5cd..1ec89da 100644
--- a/OpenSim/Services/FreeswitchService/FreeswitchService.cs
+++ b/OpenSim/Services/FreeswitchService/FreeswitchService.cs
@@ -50,13 +50,13 @@ namespace OpenSim.Services.FreeswitchService
50 50
51 public Hashtable HandleDialplanRequest(Hashtable request) 51 public Hashtable HandleDialplanRequest(Hashtable request)
52 { 52 {
53 m_log.DebugFormat("[FreeSwitchVoice] HandleDialplanRequest called with {0}",request.ToString()); 53 m_log.DebugFormat("[FreeSwitchVoice]: HandleDialplanRequest called with {0}",request.ToString());
54 54
55 Hashtable response = new Hashtable(); 55 Hashtable response = new Hashtable();
56 56
57 foreach (DictionaryEntry item in request) 57 foreach (DictionaryEntry item in request)
58 { 58 {
59 m_log.InfoFormat("[FreeSwitchDirectory] requestBody item {0} {1}",item.Key, item.Value); 59 m_log.InfoFormat("[FreeSwitchDirectory]: requestBody item {0} {1}",item.Key, item.Value);
60 } 60 }
61 61
62 string requestcontext = (string) request["Hunt-Context"]; 62 string requestcontext = (string) request["Hunt-Context"];
@@ -66,7 +66,7 @@ namespace OpenSim.Services.FreeswitchService
66 66
67 if (m_freeSwitchContext != String.Empty && m_freeSwitchContext != requestcontext) 67 if (m_freeSwitchContext != String.Empty && m_freeSwitchContext != requestcontext)
68 { 68 {
69 m_log.Debug("[FreeSwitchDirectory] returning empty as it's for another context"); 69 m_log.Debug("[FreeSwitchDirectory]: returning empty as it's for another context");
70 response["str_response_string"] = ""; 70 response["str_response_string"] = "";
71 } 71 }
72 else 72 else
@@ -116,13 +116,16 @@ namespace OpenSim.Services.FreeswitchService
116 { 116 {
117 Hashtable response = new Hashtable(); 117 Hashtable response = new Hashtable();
118 string domain = (string) request["domain"]; 118 string domain = (string) request["domain"];
119 if (domain != m_freeSwitchRealm) { 119 if (domain != m_freeSwitchRealm)
120 {
120 response["content_type"] = "text/xml"; 121 response["content_type"] = "text/xml";
121 response["keepalive"] = false; 122 response["keepalive"] = false;
122 response["int_response_code"] = 200; 123 response["int_response_code"] = 200;
123 response["str_response_string"] = ""; 124 response["str_response_string"] = "";
124 } else { 125 }
125 m_log.DebugFormat("[FreeSwitchDirectory] HandleDirectoryRequest called with {0}",request.ToString()); 126 else
127 {
128// m_log.DebugFormat("[FreeSwitchDirectory]: HandleDirectoryRequest called with {0}",request.ToString());
126 129
127 // information in the request we might be interested in 130 // information in the request we might be interested in
128 131
@@ -145,7 +148,7 @@ namespace OpenSim.Services.FreeswitchService
145 148
146 foreach (DictionaryEntry item in request) 149 foreach (DictionaryEntry item in request)
147 { 150 {
148 m_log.InfoFormat("[FreeSwitchDirectory] requestBody item {0} {1}", item.Key, item.Value); 151 m_log.DebugFormat("[FreeSwitchDirectory]: requestBody item {0} {1}", item.Key, item.Value);
149 } 152 }
150 153
151 string eventCallingFunction = (string) request["Event-Calling-Function"]; 154 string eventCallingFunction = (string) request["Event-Calling-Function"];
@@ -173,7 +176,7 @@ namespace OpenSim.Services.FreeswitchService
173 } 176 }
174 else 177 else
175 { 178 {
176 m_log.ErrorFormat("[FreeSwitchVoice] HandleDirectoryRequest unknown sip_auth_method {0}",sipAuthMethod); 179 m_log.ErrorFormat("[FreeSwitchVoice]: HandleDirectoryRequest unknown sip_auth_method {0}",sipAuthMethod);
177 response["int_response_code"] = 404; 180 response["int_response_code"] = 404;
178 response["content_type"] = "text/xml"; 181 response["content_type"] = "text/xml";
179 response["str_response_string"] = ""; 182 response["str_response_string"] = "";
@@ -205,7 +208,7 @@ namespace OpenSim.Services.FreeswitchService
205 } 208 }
206 else 209 else
207 { 210 {
208 m_log.ErrorFormat("[FreeSwitchVoice] HandleDirectoryRequest unknown Event-Calling-Function {0}",eventCallingFunction); 211 m_log.ErrorFormat("[FreeSwitchVoice]: HandleDirectoryRequest unknown Event-Calling-Function {0}",eventCallingFunction);
209 response["int_response_code"] = 404; 212 response["int_response_code"] = 404;
210 response["keepalive"] = false; 213 response["keepalive"] = false;
211 response["content_type"] = "text/xml"; 214 response["content_type"] = "text/xml";
@@ -217,7 +220,7 @@ namespace OpenSim.Services.FreeswitchService
217 220
218 private Hashtable HandleRegister(string Context, string Realm, Hashtable request) 221 private Hashtable HandleRegister(string Context, string Realm, Hashtable request)
219 { 222 {
220 m_log.Info("[FreeSwitchDirectory] HandleRegister called"); 223 m_log.Info("[FreeSwitchDirectory]: HandleRegister called");
221 224
222 // TODO the password we return needs to match that sent in the request, this is hard coded for now 225 // TODO the password we return needs to match that sent in the request, this is hard coded for now
223 string password = "1234"; 226 string password = "1234";
@@ -254,7 +257,7 @@ namespace OpenSim.Services.FreeswitchService
254 257
255 private Hashtable HandleInvite(string Context, string Realm, Hashtable request) 258 private Hashtable HandleInvite(string Context, string Realm, Hashtable request)
256 { 259 {
257 m_log.Info("[FreeSwitchDirectory] HandleInvite called"); 260 m_log.Info("[FreeSwitchDirectory]: HandleInvite called");
258 261
259 // TODO the password we return needs to match that sent in the request, this is hard coded for now 262 // TODO the password we return needs to match that sent in the request, this is hard coded for now
260 string password = "1234"; 263 string password = "1234";
@@ -301,7 +304,7 @@ namespace OpenSim.Services.FreeswitchService
301 304
302 private Hashtable HandleLocateUser(String Realm, Hashtable request) 305 private Hashtable HandleLocateUser(String Realm, Hashtable request)
303 { 306 {
304 m_log.Info("[FreeSwitchDirectory] HandleLocateUser called"); 307 m_log.Info("[FreeSwitchDirectory]: HandleLocateUser called");
305 308
306 // TODO the password we return needs to match that sent in the request, this is hard coded for now 309 // TODO the password we return needs to match that sent in the request, this is hard coded for now
307 string domain = (string) request["domain"]; 310 string domain = (string) request["domain"];
@@ -335,7 +338,7 @@ namespace OpenSim.Services.FreeswitchService
335 338
336 private Hashtable HandleConfigSofia(string Context, string Realm, Hashtable request) 339 private Hashtable HandleConfigSofia(string Context, string Realm, Hashtable request)
337 { 340 {
338 m_log.Info("[FreeSwitchDirectory] HandleConfigSofia called"); 341 m_log.Info("[FreeSwitchDirectory]: HandleConfigSofia called.");
339 342
340 // TODO the password we return needs to match that sent in the request, this is hard coded for now 343 // TODO the password we return needs to match that sent in the request, this is hard coded for now
341 string domain = (string) request["domain"]; 344 string domain = (string) request["domain"];
diff --git a/OpenSim/Services/FreeswitchService/FreeswitchServiceBase.cs b/OpenSim/Services/FreeswitchService/FreeswitchServiceBase.cs
index ebbb1b0..25c18b6 100644
--- a/OpenSim/Services/FreeswitchService/FreeswitchServiceBase.cs
+++ b/OpenSim/Services/FreeswitchService/FreeswitchServiceBase.cs
@@ -64,7 +64,7 @@ namespace OpenSim.Services.FreeswitchService
64 m_freeSwitchDefaultWellKnownIP = freeswitchConfig.GetString("ServerAddress", String.Empty); 64 m_freeSwitchDefaultWellKnownIP = freeswitchConfig.GetString("ServerAddress", String.Empty);
65 if (m_freeSwitchDefaultWellKnownIP == String.Empty) 65 if (m_freeSwitchDefaultWellKnownIP == String.Empty)
66 { 66 {
67 m_log.Error("[FREESWITCH]: No FreeswitchServerAddress given, can't continue"); 67 m_log.Error("[FREESWITCH]: No ServerAddress given, cannot start service.");
68 return; 68 return;
69 } 69 }
70 70