aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2011-04-17 18:42:06 +0200
committerMelanie2011-04-17 18:42:06 +0200
commitc02e0e930d078ab5e2d4070df65c3d74f5812cbc (patch)
treeabb12e192cf0675b675d874eb86b65aa4fd177d7 /OpenSim
parentFix the cert validation handler so that it will not block other parts of (diff)
parentMerge branch 'master' into careminster-presence-refactor (diff)
downloadopensim-SC_OLD-c02e0e930d078ab5e2d4070df65c3d74f5812cbc.zip
opensim-SC_OLD-c02e0e930d078ab5e2d4070df65c3d74f5812cbc.tar.gz
opensim-SC_OLD-c02e0e930d078ab5e2d4070df65c3d74f5812cbc.tar.bz2
opensim-SC_OLD-c02e0e930d078ab5e2d4070df65c3d74f5812cbc.tar.xz
Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs196
-rwxr-xr-xOpenSim/Data/Null/NullEstateData.cs6
-rw-r--r--OpenSim/Framework/Servers/HttpServer/AsynchronousRestObjectRequester.cs192
-rw-r--r--OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs131
-rw-r--r--OpenSim/Framework/Servers/HttpServer/SynchronousRestObjectRequester.cs137
-rw-r--r--OpenSim/Framework/WebUtil.cs346
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs9
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs13
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs11
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs1
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs28
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs57
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs52
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs14
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs27
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs10
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs174
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs1
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Authentication/AuthenticationServiceInConnectorModule.cs1
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/GridInfoServiceInConnectorModule.cs1
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Hypergrid/HypergridServiceInConnectorModule.cs1
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs3
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs1
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Login/LLLoginServiceInConnectorModule.cs1
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs1
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs1
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs46
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/FileLoaders/JPEG.cs8
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs8
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/FileLoaders/RAW32.cs7
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/FileLoaders/Terragen.cs8
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/ITerrainLoader.cs1
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs54
-rw-r--r--OpenSim/Region/Framework/Scenes/CoalescedSceneObjects.cs154
-rw-r--r--OpenSim/Region/Framework/Scenes/Prioritizer.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs68
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs19
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs21
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs149
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs25
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs4
-rw-r--r--OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETScene.cs3
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs3
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs2
-rw-r--r--OpenSim/Services/AssetService/AssetService.cs6
-rw-r--r--OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs1
-rw-r--r--OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs1
-rw-r--r--OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs1
-rw-r--r--OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs1
-rw-r--r--OpenSim/Services/Connectors/Freeswitch/RemoteFreeswitchConnector.cs1
-rw-r--r--OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs1
-rw-r--r--OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs2
-rw-r--r--OpenSim/Services/Connectors/Grid/GridServiceConnector.cs1
-rw-r--r--OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs1
-rw-r--r--OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs1
-rw-r--r--OpenSim/Services/Connectors/Land/LandServiceConnector.cs1
-rw-r--r--OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs1
-rw-r--r--OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs1
-rw-r--r--OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs1
-rw-r--r--OpenSim/Services/Interfaces/IAssetService.cs5
-rw-r--r--OpenSim/Tests/Common/Mock/MockAssetService.cs109
-rw-r--r--OpenSim/Tests/Common/Mock/MockInventoryService.cs186
-rw-r--r--OpenSim/Tests/Common/Setup/AssetHelpers.cs38
-rw-r--r--OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs98
71 files changed, 1411 insertions, 1067 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index 9659883..10cd3d5 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -94,7 +94,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
94 94
95 public void Initialise() 95 public void Initialise()
96 { 96 {
97 m_log.Info("[RADMIN]: " + Name + " cannot be default-initialized!"); 97 m_log.Error("[RADMIN]: " + Name + " cannot be default-initialized!");
98 throw new PluginNotInitialisedException(Name); 98 throw new PluginNotInitialisedException(Name);
99 } 99 }
100 100
@@ -111,7 +111,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
111 else 111 else
112 { 112 {
113 m_config = m_configSource.Configs["RemoteAdmin"]; 113 m_config = m_configSource.Configs["RemoteAdmin"];
114 m_log.Info("[RADMIN]: Remote Admin Plugin Enabled"); 114 m_log.Debug("[RADMIN]: Remote Admin Plugin Enabled");
115 m_requiredPassword = m_config.GetString("access_password", String.Empty); 115 m_requiredPassword = m_config.GetString("access_password", String.Empty);
116 int port = m_config.GetInt("port", 0); 116 int port = m_config.GetInt("port", 0);
117 117
@@ -266,8 +266,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
266 } 266 }
267 catch (Exception e) 267 catch (Exception e)
268 { 268 {
269 m_log.ErrorFormat("[RADMIN]: Restart region: failed: {0}", e.Message); 269 m_log.ErrorFormat("[RADMIN]: Restart region: failed: {0} {1}", e.Message, e.StackTrace);
270 m_log.DebugFormat("[RADMIN]: Restart region: failed: {0}", e.ToString());
271 responseData["accepted"] = false; 270 responseData["accepted"] = false;
272 responseData["success"] = false; 271 responseData["success"] = false;
273 responseData["rebooting"] = false; 272 responseData["rebooting"] = false;
@@ -313,8 +312,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
313 } 312 }
314 catch (Exception e) 313 catch (Exception e)
315 { 314 {
316 m_log.ErrorFormat("[RADMIN]: Broadcasting: failed: {0}", e.Message); 315 m_log.ErrorFormat("[RADMIN]: Broadcasting: failed: {0}", e.Message, e.StackTrace);
317 m_log.DebugFormat("[RADMIN]: Broadcasting: failed: {0}", e.ToString());
318 316
319 responseData["accepted"] = false; 317 responseData["accepted"] = false;
320 responseData["success"] = false; 318 responseData["success"] = false;
@@ -384,7 +382,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
384 { 382 {
385 Hashtable requestData = (Hashtable) request.Params[0]; 383 Hashtable requestData = (Hashtable) request.Params[0];
386 384
387 m_log.DebugFormat("[RADMIN]: Load Terrain: XmlRpc {0}", request.ToString()); 385 m_log.DebugFormat("[RADMIN]: Load Terrain: XmlRpc {0}", request);
388 // foreach (string k in requestData.Keys) 386 // foreach (string k in requestData.Keys)
389 // { 387 // {
390 // m_log.DebugFormat("[RADMIN]: Load Terrain: XmlRpc {0}: >{1}< {2}", 388 // m_log.DebugFormat("[RADMIN]: Load Terrain: XmlRpc {0}: >{1}< {2}",
@@ -431,8 +429,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
431 } 429 }
432 catch (Exception e) 430 catch (Exception e)
433 { 431 {
434 m_log.ErrorFormat("[RADMIN]: Terrain Loading: failed: {0}", e.Message); 432 m_log.ErrorFormat("[RADMIN]: Terrain Loading: failed: {0} {1}", e.Message, e.StackTrace);
435 m_log.DebugFormat("[RADMIN]: Terrain Loading: failed: {0}", e.ToString());
436 433
437 responseData["success"] = false; 434 responseData["success"] = false;
438 responseData["error"] = e.Message; 435 responseData["error"] = e.Message;
@@ -520,14 +517,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController
520 } 517 }
521 catch (Exception e) 518 catch (Exception e)
522 { 519 {
523 m_log.ErrorFormat("[RADMIN] Shutdown: failed: {0}", e.Message); 520 m_log.ErrorFormat("[RADMIN]: Shutdown: failed: {0} {1}", e.Message, e.StackTrace);
524 m_log.DebugFormat("[RADMIN] Shutdown: failed: {0}", e.ToString());
525 521
526 responseData["accepted"] = false; 522 responseData["accepted"] = false;
527 responseData["error"] = e.Message; 523 responseData["error"] = e.Message;
528 524
529 response.Value = responseData; 525 response.Value = responseData;
530 } 526 }
527
531 m_log.Info("[RADMIN]: Shutdown Administrator Request complete"); 528 m_log.Info("[RADMIN]: Shutdown Administrator Request complete");
532 return response; 529 return response;
533 } 530 }
@@ -828,8 +825,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
828 } 825 }
829 catch (Exception e) 826 catch (Exception e)
830 { 827 {
831 m_log.ErrorFormat("[RADMIN] CreateRegion: failed {0}", e.Message); 828 m_log.ErrorFormat("[RADMIN] CreateRegion: failed {0} {1}", e.Message, e.StackTrace);
832 m_log.DebugFormat("[RADMIN] CreateRegion: failed {0}", e.ToString());
833 829
834 responseData["success"] = false; 830 responseData["success"] = false;
835 responseData["error"] = e.Message; 831 responseData["error"] = e.Message;
@@ -895,8 +891,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
895 } 891 }
896 catch (Exception e) 892 catch (Exception e)
897 { 893 {
898 m_log.ErrorFormat("[RADMIN] DeleteRegion: failed {0}", e.Message); 894 m_log.ErrorFormat("[RADMIN] DeleteRegion: failed {0} {1}", e.Message, e.StackTrace);
899 m_log.DebugFormat("[RADMIN] DeleteRegion: failed {0}", e.ToString());
900 895
901 responseData["success"] = false; 896 responseData["success"] = false;
902 responseData["error"] = e.Message; 897 responseData["error"] = e.Message;
@@ -987,8 +982,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
987 } 982 }
988 catch (Exception e) 983 catch (Exception e)
989 { 984 {
990 m_log.ErrorFormat("[RADMIN] CloseRegion: failed {0}", e.Message); 985 m_log.ErrorFormat("[RADMIN]: CloseRegion: failed {0} {1}", e.Message, e.StackTrace);
991 m_log.DebugFormat("[RADMIN] CloseRegion: failed {0}", e.ToString());
992 986
993 responseData["success"] = false; 987 responseData["success"] = false;
994 responseData["error"] = e.Message; 988 responseData["error"] = e.Message;
@@ -1085,8 +1079,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1085 } 1079 }
1086 catch (Exception e) 1080 catch (Exception e)
1087 { 1081 {
1088 m_log.ErrorFormat("[RADMIN] ModifyRegion: failed {0}", e.Message); 1082 m_log.ErrorFormat("[RADMIN] ModifyRegion: failed {0} {1}", e.Message, e.StackTrace);
1089 m_log.DebugFormat("[RADMIN] ModifyRegion: failed {0}", e.ToString());
1090 1083
1091 responseData["success"] = false; 1084 responseData["success"] = false;
1092 responseData["error"] = e.Message; 1085 responseData["error"] = e.Message;
@@ -1209,8 +1202,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1209 } 1202 }
1210 catch (Exception e) 1203 catch (Exception e)
1211 { 1204 {
1212 m_log.ErrorFormat("[RADMIN] CreateUser: failed: {0}", e.Message); 1205 m_log.ErrorFormat("[RADMIN]: CreateUser: failed: {0} {1}", e.Message, e.StackTrace);
1213 m_log.DebugFormat("[RADMIN] CreateUser: failed: {0}", e.ToString());
1214 1206
1215 responseData["success"] = false; 1207 responseData["success"] = false;
1216 responseData["avatar_uuid"] = UUID.Zero.ToString(); 1208 responseData["avatar_uuid"] = UUID.Zero.ToString();
@@ -1301,8 +1293,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1301 } 1293 }
1302 catch (Exception e) 1294 catch (Exception e)
1303 { 1295 {
1304 m_log.ErrorFormat("[RADMIN] UserExists: failed: {0}", e.Message); 1296 m_log.ErrorFormat("[RADMIN]: UserExists: failed: {0} {1}", e.Message, e.StackTrace);
1305 m_log.DebugFormat("[RADMIN] UserExists: failed: {0}", e.ToString());
1306 1297
1307 responseData["success"] = false; 1298 responseData["success"] = false;
1308 responseData["error"] = e.Message; 1299 responseData["error"] = e.Message;
@@ -1475,9 +1466,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1475 } 1466 }
1476 catch (Exception e) 1467 catch (Exception e)
1477 { 1468 {
1478 1469 m_log.ErrorFormat("[RADMIN] UpdateUserAccount: failed: {0} {1}", e.Message, e.StackTrace);
1479 m_log.ErrorFormat("[RADMIN] UpdateUserAccount: failed: {0}", e.Message);
1480 m_log.DebugFormat("[RADMIN] UpdateUserAccount: failed: {0}", e.ToString());
1481 1470
1482 responseData["success"] = false; 1471 responseData["success"] = false;
1483 responseData["avatar_uuid"] = UUID.Zero.ToString(); 1472 responseData["avatar_uuid"] = UUID.Zero.ToString();
@@ -1485,6 +1474,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1485 1474
1486 response.Value = responseData; 1475 response.Value = responseData;
1487 } 1476 }
1477
1488 m_log.Info("[RADMIN]: UpdateUserAccount: request complete"); 1478 m_log.Info("[RADMIN]: UpdateUserAccount: request complete");
1489 return response; 1479 return response;
1490 } 1480 }
@@ -1500,7 +1490,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1500 1490
1501 private void UpdateUserAppearance(Hashtable responseData, Hashtable requestData, UUID userid) 1491 private void UpdateUserAppearance(Hashtable responseData, Hashtable requestData, UUID userid)
1502 { 1492 {
1503 m_log.DebugFormat("[RADMIN] updateUserAppearance"); 1493 m_log.DebugFormat("[RADMIN]: updateUserAppearance");
1504 1494
1505 string defaultMale = m_config.GetString("default_male", "Default Male"); 1495 string defaultMale = m_config.GetString("default_male", "Default Male");
1506 string defaultFemale = m_config.GetString("default_female", "Default Female"); 1496 string defaultFemale = m_config.GetString("default_female", "Default Female");
@@ -1540,16 +1530,16 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1540 1530
1541 if (String.IsNullOrEmpty(model)) 1531 if (String.IsNullOrEmpty(model))
1542 { 1532 {
1543 m_log.DebugFormat("[RADMIN] Appearance update not requested"); 1533 m_log.DebugFormat("[RADMIN]: Appearance update not requested");
1544 return; 1534 return;
1545 } 1535 }
1546 1536
1547 m_log.DebugFormat("[RADMIN] Setting appearance for avatar {0}, using model <{1}>", userid, model); 1537 m_log.DebugFormat("[RADMIN]: Setting appearance for avatar {0}, using model <{1}>", userid, model);
1548 1538
1549 string[] modelSpecifiers = model.Split(); 1539 string[] modelSpecifiers = model.Split();
1550 if (modelSpecifiers.Length != 2) 1540 if (modelSpecifiers.Length != 2)
1551 { 1541 {
1552 m_log.WarnFormat("[RADMIN] User appearance not set for {0}. Invalid model name : <{1}>", userid, model); 1542 m_log.WarnFormat("[RADMIN]: User appearance not set for {0}. Invalid model name : <{1}>", userid, model);
1553 // modelSpecifiers = dmodel.Split(); 1543 // modelSpecifiers = dmodel.Split();
1554 return; 1544 return;
1555 } 1545 }
@@ -1560,7 +1550,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1560 1550
1561 if (modelProfile == null) 1551 if (modelProfile == null)
1562 { 1552 {
1563 m_log.WarnFormat("[RADMIN] Requested model ({0}) not found. Appearance unchanged", model); 1553 m_log.WarnFormat("[RADMIN]: Requested model ({0}) not found. Appearance unchanged", model);
1564 return; 1554 return;
1565 } 1555 }
1566 1556
@@ -1570,7 +1560,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1570 1560
1571 EstablishAppearance(userid, modelProfile.PrincipalID); 1561 EstablishAppearance(userid, modelProfile.PrincipalID);
1572 1562
1573 m_log.DebugFormat("[RADMIN] Finished setting appearance for avatar {0}, using model {1}", 1563 m_log.DebugFormat("[RADMIN]: Finished setting appearance for avatar {0}, using model {1}",
1574 userid, model); 1564 userid, model);
1575 } 1565 }
1576 1566
@@ -1582,7 +1572,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1582 1572
1583 private void EstablishAppearance(UUID destination, UUID source) 1573 private void EstablishAppearance(UUID destination, UUID source)
1584 { 1574 {
1585 m_log.DebugFormat("[RADMIN] Initializing inventory for {0} from {1}", destination, source); 1575 m_log.DebugFormat("[RADMIN]: Initializing inventory for {0} from {1}", destination, source);
1586 Scene scene = m_application.SceneManager.CurrentOrFirstScene; 1576 Scene scene = m_application.SceneManager.CurrentOrFirstScene;
1587 1577
1588 // If the model has no associated appearance we're done. 1578 // If the model has no associated appearance we're done.
@@ -1604,7 +1594,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1604 } 1594 }
1605 catch (Exception e) 1595 catch (Exception e)
1606 { 1596 {
1607 m_log.WarnFormat("[RADMIN] Error transferring appearance for {0} : {1}", 1597 m_log.WarnFormat("[RADMIN]: Error transferring appearance for {0} : {1}",
1608 destination, e.Message); 1598 destination, e.Message);
1609 } 1599 }
1610 1600
@@ -1635,7 +1625,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1635 } 1625 }
1636 catch (Exception e) 1626 catch (Exception e)
1637 { 1627 {
1638 m_log.WarnFormat("[RADMIN] Error transferring appearance for {0} : {1}", 1628 m_log.WarnFormat("[RADMIN]: Error transferring appearance for {0} : {1}",
1639 destination, e.Message); 1629 destination, e.Message);
1640 } 1630 }
1641 1631
@@ -1670,7 +1660,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1670 destinationFolder.ParentID = inventoryService.GetRootFolder(destination).ID; 1660 destinationFolder.ParentID = inventoryService.GetRootFolder(destination).ID;
1671 destinationFolder.Version = 1; 1661 destinationFolder.Version = 1;
1672 inventoryService.AddFolder(destinationFolder); // store base record 1662 inventoryService.AddFolder(destinationFolder); // store base record
1673 m_log.ErrorFormat("[RADMIN] Created folder for destination {0}", source); 1663 m_log.ErrorFormat("[RADMIN]: Created folder for destination {0}", source);
1674 } 1664 }
1675 1665
1676 // Wearables 1666 // Wearables
@@ -1690,6 +1680,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1690 { 1680 {
1691 InventoryItemBase destinationItem = new InventoryItemBase(UUID.Random(), destination); 1681 InventoryItemBase destinationItem = new InventoryItemBase(UUID.Random(), destination);
1692 destinationItem.Name = item.Name; 1682 destinationItem.Name = item.Name;
1683 destinationItem.Owner = destination;
1693 destinationItem.Description = item.Description; 1684 destinationItem.Description = item.Description;
1694 destinationItem.InvType = item.InvType; 1685 destinationItem.InvType = item.InvType;
1695 destinationItem.CreatorId = item.CreatorId; 1686 destinationItem.CreatorId = item.CreatorId;
@@ -1709,6 +1700,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1709 destinationItem.Flags = item.Flags; 1700 destinationItem.Flags = item.Flags;
1710 destinationItem.CreationDate = item.CreationDate; 1701 destinationItem.CreationDate = item.CreationDate;
1711 destinationItem.Folder = destinationFolder.ID; 1702 destinationItem.Folder = destinationFolder.ID;
1703 ApplyNextOwnerPermissions(destinationItem);
1712 1704
1713 m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(destinationItem); 1705 m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(destinationItem);
1714 m_log.DebugFormat("[RADMIN]: Added item {0} to folder {1}", destinationItem.ID, destinationFolder.ID); 1706 m_log.DebugFormat("[RADMIN]: Added item {0} to folder {1}", destinationItem.ID, destinationFolder.ID);
@@ -1743,6 +1735,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1743 { 1735 {
1744 InventoryItemBase destinationItem = new InventoryItemBase(UUID.Random(), destination); 1736 InventoryItemBase destinationItem = new InventoryItemBase(UUID.Random(), destination);
1745 destinationItem.Name = item.Name; 1737 destinationItem.Name = item.Name;
1738 destinationItem.Owner = destination;
1746 destinationItem.Description = item.Description; 1739 destinationItem.Description = item.Description;
1747 destinationItem.InvType = item.InvType; 1740 destinationItem.InvType = item.InvType;
1748 destinationItem.CreatorId = item.CreatorId; 1741 destinationItem.CreatorId = item.CreatorId;
@@ -1762,6 +1755,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1762 destinationItem.Flags = item.Flags; 1755 destinationItem.Flags = item.Flags;
1763 destinationItem.CreationDate = item.CreationDate; 1756 destinationItem.CreationDate = item.CreationDate;
1764 destinationItem.Folder = destinationFolder.ID; 1757 destinationItem.Folder = destinationFolder.ID;
1758 ApplyNextOwnerPermissions(destinationItem);
1765 1759
1766 m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(destinationItem); 1760 m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(destinationItem);
1767 m_log.DebugFormat("[RADMIN]: Added item {0} to folder {1}", destinationItem.ID, destinationFolder.ID); 1761 m_log.DebugFormat("[RADMIN]: Added item {0} to folder {1}", destinationItem.ID, destinationFolder.ID);
@@ -1819,13 +1813,17 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1819 { 1813 {
1820 destinationFolder = new InventoryFolderBase(); 1814 destinationFolder = new InventoryFolderBase();
1821 destinationFolder.ID = UUID.Random(); 1815 destinationFolder.ID = UUID.Random();
1822 destinationFolder.Name = assetType.ToString(); 1816 if (assetType == AssetType.Clothing) {
1817 destinationFolder.Name = "Clothing";
1818 } else {
1819 destinationFolder.Name = "Body Parts";
1820 }
1823 destinationFolder.Owner = destination; 1821 destinationFolder.Owner = destination;
1824 destinationFolder.Type = (short)assetType; 1822 destinationFolder.Type = (short)assetType;
1825 destinationFolder.ParentID = inventoryService.GetRootFolder(destination).ID; 1823 destinationFolder.ParentID = inventoryService.GetRootFolder(destination).ID;
1826 destinationFolder.Version = 1; 1824 destinationFolder.Version = 1;
1827 inventoryService.AddFolder(destinationFolder); // store base record 1825 inventoryService.AddFolder(destinationFolder); // store base record
1828 m_log.ErrorFormat("[RADMIN] Created folder for destination {0}", source); 1826 m_log.ErrorFormat("[RADMIN]: Created folder for destination {0}", source);
1829 } 1827 }
1830 1828
1831 InventoryFolderBase extraFolder; 1829 InventoryFolderBase extraFolder;
@@ -1843,7 +1841,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1843 extraFolder.ParentID = destinationFolder.ID; 1841 extraFolder.ParentID = destinationFolder.ID;
1844 inventoryService.AddFolder(extraFolder); 1842 inventoryService.AddFolder(extraFolder);
1845 1843
1846 m_log.DebugFormat("[RADMIN] Added folder {0} to folder {1}", extraFolder.ID, sourceFolder.ID); 1844 m_log.DebugFormat("[RADMIN]: Added folder {0} to folder {1}", extraFolder.ID, sourceFolder.ID);
1847 1845
1848 List<InventoryItemBase> items = inventoryService.GetFolderContent(source, folder.ID).Items; 1846 List<InventoryItemBase> items = inventoryService.GetFolderContent(source, folder.ID).Items;
1849 1847
@@ -1851,6 +1849,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1851 { 1849 {
1852 InventoryItemBase destinationItem = new InventoryItemBase(UUID.Random(), destination); 1850 InventoryItemBase destinationItem = new InventoryItemBase(UUID.Random(), destination);
1853 destinationItem.Name = item.Name; 1851 destinationItem.Name = item.Name;
1852 destinationItem.Owner = destination;
1854 destinationItem.Description = item.Description; 1853 destinationItem.Description = item.Description;
1855 destinationItem.InvType = item.InvType; 1854 destinationItem.InvType = item.InvType;
1856 destinationItem.CreatorId = item.CreatorId; 1855 destinationItem.CreatorId = item.CreatorId;
@@ -1870,6 +1869,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1870 destinationItem.Flags = item.Flags; 1869 destinationItem.Flags = item.Flags;
1871 destinationItem.CreationDate = item.CreationDate; 1870 destinationItem.CreationDate = item.CreationDate;
1872 destinationItem.Folder = extraFolder.ID; 1871 destinationItem.Folder = extraFolder.ID;
1872 ApplyNextOwnerPermissions(destinationItem);
1873 1873
1874 m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(destinationItem); 1874 m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(destinationItem);
1875 inventoryMap.Add(item.ID, destinationItem.ID); 1875 inventoryMap.Add(item.ID, destinationItem.ID);
@@ -1887,6 +1887,29 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1887 } 1887 }
1888 1888
1889 /// <summary> 1889 /// <summary>
1890 /// Apply next owner permissions.
1891 /// </summary>
1892
1893 private void ApplyNextOwnerPermissions(InventoryItemBase item)
1894 {
1895 if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0)
1896 {
1897 if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
1898 item.CurrentPermissions &= ~(uint)PermissionMask.Copy;
1899 if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0)
1900 item.CurrentPermissions &= ~(uint)PermissionMask.Transfer;
1901 if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
1902 item.CurrentPermissions &= ~(uint)PermissionMask.Modify;
1903 }
1904 item.CurrentPermissions &= item.NextPermissions;
1905 item.BasePermissions &= item.NextPermissions;
1906 item.EveryOnePermissions &= item.NextPermissions;
1907 // item.OwnerChanged = true;
1908 // item.PermsMask = 0;
1909 // item.PermsGranter = UUID.Zero;
1910 }
1911
1912 /// <summary>
1890 /// This method is called if a given model avatar name can not be found. If the external 1913 /// This method is called if a given model avatar name can not be found. If the external
1891 /// file has already been loaded once, then control returns immediately. If not, then it 1914 /// file has already been loaded once, then control returns immediately. If not, then it
1892 /// looks for a default appearance file. This file contains XML definitions of zero or more named 1915 /// looks for a default appearance file. This file contains XML definitions of zero or more named
@@ -1895,7 +1918,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1895 /// indicate which outfit is the default, and this outfit will be automatically worn. The 1918 /// indicate which outfit is the default, and this outfit will be automatically worn. The
1896 /// other outfits are provided to allow "real" avatars a way to easily change their outfits. 1919 /// other outfits are provided to allow "real" avatars a way to easily change their outfits.
1897 /// </summary> 1920 /// </summary>
1898
1899 private bool CreateDefaultAvatars() 1921 private bool CreateDefaultAvatars()
1900 { 1922 {
1901 // Only load once 1923 // Only load once
@@ -1904,7 +1926,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1904 return false; 1926 return false;
1905 } 1927 }
1906 1928
1907 m_log.DebugFormat("[RADMIN] Creating default avatar entries"); 1929 m_log.DebugFormat("[RADMIN]: Creating default avatar entries");
1908 1930
1909 m_defaultAvatarsLoaded = true; 1931 m_defaultAvatarsLoaded = true;
1910 1932
@@ -1960,7 +1982,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1960 1982
1961 foreach (XmlElement avatar in avatars) 1983 foreach (XmlElement avatar in avatars)
1962 { 1984 {
1963 m_log.DebugFormat("[RADMIN] Loading appearance for {0}, gender = {1}", 1985 m_log.DebugFormat("[RADMIN]: Loading appearance for {0}, gender = {1}",
1964 GetStringAttribute(avatar,"name","?"), GetStringAttribute(avatar,"gender","?")); 1986 GetStringAttribute(avatar,"name","?"), GetStringAttribute(avatar,"gender","?"));
1965 1987
1966 // Create the user identified by the avatar entry 1988 // Create the user identified by the avatar entry
@@ -1982,7 +2004,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1982 account = CreateUser(scopeID, names[0], names[1], password, email); 2004 account = CreateUser(scopeID, names[0], names[1], password, email);
1983 if (null == account) 2005 if (null == account)
1984 { 2006 {
1985 m_log.ErrorFormat("[RADMIN] Avatar {0} {1} was not created", names[0], names[1]); 2007 m_log.ErrorFormat("[RADMIN]: Avatar {0} {1} was not created", names[0], names[1]);
1986 return false; 2008 return false;
1987 } 2009 }
1988 } 2010 }
@@ -2000,12 +2022,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2000 2022
2001 ID = account.PrincipalID; 2023 ID = account.PrincipalID;
2002 2024
2003 m_log.DebugFormat("[RADMIN] User {0}[{1}] created or retrieved", name, ID); 2025 m_log.DebugFormat("[RADMIN]: User {0}[{1}] created or retrieved", name, ID);
2004 include = true; 2026 include = true;
2005 } 2027 }
2006 catch (Exception e) 2028 catch (Exception e)
2007 { 2029 {
2008 m_log.DebugFormat("[RADMIN] Error creating user {0} : {1}", name, e.Message); 2030 m_log.DebugFormat("[RADMIN]: Error creating user {0} : {1}", name, e.Message);
2009 include = false; 2031 include = false;
2010 } 2032 }
2011 2033
@@ -2045,7 +2067,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2045 clothingFolder.ParentID = inventoryService.GetRootFolder(ID).ID; 2067 clothingFolder.ParentID = inventoryService.GetRootFolder(ID).ID;
2046 clothingFolder.Version = 1; 2068 clothingFolder.Version = 1;
2047 inventoryService.AddFolder(clothingFolder); // store base record 2069 inventoryService.AddFolder(clothingFolder); // store base record
2048 m_log.ErrorFormat("[RADMIN] Created clothing folder for {0}/{1}", name, ID); 2070 m_log.ErrorFormat("[RADMIN]: Created clothing folder for {0}/{1}", name, ID);
2049 } 2071 }
2050 2072
2051 // OK, now we have an inventory for the user, read in the outfits from the 2073 // OK, now we have an inventory for the user, read in the outfits from the
@@ -2058,7 +2080,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2058 2080
2059 foreach (XmlElement outfit in outfits) 2081 foreach (XmlElement outfit in outfits)
2060 { 2082 {
2061 m_log.DebugFormat("[RADMIN] Loading outfit {0} for {1}", 2083 m_log.DebugFormat("[RADMIN]: Loading outfit {0} for {1}",
2062 GetStringAttribute(outfit,"name","?"), GetStringAttribute(avatar,"name","?")); 2084 GetStringAttribute(outfit,"name","?"), GetStringAttribute(avatar,"name","?"));
2063 2085
2064 outfitName = GetStringAttribute(outfit,"name",""); 2086 outfitName = GetStringAttribute(outfit,"name","");
@@ -2082,7 +2104,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2082 // Otherwise, we must create the folder. 2104 // Otherwise, we must create the folder.
2083 if (extraFolder == null) 2105 if (extraFolder == null)
2084 { 2106 {
2085 m_log.DebugFormat("[RADMIN] Creating outfit folder {0} for {1}", outfitName, name); 2107 m_log.DebugFormat("[RADMIN]: Creating outfit folder {0} for {1}", outfitName, name);
2086 extraFolder = new InventoryFolderBase(); 2108 extraFolder = new InventoryFolderBase();
2087 extraFolder.ID = UUID.Random(); 2109 extraFolder.ID = UUID.Random();
2088 extraFolder.Name = outfitName; 2110 extraFolder.Name = outfitName;
@@ -2091,7 +2113,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2091 extraFolder.Version = 1; 2113 extraFolder.Version = 1;
2092 extraFolder.ParentID = clothingFolder.ID; 2114 extraFolder.ParentID = clothingFolder.ID;
2093 inventoryService.AddFolder(extraFolder); 2115 inventoryService.AddFolder(extraFolder);
2094 m_log.DebugFormat("[RADMIN] Adding outfile folder {0} to folder {1}", extraFolder.ID, clothingFolder.ID); 2116 m_log.DebugFormat("[RADMIN]: Adding outfile folder {0} to folder {1}", extraFolder.ID, clothingFolder.ID);
2095 } 2117 }
2096 2118
2097 // Now get the pieces that make up the outfit 2119 // Now get the pieces that make up the outfit
@@ -2106,7 +2128,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2106 switch (child.Name) 2128 switch (child.Name)
2107 { 2129 {
2108 case "Permissions" : 2130 case "Permissions" :
2109 m_log.DebugFormat("[RADMIN] Permissions specified"); 2131 m_log.DebugFormat("[RADMIN]: Permissions specified");
2110 perms = child; 2132 perms = child;
2111 break; 2133 break;
2112 case "Asset" : 2134 case "Asset" :
@@ -2156,7 +2178,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2156 inventoryItem.Folder = extraFolder.ID; // Parent folder 2178 inventoryItem.Folder = extraFolder.ID; // Parent folder
2157 2179
2158 m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(inventoryItem); 2180 m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(inventoryItem);
2159 m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", inventoryItem.ID, extraFolder.ID); 2181 m_log.DebugFormat("[RADMIN]: Added item {0} to folder {1}", inventoryItem.ID, extraFolder.ID);
2160 } 2182 }
2161 2183
2162 // Attach item, if attachpoint is specified 2184 // Attach item, if attachpoint is specified
@@ -2164,7 +2186,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2164 if (attachpoint != 0) 2186 if (attachpoint != 0)
2165 { 2187 {
2166 avatarAppearance.SetAttachment(attachpoint, inventoryItem.ID, inventoryItem.AssetID); 2188 avatarAppearance.SetAttachment(attachpoint, inventoryItem.ID, inventoryItem.AssetID);
2167 m_log.DebugFormat("[RADMIN] Attached {0}", inventoryItem.ID); 2189 m_log.DebugFormat("[RADMIN]: Attached {0}", inventoryItem.ID);
2168 } 2190 }
2169 2191
2170 // Record whether or not the item is to be initially worn 2192 // Record whether or not the item is to be initially worn
@@ -2177,32 +2199,32 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2177 } 2199 }
2178 catch (Exception e) 2200 catch (Exception e)
2179 { 2201 {
2180 m_log.WarnFormat("[RADMIN] Error wearing item {0} : {1}", inventoryItem.ID, e.Message); 2202 m_log.WarnFormat("[RADMIN]: Error wearing item {0} : {1}", inventoryItem.ID, e.Message);
2181 } 2203 }
2182 } // foreach item in outfit 2204 } // foreach item in outfit
2183 m_log.DebugFormat("[RADMIN] Outfit {0} load completed", outfitName); 2205 m_log.DebugFormat("[RADMIN]: Outfit {0} load completed", outfitName);
2184 } // foreach outfit 2206 } // foreach outfit
2185 m_log.DebugFormat("[RADMIN] Inventory update complete for {0}", name); 2207 m_log.DebugFormat("[RADMIN]: Inventory update complete for {0}", name);
2186 scene.AvatarService.SetAppearance(ID, avatarAppearance); 2208 scene.AvatarService.SetAppearance(ID, avatarAppearance);
2187 } 2209 }
2188 catch (Exception e) 2210 catch (Exception e)
2189 { 2211 {
2190 m_log.WarnFormat("[RADMIN] Inventory processing incomplete for user {0} : {1}", 2212 m_log.WarnFormat("[RADMIN]: Inventory processing incomplete for user {0} : {1}",
2191 name, e.Message); 2213 name, e.Message);
2192 } 2214 }
2193 } // End of include 2215 } // End of include
2194 } 2216 }
2195 m_log.DebugFormat("[RADMIN] Default avatar loading complete"); 2217 m_log.DebugFormat("[RADMIN]: Default avatar loading complete");
2196 } 2218 }
2197 else 2219 else
2198 { 2220 {
2199 m_log.DebugFormat("[RADMIN] No default avatar information available"); 2221 m_log.DebugFormat("[RADMIN]: No default avatar information available");
2200 return false; 2222 return false;
2201 } 2223 }
2202 } 2224 }
2203 catch (Exception e) 2225 catch (Exception e)
2204 { 2226 {
2205 m_log.WarnFormat("[RADMIN] Exception whilst loading default avatars ; {0}", e.Message); 2227 m_log.WarnFormat("[RADMIN]: Exception whilst loading default avatars ; {0}", e.Message);
2206 return false; 2228 return false;
2207 } 2229 }
2208 2230
@@ -2297,8 +2319,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2297 } 2319 }
2298 catch (Exception e) 2320 catch (Exception e)
2299 { 2321 {
2300 m_log.InfoFormat("[RADMIN] LoadOAR: {0}", e.Message); 2322 m_log.ErrorFormat("[RADMIN]: LoadOAR: {0} {1}", e.Message, e.StackTrace);
2301 m_log.DebugFormat("[RADMIN] LoadOAR: {0}", e.ToString());
2302 2323
2303 responseData["loaded"] = false; 2324 responseData["loaded"] = false;
2304 responseData["error"] = e.Message; 2325 responseData["error"] = e.Message;
@@ -2403,8 +2424,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2403 } 2424 }
2404 catch (Exception e) 2425 catch (Exception e)
2405 { 2426 {
2406 m_log.InfoFormat("[RADMIN] SaveOAR: {0}", e.Message); 2427 m_log.ErrorFormat("[RADMIN]: SaveOAR: {0} {1}", e.Message, e.StackTrace);
2407 m_log.DebugFormat("[RADMIN] SaveOAR: {0}", e.ToString());
2408 2428
2409 responseData["saved"] = false; 2429 responseData["saved"] = false;
2410 responseData["error"] = e.Message; 2430 responseData["error"] = e.Message;
@@ -2418,7 +2438,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2418 2438
2419 private void RemoteAdminOarSaveCompleted(Guid uuid, string name) 2439 private void RemoteAdminOarSaveCompleted(Guid uuid, string name)
2420 { 2440 {
2421 m_log.DebugFormat("[RADMIN] File processing complete for {0}", name); 2441 m_log.DebugFormat("[RADMIN]: File processing complete for {0}", name);
2422 lock (m_saveOarLock) Monitor.Pulse(m_saveOarLock); 2442 lock (m_saveOarLock) Monitor.Pulse(m_saveOarLock);
2423 } 2443 }
2424 2444
@@ -2456,14 +2476,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2456 UUID region_uuid = (UUID) (string) requestData["region_uuid"]; 2476 UUID region_uuid = (UUID) (string) requestData["region_uuid"];
2457 if (!m_application.SceneManager.TrySetCurrentScene(region_uuid)) 2477 if (!m_application.SceneManager.TrySetCurrentScene(region_uuid))
2458 throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); 2478 throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
2459 m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); 2479 m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_uuid.ToString());
2460 } 2480 }
2461 else if (requestData.Contains("region_name")) 2481 else if (requestData.Contains("region_name"))
2462 { 2482 {
2463 string region_name = (string) requestData["region_name"]; 2483 string region_name = (string) requestData["region_name"];
2464 if (!m_application.SceneManager.TrySetCurrentScene(region_name)) 2484 if (!m_application.SceneManager.TrySetCurrentScene(region_name))
2465 throw new Exception(String.Format("failed to switch to region {0}", region_name)); 2485 throw new Exception(String.Format("failed to switch to region {0}", region_name));
2466 m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); 2486 m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_name);
2467 } 2487 }
2468 else throw new Exception("neither region_name nor region_uuid given"); 2488 else throw new Exception("neither region_name nor region_uuid given");
2469 2489
@@ -2494,8 +2514,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2494 } 2514 }
2495 catch (Exception e) 2515 catch (Exception e)
2496 { 2516 {
2497 m_log.InfoFormat("[RADMIN] LoadXml: {0}", e.Message); 2517 m_log.ErrorFormat("[RADMIN] LoadXml: {0} {1}", e.Message, e.StackTrace);
2498 m_log.DebugFormat("[RADMIN] LoadXml: {0}", e.ToString());
2499 2518
2500 responseData["loaded"] = false; 2519 responseData["loaded"] = false;
2501 responseData["switched"] = false; 2520 responseData["switched"] = false;
@@ -2541,14 +2560,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2541 UUID region_uuid = (UUID) (string) requestData["region_uuid"]; 2560 UUID region_uuid = (UUID) (string) requestData["region_uuid"];
2542 if (!m_application.SceneManager.TrySetCurrentScene(region_uuid)) 2561 if (!m_application.SceneManager.TrySetCurrentScene(region_uuid))
2543 throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); 2562 throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
2544 m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); 2563 m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_uuid.ToString());
2545 } 2564 }
2546 else if (requestData.Contains("region_name")) 2565 else if (requestData.Contains("region_name"))
2547 { 2566 {
2548 string region_name = (string) requestData["region_name"]; 2567 string region_name = (string) requestData["region_name"];
2549 if (!m_application.SceneManager.TrySetCurrentScene(region_name)) 2568 if (!m_application.SceneManager.TrySetCurrentScene(region_name))
2550 throw new Exception(String.Format("failed to switch to region {0}", region_name)); 2569 throw new Exception(String.Format("failed to switch to region {0}", region_name));
2551 m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); 2570 m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_name);
2552 } 2571 }
2553 else throw new Exception("neither region_name nor region_uuid given"); 2572 else throw new Exception("neither region_name nor region_uuid given");
2554 2573
@@ -2580,8 +2599,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2580 } 2599 }
2581 catch (Exception e) 2600 catch (Exception e)
2582 { 2601 {
2583 m_log.InfoFormat("[RADMIN] SaveXml: {0}", e.Message); 2602 m_log.ErrorFormat("[RADMIN]: SaveXml: {0} {1}", e.Message, e.StackTrace);
2584 m_log.DebugFormat("[RADMIN] SaveXml: {0}", e.ToString());
2585 2603
2586 responseData["saved"] = false; 2604 responseData["saved"] = false;
2587 responseData["switched"] = false; 2605 responseData["switched"] = false;
@@ -2620,14 +2638,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2620 UUID region_uuid = (UUID) (string) requestData["region_uuid"]; 2638 UUID region_uuid = (UUID) (string) requestData["region_uuid"];
2621 if (!m_application.SceneManager.TrySetCurrentScene(region_uuid)) 2639 if (!m_application.SceneManager.TrySetCurrentScene(region_uuid))
2622 throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); 2640 throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
2623 m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); 2641 m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_uuid.ToString());
2624 } 2642 }
2625 else if (requestData.Contains("region_name")) 2643 else if (requestData.Contains("region_name"))
2626 { 2644 {
2627 string region_name = (string) requestData["region_name"]; 2645 string region_name = (string) requestData["region_name"];
2628 if (!m_application.SceneManager.TrySetCurrentScene(region_name)) 2646 if (!m_application.SceneManager.TrySetCurrentScene(region_name))
2629 throw new Exception(String.Format("failed to switch to region {0}", region_name)); 2647 throw new Exception(String.Format("failed to switch to region {0}", region_name));
2630 m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); 2648 m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_name);
2631 } 2649 }
2632 else throw new Exception("neither region_name nor region_uuid given"); 2650 else throw new Exception("neither region_name nor region_uuid given");
2633 2651
@@ -2643,7 +2661,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2643 } 2661 }
2644 catch (Exception e) 2662 catch (Exception e)
2645 { 2663 {
2646 m_log.InfoFormat("[RADMIN] RegionQuery: {0}", e.Message); 2664 m_log.InfoFormat("[RADMIN]: RegionQuery: {0}", e.Message);
2647 2665
2648 responseData["success"] = false; 2666 responseData["success"] = false;
2649 responseData["error"] = e.Message; 2667 responseData["error"] = e.Message;
@@ -2684,7 +2702,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2684 } 2702 }
2685 catch (Exception e) 2703 catch (Exception e)
2686 { 2704 {
2687 m_log.InfoFormat("[RADMIN] ConsoleCommand: {0}", e.Message); 2705 m_log.InfoFormat("[RADMIN]: ConsoleCommand: {0}", e.Message);
2688 2706
2689 responseData["success"] = false; 2707 responseData["success"] = false;
2690 responseData["error"] = e.Message; 2708 responseData["error"] = e.Message;
@@ -2721,14 +2739,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2721 UUID region_uuid = (UUID) (string) requestData["region_uuid"]; 2739 UUID region_uuid = (UUID) (string) requestData["region_uuid"];
2722 if (!m_application.SceneManager.TrySetCurrentScene(region_uuid)) 2740 if (!m_application.SceneManager.TrySetCurrentScene(region_uuid))
2723 throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); 2741 throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
2724 m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); 2742 m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_uuid.ToString());
2725 } 2743 }
2726 else if (requestData.Contains("region_name")) 2744 else if (requestData.Contains("region_name"))
2727 { 2745 {
2728 string region_name = (string) requestData["region_name"]; 2746 string region_name = (string) requestData["region_name"];
2729 if (!m_application.SceneManager.TrySetCurrentScene(region_name)) 2747 if (!m_application.SceneManager.TrySetCurrentScene(region_name))
2730 throw new Exception(String.Format("failed to switch to region {0}", region_name)); 2748 throw new Exception(String.Format("failed to switch to region {0}", region_name));
2731 m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); 2749 m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_name);
2732 } 2750 }
2733 else throw new Exception("neither region_name nor region_uuid given"); 2751 else throw new Exception("neither region_name nor region_uuid given");
2734 2752
@@ -2739,7 +2757,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2739 } 2757 }
2740 catch (Exception e) 2758 catch (Exception e)
2741 { 2759 {
2742 m_log.InfoFormat("[RADMIN] Access List Clear Request: {0}", e.Message); 2760 m_log.ErrorFormat("[RADMIN]: Access List Clear Request: {0} {1}", e.Message, e.StackTrace);
2743 2761
2744 responseData["success"] = false; 2762 responseData["success"] = false;
2745 responseData["error"] = e.Message; 2763 responseData["error"] = e.Message;
@@ -2778,14 +2796,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2778 UUID region_uuid = (UUID) (string) requestData["region_uuid"]; 2796 UUID region_uuid = (UUID) (string) requestData["region_uuid"];
2779 if (!m_application.SceneManager.TrySetCurrentScene(region_uuid)) 2797 if (!m_application.SceneManager.TrySetCurrentScene(region_uuid))
2780 throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); 2798 throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
2781 m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); 2799 m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_uuid.ToString());
2782 } 2800 }
2783 else if (requestData.Contains("region_name")) 2801 else if (requestData.Contains("region_name"))
2784 { 2802 {
2785 string region_name = (string) requestData["region_name"]; 2803 string region_name = (string) requestData["region_name"];
2786 if (!m_application.SceneManager.TrySetCurrentScene(region_name)) 2804 if (!m_application.SceneManager.TrySetCurrentScene(region_name))
2787 throw new Exception(String.Format("failed to switch to region {0}", region_name)); 2805 throw new Exception(String.Format("failed to switch to region {0}", region_name));
2788 m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); 2806 m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_name);
2789 } 2807 }
2790 else throw new Exception("neither region_name nor region_uuid given"); 2808 else throw new Exception("neither region_name nor region_uuid given");
2791 2809
@@ -2805,7 +2823,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2805 if (account != null) 2823 if (account != null)
2806 { 2824 {
2807 uuids.Add(account.PrincipalID); 2825 uuids.Add(account.PrincipalID);
2808 m_log.DebugFormat("[RADMIN] adding \"{0}\" to ACL for \"{1}\"", name, scene.RegionInfo.RegionName); 2826 m_log.DebugFormat("[RADMIN]: adding \"{0}\" to ACL for \"{1}\"", name, scene.RegionInfo.RegionName);
2809 } 2827 }
2810 } 2828 }
2811 List<UUID> accessControlList = new List<UUID>(scene.RegionInfo.EstateSettings.EstateAccess); 2829 List<UUID> accessControlList = new List<UUID>(scene.RegionInfo.EstateSettings.EstateAccess);
@@ -2826,7 +2844,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2826 } 2844 }
2827 catch (Exception e) 2845 catch (Exception e)
2828 { 2846 {
2829 m_log.InfoFormat("[RADMIN] Access List Add Request: {0}", e.Message); 2847 m_log.ErrorFormat("[RADMIN]: Access List Add Request: {0} {1}", e.Message, e.StackTrace);
2830 2848
2831 responseData["success"] = false; 2849 responseData["success"] = false;
2832 responseData["error"] = e.Message; 2850 responseData["error"] = e.Message;
@@ -2865,14 +2883,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2865 UUID region_uuid = (UUID) (string) requestData["region_uuid"]; 2883 UUID region_uuid = (UUID) (string) requestData["region_uuid"];
2866 if (!m_application.SceneManager.TrySetCurrentScene(region_uuid)) 2884 if (!m_application.SceneManager.TrySetCurrentScene(region_uuid))
2867 throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); 2885 throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
2868 m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); 2886 m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_uuid.ToString());
2869 } 2887 }
2870 else if (requestData.Contains("region_name")) 2888 else if (requestData.Contains("region_name"))
2871 { 2889 {
2872 string region_name = (string) requestData["region_name"]; 2890 string region_name = (string) requestData["region_name"];
2873 if (!m_application.SceneManager.TrySetCurrentScene(region_name)) 2891 if (!m_application.SceneManager.TrySetCurrentScene(region_name))
2874 throw new Exception(String.Format("failed to switch to region {0}", region_name)); 2892 throw new Exception(String.Format("failed to switch to region {0}", region_name));
2875 m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); 2893 m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_name);
2876 } 2894 }
2877 else throw new Exception("neither region_name nor region_uuid given"); 2895 else throw new Exception("neither region_name nor region_uuid given");
2878 2896
@@ -2913,7 +2931,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2913 } 2931 }
2914 catch (Exception e) 2932 catch (Exception e)
2915 { 2933 {
2916 m_log.InfoFormat("[RADMIN] Access List Remove Request: {0}", e.Message); 2934 m_log.ErrorFormat("[RADMIN]: Access List Remove Request: {0} {1}", e.Message, e.StackTrace);
2917 2935
2918 responseData["success"] = false; 2936 responseData["success"] = false;
2919 responseData["error"] = e.Message; 2937 responseData["error"] = e.Message;
@@ -2952,14 +2970,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2952 UUID region_uuid = (UUID) (string) requestData["region_uuid"]; 2970 UUID region_uuid = (UUID) (string) requestData["region_uuid"];
2953 if (!m_application.SceneManager.TrySetCurrentScene(region_uuid)) 2971 if (!m_application.SceneManager.TrySetCurrentScene(region_uuid))
2954 throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); 2972 throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
2955 m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); 2973 m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_uuid.ToString());
2956 } 2974 }
2957 else if (requestData.Contains("region_name")) 2975 else if (requestData.Contains("region_name"))
2958 { 2976 {
2959 string region_name = (string) requestData["region_name"]; 2977 string region_name = (string) requestData["region_name"];
2960 if (!m_application.SceneManager.TrySetCurrentScene(region_name)) 2978 if (!m_application.SceneManager.TrySetCurrentScene(region_name))
2961 throw new Exception(String.Format("failed to switch to region {0}", region_name)); 2979 throw new Exception(String.Format("failed to switch to region {0}", region_name));
2962 m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); 2980 m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_name);
2963 } 2981 }
2964 else throw new Exception("neither region_name nor region_uuid given"); 2982 else throw new Exception("neither region_name nor region_uuid given");
2965 2983
@@ -2981,7 +2999,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2981 } 2999 }
2982 catch (Exception e) 3000 catch (Exception e)
2983 { 3001 {
2984 m_log.InfoFormat("[RADMIN] Acces List List: {0}", e.Message); 3002 m_log.ErrorFormat("[RADMIN]: Access List List: {0} {1}", e.Message, e.StackTrace);
2985 3003
2986 responseData["success"] = false; 3004 responseData["success"] = false;
2987 responseData["error"] = e.Message; 3005 responseData["error"] = e.Message;
diff --git a/OpenSim/Data/Null/NullEstateData.cs b/OpenSim/Data/Null/NullEstateData.cs
index 0cebff5..8db8064 100755
--- a/OpenSim/Data/Null/NullEstateData.cs
+++ b/OpenSim/Data/Null/NullEstateData.cs
@@ -38,9 +38,9 @@ namespace OpenSim.Data.Null
38{ 38{
39 public class NullEstateStore : IEstateDataStore 39 public class NullEstateStore : IEstateDataStore
40 { 40 {
41 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 41// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
42 42
43 private string m_connectionString; 43// private string m_connectionString;
44 44
45 protected virtual Assembly Assembly 45 protected virtual Assembly Assembly
46 { 46 {
@@ -58,7 +58,7 @@ namespace OpenSim.Data.Null
58 58
59 public void Initialise(string connectionString) 59 public void Initialise(string connectionString)
60 { 60 {
61 m_connectionString = connectionString; 61// m_connectionString = connectionString;
62 } 62 }
63 63
64 private string[] FieldList 64 private string[] FieldList
diff --git a/OpenSim/Framework/Servers/HttpServer/AsynchronousRestObjectRequester.cs b/OpenSim/Framework/Servers/HttpServer/AsynchronousRestObjectRequester.cs
deleted file mode 100644
index 03c12dd..0000000
--- a/OpenSim/Framework/Servers/HttpServer/AsynchronousRestObjectRequester.cs
+++ /dev/null
@@ -1,192 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.IO;
30using System.Net;
31using System.Reflection;
32using System.Text;
33using System.Xml;
34using System.Xml.Serialization;
35using log4net;
36
37namespace OpenSim.Framework.Servers.HttpServer
38{
39 public class AsynchronousRestObjectRequester
40 {
41 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
42
43 /// <summary>
44 /// Perform an asynchronous REST request.
45 /// </summary>
46 /// <param name="verb">GET or POST</param>
47 /// <param name="requestUrl"></param>
48 /// <param name="obj"></param>
49 /// <param name="action"></param>
50 /// <returns></returns>
51 ///
52 /// <exception cref="System.Net.WebException">Thrown if we encounter a
53 /// network issue while posting the request. You'll want to make
54 /// sure you deal with this as they're not uncommon</exception>
55 //
56 public static void MakeRequest<TRequest, TResponse>(string verb,
57 string requestUrl, TRequest obj, Action<TResponse> action)
58 {
59// m_log.DebugFormat("[ASYNC REQUEST]: Starting {0} {1}", verb, requestUrl);
60
61 Type type = typeof (TRequest);
62
63 WebRequest request = WebRequest.Create(requestUrl);
64 WebResponse response = null;
65 TResponse deserial = default(TResponse);
66 XmlSerializer deserializer = new XmlSerializer(typeof (TResponse));
67
68 request.Method = verb;
69
70 if (verb == "POST")
71 {
72 request.ContentType = "text/xml";
73
74 MemoryStream buffer = new MemoryStream();
75
76 XmlWriterSettings settings = new XmlWriterSettings();
77 settings.Encoding = Encoding.UTF8;
78
79 using (XmlWriter writer = XmlWriter.Create(buffer, settings))
80 {
81 XmlSerializer serializer = new XmlSerializer(type);
82 serializer.Serialize(writer, obj);
83 writer.Flush();
84 }
85
86 int length = (int) buffer.Length;
87 request.ContentLength = length;
88
89 request.BeginGetRequestStream(delegate(IAsyncResult res)
90 {
91 Stream requestStream = request.EndGetRequestStream(res);
92
93 requestStream.Write(buffer.ToArray(), 0, length);
94 requestStream.Close();
95
96 request.BeginGetResponse(delegate(IAsyncResult ar)
97 {
98 response = request.EndGetResponse(ar);
99 Stream respStream = null;
100 try
101 {
102 respStream = response.GetResponseStream();
103 deserial = (TResponse)deserializer.Deserialize(
104 respStream);
105 }
106 catch (System.InvalidOperationException)
107 {
108 }
109 finally
110 {
111 // Let's not close this
112 //buffer.Close();
113 respStream.Close();
114 response.Close();
115 }
116
117 action(deserial);
118
119 }, null);
120 }, null);
121
122
123 return;
124 }
125
126 request.BeginGetResponse(delegate(IAsyncResult res2)
127 {
128 try
129 {
130 // If the server returns a 404, this appears to trigger a System.Net.WebException even though that isn't
131 // documented in MSDN
132 response = request.EndGetResponse(res2);
133
134 Stream respStream = null;
135 try
136 {
137 respStream = response.GetResponseStream();
138 deserial = (TResponse)deserializer.Deserialize(respStream);
139 }
140 catch (System.InvalidOperationException)
141 {
142 }
143 finally
144 {
145 respStream.Close();
146 response.Close();
147 }
148 }
149 catch (WebException e)
150 {
151 if (e.Status == WebExceptionStatus.ProtocolError)
152 {
153 if (e.Response is HttpWebResponse)
154 {
155 HttpWebResponse httpResponse = (HttpWebResponse)e.Response;
156
157 if (httpResponse.StatusCode != HttpStatusCode.NotFound)
158 {
159 // We don't appear to be handling any other status codes, so log these feailures to that
160 // people don't spend unnecessary hours hunting phantom bugs.
161 m_log.DebugFormat(
162 "[ASYNC REQUEST]: Request {0} {1} failed with unexpected status code {2}",
163 verb, requestUrl, httpResponse.StatusCode);
164 }
165 }
166 }
167 else
168 {
169 m_log.ErrorFormat("[ASYNC REQUEST]: Request {0} {1} failed with status {2} and message {3}", verb, requestUrl, e.Status, e.Message);
170 }
171 }
172 catch (Exception e)
173 {
174 m_log.ErrorFormat("[ASYNC REQUEST]: Request {0} {1} failed with exception {2}", verb, requestUrl, e);
175 }
176
177 // m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString());
178
179 try
180 {
181 action(deserial);
182 }
183 catch (Exception e)
184 {
185 m_log.ErrorFormat(
186 "[ASYNC REQUEST]: Request {0} {1} callback failed with exception {2}", verb, requestUrl, e);
187 }
188
189 }, null);
190 }
191 }
192}
diff --git a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs
deleted file mode 100644
index d5646d0..0000000
--- a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs
+++ /dev/null
@@ -1,131 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.IO;
30using System.Net;
31using System.Reflection;
32using System.Text;
33using System.Xml;
34using System.Xml.Serialization;
35
36using log4net;
37
38namespace OpenSim.Framework.Servers.HttpServer
39{
40 public class SynchronousRestFormsRequester
41 {
42 private static readonly ILog m_log =
43 LogManager.GetLogger(
44 MethodBase.GetCurrentMethod().DeclaringType);
45
46 /// <summary>
47 /// Perform a synchronous REST request.
48 /// </summary>
49 /// <param name="verb"></param>
50 /// <param name="requestUrl"></param>
51 /// <param name="obj"> </param>
52 /// <returns></returns>
53 ///
54 /// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting
55 /// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
56 public static string MakeRequest(string verb, string requestUrl, string obj)
57 {
58 WebRequest request = WebRequest.Create(requestUrl);
59 request.Method = verb;
60 string respstring = String.Empty;
61
62 using (MemoryStream buffer = new MemoryStream())
63 {
64 if ((verb == "POST") || (verb == "PUT"))
65 {
66 request.ContentType = "text/www-form-urlencoded";
67
68 int length = 0;
69 using (StreamWriter writer = new StreamWriter(buffer))
70 {
71 writer.Write(obj);
72 writer.Flush();
73 }
74
75 length = (int)obj.Length;
76 request.ContentLength = length;
77
78 Stream requestStream = null;
79 try
80 {
81 requestStream = request.GetRequestStream();
82 requestStream.Write(buffer.ToArray(), 0, length);
83 }
84 catch (Exception e)
85 {
86 m_log.DebugFormat("[FORMS]: exception occured on sending request to {0}: with {1} " + e.ToString(), requestUrl,obj);
87 }
88 finally
89 {
90 if (requestStream != null)
91 requestStream.Close();
92 }
93 }
94
95 try
96 {
97 using (WebResponse resp = request.GetResponse())
98 {
99 if (resp.ContentLength != 0)
100 {
101 Stream respStream = null;
102 try
103 {
104 respStream = resp.GetResponseStream();
105 using (StreamReader reader = new StreamReader(respStream))
106 {
107 respstring = reader.ReadToEnd();
108 }
109 }
110 catch (Exception e)
111 {
112 m_log.DebugFormat("[FORMS]: exception occured on receiving reply " + e.ToString());
113 }
114 finally
115 {
116 if (respStream != null)
117 respStream.Close();
118 }
119 }
120 }
121 }
122 catch (System.InvalidOperationException)
123 {
124 // This is what happens when there is invalid XML
125 m_log.DebugFormat("[FORMS]: InvalidOperationException on receiving request");
126 }
127 }
128 return respstring;
129 }
130 }
131}
diff --git a/OpenSim/Framework/Servers/HttpServer/SynchronousRestObjectRequester.cs b/OpenSim/Framework/Servers/HttpServer/SynchronousRestObjectRequester.cs
deleted file mode 100644
index 077a1e8..0000000
--- a/OpenSim/Framework/Servers/HttpServer/SynchronousRestObjectRequester.cs
+++ /dev/null
@@ -1,137 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.IO;
30using System.Net;
31using System.Text;
32using System.Xml;
33using System.Xml.Serialization;
34
35namespace OpenSim.Framework.Servers.HttpServer
36{
37 public class SynchronousRestObjectPoster
38 {
39 [Obsolete]
40 public static TResponse BeginPostObject<TRequest, TResponse>(string verb, string requestUrl, TRequest obj)
41 {
42 return SynchronousRestObjectRequester.MakeRequest<TRequest, TResponse>(verb, requestUrl, obj);
43 }
44 }
45
46 public class SynchronousRestObjectRequester
47 {
48 /// <summary>
49 /// Perform a synchronous REST request.
50 /// </summary>
51 /// <param name="verb"></param>
52 /// <param name="requestUrl"></param>
53 /// <param name="obj"> </param>
54 /// <returns></returns>
55 ///
56 /// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting
57 /// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
58 public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj)
59 {
60 return MakeRequest<TRequest, TResponse>(verb, requestUrl, obj, 100);
61 }
62 /// <summary>
63 /// Perform a synchronous REST request.
64 /// </summary>
65 /// <param name="verb"></param>
66 /// <param name="requestUrl"></param>
67 /// <param name="obj"> </param>
68 /// <param name="timeout"> </param>
69 /// <returns></returns>
70 ///
71 /// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting
72 /// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
73 public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj, int pTimeout)
74 {
75 Type type = typeof (TRequest);
76 TResponse deserial = default(TResponse);
77
78 WebRequest request = WebRequest.Create(requestUrl);
79 request.Method = verb;
80 request.Timeout = pTimeout * 1000;
81
82 if ((verb == "POST") || (verb == "PUT"))
83 {
84 request.ContentType = "text/xml";
85
86 MemoryStream buffer = new MemoryStream();
87
88 XmlWriterSettings settings = new XmlWriterSettings();
89 settings.Encoding = Encoding.UTF8;
90
91 using (XmlWriter writer = XmlWriter.Create(buffer, settings))
92 {
93 XmlSerializer serializer = new XmlSerializer(type);
94 serializer.Serialize(writer, obj);
95 writer.Flush();
96 }
97
98 int length = (int) buffer.Length;
99 request.ContentLength = length;
100 Stream requestStream = null;
101 try
102 {
103 requestStream = request.GetRequestStream();
104 requestStream.Write(buffer.ToArray(), 0, length);
105 }
106 catch (Exception)
107 {
108 return deserial;
109 }
110 finally
111 {
112 if (requestStream != null)
113 requestStream.Close();
114 }
115 }
116
117 try
118 {
119 using (WebResponse resp = request.GetResponse())
120 {
121 if (resp.ContentLength != 0)
122 {
123 Stream respStream = resp.GetResponseStream();
124 XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));
125 deserial = (TResponse)deserializer.Deserialize(respStream);
126 respStream.Close();
127 }
128 }
129 }
130 catch (System.InvalidOperationException)
131 {
132 // This is what happens when there is invalid XML
133 }
134 return deserial;
135 }
136 }
137}
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index f59c8f8..d04a3df 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -36,6 +36,9 @@ using System.Net.Security;
36using System.Reflection; 36using System.Reflection;
37using System.Text; 37using System.Text;
38using System.Web; 38using System.Web;
39using System.Xml;
40using System.Xml.Serialization;
41
39using log4net; 42using log4net;
40using OpenSim.Framework.Servers.HttpServer; 43using OpenSim.Framework.Servers.HttpServer;
41using OpenMetaverse.StructuredData; 44using OpenMetaverse.StructuredData;
@@ -224,8 +227,8 @@ namespace OpenSim.Framework
224 m_log.InfoFormat("[WEB UTIL]: osd request <{0}> (URI:{1}, METHOD:{2}) took {3}ms overall, {4}ms writing", 227 m_log.InfoFormat("[WEB UTIL]: osd request <{0}> (URI:{1}, METHOD:{2}) took {3}ms overall, {4}ms writing",
225 reqnum,url,method,tickdiff,tickdata); 228 reqnum,url,method,tickdiff,tickdata);
226 } 229 }
227 230
228 m_log.WarnFormat("[WEB UTIL] <{0}> osd request failed: {1}",reqnum,errorMessage); 231 m_log.WarnFormat("[WEB UTIL]: <{0}> osd request for {1}, method {2} FAILED: {3}", reqnum, url, method, errorMessage);
229 return ErrorResponseMap(errorMessage); 232 return ErrorResponseMap(errorMessage);
230 } 233 }
231 234
@@ -630,4 +633,343 @@ namespace OpenSim.Framework
630 633
631 634
632 } 635 }
636
637 public static class AsynchronousRestObjectRequester
638 {
639 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
640
641 /// <summary>
642 /// Perform an asynchronous REST request.
643 /// </summary>
644 /// <param name="verb">GET or POST</param>
645 /// <param name="requestUrl"></param>
646 /// <param name="obj"></param>
647 /// <param name="action"></param>
648 /// <returns></returns>
649 ///
650 /// <exception cref="System.Net.WebException">Thrown if we encounter a
651 /// network issue while posting the request. You'll want to make
652 /// sure you deal with this as they're not uncommon</exception>
653 //
654 public static void MakeRequest<TRequest, TResponse>(string verb,
655 string requestUrl, TRequest obj, Action<TResponse> action)
656 {
657 // m_log.DebugFormat("[ASYNC REQUEST]: Starting {0} {1}", verb, requestUrl);
658
659 Type type = typeof(TRequest);
660
661 WebRequest request = WebRequest.Create(requestUrl);
662 WebResponse response = null;
663 TResponse deserial = default(TResponse);
664 XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));
665
666 request.Method = verb;
667
668 if (verb == "POST")
669 {
670 request.ContentType = "text/xml";
671
672 MemoryStream buffer = new MemoryStream();
673
674 XmlWriterSettings settings = new XmlWriterSettings();
675 settings.Encoding = Encoding.UTF8;
676
677 using (XmlWriter writer = XmlWriter.Create(buffer, settings))
678 {
679 XmlSerializer serializer = new XmlSerializer(type);
680 serializer.Serialize(writer, obj);
681 writer.Flush();
682 }
683
684 int length = (int)buffer.Length;
685 request.ContentLength = length;
686
687 request.BeginGetRequestStream(delegate(IAsyncResult res)
688 {
689 Stream requestStream = request.EndGetRequestStream(res);
690
691 requestStream.Write(buffer.ToArray(), 0, length);
692 requestStream.Close();
693
694 request.BeginGetResponse(delegate(IAsyncResult ar)
695 {
696 response = request.EndGetResponse(ar);
697 Stream respStream = null;
698 try
699 {
700 respStream = response.GetResponseStream();
701 deserial = (TResponse)deserializer.Deserialize(
702 respStream);
703 }
704 catch (System.InvalidOperationException)
705 {
706 }
707 finally
708 {
709 // Let's not close this
710 //buffer.Close();
711 respStream.Close();
712 response.Close();
713 }
714
715 action(deserial);
716
717 }, null);
718 }, null);
719
720
721 return;
722 }
723
724 request.BeginGetResponse(delegate(IAsyncResult res2)
725 {
726 try
727 {
728 // If the server returns a 404, this appears to trigger a System.Net.WebException even though that isn't
729 // documented in MSDN
730 response = request.EndGetResponse(res2);
731
732 Stream respStream = null;
733 try
734 {
735 respStream = response.GetResponseStream();
736 deserial = (TResponse)deserializer.Deserialize(respStream);
737 }
738 catch (System.InvalidOperationException)
739 {
740 }
741 finally
742 {
743 respStream.Close();
744 response.Close();
745 }
746 }
747 catch (WebException e)
748 {
749 if (e.Status == WebExceptionStatus.ProtocolError)
750 {
751 if (e.Response is HttpWebResponse)
752 {
753 HttpWebResponse httpResponse = (HttpWebResponse)e.Response;
754
755 if (httpResponse.StatusCode != HttpStatusCode.NotFound)
756 {
757 // We don't appear to be handling any other status codes, so log these feailures to that
758 // people don't spend unnecessary hours hunting phantom bugs.
759 m_log.DebugFormat(
760 "[ASYNC REQUEST]: Request {0} {1} failed with unexpected status code {2}",
761 verb, requestUrl, httpResponse.StatusCode);
762 }
763 }
764 }
765 else
766 {
767 m_log.ErrorFormat("[ASYNC REQUEST]: Request {0} {1} failed with status {2} and message {3}", verb, requestUrl, e.Status, e.Message);
768 }
769 }
770 catch (Exception e)
771 {
772 m_log.ErrorFormat("[ASYNC REQUEST]: Request {0} {1} failed with exception {2}", verb, requestUrl, e);
773 }
774
775 // m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString());
776
777 try
778 {
779 action(deserial);
780 }
781 catch (Exception e)
782 {
783 m_log.ErrorFormat(
784 "[ASYNC REQUEST]: Request {0} {1} callback failed with exception {2}", verb, requestUrl, e);
785 }
786
787 }, null);
788 }
789 }
790
791 public static class SynchronousRestFormsRequester
792 {
793 private static readonly ILog m_log =
794 LogManager.GetLogger(
795 MethodBase.GetCurrentMethod().DeclaringType);
796
797 /// <summary>
798 /// Perform a synchronous REST request.
799 /// </summary>
800 /// <param name="verb"></param>
801 /// <param name="requestUrl"></param>
802 /// <param name="obj"> </param>
803 /// <returns></returns>
804 ///
805 /// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting
806 /// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
807 public static string MakeRequest(string verb, string requestUrl, string obj)
808 {
809 WebRequest request = WebRequest.Create(requestUrl);
810 request.Method = verb;
811 string respstring = String.Empty;
812
813 using (MemoryStream buffer = new MemoryStream())
814 {
815 if ((verb == "POST") || (verb == "PUT"))
816 {
817 request.ContentType = "text/www-form-urlencoded";
818
819 int length = 0;
820 using (StreamWriter writer = new StreamWriter(buffer))
821 {
822 writer.Write(obj);
823 writer.Flush();
824 }
825
826 length = (int)obj.Length;
827 request.ContentLength = length;
828
829 Stream requestStream = null;
830 try
831 {
832 requestStream = request.GetRequestStream();
833 requestStream.Write(buffer.ToArray(), 0, length);
834 }
835 catch (Exception e)
836 {
837 m_log.DebugFormat("[FORMS]: exception occured on sending request to {0}: " + e.ToString(), requestUrl);
838 }
839 finally
840 {
841 if (requestStream != null)
842 requestStream.Close();
843 }
844 }
845
846 try
847 {
848 using (WebResponse resp = request.GetResponse())
849 {
850 if (resp.ContentLength != 0)
851 {
852 Stream respStream = null;
853 try
854 {
855 respStream = resp.GetResponseStream();
856 using (StreamReader reader = new StreamReader(respStream))
857 {
858 respstring = reader.ReadToEnd();
859 }
860 }
861 catch (Exception e)
862 {
863 m_log.DebugFormat("[FORMS]: exception occured on receiving reply " + e.ToString());
864 }
865 finally
866 {
867 if (respStream != null)
868 respStream.Close();
869 }
870 }
871 }
872 }
873 catch (System.InvalidOperationException)
874 {
875 // This is what happens when there is invalid XML
876 m_log.DebugFormat("[FORMS]: InvalidOperationException on receiving request");
877 }
878 }
879 return respstring;
880 }
881 }
882
883 public class SynchronousRestObjectPoster
884 {
885 [Obsolete]
886 public static TResponse BeginPostObject<TRequest, TResponse>(string verb, string requestUrl, TRequest obj)
887 {
888 return SynchronousRestObjectRequester.MakeRequest<TRequest, TResponse>(verb, requestUrl, obj);
889 }
890 }
891
892 public class SynchronousRestObjectRequester
893 {
894 /// <summary>
895 /// Perform a synchronous REST request.
896 /// </summary>
897 /// <param name="verb"></param>
898 /// <param name="requestUrl"></param>
899 /// <param name="obj"> </param>
900 /// <returns></returns>
901 ///
902 /// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting
903 /// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
904 public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj)
905 {
906 return MakeRequest<TRequest, TResponse>(verb, requestUrl, obj, 0);
907 }
908
909 public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj, int pTimeout)
910 {
911 Type type = typeof(TRequest);
912 TResponse deserial = default(TResponse);
913
914 WebRequest request = WebRequest.Create(requestUrl);
915 request.Method = verb;
916 if (pTimeout != 0)
917 request.Timeout = pTimeout * 1000;
918
919 if ((verb == "POST") || (verb == "PUT"))
920 {
921 request.ContentType = "text/xml";
922
923 MemoryStream buffer = new MemoryStream();
924
925 XmlWriterSettings settings = new XmlWriterSettings();
926 settings.Encoding = Encoding.UTF8;
927
928 using (XmlWriter writer = XmlWriter.Create(buffer, settings))
929 {
930 XmlSerializer serializer = new XmlSerializer(type);
931 serializer.Serialize(writer, obj);
932 writer.Flush();
933 }
934
935 int length = (int)buffer.Length;
936 request.ContentLength = length;
937
938 Stream requestStream = null;
939 try
940 {
941 requestStream = request.GetRequestStream();
942 requestStream.Write(buffer.ToArray(), 0, length);
943 }
944 catch (Exception)
945 {
946 return deserial;
947 }
948 finally
949 {
950 if (requestStream != null)
951 requestStream.Close();
952 }
953 }
954
955 try
956 {
957 using (WebResponse resp = request.GetResponse())
958 {
959 if (resp.ContentLength > 0)
960 {
961 Stream respStream = resp.GetResponseStream();
962 XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));
963 deserial = (TResponse)deserializer.Deserialize(respStream);
964 respStream.Close();
965 }
966 }
967 }
968 catch (System.InvalidOperationException)
969 {
970 // This is what happens when there is invalid XML
971 }
972 return deserial;
973 }
974 }
633} 975}
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 4abb6e2..e72159c 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -4351,6 +4351,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4351 4351
4352 public void SendEstateCovenantInformation(UUID covenant) 4352 public void SendEstateCovenantInformation(UUID covenant)
4353 { 4353 {
4354// m_log.DebugFormat("[LLCLIENTVIEW]: Sending estate covenant asset id of {0} to {1}", covenant, Name);
4355
4354 EstateCovenantReplyPacket einfopack = new EstateCovenantReplyPacket(); 4356 EstateCovenantReplyPacket einfopack = new EstateCovenantReplyPacket();
4355 EstateCovenantReplyPacket.DataBlock edata = new EstateCovenantReplyPacket.DataBlock(); 4357 EstateCovenantReplyPacket.DataBlock edata = new EstateCovenantReplyPacket.DataBlock();
4356 edata.CovenantID = covenant; 4358 edata.CovenantID = covenant;
@@ -4361,8 +4363,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4361 OutPacket(einfopack, ThrottleOutPacketType.Task); 4363 OutPacket(einfopack, ThrottleOutPacketType.Task);
4362 } 4364 }
4363 4365
4364 public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, string abuseEmail, UUID estateOwner) 4366 public void SendDetailedEstateData(
4367 UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition,
4368 UUID covenant, string abuseEmail, UUID estateOwner)
4365 { 4369 {
4370// m_log.DebugFormat(
4371// "[LLCLIENTVIEW]: Sending detailed estate data to {0} with covenant asset id {1}", Name, covenant);
4372
4366 EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket(); 4373 EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket();
4367 packet.MethodData.Invoice = invoice; 4374 packet.MethodData.Invoice = invoice;
4368 packet.AgentData.TransactionID = UUID.Random(); 4375 packet.AgentData.TransactionID = UUID.Random();
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs
index 878242a..d2278bc 100644
--- a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs
@@ -54,6 +54,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
54 54
55 private Scene m_scene; 55 private Scene m_scene;
56 private IAssetService m_assetService; 56 private IAssetService m_assetService;
57 private bool m_enabled = true;
57 58
58 #region IRegionModuleBase Members 59 #region IRegionModuleBase Members
59 60
@@ -65,7 +66,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
65 66
66 public void Initialise(IConfigSource source) 67 public void Initialise(IConfigSource source)
67 { 68 {
68 69 IConfig startupConfig = source.Configs["Startup"];
70 if (startupConfig == null)
71 return;
72
73 if (!startupConfig.GetBoolean("ColladaMesh",true))
74 m_enabled = false;
69 } 75 }
70 76
71 public void AddRegion(Scene pScene) 77 public void AddRegion(Scene pScene)
@@ -101,16 +107,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
101 107
102 public void RegisterCaps(UUID agentID, Caps caps) 108 public void RegisterCaps(UUID agentID, Caps caps)
103 { 109 {
110 if(!m_enabled)
111 return;
112
104 UUID capID = UUID.Random(); 113 UUID capID = UUID.Random();
105 114
106// m_log.Info("[GETMESH]: /CAPS/" + capID); 115// m_log.Info("[GETMESH]: /CAPS/" + capID);
116
107 caps.RegisterHandler("GetMesh", 117 caps.RegisterHandler("GetMesh",
108 new RestHTTPHandler("GET", "/CAPS/" + capID, 118 new RestHTTPHandler("GET", "/CAPS/" + capID,
109 delegate(Hashtable m_dhttpMethod) 119 delegate(Hashtable m_dhttpMethod)
110 { 120 {
111 return ProcessGetMesh(m_dhttpMethod, agentID, caps); 121 return ProcessGetMesh(m_dhttpMethod, agentID, caps);
112 })); 122 }));
113
114 } 123 }
115 124
116 #endregion 125 #endregion
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs
index 4a42c93..fb07cc9 100644
--- a/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs
@@ -56,6 +56,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
56 private Scene m_scene; 56 private Scene m_scene;
57// private IAssetService m_assetService; 57// private IAssetService m_assetService;
58 private bool m_dumpAssetsToFile = false; 58 private bool m_dumpAssetsToFile = false;
59 private bool m_enabled = true;
59 60
60 #region IRegionModuleBase Members 61 #region IRegionModuleBase Members
61 62
@@ -67,7 +68,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
67 68
68 public void Initialise(IConfigSource source) 69 public void Initialise(IConfigSource source)
69 { 70 {
70 71 IConfig startupConfig = source.Configs["Startup"];
72 if (startupConfig == null)
73 return;
74
75 if (!startupConfig.GetBoolean("ColladaMesh",true))
76 m_enabled = false;
71 } 77 }
72 78
73 public void AddRegion(Scene pScene) 79 public void AddRegion(Scene pScene)
@@ -103,6 +109,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
103 109
104 public void RegisterCaps(UUID agentID, Caps caps) 110 public void RegisterCaps(UUID agentID, Caps caps)
105 { 111 {
112 if(!m_enabled)
113 return;
114
106 UUID capID = UUID.Random(); 115 UUID capID = UUID.Random();
107 116
108// m_log.Debug("[NEW FILE AGENT INVENTORY VARIABLE PRICE]: /CAPS/" + capID); 117// m_log.Debug("[NEW FILE AGENT INVENTORY VARIABLE PRICE]: /CAPS/" + capID);
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
index 3148871..0cd05e3 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
@@ -34,13 +34,13 @@ using Nini.Config;
34using Nwc.XmlRpc; 34using Nwc.XmlRpc;
35using OpenMetaverse; 35using OpenMetaverse;
36using OpenSim.Framework; 36using OpenSim.Framework;
37using OpenSim.Framework.Servers.HttpServer;
37using OpenSim.Framework.Communications; 38using OpenSim.Framework.Communications;
38using OpenSim.Region.Framework.Interfaces; 39using OpenSim.Region.Framework.Interfaces;
39using OpenSim.Region.Framework.Scenes; 40using OpenSim.Region.Framework.Scenes;
40using OpenSim.Services.Interfaces; 41using OpenSim.Services.Interfaces;
41using OpenSim.Services.Connectors.Friends; 42using OpenSim.Services.Connectors.Friends;
42using OpenSim.Server.Base; 43using OpenSim.Server.Base;
43using OpenSim.Framework.Servers.HttpServer;
44using FriendInfo = OpenSim.Services.Interfaces.FriendInfo; 44using FriendInfo = OpenSim.Services.Interfaces.FriendInfo;
45using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo; 45using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo;
46using GridRegion = OpenSim.Services.Interfaces.GridRegion; 46using GridRegion = OpenSim.Services.Interfaces.GridRegion;
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs
index 164ae50..1a0b914 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs
@@ -33,7 +33,6 @@ using OpenMetaverse;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Communications; 34using OpenSim.Framework.Communications;
35using OpenSim.Framework.Servers; 35using OpenSim.Framework.Servers;
36using OpenSim.Framework.Servers.HttpServer;
37using OpenSim.Framework.Client; 36using OpenSim.Framework.Client;
38using OpenSim.Region.Framework.Interfaces; 37using OpenSim.Region.Framework.Interfaces;
39using OpenSim.Region.Framework.Scenes; 38using OpenSim.Region.Framework.Scenes;
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index 9b98de3..2fff533 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -466,16 +466,30 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
466 if (m_creatorIdForAssetId.ContainsKey(assetId)) 466 if (m_creatorIdForAssetId.ContainsKey(assetId))
467 { 467 {
468 string xmlData = Utils.BytesToString(data); 468 string xmlData = Utils.BytesToString(data);
469 SceneObjectGroup sog = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); 469 List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
470 foreach (SceneObjectPart sop in sog.Parts) 470
471 CoalescedSceneObjects coa = null;
472 if (CoalescedSceneObjectsSerializer.TryFromXml(xmlData, out coa))
473 {
474// m_log.DebugFormat(
475// "[INVENTORY ARCHIVER]: Loaded coalescence {0} has {1} objects", assetId, coa.Count);
476
477 sceneObjects.AddRange(coa.Objects);
478 }
479 else
471 { 480 {
472 if (sop.CreatorData == null || sop.CreatorData == "") 481 sceneObjects.Add(SceneObjectSerializer.FromOriginalXmlFormat(xmlData));
473 {
474 sop.CreatorID = m_creatorIdForAssetId[assetId];
475 }
476 } 482 }
477 483
478 data = Utils.StringToBytes(SceneObjectSerializer.ToOriginalXmlFormat(sog)); 484 foreach (SceneObjectGroup sog in sceneObjects)
485 foreach (SceneObjectPart sop in sog.Parts)
486 if (sop.CreatorData == null || sop.CreatorData == "")
487 sop.CreatorID = m_creatorIdForAssetId[assetId];
488
489 if (coa != null)
490 data = Utils.StringToBytes(CoalescedSceneObjectsSerializer.ToXml(coa));
491 else
492 data = Utils.StringToBytes(SceneObjectSerializer.ToOriginalXmlFormat(sceneObjects[0]));
479 } 493 }
480 } 494 }
481 495
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
index e5127a0..5ba08ee 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiveTestCase.cs
@@ -68,17 +68,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
68 PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000555"), 68 PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000555"),
69 FirstName = "Mr", 69 FirstName = "Mr",
70 LastName = "Tiddles" }; 70 LastName = "Tiddles" };
71
71 protected UserAccount m_uaLL1 72 protected UserAccount m_uaLL1
72 = new UserAccount { 73 = new UserAccount {
73 PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000666"), 74 PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000666"),
74 FirstName = "Lord", 75 FirstName = "Lord",
75 LastName = "Lucan" }; 76 LastName = "Lucan" };
77
76 protected UserAccount m_uaLL2 78 protected UserAccount m_uaLL2
77 = new UserAccount { 79 = new UserAccount {
78 PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000777"), 80 PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000777"),
79 FirstName = "Lord", 81 FirstName = "Lord",
80 LastName = "Lucan" }; 82 LastName = "Lucan" };
83
81 protected string m_item1Name = "Ray Gun Item"; 84 protected string m_item1Name = "Ray Gun Item";
85 protected string m_coaItemName = "Coalesced Item";
82 86
83 [SetUp] 87 [SetUp]
84 public virtual void SetUp() 88 public virtual void SetUp()
@@ -97,38 +101,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
97// log4net.Config.XmlConfigurator.Configure(); 101// log4net.Config.XmlConfigurator.Configure();
98 102
99 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 103 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
100 Scene scene = SceneSetupHelpers.SetupScene("Inventory"); 104 Scene scene = SceneSetupHelpers.SetupScene();
101 SceneSetupHelpers.SetupSceneModules(scene, archiverModule); 105 SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
102 106
103 UserProfileTestUtils.CreateUserWithInventory(scene, m_uaLL1, "hampshire"); 107 UserProfileTestUtils.CreateUserWithInventory(scene, m_uaLL1, "hampshire");
104 108
105 MemoryStream archiveWriteStream = new MemoryStream(); 109 MemoryStream archiveWriteStream = new MemoryStream();
106 110
107 // Create asset 111 // Create scene object asset
108 SceneObjectGroup object1; 112 UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
109 SceneObjectPart part1; 113 SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, ownerId, "Ray Gun Object", 0x50);
110 {
111 string partName = "Ray Gun Object";
112 UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
113 PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere();
114 Vector3 groupPosition = new Vector3(10, 20, 30);
115 Quaternion rotationOffset = new Quaternion(20, 30, 40, 50);
116 Vector3 offsetPosition = new Vector3(5, 10, 15);
117
118 part1
119 = new SceneObjectPart(
120 ownerId, shape, groupPosition, rotationOffset, offsetPosition);
121 part1.Name = partName;
122
123 object1 = new SceneObjectGroup(part1);
124 scene.AddNewSceneObject(object1, false);
125 }
126 114
127 UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); 115 UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
128 AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); 116 AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
129 scene.AssetService.Store(asset1); 117 scene.AssetService.Store(asset1);
130 118
131 // Create item 119 // Create scene object item
132 InventoryItemBase item1 = new InventoryItemBase(); 120 InventoryItemBase item1 = new InventoryItemBase();
133 item1.Name = m_item1Name; 121 item1.Name = m_item1Name;
134 item1.ID = UUID.Parse("00000000-0000-0000-0000-000000000020"); 122 item1.ID = UUID.Parse("00000000-0000-0000-0000-000000000020");
@@ -139,8 +127,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
139 item1.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID; 127 item1.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID;
140 scene.AddInventoryItem(item1); 128 scene.AddInventoryItem(item1);
141 129
130 // Create coalesced objects asset
131 SceneObjectGroup cobj1 = SceneSetupHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object1", 0x120);
132 cobj1.AbsolutePosition = new Vector3(15, 30, 45);
133
134 SceneObjectGroup cobj2 = SceneSetupHelpers.CreateSceneObject(1, m_uaLL1.PrincipalID, "Object2", 0x140);
135 cobj2.AbsolutePosition = new Vector3(25, 50, 75);
136
137 CoalescedSceneObjects coa = new CoalescedSceneObjects(m_uaLL1.PrincipalID, cobj1, cobj2);
138
139 AssetBase coaAsset = AssetHelpers.CreateAsset(0x160, coa);
140 scene.AssetService.Store(coaAsset);
141
142 // Create coalesced objects inventory item
143 InventoryItemBase coaItem = new InventoryItemBase();
144 coaItem.Name = m_coaItemName;
145 coaItem.ID = UUID.Parse("00000000-0000-0000-0000-000000000180");
146 coaItem.AssetID = coaAsset.FullID;
147 coaItem.GroupID = UUID.Random();
148 coaItem.CreatorIdAsUuid = m_uaLL1.PrincipalID;
149 coaItem.Owner = m_uaLL1.PrincipalID;
150 coaItem.Folder = scene.InventoryService.GetRootFolder(m_uaLL1.PrincipalID).ID;
151 scene.AddInventoryItem(coaItem);
152
142 archiverModule.ArchiveInventory( 153 archiverModule.ArchiveInventory(
143 Guid.NewGuid(), m_uaLL1.FirstName, m_uaLL1.LastName, m_item1Name, "hampshire", archiveWriteStream); 154 Guid.NewGuid(), m_uaLL1.FirstName, m_uaLL1.LastName, "/*", "hampshire", archiveWriteStream);
144 155
145 m_iarStreamBytes = archiveWriteStream.ToArray(); 156 m_iarStreamBytes = archiveWriteStream.ToArray();
146 } 157 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index 7f156f8..d03f6da 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -62,9 +62,39 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
62 SerialiserModule serialiserModule = new SerialiserModule(); 62 SerialiserModule serialiserModule = new SerialiserModule();
63 m_archiverModule = new InventoryArchiverModule(); 63 m_archiverModule = new InventoryArchiverModule();
64 64
65 m_scene = SceneSetupHelpers.SetupScene("Inventory"); 65 m_scene = SceneSetupHelpers.SetupScene();
66 SceneSetupHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule); 66 SceneSetupHelpers.SetupSceneModules(m_scene, serialiserModule, m_archiverModule);
67 } 67 }
68
69 [Test]
70 public void TestLoadCoalesecedItem()
71 {
72 TestHelper.InMethod();
73// log4net.Config.XmlConfigurator.Configure();
74
75 UserProfileTestUtils.CreateUserWithInventory(m_scene, m_uaLL1, "password");
76 m_archiverModule.DearchiveInventory(m_uaLL1.FirstName, m_uaLL1.LastName, "/", "password", m_iarStream);
77
78 InventoryItemBase coaItem
79 = InventoryArchiveUtils.FindItemByPath(m_scene.InventoryService, m_uaLL1.PrincipalID, m_coaItemName);
80
81 Assert.That(coaItem, Is.Not.Null, "Didn't find loaded item 1");
82
83 string assetXml = AssetHelpers.ReadAssetAsString(m_scene.AssetService, coaItem.AssetID);
84
85 CoalescedSceneObjects coa;
86 bool readResult = CoalescedSceneObjectsSerializer.TryFromXml(assetXml, out coa);
87
88 Assert.That(readResult, Is.True);
89 Assert.That(coa.Count, Is.EqualTo(2));
90
91 List<SceneObjectGroup> coaObjects = coa.Objects;
92 Assert.That(coaObjects[0].UUID, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000120")));
93 Assert.That(coaObjects[0].AbsolutePosition, Is.EqualTo(new Vector3(15, 30, 45)));
94
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)));
97 }
68 98
69 /// <summary> 99 /// <summary>
70 /// Test saving a single inventory item to a V0.1 OpenSim Inventory Archive 100 /// Test saving a single inventory item to a V0.1 OpenSim Inventory Archive
@@ -84,24 +114,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
84 UserProfileTestUtils.CreateUserWithInventory(m_scene, userFirstName, userLastName, userId, userPassword); 114 UserProfileTestUtils.CreateUserWithInventory(m_scene, userFirstName, userLastName, userId, userPassword);
85 115
86 // Create asset 116 // Create asset
87 SceneObjectGroup object1; 117 UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
88 SceneObjectPart part1; 118 SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, ownerId, "My Little Dog Object", 0x50);
89 {
90 string partName = "My Little Dog Object";
91 UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
92 PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere();
93 Vector3 groupPosition = new Vector3(10, 20, 30);
94 Quaternion rotationOffset = new Quaternion(20, 30, 40, 50);
95 Vector3 offsetPosition = new Vector3(5, 10, 15);
96
97 part1
98 = new SceneObjectPart(
99 ownerId, shape, groupPosition, rotationOffset, offsetPosition);
100 part1.Name = partName;
101
102 object1 = new SceneObjectGroup(part1);
103 m_scene.AddNewSceneObject(object1, false);
104 }
105 119
106 UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); 120 UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
107 AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); 121 AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
index 0e8f647..c7dae52 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/PathTests.cs
@@ -63,7 +63,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
63 63
64 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 64 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
65 65
66 Scene scene = SceneSetupHelpers.SetupScene("Inventory"); 66 Scene scene = SceneSetupHelpers.SetupScene();
67 SceneSetupHelpers.SetupSceneModules(scene, archiverModule); 67 SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
68 68
69 // Create user 69 // Create user
@@ -180,7 +180,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
180 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 180 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
181 181
182 // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene 182 // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
183 Scene scene = SceneSetupHelpers.SetupScene("inventory"); 183 Scene scene = SceneSetupHelpers.SetupScene();
184 184
185 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); 185 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
186 186
@@ -223,7 +223,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
223 223
224 SerialiserModule serialiserModule = new SerialiserModule(); 224 SerialiserModule serialiserModule = new SerialiserModule();
225 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 225 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
226 Scene scene = SceneSetupHelpers.SetupScene("inventory"); 226 Scene scene = SceneSetupHelpers.SetupScene();
227 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); 227 SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
228 228
229 UserProfileTestUtils.CreateUserWithInventory(scene, m_uaMT, "password"); 229 UserProfileTestUtils.CreateUserWithInventory(scene, m_uaMT, "password");
@@ -248,7 +248,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
248 248
249 InventoryArchiverModule archiverModule = new InventoryArchiverModule(); 249 InventoryArchiverModule archiverModule = new InventoryArchiverModule();
250 250
251 Scene scene = SceneSetupHelpers.SetupScene("Inventory"); 251 Scene scene = SceneSetupHelpers.SetupScene();
252 SceneSetupHelpers.SetupSceneModules(scene, archiverModule); 252 SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
253 253
254 // Create user 254 // Create user
@@ -327,7 +327,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
327 TestHelper.InMethod(); 327 TestHelper.InMethod();
328// log4net.Config.XmlConfigurator.Configure(); 328// log4net.Config.XmlConfigurator.Configure();
329 329
330 Scene scene = SceneSetupHelpers.SetupScene("inventory"); 330 Scene scene = SceneSetupHelpers.SetupScene();
331 UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene); 331 UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene);
332 332
333 Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>(); 333 Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>();
@@ -394,7 +394,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
394 TestHelper.InMethod(); 394 TestHelper.InMethod();
395 //log4net.Config.XmlConfigurator.Configure(); 395 //log4net.Config.XmlConfigurator.Configure();
396 396
397 Scene scene = SceneSetupHelpers.SetupScene("inventory"); 397 Scene scene = SceneSetupHelpers.SetupScene();
398 UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene); 398 UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene);
399 399
400 string folder1ExistingName = "a"; 400 string folder1ExistingName = "a";
@@ -445,7 +445,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
445 TestHelper.InMethod(); 445 TestHelper.InMethod();
446// log4net.Config.XmlConfigurator.Configure(); 446// log4net.Config.XmlConfigurator.Configure();
447 447
448 Scene scene = SceneSetupHelpers.SetupScene("inventory"); 448 Scene scene = SceneSetupHelpers.SetupScene();
449 UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene); 449 UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene);
450 450
451 string folder1ExistingName = "a"; 451 string folder1ExistingName = "a";
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index 4565d10..8c99983 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -129,35 +129,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
129 } 129 }
130 130
131 /// 131 ///
132 /// DeleteToInventory 132 /// Used in DeleteToInventory
133 /// 133 ///
134 public override UUID DeleteToInventory(DeRezAction action, UUID folderID, List<SceneObjectGroup> objectGroups, IClientAPI remoteClient) 134 protected override void ExportAsset(UUID agentID, UUID assetID)
135 { 135 {
136 UUID ret = UUID.Zero;
137
138 // HACK: Only works for lists of length one.
139 // Intermediate version, just to make things compile
140 foreach (SceneObjectGroup g in objectGroups)
141 ret = DeleteToInventory(action, folderID, g, remoteClient);
142
143 return ret;
144 }
145
146 // DO NOT OVERRIDE THE BASE METHOD
147 public new virtual UUID DeleteToInventory(DeRezAction action, UUID folderID,
148 SceneObjectGroup objectGroup, IClientAPI remoteClient)
149 {
150 UUID assetID = base.DeleteToInventory(action, folderID, new List<SceneObjectGroup>() {objectGroup}, remoteClient);
151
152 if (!assetID.Equals(UUID.Zero)) 136 if (!assetID.Equals(UUID.Zero))
153 { 137 UploadInventoryItem(agentID, assetID, "", 0);
154 if (remoteClient != null)
155 UploadInventoryItem(remoteClient.AgentId, assetID, "", 0);
156 }
157 else 138 else
158 m_log.Debug("[HGScene]: Scene.Inventory did not create asset"); 139 m_log.Debug("[HGScene]: Scene.Inventory did not create asset");
159
160 return assetID;
161 } 140 }
162 141
163 /// 142 ///
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 0fbd5e7..c91c0b2 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -279,7 +279,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
279 float minX, minY, minZ; 279 float minX, minY, minZ;
280 float maxX, maxY, maxZ; 280 float maxX, maxY, maxZ;
281 281
282 Vector3[] offsets = m_Scene.GetCombinedBoundingBox(objlist, 282 Vector3[] offsets = Scene.GetCombinedBoundingBox(objlist,
283 out minX, out maxX, out minY, out maxY, 283 out minX, out maxX, out minY, out maxY,
284 out minZ, out maxZ); 284 out minZ, out maxZ);
285 285
@@ -785,8 +785,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
785 // affect the name stored in the serialization, transfer 785 // affect the name stored in the serialization, transfer
786 // the correct name from the inventory to the 786 // the correct name from the inventory to the
787 // object itself before we rez. 787 // object itself before we rez.
788 // On coalesced objects, this has no effect. 788 // On coalesced objects, do the first one
789 if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0) 789 if (((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0) || i == 0)
790 { 790 {
791 rootPart.Name = item.Name; 791 rootPart.Name = item.Name;
792 rootPart.Description = item.Description; 792 rootPart.Description = item.Description;
@@ -984,5 +984,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
984 } 984 }
985 985
986 #endregion 986 #endregion
987
988 protected virtual void ExportAsset(UUID agentID, UUID assetID)
989 {
990 }
987 } 991 }
988} 992}
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
new file mode 100644
index 0000000..8d53cf1
--- /dev/null
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
@@ -0,0 +1,174 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.IO;
31using System.Reflection;
32using System.Threading;
33using Nini.Config;
34using NUnit.Framework;
35using OpenMetaverse;
36using OpenSim.Data;
37using OpenSim.Framework;
38using OpenSim.Framework.Serialization;
39using OpenSim.Framework.Serialization.External;
40using OpenSim.Framework.Communications;
41using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver;
42using OpenSim.Region.CoreModules.Framework.InventoryAccess;
43using OpenSim.Region.Framework.Scenes;
44using OpenSim.Region.Framework.Scenes.Serialization;
45using OpenSim.Services.Interfaces;
46using OpenSim.Tests.Common;
47using OpenSim.Tests.Common.Mock;
48using OpenSim.Tests.Common.Setup;
49
50namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests
51{
52 [TestFixture]
53 public class InventoryAccessModuleTests
54 {
55 protected TestScene m_scene;
56 protected BasicInventoryAccessModule m_iam;
57 protected UUID m_userId = UUID.Parse("00000000-0000-0000-0000-000000000020");
58 protected TestClient m_tc;
59
60 [SetUp]
61 public void SetUp()
62 {
63 m_iam = new BasicInventoryAccessModule();
64
65 IConfigSource config = new IniConfigSource();
66 config.AddConfig("Modules");
67 config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");
68
69 m_scene = SceneSetupHelpers.SetupScene();
70 SceneSetupHelpers.SetupSceneModules(m_scene, config, m_iam);
71
72 // Create user
73 string userFirstName = "Jock";
74 string userLastName = "Stirrup";
75 string userPassword = "troll";
76 UserProfileTestUtils.CreateUserWithInventory(m_scene, userFirstName, userLastName, m_userId, userPassword);
77
78 AgentCircuitData acd = new AgentCircuitData();
79 acd.AgentID = m_userId;
80 m_tc = new TestClient(acd, m_scene);
81 }
82
83 [Test]
84 public void TestRezCoalescedObject()
85 {
86 TestHelper.InMethod();
87// log4net.Config.XmlConfigurator.Configure();
88
89 // Create asset
90 SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, m_userId, "Object1", 0x20);
91 object1.AbsolutePosition = new Vector3(15, 30, 45);
92
93 SceneObjectGroup object2 = SceneSetupHelpers.CreateSceneObject(1, m_userId, "Object2", 0x40);
94 object2.AbsolutePosition = new Vector3(25, 50, 75);
95
96 CoalescedSceneObjects coa = new CoalescedSceneObjects(m_userId, object1, object2);
97
98 UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
99 AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, coa);
100 m_scene.AssetService.Store(asset1);
101
102 // Create item
103 UUID item1Id = UUID.Parse("00000000-0000-0000-0000-000000000080");
104 string item1Name = "My Little Dog";
105 InventoryItemBase item1 = new InventoryItemBase();
106 item1.Name = item1Name;
107 item1.AssetID = asset1.FullID;
108 item1.ID = item1Id;
109 InventoryFolderBase objsFolder
110 = InventoryArchiveUtils.FindFolderByPath(m_scene.InventoryService, m_userId, "Objects")[0];
111 item1.Folder = objsFolder.ID;
112 m_scene.AddInventoryItem(item1);
113
114 SceneObjectGroup so
115 = m_iam.RezObject(
116 m_tc, item1Id, new Vector3(100, 100, 100), Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false);
117
118 Assert.That(so, Is.Not.Null);
119
120 Assert.That(m_scene.SceneGraph.GetTotalObjectsCount(), Is.EqualTo(2));
121
122 SceneObjectPart retrievedObj1Part = m_scene.GetSceneObjectPart(object1.Name);
123 Assert.That(retrievedObj1Part, Is.Null);
124
125 retrievedObj1Part = m_scene.GetSceneObjectPart(item1.Name);
126 Assert.That(retrievedObj1Part, Is.Not.Null);
127 Assert.That(retrievedObj1Part.Name, Is.EqualTo(item1.Name));
128
129 // Bottom of coalescence is placed on ground, hence we end up with 100.5 rather than 85 since the bottom
130 // object is unit square.
131 Assert.That(retrievedObj1Part.AbsolutePosition, Is.EqualTo(new Vector3(95, 90, 100.5f)));
132
133 SceneObjectPart retrievedObj2Part = m_scene.GetSceneObjectPart(object2.Name);
134 Assert.That(retrievedObj2Part, Is.Not.Null);
135 Assert.That(retrievedObj2Part.Name, Is.EqualTo(object2.Name));
136 Assert.That(retrievedObj2Part.AbsolutePosition, Is.EqualTo(new Vector3(105, 110, 130.5f)));
137 }
138
139 [Test]
140 public void TestRezObject()
141 {
142 TestHelper.InMethod();
143// log4net.Config.XmlConfigurator.Configure();
144
145 // Create asset
146 SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, m_userId, "My Little Dog Object", 0x40);
147
148 UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
149 AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
150 m_scene.AssetService.Store(asset1);
151
152 // Create item
153 UUID item1Id = UUID.Parse("00000000-0000-0000-0000-000000000080");
154 string item1Name = "My Little Dog";
155 InventoryItemBase item1 = new InventoryItemBase();
156 item1.Name = item1Name;
157 item1.AssetID = asset1.FullID;
158 item1.ID = item1Id;
159 InventoryFolderBase objsFolder
160 = InventoryArchiveUtils.FindFolderByPath(m_scene.InventoryService, m_userId, "Objects")[0];
161 item1.Folder = objsFolder.ID;
162 m_scene.AddInventoryItem(item1);
163
164 SceneObjectGroup so
165 = m_iam.RezObject(
166 m_tc, item1Id, Vector3.Zero, Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false);
167
168 Assert.That(so, Is.Not.Null);
169
170 SceneObjectPart retrievedPart = m_scene.GetSceneObjectPart(so.UUID);
171 Assert.That(retrievedPart, Is.Not.Null);
172 }
173 }
174} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs
index e25700d..422f394 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs
@@ -31,7 +31,6 @@ using System.Collections.Generic;
31using log4net; 31using log4net;
32using Nini.Config; 32using Nini.Config;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Servers.HttpServer;
35using OpenSim.Region.Framework.Scenes; 34using OpenSim.Region.Framework.Scenes;
36using OpenSim.Region.Framework.Interfaces; 35using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Server.Base; 36using OpenSim.Server.Base;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Authentication/AuthenticationServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Authentication/AuthenticationServiceInConnectorModule.cs
index 02acddc..2b5beba 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Authentication/AuthenticationServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Authentication/AuthenticationServiceInConnectorModule.cs
@@ -31,7 +31,6 @@ using System.Collections.Generic;
31using log4net; 31using log4net;
32using Nini.Config; 32using Nini.Config;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Servers.HttpServer;
35using OpenSim.Region.Framework.Scenes; 34using OpenSim.Region.Framework.Scenes;
36using OpenSim.Region.Framework.Interfaces; 35using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Server.Base; 36using OpenSim.Server.Base;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/GridInfoServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/GridInfoServiceInConnectorModule.cs
index 6d975af..f29c074 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/GridInfoServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/GridInfoServiceInConnectorModule.cs
@@ -31,7 +31,6 @@ using System.Collections.Generic;
31using log4net; 31using log4net;
32using Nini.Config; 32using Nini.Config;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Servers.HttpServer;
35using OpenSim.Region.Framework.Scenes; 34using OpenSim.Region.Framework.Scenes;
36using OpenSim.Region.Framework.Interfaces; 35using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Server.Base; 36using OpenSim.Server.Base;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Hypergrid/HypergridServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Hypergrid/HypergridServiceInConnectorModule.cs
index 2f96bcb..d2343c9 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Hypergrid/HypergridServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Hypergrid/HypergridServiceInConnectorModule.cs
@@ -31,7 +31,6 @@ using System.Collections.Generic;
31using log4net; 31using log4net;
32using Nini.Config; 32using Nini.Config;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Servers.HttpServer;
35using OpenSim.Region.Framework.Scenes; 34using OpenSim.Region.Framework.Scenes;
36using OpenSim.Region.Framework.Interfaces; 35using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Server.Base; 36using OpenSim.Server.Base;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs
index 209cf0d..53a8ace 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs
@@ -31,9 +31,8 @@ using System.Collections.Generic;
31using log4net; 31using log4net;
32using Nini.Config; 32using Nini.Config;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Servers.HttpServer;
35using OpenSim.Region.Framework.Scenes;
36using OpenSim.Region.Framework.Interfaces; 34using OpenSim.Region.Framework.Interfaces;
35using OpenSim.Region.Framework.Scenes;
37using OpenSim.Server.Base; 36using OpenSim.Server.Base;
38using OpenSim.Server.Handlers.Base; 37using OpenSim.Server.Handlers.Base;
39 38
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs
index fcc69e9..fc64203 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs
@@ -31,7 +31,6 @@ using System.Collections.Generic;
31using log4net; 31using log4net;
32using Nini.Config; 32using Nini.Config;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Servers.HttpServer;
35using OpenSim.Region.Framework.Scenes; 34using OpenSim.Region.Framework.Scenes;
36using OpenSim.Region.Framework.Interfaces; 35using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Server.Base; 36using OpenSim.Server.Base;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Login/LLLoginServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Login/LLLoginServiceInConnectorModule.cs
index 2a9366c..f759470 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Login/LLLoginServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Login/LLLoginServiceInConnectorModule.cs
@@ -31,7 +31,6 @@ using System.Collections.Generic;
31using log4net; 31using log4net;
32using Nini.Config; 32using Nini.Config;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Servers.HttpServer;
35using OpenSim.Region.Framework.Scenes; 34using OpenSim.Region.Framework.Scenes;
36using OpenSim.Region.Framework.Interfaces; 35using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Server.Base; 36using OpenSim.Server.Base;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs
index 35518d5..5c32632 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs
@@ -31,7 +31,6 @@ using System.Collections.Generic;
31using log4net; 31using log4net;
32using Nini.Config; 32using Nini.Config;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Servers.HttpServer;
35using OpenSim.Region.Framework.Scenes; 34using OpenSim.Region.Framework.Scenes;
36using OpenSim.Region.Framework.Interfaces; 35using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Server.Base; 36using OpenSim.Server.Base;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs
index 5ee1c97..86b4926 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs
@@ -31,7 +31,6 @@ using System.Collections.Generic;
31using log4net; 31using log4net;
32using Nini.Config; 32using Nini.Config;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Servers.HttpServer;
35using OpenSim.Region.Framework.Scenes; 34using OpenSim.Region.Framework.Scenes;
36using OpenSim.Region.Framework.Interfaces; 35using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Server.Base; 36using OpenSim.Server.Base;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs
index 1b3419d..51d1d59 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs
@@ -195,6 +195,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
195 195
196 public byte[] GetData(string id) 196 public byte[] GetData(string id)
197 { 197 {
198// m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Requesting data for asset {0}", id);
199
198 AssetBase asset = m_Cache.Get(id); 200 AssetBase asset = m_Cache.Get(id);
199 201
200 if (asset != null) 202 if (asset != null)
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index 6d9cb7f..598948a 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -261,6 +261,10 @@ namespace OpenSim.Region.CoreModules.World.Estate
261 261
262 private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, UUID estateCovenantID) 262 private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, UUID estateCovenantID)
263 { 263 {
264// m_log.DebugFormat(
265// "[ESTATE MANAGEMENT MODULE]: Handling request from {0} to change estate covenant to {1}",
266// remoteClient.Name, estateCovenantID);
267
264 Scene.RegionInfo.RegionSettings.Covenant = estateCovenantID; 268 Scene.RegionInfo.RegionSettings.Covenant = estateCovenantID;
265 Scene.RegionInfo.RegionSettings.Save(); 269 Scene.RegionInfo.RegionSettings.Save();
266 TriggerRegionInfoChange(); 270 TriggerRegionInfoChange();
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
index dafaa0c..a866fd9 100644
--- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
+++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
@@ -237,7 +237,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
237 public void Init() 237 public void Init()
238 { 238 {
239 m_serialiserModule = new SerialiserModule(); 239 m_serialiserModule = new SerialiserModule();
240 m_scene = SceneSetupHelpers.SetupScene(""); 240 m_scene = SceneSetupHelpers.SetupScene();
241 SceneSetupHelpers.SetupSceneModules(m_scene, m_serialiserModule); 241 SceneSetupHelpers.SetupSceneModules(m_scene, m_serialiserModule);
242 } 242 }
243 243
diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
index d6fa093..21a9999 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
@@ -124,6 +124,52 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
124 colours.Save(stream, ImageFormat.Png); 124 colours.Save(stream, ImageFormat.Png);
125 } 125 }
126 126
127 public virtual void SaveFile(ITerrainChannel m_channel, string filename,
128 int offsetX, int offsetY,
129 int fileWidth, int fileHeight,
130 int regionSizeX, int regionSizeY)
131
132 {
133 // We need to do this because:
134 // "Saving the image to the same file it was constructed from is not allowed and throws an exception."
135 string tempName = offsetX + "_ " + offsetY + "_" + filename;
136
137 Bitmap entireBitmap = null;
138 Bitmap thisBitmap = null;
139 if (File.Exists(filename))
140 {
141 File.Copy(filename, tempName);
142 entireBitmap = new Bitmap(tempName);
143 if (entireBitmap.Width != fileWidth * regionSizeX || entireBitmap.Height != fileHeight * regionSizeY)
144 {
145 // old file, let's overwrite it
146 entireBitmap = new Bitmap(fileWidth * regionSizeX, fileHeight * regionSizeY);
147 }
148 }
149 else
150 {
151 entireBitmap = new Bitmap(fileWidth * regionSizeX, fileHeight * regionSizeY);
152 }
153
154 thisBitmap = CreateGrayscaleBitmapFromMap(m_channel);
155 Console.WriteLine("offsetX=" + offsetX + " offsetY=" + offsetY);
156 for (int x = 0; x < regionSizeX; x++)
157 for (int y = 0; y < regionSizeY; y++)
158 entireBitmap.SetPixel(x + offsetX * regionSizeX, y + (fileHeight - 1 - offsetY) * regionSizeY, thisBitmap.GetPixel(x, y));
159
160 Save(entireBitmap, filename);
161 thisBitmap.Dispose();
162 entireBitmap.Dispose();
163
164 if (File.Exists(tempName))
165 File.Delete(tempName);
166 }
167
168 protected virtual void Save(Bitmap bmp, string filename)
169 {
170 bmp.Save(filename, ImageFormat.Png);
171 }
172
127 #endregion 173 #endregion
128 174
129 public override string ToString() 175 public override string ToString()
diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/JPEG.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/JPEG.cs
index 8667607..1a0d8ec 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/JPEG.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/JPEG.cs
@@ -76,6 +76,14 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
76 colours.Save(stream, ImageFormat.Jpeg); 76 colours.Save(stream, ImageFormat.Jpeg);
77 } 77 }
78 78
79 public virtual void SaveFile(ITerrainChannel m_channel, string filename,
80 int offsetX, int offsetY,
81 int fileWidth, int fileHeight,
82 int regionSizeX, int regionSizeY)
83 {
84 throw new System.Exception("Not Implemented");
85 }
86
79 #endregion 87 #endregion
80 88
81 public override string ToString() 89 public override string ToString()
diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs
index a70ef13..fad7641 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs
@@ -240,6 +240,14 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
240 get { return ".raw"; } 240 get { return ".raw"; }
241 } 241 }
242 242
243 public virtual void SaveFile(ITerrainChannel m_channel, string filename,
244 int offsetX, int offsetY,
245 int fileWidth, int fileHeight,
246 int regionSizeX, int regionSizeY)
247 {
248 throw new System.Exception("Not Implemented");
249 }
250
243 #endregion 251 #endregion
244 252
245 public override string ToString() 253 public override string ToString()
diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/RAW32.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/RAW32.cs
index 3c76665..ba073ca 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/RAW32.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/RAW32.cs
@@ -160,6 +160,13 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
160 bs.Close(); 160 bs.Close();
161 } 161 }
162 162
163 public virtual void SaveFile(ITerrainChannel m_channel, string filename,
164 int offsetX, int offsetY,
165 int fileWidth, int fileHeight,
166 int regionSizeX, int regionSizeY)
167 {
168 throw new System.Exception("Not Implemented");
169 }
163 #endregion 170 #endregion
164 171
165 public override string ToString() 172 public override string ToString()
diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/Terragen.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/Terragen.cs
index 2919897..2f37d9d 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/Terragen.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/Terragen.cs
@@ -308,6 +308,14 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
308 get { return ".ter"; } 308 get { return ".ter"; }
309 } 309 }
310 310
311 public virtual void SaveFile(ITerrainChannel m_channel, string filename,
312 int offsetX, int offsetY,
313 int fileWidth, int fileHeight,
314 int regionSizeX, int regionSizeY)
315 {
316 throw new System.Exception("Not Implemented");
317 }
318
311 #endregion 319 #endregion
312 320
313 public override string ToString() 321 public override string ToString()
diff --git a/OpenSim/Region/CoreModules/World/Terrain/ITerrainLoader.cs b/OpenSim/Region/CoreModules/World/Terrain/ITerrainLoader.cs
index 7403281..7237f90 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/ITerrainLoader.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/ITerrainLoader.cs
@@ -38,5 +38,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain
38 ITerrainChannel LoadStream(Stream stream); 38 ITerrainChannel LoadStream(Stream stream);
39 void SaveFile(string filename, ITerrainChannel map); 39 void SaveFile(string filename, ITerrainChannel map);
40 void SaveStream(Stream stream, ITerrainChannel map); 40 void SaveStream(Stream stream, ITerrainChannel map);
41 void SaveFile(ITerrainChannel map, string filename, int offsetX, int offsetY, int fileWidth, int fileHeight, int regionSizeX, int regionSizeY);
41 } 42 }
42} \ No newline at end of file 43} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
index 9d968e7..2da6458 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
@@ -541,6 +541,39 @@ namespace OpenSim.Region.CoreModules.World.Terrain
541 } 541 }
542 542
543 /// <summary> 543 /// <summary>
544 /// Saves the terrain to a larger terrain file.
545 /// </summary>
546 /// <param name="filename">The terrain file to save</param>
547 /// <param name="fileWidth">The width of the file in units</param>
548 /// <param name="fileHeight">The height of the file in units</param>
549 /// <param name="fileStartX">Where to begin our slice</param>
550 /// <param name="fileStartY">Where to begin our slice</param>
551 public void SaveToFile(string filename, int fileWidth, int fileHeight, int fileStartX, int fileStartY)
552 {
553 int offsetX = (int)m_scene.RegionInfo.RegionLocX - fileStartX;
554 int offsetY = (int)m_scene.RegionInfo.RegionLocY - fileStartY;
555
556 if (offsetX >= 0 && offsetX < fileWidth && offsetY >= 0 && offsetY < fileHeight)
557 {
558 // this region is included in the tile request
559 foreach (KeyValuePair<string, ITerrainLoader> loader in m_loaders)
560 {
561 if (filename.EndsWith(loader.Key))
562 {
563 lock (m_scene)
564 {
565 loader.Value.SaveFile(m_channel, filename, offsetX, offsetY,
566 fileWidth, fileHeight,
567 (int)Constants.RegionSize,
568 (int)Constants.RegionSize);
569 }
570 return;
571 }
572 }
573 }
574 }
575
576 /// <summary>
544 /// Performs updates to the region periodically, synchronising physics and other heightmap aware sections 577 /// Performs updates to the region periodically, synchronising physics and other heightmap aware sections
545 /// </summary> 578 /// </summary>
546 private void EventManager_OnTerrainTick() 579 private void EventManager_OnTerrainTick()
@@ -862,6 +895,15 @@ namespace OpenSim.Region.CoreModules.World.Terrain
862 SaveToFile((string) args[0]); 895 SaveToFile((string) args[0]);
863 } 896 }
864 897
898 private void InterfaceSaveTileFile(Object[] args)
899 {
900 SaveToFile((string)args[0],
901 (int)args[1],
902 (int)args[2],
903 (int)args[3],
904 (int)args[4]);
905 }
906
865 private void InterfaceBakeTerrain(Object[] args) 907 private void InterfaceBakeTerrain(Object[] args)
866 { 908 {
867 UpdateRevertMap(); 909 UpdateRevertMap();
@@ -1117,6 +1159,17 @@ namespace OpenSim.Region.CoreModules.World.Terrain
1117 loadFromTileCommand.AddArgument("minimum Y tile", "The Y region coordinate of the first section on the file", 1159 loadFromTileCommand.AddArgument("minimum Y tile", "The Y region coordinate of the first section on the file",
1118 "Integer"); 1160 "Integer");
1119 1161
1162 Command saveToTileCommand =
1163 new Command("save-tile", CommandIntentions.COMMAND_HAZARDOUS, InterfaceSaveTileFile, "Saves the current heightmap to the larger file.");
1164 saveToTileCommand.AddArgument("filename",
1165 "The file you wish to save to, the file extension determines the loader to be used. Supported extensions include: " +
1166 supportedFileExtensions, "String");
1167 saveToTileCommand.AddArgument("file width", "The width of the file in tiles", "Integer");
1168 saveToTileCommand.AddArgument("file height", "The height of the file in tiles", "Integer");
1169 saveToTileCommand.AddArgument("minimum X tile", "The X region coordinate of the first section on the file",
1170 "Integer");
1171 saveToTileCommand.AddArgument("minimum Y tile", "The Y region coordinate of the first section on the file",
1172 "Integer");
1120 // Terrain adjustments 1173 // Terrain adjustments
1121 Command fillRegionCommand = 1174 Command fillRegionCommand =
1122 new Command("fill", CommandIntentions.COMMAND_HAZARDOUS, InterfaceFillTerrain, "Fills the current heightmap with a specified value."); 1175 new Command("fill", CommandIntentions.COMMAND_HAZARDOUS, InterfaceFillTerrain, "Fills the current heightmap with a specified value.");
@@ -1168,6 +1221,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
1168 m_commander.RegisterCommand("load", loadFromFileCommand); 1221 m_commander.RegisterCommand("load", loadFromFileCommand);
1169 m_commander.RegisterCommand("load-tile", loadFromTileCommand); 1222 m_commander.RegisterCommand("load-tile", loadFromTileCommand);
1170 m_commander.RegisterCommand("save", saveToFileCommand); 1223 m_commander.RegisterCommand("save", saveToFileCommand);
1224 m_commander.RegisterCommand("save-tile", saveToTileCommand);
1171 m_commander.RegisterCommand("fill", fillRegionCommand); 1225 m_commander.RegisterCommand("fill", fillRegionCommand);
1172 m_commander.RegisterCommand("elevate", elevateCommand); 1226 m_commander.RegisterCommand("elevate", elevateCommand);
1173 m_commander.RegisterCommand("lower", lowerCommand); 1227 m_commander.RegisterCommand("lower", lowerCommand);
diff --git a/OpenSim/Region/Framework/Scenes/CoalescedSceneObjects.cs b/OpenSim/Region/Framework/Scenes/CoalescedSceneObjects.cs
new file mode 100644
index 0000000..af8ccda
--- /dev/null
+++ b/OpenSim/Region/Framework/Scenes/CoalescedSceneObjects.cs
@@ -0,0 +1,154 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Linq;
31using OpenMetaverse;
32
33namespace OpenSim.Region.Framework.Scenes
34{
35 /// <summary>
36 /// Represents a coalescene of scene objects. A coalescence occurs when objects that are not in the same linkset
37 /// are grouped together.
38 /// </summary>
39 public class CoalescedSceneObjects
40 {
41 /// <summary>
42 /// The creator of this coalesence, though not necessarily the objects within it.
43 /// </summary>
44 public UUID CreatorId { get; set; }
45
46 /// <summary>
47 /// The number of objects in this coalesence
48 /// </summary>
49 public int Count
50 {
51 get
52 {
53 lock (m_memberObjects)
54 return m_memberObjects.Count;
55 }
56 }
57
58 /// <summary>
59 /// Does this coalesence have any member objects?
60 /// </summary>
61 public bool HasObjects { get { return Count > 0; } }
62
63 /// <summary>
64 /// Get the objects currently in this coalescence
65 /// </summary>
66 public List<SceneObjectGroup> Objects
67 {
68 get
69 {
70 lock (m_memberObjects)
71 return new List<SceneObjectGroup>(m_memberObjects);
72 }
73 }
74
75 /// <summary>
76 /// Get the scene that contains the objects in this coalescence. If there are no objects then null is returned.
77 /// </summary>
78 public Scene Scene
79 {
80 get
81 {
82 if (!HasObjects)
83 return null;
84 else
85 return Objects[0].Scene;
86 }
87 }
88
89 /// <summary>
90 /// At this point, we need to preserve the order of objects added to the coalescence, since the first
91 /// one will end up matching the item name when rerezzed.
92 /// </summary>
93 protected List<SceneObjectGroup> m_memberObjects = new List<SceneObjectGroup>();
94
95 public CoalescedSceneObjects(UUID creatorId)
96 {
97 CreatorId = creatorId;
98 }
99
100 public CoalescedSceneObjects(UUID creatorId, params SceneObjectGroup[] objs) : this(creatorId)
101 {
102 foreach (SceneObjectGroup obj in objs)
103 Add(obj);
104 }
105
106 /// <summary>
107 /// Add an object to the coalescence.
108 /// </summary>
109 /// <param name="obj"></param>
110 /// <param name="offset">The offset of the object within the group</param>
111 public void Add(SceneObjectGroup obj)
112 {
113 lock (m_memberObjects)
114 m_memberObjects.Add(obj);
115 }
116
117 /// <summary>
118 /// Removes a scene object from the coalescene
119 /// </summary>
120 /// <param name="sceneObjectId"></param>
121 /// <returns>true if the object was there to be removed, false if not.</returns>
122 public bool Remove(SceneObjectGroup obj)
123 {
124 lock (m_memberObjects)
125 return m_memberObjects.Remove(obj);
126 }
127
128 /// <summary>
129 /// Get the total size of the coalescence (the size required to cover all the objects within it) and the
130 /// offsets of each of those objects.
131 /// </summary>
132 /// <param name="size"></param>
133 /// <returns>
134 /// An array of offsets. The order of objects is the same as returned from the Objects property
135 /// </returns>
136 public Vector3[] GetSizeAndOffsets(out Vector3 size)
137 {
138 float minX, minY, minZ;
139 float maxX, maxY, maxZ;
140
141 Vector3[] offsets
142 = Scene.GetCombinedBoundingBox(
143 Objects, out minX, out maxX, out minY, out maxY, out minZ, out maxZ);
144
145 float sizeX = maxX - minX;
146 float sizeY = maxY - minY;
147 float sizeZ = maxZ - minZ;
148
149 size = new Vector3(sizeX, sizeY, sizeZ);
150
151 return offsets;
152 }
153 }
154} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
index cd6dc95..e4b0323 100644
--- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs
+++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
@@ -174,7 +174,11 @@ namespace OpenSim.Region.Framework.Scenes
174 ScenePresence presence = m_scene.GetScenePresence(client.AgentId); 174 ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
175 if (presence == null) 175 if (presence == null)
176 { 176 {
177 m_log.WarnFormat("[PRIORITIZER] attempt to use agent {0} not in the scene",client.AgentId); 177 // this shouldn't happen, it basically means that we are prioritizing
178 // updates to send to a client that doesn't have a presence in the scene
179 // seems like there's race condition here...
180
181 // m_log.WarnFormat("[PRIORITIZER] attempt to use agent {0} not in the scene",client.AgentId);
178 // throw new InvalidOperationException("Prioritization agent not defined"); 182 // throw new InvalidOperationException("Prioritization agent not defined");
179 return Int32.MaxValue; 183 return Int32.MaxValue;
180 } 184 }
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 0748954..f41c6b9 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2005,11 +2005,49 @@ namespace OpenSim.Region.Framework.Scenes
2005 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, 2005 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
2006 bool RezSelected, bool RemoveItem, UUID fromTaskID) 2006 bool RezSelected, bool RemoveItem, UUID fromTaskID)
2007 { 2007 {
2008 IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>(); 2008// m_log.DebugFormat(
2009 if (invAccess != null) 2009// "[PRIM INVENTORY]: RezObject from {0} for item {1} from task id {2}",
2010 invAccess.RezObject( 2010// remoteClient.Name, itemID, fromTaskID);
2011 remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection, 2011
2012 RezSelected, RemoveItem, fromTaskID, false); 2012 if (fromTaskID == UUID.Zero)
2013 {
2014 IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>();
2015 if (invAccess != null)
2016 invAccess.RezObject(
2017 remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection,
2018 RezSelected, RemoveItem, fromTaskID, false);
2019 }
2020 else
2021 {
2022 SceneObjectPart part = GetSceneObjectPart(fromTaskID);
2023 if (part == null)
2024 {
2025 m_log.ErrorFormat(
2026 "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such scene object",
2027 remoteClient.Name, itemID, fromTaskID);
2028
2029 return;
2030 }
2031
2032 TaskInventoryItem item = part.Inventory.GetInventoryItem(itemID);
2033 if (item == null)
2034 {
2035 m_log.ErrorFormat(
2036 "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such item",
2037 remoteClient.Name, itemID, fromTaskID);
2038
2039 return;
2040 }
2041
2042 byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0);
2043 Vector3 scale = new Vector3(0.5f, 0.5f, 0.5f);
2044 Vector3 pos
2045 = GetNewRezLocation(
2046 RayStart, RayEnd, RayTargetID, Quaternion.Identity,
2047 BypassRayCast, bRayEndIsIntersection, true, scale, false);
2048
2049 RezObject(part, item, pos, null, Vector3.Zero, 0);
2050 }
2013 } 2051 }
2014 2052
2015 /// <summary> 2053 /// <summary>
@@ -2017,14 +2055,14 @@ namespace OpenSim.Region.Framework.Scenes
2017 /// </summary> 2055 /// </summary>
2018 /// <param name="sourcePart"></param> 2056 /// <param name="sourcePart"></param>
2019 /// <param name="item"></param> 2057 /// <param name="item"></param>
2020 /// <param name="pos"></param> 2058 /// <param name="pos">The position of the rezzed object.</param>
2021 /// <param name="rot"></param> 2059 /// <param name="rot">The rotation of the rezzed object. If null, then the rotation stored with the object
2022 /// <param name="vel"></param> 2060 /// will be used if it exists.</param>
2061 /// <param name="vel">The velocity of the rezzed object.</param>
2023 /// <param name="param"></param> 2062 /// <param name="param"></param>
2024 /// <returns>The SceneObjectGroup rezzed or null if rez was unsuccessful</returns> 2063 /// <returns>The SceneObjectGroup rezzed or null if rez was unsuccessful</returns>
2025 public virtual SceneObjectGroup RezObject( 2064 public virtual SceneObjectGroup RezObject(
2026 SceneObjectPart sourcePart, TaskInventoryItem item, 2065 SceneObjectPart sourcePart, TaskInventoryItem item, Vector3 pos, Quaternion? rot, Vector3 vel, int param)
2027 Vector3 pos, Quaternion rot, Vector3 vel, int param)
2028 { 2066 {
2029 if (null == item) 2067 if (null == item)
2030 return null; 2068 return null;
@@ -2042,8 +2080,14 @@ namespace OpenSim.Region.Framework.Scenes
2042 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) 2080 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
2043 sourcePart.Inventory.RemoveInventoryItem(item.ItemID); 2081 sourcePart.Inventory.RemoveInventoryItem(item.ItemID);
2044 } 2082 }
2045 2083
2046 AddNewSceneObject(group, true, pos, rot, vel); 2084 AddNewSceneObject(group, true);
2085
2086 group.AbsolutePosition = pos;
2087 group.Velocity = vel;
2088
2089 if (rot != null)
2090 group.UpdateGroupRotationR((Quaternion)rot);
2047 2091
2048 // We can only call this after adding the scene object, since the scene object references the scene 2092 // We can only call this after adding the scene object, since the scene object references the scene
2049 // to find out if scripts should be activated at all. 2093 // to find out if scripts should be activated at all.
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 0e3cffb..eed5ebc 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -5038,7 +5038,20 @@ namespace OpenSim.Region.Framework.Scenes
5038 } 5038 }
5039 } 5039 }
5040 5040
5041 public Vector3[] GetCombinedBoundingBox(List<SceneObjectGroup> objects, out float minX, out float maxX, out float minY, out float maxY, out float minZ, out float maxZ) 5041 /// <summary>
5042 /// Get the volume of space that will encompass all the given objects.
5043 /// </summary>
5044 /// <param name="objects"></param>
5045 /// <param name="minX"></param>
5046 /// <param name="maxX"></param>
5047 /// <param name="minY"></param>
5048 /// <param name="maxY"></param>
5049 /// <param name="minZ"></param>
5050 /// <param name="maxZ"></param>
5051 /// <returns></returns>
5052 public static Vector3[] GetCombinedBoundingBox(
5053 List<SceneObjectGroup> objects,
5054 out float minX, out float maxX, out float minY, out float maxY, out float minZ, out float maxZ)
5042 { 5055 {
5043 minX = 256; 5056 minX = 256;
5044 maxX = -256; 5057 maxX = -256;
@@ -5056,6 +5069,10 @@ namespace OpenSim.Region.Framework.Scenes
5056 Vector3 vec = g.AbsolutePosition; 5069 Vector3 vec = g.AbsolutePosition;
5057 5070
5058 g.GetAxisAlignedBoundingBoxRaw(out ominX, out omaxX, out ominY, out omaxY, out ominZ, out omaxZ); 5071 g.GetAxisAlignedBoundingBoxRaw(out ominX, out omaxX, out ominY, out omaxY, out ominZ, out omaxZ);
5072
5073// m_log.DebugFormat(
5074// "[SCENE]: For {0} found AxisAlignedBoundingBoxRaw {1}, {2}",
5075// g.Name, new Vector3(ominX, ominY, ominZ), new Vector3(omaxX, omaxY, omaxZ));
5059 5076
5060 ominX += vec.X; 5077 ominX += vec.X;
5061 omaxX += vec.X; 5078 omaxX += vec.X;
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 6773e08..3d6057b 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1077,6 +1077,8 @@ namespace OpenSim.Region.Framework.Scenes
1077 { 1077 {
1078 foreach (SceneObjectPart p in ((SceneObjectGroup)entity).Parts) 1078 foreach (SceneObjectPart p in ((SceneObjectGroup)entity).Parts)
1079 { 1079 {
1080// m_log.DebugFormat("[SCENE GRAPH]: Part {0} has name {1}", p.UUID, p.Name);
1081
1080 if (p.Name == name) 1082 if (p.Name == name)
1081 { 1083 {
1082 sop = p; 1084 sop = p;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 759fc23..69bfb9a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -365,11 +365,14 @@ namespace OpenSim.Region.Framework.Scenes
365 { 365 {
366 Vector3 val = value; 366 Vector3 val = value;
367 367
368 if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W) 368 if (Scene != null)
369 || m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
370 && !IsAttachmentCheckFull() && (!m_scene.LoadingPrims))
371 { 369 {
372 m_scene.CrossPrimGroupIntoNewRegion(val, this, true); 370 if ((Scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || Scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
371 || Scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || Scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
372 && !IsAttachmentCheckFull() && (!Scene.LoadingPrims))
373 {
374 m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
375 }
373 } 376 }
374 377
375 foreach (SceneObjectPart part in m_parts.GetArray()) 378 foreach (SceneObjectPart part in m_parts.GetArray())
@@ -381,8 +384,11 @@ namespace OpenSim.Region.Framework.Scenes
381 if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10) 384 if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10)
382 { 385 {
383 RootPart.ScriptSetPhysicsStatus(false); 386 RootPart.ScriptSetPhysicsStatus(false);
384 Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"), 387
385 ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false); 388 if (Scene != null)
389 Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"),
390 ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false);
391
386 return; 392 return;
387 } 393 }
388 } 394 }
@@ -420,7 +426,8 @@ namespace OpenSim.Region.Framework.Scenes
420 //m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); 426 //m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
421 //} 427 //}
422 428
423 m_scene.EventManager.TriggerParcelPrimCountTainted(); 429 if (Scene != null)
430 Scene.EventManager.TriggerParcelPrimCountTainted();
424 } 431 }
425 } 432 }
426 433
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs
new file mode 100644
index 0000000..babcb54
--- /dev/null
+++ b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs
@@ -0,0 +1,149 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Drawing;
31using System.IO;
32using System.Reflection;
33using System.Xml;
34using log4net;
35using OpenMetaverse;
36using OpenSim.Framework;
37using OpenSim.Region.Framework.Interfaces;
38using OpenSim.Region.Framework.Scenes;
39
40namespace OpenSim.Region.Framework.Scenes.Serialization
41{
42 /// <summary>
43 /// Serialize and deserialize coalesced scene objects.
44 /// </summary>
45 /// <remarks>
46 /// Deserialization not yet here.
47 /// </remarks>
48 public class CoalescedSceneObjectsSerializer
49 {
50 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
51
52 /// <summary>
53 /// Serialize coalesced objects to Xml
54 /// </summary>
55 /// <param name="coa"></param>
56 /// <returns></returns>
57 public static string ToXml(CoalescedSceneObjects coa)
58 {
59 using (StringWriter sw = new StringWriter())
60 {
61 using (XmlTextWriter writer = new XmlTextWriter(sw))
62 {
63 Vector3 size;
64
65 List<SceneObjectGroup> coaObjects = coa.Objects;
66
67// m_log.DebugFormat(
68// "[COALESCED SCENE OBJECTS SERIALIZER]: Writing {0} objects for coalesced object",
69// coaObjects.Count);
70
71 // This is weak - we're relying on the set of coalesced objects still being identical
72 Vector3[] offsets = coa.GetSizeAndOffsets(out size);
73
74 writer.WriteStartElement("CoalescedObject");
75
76 writer.WriteAttributeString("x", size.X.ToString());
77 writer.WriteAttributeString("y", size.Y.ToString());
78 writer.WriteAttributeString("z", size.Z.ToString());
79
80 // Embed the offsets into the group XML
81 for (int i = 0; i < coaObjects.Count; i++)
82 {
83 SceneObjectGroup obj = coaObjects[i];
84
85// m_log.DebugFormat(
86// "[COALESCED SCENE OBJECTS SERIALIZER]: Writing offset for object {0}, {1}",
87// i, obj.Name);
88
89 writer.WriteStartElement("SceneObjectGroup");
90 writer.WriteAttributeString("offsetx", offsets[i].X.ToString());
91 writer.WriteAttributeString("offsety", offsets[i].Y.ToString());
92 writer.WriteAttributeString("offsetz", offsets[i].Z.ToString());
93
94 SceneObjectSerializer.ToOriginalXmlFormat(obj, writer, true);
95
96 writer.WriteEndElement(); // SceneObjectGroup
97 }
98
99 writer.WriteEndElement(); // CoalescedObject
100 }
101
102 string output = sw.ToString();
103
104// Console.WriteLine(output);
105
106 return output;
107 }
108 }
109
110 public static bool TryFromXml(string xml, out CoalescedSceneObjects coa)
111 {
112// m_log.DebugFormat("[COALESCED SCENE OBJECTS SERIALIZER]: TryFromXml() deserializing {0}", xml);
113
114 coa = null;
115
116 using (StringReader sr = new StringReader(xml))
117 {
118 using (XmlTextReader reader = new XmlTextReader(sr))
119 {
120 reader.Read();
121 if (reader.Name != "CoalescedObject")
122 {
123// m_log.DebugFormat(
124// "[COALESCED SCENE OBJECTS SERIALIZER]: TryFromXml() root element was {0} so returning false",
125// reader.Name);
126
127 return false;
128 }
129
130 coa = new CoalescedSceneObjects(UUID.Zero);
131 reader.Read();
132
133 while (reader.NodeType != XmlNodeType.EndElement && reader.Name != "CoalescedObject")
134 {
135 if (reader.Name == "SceneObjectGroup")
136 {
137 string soXml = reader.ReadOuterXml();
138 coa.Add(SceneObjectSerializer.FromOriginalXmlFormat(soXml));
139 }
140 }
141
142 reader.ReadEndElement(); // CoalescedObject
143 }
144 }
145
146 return true;
147 }
148 }
149} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index b2b3ad9..769d8a5 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -139,6 +139,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
139 return sw.ToString(); 139 return sw.ToString();
140 } 140 }
141 } 141 }
142
142 143
143 /// <summary> 144 /// <summary>
144 /// Serialize a scene object to the original xml format 145 /// Serialize a scene object to the original xml format
@@ -147,10 +148,24 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
147 /// <returns></returns> 148 /// <returns></returns>
148 public static void ToOriginalXmlFormat(SceneObjectGroup sceneObject, XmlTextWriter writer) 149 public static void ToOriginalXmlFormat(SceneObjectGroup sceneObject, XmlTextWriter writer)
149 { 150 {
151 ToOriginalXmlFormat(sceneObject, writer, false);
152 }
153
154 /// <summary>
155 /// Serialize a scene object to the original xml format
156 /// </summary>
157 /// <param name="sceneObject"></param>
158 /// <param name="writer"></param>
159 /// <param name="noRootElement">If false, don't write the enclosing SceneObjectGroup element</param>
160 /// <returns></returns>
161 public static void ToOriginalXmlFormat(SceneObjectGroup sceneObject, XmlTextWriter writer, bool noRootElement)
162 {
150 //m_log.DebugFormat("[SERIALIZER]: Starting serialization of {0}", Name); 163 //m_log.DebugFormat("[SERIALIZER]: Starting serialization of {0}", Name);
151 //int time = System.Environment.TickCount; 164 //int time = System.Environment.TickCount;
152 165
153 writer.WriteStartElement(String.Empty, "SceneObjectGroup", String.Empty); 166 if (!noRootElement)
167 writer.WriteStartElement(String.Empty, "SceneObjectGroup", String.Empty);
168
154 writer.WriteStartElement(String.Empty, "RootPart", String.Empty); 169 writer.WriteStartElement(String.Empty, "RootPart", String.Empty);
155 ToXmlFormat(sceneObject.RootPart, writer); 170 ToXmlFormat(sceneObject.RootPart, writer);
156 writer.WriteEndElement(); 171 writer.WriteEndElement();
@@ -170,10 +185,12 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
170 185
171 writer.WriteEndElement(); // OtherParts 186 writer.WriteEndElement(); // OtherParts
172 sceneObject.SaveScriptedState(writer); 187 sceneObject.SaveScriptedState(writer);
173 writer.WriteEndElement(); // SceneObjectGroup 188
189 if (!noRootElement)
190 writer.WriteEndElement(); // SceneObjectGroup
174 191
175 //m_log.DebugFormat("[SERIALIZER]: Finished serialization of SOG {0}, {1}ms", Name, System.Environment.TickCount - time); 192 //m_log.DebugFormat("[SERIALIZER]: Finished serialization of SOG {0}, {1}ms", Name, System.Environment.TickCount - time);
176 } 193 }
177 194
178 protected static void ToXmlFormat(SceneObjectPart part, XmlTextWriter writer) 195 protected static void ToXmlFormat(SceneObjectPart part, XmlTextWriter writer)
179 { 196 {
@@ -1318,7 +1335,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1318 writer.WriteStartElement("SculptData"); 1335 writer.WriteStartElement("SculptData");
1319 byte[] sd; 1336 byte[] sd;
1320 if (shp.SculptData != null) 1337 if (shp.SculptData != null)
1321 sd = shp.ExtraParams; 1338 sd = shp.SculptData;
1322 else 1339 else
1323 sd = Utils.EmptyBytes; 1340 sd = Utils.EmptyBytes;
1324 writer.WriteBase64(sd, 0, sd.Length); 1341 writer.WriteBase64(sd, 0, sd.Length);
diff --git a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs
index 8588f7f..dd28416 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs
@@ -117,11 +117,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
117 ISharedRegionModule interregionComms = new LocalSimulationConnectorModule(); 117 ISharedRegionModule interregionComms = new LocalSimulationConnectorModule();
118 118
119 119
120 Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, "grid"); 120 Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010);
121 SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms); 121 SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms);
122 sceneB.RegisterRegionWithGrid(); 122 sceneB.RegisterRegionWithGrid();
123 123
124 Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, "grid"); 124 Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000);
125 SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms); 125 SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms);
126 sceneA.RegisterRegionWithGrid(); 126 sceneA.RegisterRegionWithGrid();
127 127
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index 8138bcc..2aef4b0 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -101,7 +101,7 @@ namespace OpenSim.Region.Framework.Tests
101 TestHelper.InMethod(); 101 TestHelper.InMethod();
102// log4net.Config.XmlConfigurator.Configure(); 102// log4net.Config.XmlConfigurator.Configure();
103 103
104 Scene scene = SceneSetupHelpers.SetupScene("inventory"); 104 Scene scene = SceneSetupHelpers.SetupScene();
105 UserAccount user1 = CreateUser(scene); 105 UserAccount user1 = CreateUser(scene);
106 SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID); 106 SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID);
107 SceneObjectPart sop1 = sog1.RootPart; 107 SceneObjectPart sop1 = sog1.RootPart;
@@ -127,7 +127,7 @@ namespace OpenSim.Region.Framework.Tests
127 TestHelper.InMethod(); 127 TestHelper.InMethod();
128// log4net.Config.XmlConfigurator.Configure(); 128// log4net.Config.XmlConfigurator.Configure();
129 129
130 Scene scene = SceneSetupHelpers.SetupScene("inventory"); 130 Scene scene = SceneSetupHelpers.SetupScene();
131 UserAccount user1 = CreateUser(scene); 131 UserAccount user1 = CreateUser(scene);
132 SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID); 132 SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID);
133 SceneObjectPart sop1 = sog1.RootPart; 133 SceneObjectPart sop1 = sog1.RootPart;
diff --git a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
index 6b70865..dbf9e0f 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs
@@ -47,7 +47,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests
47 [SetUp] 47 [SetUp]
48 public void Init() 48 public void Init()
49 { 49 {
50 m_assetService = new MockAssetService(); 50 // FIXME: We don't need a full scene here - it would be enough to set up the asset service.
51 Scene scene = SceneSetupHelpers.SetupScene();
52 m_assetService = scene.AssetService;
51 m_uuidGatherer = new UuidGatherer(m_assetService); 53 m_uuidGatherer = new UuidGatherer(m_assetService);
52 } 54 }
53 55
diff --git a/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETScene.cs b/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETScene.cs
index 85e34c1..6df213d 100644
--- a/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETScene.cs
+++ b/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETScene.cs
@@ -648,6 +648,9 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
648 if (pbs.ProfileHollow != 0) 648 if (pbs.ProfileHollow != 0)
649 iPropertiesNotSupportedDefault++; 649 iPropertiesNotSupportedDefault++;
650 650
651 if ((pbs.PathBegin != 0) || pbs.PathEnd != 0)
652 iPropertiesNotSupportedDefault++;
653
651 if ((pbs.PathTwistBegin != 0) || (pbs.PathTwist != 0)) 654 if ((pbs.PathTwistBegin != 0) || (pbs.PathTwist != 0))
652 iPropertiesNotSupportedDefault++; 655 iPropertiesNotSupportedDefault++;
653 656
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index eb97f41..a0101af 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -2528,6 +2528,9 @@ namespace OpenSim.Region.Physics.OdePlugin
2528 if (pbs.ProfileHollow != 0) 2528 if (pbs.ProfileHollow != 0)
2529 iPropertiesNotSupportedDefault++; 2529 iPropertiesNotSupportedDefault++;
2530 2530
2531 if ((pbs.PathBegin != 0) || pbs.PathEnd != 0)
2532 iPropertiesNotSupportedDefault++;
2533
2531 if ((pbs.PathTwistBegin != 0) || (pbs.PathTwist != 0)) 2534 if ((pbs.PathTwistBegin != 0) || (pbs.PathTwist != 0))
2532 iPropertiesNotSupportedDefault++; 2535 iPropertiesNotSupportedDefault++;
2533 2536
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index cda8adb..f4aefac 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -8052,7 +8052,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8052 8052
8053 // This BBox is in sim coordinates, with the offset being 8053 // This BBox is in sim coordinates, with the offset being
8054 // a contained point. 8054 // a contained point.
8055 Vector3[] offsets = World.GetCombinedBoundingBox(new List<SceneObjectGroup> { part.ParentGroup }, 8055 Vector3[] offsets = Scene.GetCombinedBoundingBox(new List<SceneObjectGroup> { part.ParentGroup },
8056 out minX, out maxX, out minY, out maxY, out minZ, out maxZ); 8056 out minX, out maxX, out minY, out maxY, out minZ, out maxZ);
8057 8057
8058 minX -= offsets[0].X; 8058 minX -= offsets[0].X;
diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs
index c29bce8..acbd2b1 100644
--- a/OpenSim/Services/AssetService/AssetService.cs
+++ b/OpenSim/Services/AssetService/AssetService.cs
@@ -89,6 +89,8 @@ namespace OpenSim.Services.AssetService
89 89
90 public virtual AssetBase Get(string id) 90 public virtual AssetBase Get(string id)
91 { 91 {
92// m_log.DebugFormat("[ASSET SERVICE]: Get asset for {0}", id);
93
92 UUID assetID; 94 UUID assetID;
93 95
94 if (!UUID.TryParse(id, out assetID)) 96 if (!UUID.TryParse(id, out assetID))
@@ -107,6 +109,8 @@ namespace OpenSim.Services.AssetService
107 109
108 public virtual AssetMetadata GetMetadata(string id) 110 public virtual AssetMetadata GetMetadata(string id)
109 { 111 {
112// m_log.DebugFormat("[ASSET SERVICE]: Get asset metadata for {0}", id);
113
110 UUID assetID; 114 UUID assetID;
111 115
112 if (!UUID.TryParse(id, out assetID)) 116 if (!UUID.TryParse(id, out assetID))
@@ -121,6 +125,8 @@ namespace OpenSim.Services.AssetService
121 125
122 public virtual byte[] GetData(string id) 126 public virtual byte[] GetData(string id)
123 { 127 {
128// m_log.DebugFormat("[ASSET SERVICE]: Get asset data for {0}", id);
129
124 UUID assetID; 130 UUID assetID;
125 131
126 if (!UUID.TryParse(id, out assetID)) 132 if (!UUID.TryParse(id, out assetID))
diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs
index ad18a23..565e4f2 100644
--- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs
@@ -35,7 +35,6 @@ using Nini.Config;
35using OpenSim.Framework; 35using OpenSim.Framework;
36using OpenSim.Framework.Console; 36using OpenSim.Framework.Console;
37using OpenSim.Framework.Communications; 37using OpenSim.Framework.Communications;
38using OpenSim.Framework.Servers.HttpServer;
39using OpenSim.Services.Interfaces; 38using OpenSim.Services.Interfaces;
40using OpenMetaverse; 39using OpenMetaverse;
41 40
diff --git a/OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs
index 6f77a2d..c04e7a4 100644
--- a/OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs
@@ -33,7 +33,6 @@ using System.Reflection;
33using Nini.Config; 33using Nini.Config;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Framework.Communications; 35using OpenSim.Framework.Communications;
36using OpenSim.Framework.Servers.HttpServer;
37using OpenSim.Services.Interfaces; 36using OpenSim.Services.Interfaces;
38using OpenSim.Server.Base; 37using OpenSim.Server.Base;
39using OpenMetaverse; 38using OpenMetaverse;
diff --git a/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs b/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs
index 4eb4bd2..35b7109 100644
--- a/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs
@@ -33,7 +33,6 @@ using System.Reflection;
33using Nini.Config; 33using Nini.Config;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Framework.Communications; 35using OpenSim.Framework.Communications;
36using OpenSim.Framework.Servers.HttpServer;
37using OpenSim.Services.Interfaces; 36using OpenSim.Services.Interfaces;
38using OpenMetaverse; 37using OpenMetaverse;
39 38
diff --git a/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs b/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs
index 1cd6bf8..1a93ae7 100644
--- a/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs
@@ -33,7 +33,6 @@ using System.Reflection;
33using Nini.Config; 33using Nini.Config;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Framework.Communications; 35using OpenSim.Framework.Communications;
36using OpenSim.Framework.Servers.HttpServer;
37using OpenSim.Services.Interfaces; 36using OpenSim.Services.Interfaces;
38using GridRegion = OpenSim.Services.Interfaces.GridRegion; 37using GridRegion = OpenSim.Services.Interfaces.GridRegion;
39using IAvatarService = OpenSim.Services.Interfaces.IAvatarService; 38using IAvatarService = OpenSim.Services.Interfaces.IAvatarService;
diff --git a/OpenSim/Services/Connectors/Freeswitch/RemoteFreeswitchConnector.cs b/OpenSim/Services/Connectors/Freeswitch/RemoteFreeswitchConnector.cs
index c9bba0b..d688299 100644
--- a/OpenSim/Services/Connectors/Freeswitch/RemoteFreeswitchConnector.cs
+++ b/OpenSim/Services/Connectors/Freeswitch/RemoteFreeswitchConnector.cs
@@ -33,7 +33,6 @@ using System.Reflection;
33using Nini.Config; 33using Nini.Config;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Framework.Communications; 35using OpenSim.Framework.Communications;
36using OpenSim.Framework.Servers.HttpServer;
37using OpenSim.Services.Interfaces; 36using OpenSim.Services.Interfaces;
38using OpenSim.Server.Base; 37using OpenSim.Server.Base;
39using OpenMetaverse; 38using OpenMetaverse;
diff --git a/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs
index 36b5083..861c475 100644
--- a/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs
@@ -33,7 +33,6 @@ using System.Reflection;
33using Nini.Config; 33using Nini.Config;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Framework.Communications; 35using OpenSim.Framework.Communications;
36using OpenSim.Framework.Servers.HttpServer;
37using OpenSim.Services.Interfaces; 36using OpenSim.Services.Interfaces;
38using FriendInfo = OpenSim.Services.Interfaces.FriendInfo; 37using FriendInfo = OpenSim.Services.Interfaces.FriendInfo;
39using OpenSim.Server.Base; 38using OpenSim.Server.Base;
diff --git a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs
index 0a7b277..4ffa68c 100644
--- a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs
+++ b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs
@@ -32,7 +32,7 @@ using System.Reflection;
32using OpenSim.Services.Interfaces; 32using OpenSim.Services.Interfaces;
33using GridRegion = OpenSim.Services.Interfaces.GridRegion; 33using GridRegion = OpenSim.Services.Interfaces.GridRegion;
34using OpenSim.Server.Base; 34using OpenSim.Server.Base;
35using OpenSim.Framework.Servers.HttpServer; 35using OpenSim.Framework;
36 36
37using OpenMetaverse; 37using OpenMetaverse;
38using log4net; 38using log4net;
diff --git a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
index 5092d74..e57f28b 100644
--- a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
@@ -33,7 +33,6 @@ using System.Reflection;
33using Nini.Config; 33using Nini.Config;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Framework.Communications; 35using OpenSim.Framework.Communications;
36using OpenSim.Framework.Servers.HttpServer;
37using OpenSim.Services.Interfaces; 36using OpenSim.Services.Interfaces;
38using GridRegion = OpenSim.Services.Interfaces.GridRegion; 37using GridRegion = OpenSim.Services.Interfaces.GridRegion;
39using OpenSim.Server.Base; 38using OpenSim.Server.Base;
diff --git a/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs b/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs
index b3ea865..738cc06 100644
--- a/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs
+++ b/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs
@@ -33,7 +33,6 @@ using System.Reflection;
33using Nini.Config; 33using Nini.Config;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Framework.Communications; 35using OpenSim.Framework.Communications;
36using OpenSim.Framework.Servers.HttpServer;
37using OpenSim.Services.Interfaces; 36using OpenSim.Services.Interfaces;
38using GridRegion = OpenSim.Services.Interfaces.GridRegion; 37using GridRegion = OpenSim.Services.Interfaces.GridRegion;
39using OpenSim.Server.Base; 38using OpenSim.Server.Base;
diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs
index b3bfcc2..cd9f2bf 100644
--- a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs
@@ -34,7 +34,6 @@ using Nini.Config;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Framework.Console; 35using OpenSim.Framework.Console;
36using OpenSim.Framework.Communications; 36using OpenSim.Framework.Communications;
37using OpenSim.Framework.Servers.HttpServer;
38using OpenSim.Services.Interfaces; 37using OpenSim.Services.Interfaces;
39using OpenSim.Server.Base; 38using OpenSim.Server.Base;
40using OpenMetaverse; 39using OpenMetaverse;
diff --git a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs
index ba39c99..833e22a 100644
--- a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs
@@ -34,7 +34,6 @@ using System.Reflection;
34using Nini.Config; 34using Nini.Config;
35using OpenSim.Framework; 35using OpenSim.Framework;
36using OpenSim.Framework.Communications; 36using OpenSim.Framework.Communications;
37using OpenSim.Framework.Servers.HttpServer;
38using OpenSim.Services.Interfaces; 37using OpenSim.Services.Interfaces;
39using OpenMetaverse; 38using OpenMetaverse;
40using Nwc.XmlRpc; 39using Nwc.XmlRpc;
diff --git a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs b/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs
index 9e444c4..2cae02d 100644
--- a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs
@@ -36,7 +36,6 @@ using System.Text;
36using Nini.Config; 36using Nini.Config;
37using OpenSim.Framework; 37using OpenSim.Framework;
38using OpenSim.Framework.Communications; 38using OpenSim.Framework.Communications;
39using OpenSim.Framework.Servers.HttpServer;
40using OpenSim.Services.Interfaces; 39using OpenSim.Services.Interfaces;
41using OpenMetaverse; 40using OpenMetaverse;
42using OpenMetaverse.StructuredData; 41using OpenMetaverse.StructuredData;
diff --git a/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs b/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs
index f1c99ce..e16dc36 100644
--- a/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs
@@ -33,7 +33,6 @@ using System.Reflection;
33using Nini.Config; 33using Nini.Config;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Framework.Communications; 35using OpenSim.Framework.Communications;
36using OpenSim.Framework.Servers.HttpServer;
37using OpenSim.Services.Interfaces; 36using OpenSim.Services.Interfaces;
38using GridRegion = OpenSim.Services.Interfaces.GridRegion; 37using GridRegion = OpenSim.Services.Interfaces.GridRegion;
39using OpenSim.Server.Base; 38using OpenSim.Server.Base;
diff --git a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs
index 205a4aa..60f3abe 100644
--- a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs
+++ b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs
@@ -33,7 +33,6 @@ using System.Reflection;
33using Nini.Config; 33using Nini.Config;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Framework.Communications; 35using OpenSim.Framework.Communications;
36using OpenSim.Framework.Servers.HttpServer;
37using OpenSim.Server.Base; 36using OpenSim.Server.Base;
38using OpenSim.Services.Interfaces; 37using OpenSim.Services.Interfaces;
39using OpenMetaverse; 38using OpenMetaverse;
diff --git a/OpenSim/Services/Interfaces/IAssetService.cs b/OpenSim/Services/Interfaces/IAssetService.cs
index 3be6815..1ac1cec 100644
--- a/OpenSim/Services/Interfaces/IAssetService.cs
+++ b/OpenSim/Services/Interfaces/IAssetService.cs
@@ -48,6 +48,11 @@ namespace OpenSim.Services.Interfaces
48 /// <returns></returns> 48 /// <returns></returns>
49 AssetMetadata GetMetadata(string id); 49 AssetMetadata GetMetadata(string id);
50 50
51 /// <summary>
52 /// Get an asset's data, ignoring the metadata.
53 /// </summary>
54 /// <param name="id"></param>
55 /// <returns>null if there is no such asset</returns>
51 byte[] GetData(string id); 56 byte[] GetData(string id);
52 57
53 /// <summary> 58 /// <summary>
diff --git a/OpenSim/Tests/Common/Mock/MockAssetService.cs b/OpenSim/Tests/Common/Mock/MockAssetService.cs
deleted file mode 100644
index 4118308..0000000
--- a/OpenSim/Tests/Common/Mock/MockAssetService.cs
+++ /dev/null
@@ -1,109 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Reflection;
31using log4net;
32using OpenMetaverse;
33using OpenSim.Framework;
34using OpenSim.Data;
35using OpenSim.Services.Interfaces;
36using Nini.Config;
37
38namespace OpenSim.Tests.Common.Mock
39{
40 public class MockAssetService : IAssetService
41 {
42 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
43
44 private readonly Dictionary<string, AssetBase> Assets = new Dictionary<string, AssetBase>();
45
46 public MockAssetService() {}
47
48 /// <summary>
49 /// This constructor is required if the asset service is being created reflectively (which is the case in some
50 /// tests).
51 /// </summary>
52 /// <param name="config"></param>
53 public MockAssetService(IConfigSource config) {}
54
55 public AssetBase Get(string id)
56 {
57 m_log.DebugFormat("[MOCK ASSET SERVICE]: Getting asset with id {0}", id);
58
59 AssetBase asset;
60 if (Assets.ContainsKey(id))
61 asset = Assets[id];
62 else
63 asset = null;
64
65 return asset;
66 }
67
68 public AssetBase GetCached(string id)
69 {
70 return Get(id);
71 }
72
73 public AssetMetadata GetMetadata(string id)
74 {
75 throw new System.NotImplementedException();
76 }
77
78 public byte[] GetData(string id)
79 {
80 throw new System.NotImplementedException();
81 }
82
83 public bool Get(string id, object sender, AssetRetrieved handler)
84 {
85 handler(id, sender, Get(id));
86
87 return true;
88 }
89
90 public string Store(AssetBase asset)
91 {
92 m_log.DebugFormat("[MOCK ASSET SERVICE]: Storing asset {0}", asset.ID);
93
94 Assets[asset.ID] = asset;
95
96 return asset.ID;
97 }
98
99 public bool UpdateContent(string id, byte[] data)
100 {
101 throw new System.NotImplementedException();
102 }
103
104 public bool Delete(string id)
105 {
106 throw new System.NotImplementedException();
107 }
108 }
109} \ No newline at end of file
diff --git a/OpenSim/Tests/Common/Mock/MockInventoryService.cs b/OpenSim/Tests/Common/Mock/MockInventoryService.cs
deleted file mode 100644
index 4ac1078..0000000
--- a/OpenSim/Tests/Common/Mock/MockInventoryService.cs
+++ /dev/null
@@ -1,186 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Text;
31using OpenSim.Framework;
32using OpenMetaverse;
33using OpenSim.Services.Interfaces;
34using Nini.Config;
35
36namespace OpenSim.Tests.Common.Mock
37{
38 public class MockInventoryService : IInventoryService
39 {
40 public MockInventoryService() {}
41
42 public MockInventoryService(IConfigSource config) {}
43
44 /// <summary>
45 /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/>
46 /// </summary>
47 /// <param name="userId"></param>
48 /// <returns></returns>
49 public bool CreateUserInventory(UUID userId)
50 {
51 return false;
52 }
53
54 /// <summary>
55 /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/>
56 /// </summary>
57 /// <param name="userId"></param>
58 /// <returns></returns>
59 public List<InventoryFolderBase> GetInventorySkeleton(UUID userId)
60 {
61 List<InventoryFolderBase> folders = new List<InventoryFolderBase>();
62 InventoryFolderBase folder = new InventoryFolderBase();
63 folder.ID = UUID.Random();
64 folder.Owner = userId;
65 folders.Add(folder);
66 return folders;
67 }
68
69 public InventoryFolderBase GetRootFolder(UUID userID)
70 {
71 return new InventoryFolderBase();
72 }
73
74 public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
75 {
76 return null;
77 }
78
79 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
80 {
81 return null;
82 }
83
84 /// <summary>
85 /// Returns a list of all the active gestures in a user's inventory.
86 /// </summary>
87 /// <param name="userId">
88 /// The <see cref="UUID"/> of the user
89 /// </param>
90 /// <returns>
91 /// A flat list of the gesture items.
92 /// </returns>
93 public List<InventoryItemBase> GetActiveGestures(UUID userId)
94 {
95 return null;
96 }
97
98 public InventoryCollection GetUserInventory(UUID userID)
99 {
100 return null;
101 }
102
103 public void GetUserInventory(UUID userID, OpenSim.Services.Interfaces.InventoryReceiptCallback callback)
104 {
105 }
106
107 public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
108 {
109 return null;
110 }
111
112 public bool AddFolder(InventoryFolderBase folder)
113 {
114 return false;
115 }
116
117 public bool UpdateFolder(InventoryFolderBase folder)
118 {
119 return false;
120 }
121
122 public bool MoveFolder(InventoryFolderBase folder)
123 {
124 return false;
125 }
126
127 public bool DeleteFolders(UUID ownerID, List<UUID> ids)
128 {
129 return false;
130 }
131
132 public bool PurgeFolder(InventoryFolderBase folder)
133 {
134 return false;
135 }
136
137 public bool AddItem(InventoryItemBase item)
138 {
139 return true;
140 }
141
142 public bool UpdateItem(InventoryItemBase item)
143 {
144 return false;
145 }
146
147 public bool MoveItems(UUID ownerID, List<InventoryItemBase> items)
148 {
149 return false;
150 }
151
152 public bool DeleteItems(UUID ownerID, List<UUID> itemIDs)
153 {
154 return false;
155 }
156
157 public InventoryItemBase GetItem(InventoryItemBase item)
158 {
159 return null;
160 }
161
162 public InventoryFolderBase GetFolder(InventoryFolderBase folder)
163 {
164 return null;
165 }
166
167 public bool HasInventoryForUser(UUID userID)
168 {
169 return false;
170 }
171
172 public InventoryFolderBase RequestRootFolder(UUID userID)
173 {
174 InventoryFolderBase root = new InventoryFolderBase();
175 root.ID = UUID.Random();
176 root.Owner = userID;
177 root.ParentID = UUID.Zero;
178 return root;
179 }
180
181 public int GetAssetPermissions(UUID userID, UUID assetID)
182 {
183 return 1;
184 }
185 }
186} \ No newline at end of file
diff --git a/OpenSim/Tests/Common/Setup/AssetHelpers.cs b/OpenSim/Tests/Common/Setup/AssetHelpers.cs
index ff4423f..d572249 100644
--- a/OpenSim/Tests/Common/Setup/AssetHelpers.cs
+++ b/OpenSim/Tests/Common/Setup/AssetHelpers.cs
@@ -30,6 +30,7 @@ using OpenMetaverse;
30using OpenSim.Framework; 30using OpenSim.Framework;
31using OpenSim.Region.Framework.Scenes; 31using OpenSim.Region.Framework.Scenes;
32using OpenSim.Region.Framework.Scenes.Serialization; 32using OpenSim.Region.Framework.Scenes.Serialization;
33using OpenSim.Services.Interfaces;
33 34
34namespace OpenSim.Tests.Common 35namespace OpenSim.Tests.Common
35{ 36{
@@ -55,7 +56,7 @@ namespace OpenSim.Tests.Common
55 AssetBase asset = CreateAsset(UUID.Random(), AssetType.Notecard, "hello", creatorId); 56 AssetBase asset = CreateAsset(UUID.Random(), AssetType.Notecard, "hello", creatorId);
56 scene.AssetService.Store(asset); 57 scene.AssetService.Store(asset);
57 return asset; 58 return asset;
58 } 59 }
59 60
60 /// <summary> 61 /// <summary>
61 /// Create an asset from the given scene object. 62 /// Create an asset from the given scene object.
@@ -71,6 +72,35 @@ namespace OpenSim.Tests.Common
71 Encoding.ASCII.GetBytes(SceneObjectSerializer.ToOriginalXmlFormat(sog)), 72 Encoding.ASCII.GetBytes(SceneObjectSerializer.ToOriginalXmlFormat(sog)),
72 sog.OwnerID); 73 sog.OwnerID);
73 } 74 }
75
76 /// <summary>
77 /// Create an asset from the given scene object.
78 /// </summary>
79 /// <param name="assetUuidTailZ">
80 /// The hexadecimal last part of the UUID for the asset created. A UUID of the form "00000000-0000-0000-0000-{0:XD12}"
81 /// will be used.
82 /// </param>
83 /// <param name="coa"></param>
84 /// <returns></returns>
85 public static AssetBase CreateAsset(int assetUuidTail, CoalescedSceneObjects coa)
86 {
87 return CreateAsset(new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", assetUuidTail)), coa);
88 }
89
90 /// <summary>
91 /// Create an asset from the given scene object.
92 /// </summary>
93 /// <param name="assetUuid"></param>
94 /// <param name="coa"></param>
95 /// <returns></returns>
96 public static AssetBase CreateAsset(UUID assetUuid, CoalescedSceneObjects coa)
97 {
98 return CreateAsset(
99 assetUuid,
100 AssetType.Object,
101 Encoding.ASCII.GetBytes(CoalescedSceneObjectsSerializer.ToXml(coa)),
102 coa.CreatorId);
103 }
74 104
75 /// <summary> 105 /// <summary>
76 /// Create an asset from the given data. 106 /// Create an asset from the given data.
@@ -89,5 +119,11 @@ namespace OpenSim.Tests.Common
89 asset.Data = data; 119 asset.Data = data;
90 return asset; 120 return asset;
91 } 121 }
122
123 public static string ReadAssetAsString(IAssetService assetService, UUID uuid)
124 {
125 byte[] assetData = assetService.GetData(uuid.ToString());
126 return Encoding.ASCII.GetString(assetData);
127 }
92 } 128 }
93} 129}
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
index 709dd78..99517d2 100644
--- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
+++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
@@ -66,32 +66,7 @@ namespace OpenSim.Tests.Common.Setup
66 /// <returns></returns> 66 /// <returns></returns>
67 public static TestScene SetupScene() 67 public static TestScene SetupScene()
68 { 68 {
69 return SetupScene(""); 69 return SetupScene("Unit test region", UUID.Random(), 1000, 1000);
70 }
71
72 /// <summary>
73 /// Set up a test scene
74 /// </summary>
75 ///
76 /// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param>
77 /// <returns></returns>
78 public static TestScene SetupScene(String realServices)
79 {
80 return SetupScene("Unit test region", UUID.Random(), 1000, 1000, realServices);
81 }
82
83 /// <summary>
84 /// Set up a test scene
85 /// </summary>
86 /// <param name="name">Name of the region</param>
87 /// <param name="id">ID of the region</param>
88 /// <param name="x">X co-ordinate of the region</param>
89 /// <param name="y">Y co-ordinate of the region</param>
90 /// <param name="cm">This should be the same if simulating two scenes within a standalone</param>
91 /// <returns></returns>
92 public static TestScene SetupScene(string name, UUID id, uint x, uint y)
93 {
94 return SetupScene(name, id, x, y, "");
95 } 70 }
96 71
97 /// <summary> 72 /// <summary>
@@ -103,10 +78,8 @@ namespace OpenSim.Tests.Common.Setup
103 /// <param name="x">X co-ordinate of the region</param> 78 /// <param name="x">X co-ordinate of the region</param>
104 /// <param name="y">Y co-ordinate of the region</param> 79 /// <param name="y">Y co-ordinate of the region</param>
105 /// <param name="cm">This should be the same if simulating two scenes within a standalone</param> 80 /// <param name="cm">This should be the same if simulating two scenes within a standalone</param>
106 /// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param>
107 /// <returns></returns> 81 /// <returns></returns>
108 public static TestScene SetupScene( 82 public static TestScene SetupScene(string name, UUID id, uint x, uint y)
109 string name, UUID id, uint x, uint y, String realServices)
110 { 83 {
111 Console.WriteLine("Setting up test scene {0}", name); 84 Console.WriteLine("Setting up test scene {0}", name);
112 85
@@ -130,15 +103,11 @@ namespace OpenSim.Tests.Common.Setup
130 IRegionModule godsModule = new GodsModule(); 103 IRegionModule godsModule = new GodsModule();
131 godsModule.Initialise(testScene, new IniConfigSource()); 104 godsModule.Initialise(testScene, new IniConfigSource());
132 testScene.AddModule(godsModule.Name, godsModule); 105 testScene.AddModule(godsModule.Name, godsModule);
133 realServices = realServices.ToLower();
134
135 LocalAssetServicesConnector assetService = StartAssetService(testScene, realServices.Contains("asset"));
136
137 // For now, always started a 'real' authentication service
138 StartAuthenticationService(testScene, true);
139 106
140 LocalInventoryServicesConnector inventoryService = StartInventoryService(testScene, realServices.Contains("inventory")); 107 LocalAssetServicesConnector assetService = StartAssetService(testScene);
141 StartGridService(testScene, true); 108 StartAuthenticationService(testScene);
109 LocalInventoryServicesConnector inventoryService = StartInventoryService(testScene);
110 StartGridService(testScene);
142 LocalUserAccountServicesConnector userAccountService = StartUserAccountService(testScene); 111 LocalUserAccountServicesConnector userAccountService = StartUserAccountService(testScene);
143 LocalPresenceServicesConnector presenceService = StartPresenceService(testScene); 112 LocalPresenceServicesConnector presenceService = StartPresenceService(testScene);
144 113
@@ -164,18 +133,17 @@ namespace OpenSim.Tests.Common.Setup
164 return testScene; 133 return testScene;
165 } 134 }
166 135
167 private static LocalAssetServicesConnector StartAssetService(Scene testScene, bool real) 136 private static LocalAssetServicesConnector StartAssetService(Scene testScene)
168 { 137 {
169 LocalAssetServicesConnector assetService = new LocalAssetServicesConnector(); 138 LocalAssetServicesConnector assetService = new LocalAssetServicesConnector();
170 IConfigSource config = new IniConfigSource(); 139 IConfigSource config = new IniConfigSource();
171 config.AddConfig("Modules"); 140
141 config.AddConfig("Modules");
142 config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector");
172 config.AddConfig("AssetService"); 143 config.AddConfig("AssetService");
173 config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector"); 144 config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService");
174 if (real)
175 config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService");
176 else
177 config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockAssetService");
178 config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); 145 config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
146
179 assetService.Initialise(config); 147 assetService.Initialise(config);
180 assetService.AddRegion(testScene); 148 assetService.AddRegion(testScene);
181 assetService.RegionLoaded(testScene); 149 assetService.RegionLoaded(testScene);
@@ -184,20 +152,18 @@ namespace OpenSim.Tests.Common.Setup
184 return assetService; 152 return assetService;
185 } 153 }
186 154
187 private static void StartAuthenticationService(Scene testScene, bool real) 155 private static void StartAuthenticationService(Scene testScene)
188 { 156 {
189 ISharedRegionModule service = new LocalAuthenticationServicesConnector(); 157 ISharedRegionModule service = new LocalAuthenticationServicesConnector();
190 IConfigSource config = new IniConfigSource(); 158 IConfigSource config = new IniConfigSource();
159
191 config.AddConfig("Modules"); 160 config.AddConfig("Modules");
192 config.AddConfig("AuthenticationService"); 161 config.AddConfig("AuthenticationService");
193 config.Configs["Modules"].Set("AuthenticationServices", "LocalAuthenticationServicesConnector"); 162 config.Configs["Modules"].Set("AuthenticationServices", "LocalAuthenticationServicesConnector");
194 if (real) 163 config.Configs["AuthenticationService"].Set(
195 config.Configs["AuthenticationService"].Set( 164 "LocalServiceModule", "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService");
196 "LocalServiceModule", "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService");
197 else
198 config.Configs["AuthenticationService"].Set(
199 "LocalServiceModule", "OpenSim.Tests.Common.dll:MockAuthenticationService");
200 config.Configs["AuthenticationService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); 165 config.Configs["AuthenticationService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
166
201 service.Initialise(config); 167 service.Initialise(config);
202 service.AddRegion(testScene); 168 service.AddRegion(testScene);
203 service.RegionLoaded(testScene); 169 service.RegionLoaded(testScene);
@@ -205,24 +171,17 @@ namespace OpenSim.Tests.Common.Setup
205 //m_authenticationService = service; 171 //m_authenticationService = service;
206 } 172 }
207 173
208 private static LocalInventoryServicesConnector StartInventoryService(Scene testScene, bool real) 174 private static LocalInventoryServicesConnector StartInventoryService(Scene testScene)
209 { 175 {
210 LocalInventoryServicesConnector inventoryService = new LocalInventoryServicesConnector(); 176 LocalInventoryServicesConnector inventoryService = new LocalInventoryServicesConnector();
211 IConfigSource config = new IniConfigSource(); 177
178 IConfigSource config = new IniConfigSource();
212 config.AddConfig("Modules"); 179 config.AddConfig("Modules");
213 config.AddConfig("InventoryService"); 180 config.AddConfig("InventoryService");
214 config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector"); 181 config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector");
215 182 config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService");
216 if (real)
217 {
218 config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService");
219 }
220 else
221 {
222 config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockInventoryService");
223 }
224
225 config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); 183 config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
184
226 inventoryService.Initialise(config); 185 inventoryService.Initialise(config);
227 inventoryService.AddRegion(testScene); 186 inventoryService.AddRegion(testScene);
228 inventoryService.RegionLoaded(testScene); 187 inventoryService.RegionLoaded(testScene);
@@ -231,24 +190,19 @@ namespace OpenSim.Tests.Common.Setup
231 return inventoryService; 190 return inventoryService;
232 } 191 }
233 192
234 private static LocalGridServicesConnector StartGridService(Scene testScene, bool real) 193 private static LocalGridServicesConnector StartGridService(Scene testScene)
235 { 194 {
236 IConfigSource config = new IniConfigSource(); 195 IConfigSource config = new IniConfigSource();
237 config.AddConfig("Modules"); 196 config.AddConfig("Modules");
238 config.AddConfig("GridService"); 197 config.AddConfig("GridService");
239 config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector"); 198 config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector");
240 config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullRegionData"); 199 config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullRegionData");
241 if (real) 200 config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService");
242 config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService");
243 201
244 LocalGridServicesConnector gridService = new LocalGridServicesConnector(); 202 LocalGridServicesConnector gridService = new LocalGridServicesConnector();
245 gridService.Initialise(config); 203 gridService.Initialise(config);
246
247 //else
248 // config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:TestGridService");
249 gridService.AddRegion(testScene); 204 gridService.AddRegion(testScene);
250 gridService.RegionLoaded(testScene); 205 gridService.RegionLoaded(testScene);
251 //testScene.AddRegionModule(m_gridService.Name, m_gridService);
252 206
253 return gridService; 207 return gridService;
254 } 208 }
@@ -472,10 +426,10 @@ namespace OpenSim.Tests.Common.Setup
472 /// <param name="ownerId"></param> 426 /// <param name="ownerId"></param>
473 /// <returns></returns> 427 /// <returns></returns>
474 public static SceneObjectPart CreateSceneObjectPart(string name, UUID id, UUID ownerId) 428 public static SceneObjectPart CreateSceneObjectPart(string name, UUID id, UUID ownerId)
475 { 429 {
476 return new SceneObjectPart( 430 return new SceneObjectPart(
477 ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) 431 ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
478 { Name = name, UUID = id }; 432 { Name = name, UUID = id, Scale = new Vector3(1, 1, 1) };
479 } 433 }
480 434
481 /// <summary> 435 /// <summary>