aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps
diff options
context:
space:
mode:
authorUbitUmarov2015-09-02 19:54:53 +0100
committerUbitUmarov2015-09-02 19:54:53 +0100
commita11edceb00b5b86f825bd957bdac9edb91f893dd (patch)
treec192eae26f3aadf365a66f32fc6d9ade2f0a0c61 /OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps
parentbad merge? (diff)
downloadopensim-SC_OLD-a11edceb00b5b86f825bd957bdac9edb91f893dd.zip
opensim-SC_OLD-a11edceb00b5b86f825bd957bdac9edb91f893dd.tar.gz
opensim-SC_OLD-a11edceb00b5b86f825bd957bdac9edb91f893dd.tar.bz2
opensim-SC_OLD-a11edceb00b5b86f825bd957bdac9edb91f893dd.tar.xz
seems to compile ( tests comented out)
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs122
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs4
2 files changed, 14 insertions, 112 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index 4e6d196..1236e83 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -45,7 +45,6 @@ using OpenSim.Region.Framework.Scenes;
45using OpenSim.Region.Framework.Scenes.Serialization; 45using OpenSim.Region.Framework.Scenes.Serialization;
46using OpenSim.Framework.Servers; 46using OpenSim.Framework.Servers;
47using OpenSim.Framework.Servers.HttpServer; 47using OpenSim.Framework.Servers.HttpServer;
48using OpenSim.Framework.Client;
49using OpenSim.Services.Interfaces; 48using OpenSim.Services.Interfaces;
50 49
51using Caps = OpenSim.Framework.Capabilities.Caps; 50using Caps = OpenSim.Framework.Capabilities.Caps;
@@ -360,8 +359,8 @@ namespace OpenSim.Region.ClientStack.Linden
360 public string SeedCapRequest(string request, string path, string param, 359 public string SeedCapRequest(string request, string path, string param,
361 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 360 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
362 { 361 {
363// m_log.DebugFormat( 362 m_log.DebugFormat(
364// "[CAPS]: Received SEED caps request in {0} for agent {1}", m_regionName, m_HostCapsObj.AgentID); 363 "[CAPS]: Received SEED caps request in {0} for agent {1}", m_regionName, m_HostCapsObj.AgentID);
365 364
366 if (!m_HostCapsObj.WaitForActivation()) 365 if (!m_HostCapsObj.WaitForActivation())
367 return string.Empty; 366 return string.Empty;
@@ -789,99 +788,10 @@ namespace OpenSim.Region.ClientStack.Linden
789 } 788 }
790 else if (inventoryType == "object") 789 else if (inventoryType == "object")
791 { 790 {
792<<<<<<< HEAD
793 inType = (sbyte)InventoryType.Object;
794 assType = (sbyte)AssetType.Object;
795
796 List<Vector3> positions = new List<Vector3>();
797 List<Quaternion> rotations = new List<Quaternion>();
798 OSDMap request = (OSDMap)OSDParser.DeserializeLLSDXml(data);
799 OSDArray instance_list = (OSDArray)request["instance_list"];
800 OSDArray mesh_list = (OSDArray)request["mesh_list"];
801 OSDArray texture_list = (OSDArray)request["texture_list"];
802 SceneObjectGroup grp = null;
803
804 InventoryFolderBase textureUploadFolder = null;
805
806 List<InventoryFolderBase> foldersToUpdate = new List<InventoryFolderBase>();
807 List<InventoryItemBase> itemsToUpdate = new List<InventoryItemBase>();
808 IClientInventory clientInv = null;
809
810 if (texture_list.Count > 0)
811 {
812 ScenePresence avatar = null;
813 m_Scene.TryGetScenePresence(m_HostCapsObj.AgentID, out avatar);
814
815 if (avatar != null)
816 {
817 IClientCore core = (IClientCore)avatar.ControllingClient;
818
819 if (core.TryGet<IClientInventory>(out clientInv))
820 {
821 var systemTextureFolder = m_Scene.InventoryService.GetFolderForType(m_HostCapsObj.AgentID, FolderType.Texture);
822 textureUploadFolder = new InventoryFolderBase(UUID.Random(), assetName, m_HostCapsObj.AgentID, (short)FolderType.None, systemTextureFolder.ID, 1);
823 if (m_Scene.InventoryService.AddFolder(textureUploadFolder))
824 {
825 foldersToUpdate.Add(textureUploadFolder);
826
827 m_log.DebugFormat(
828 "[BUNCH OF CAPS]: Created new folder '{0}' ({1}) for textures uploaded with mesh object {2}",
829 textureUploadFolder.Name, textureUploadFolder.ID, assetName);
830 }
831 else
832 {
833 textureUploadFolder = null;
834 }
835 }
836 }
837 }
838
839 List<UUID> textures = new List<UUID>();
840 for (int i = 0; i < texture_list.Count; i++)
841 {
842 AssetBase textureAsset = new AssetBase(UUID.Random(), assetName, (sbyte)AssetType.Texture, "");
843 textureAsset.Data = texture_list[i].AsBinary();
844 m_assetService.Store(textureAsset);
845 textures.Add(textureAsset.FullID);
846
847 if (textureUploadFolder != null)
848 {
849 InventoryItemBase textureItem = new InventoryItemBase();
850 textureItem.Owner = m_HostCapsObj.AgentID;
851 textureItem.CreatorId = m_HostCapsObj.AgentID.ToString();
852 textureItem.CreatorData = String.Empty;
853 textureItem.ID = UUID.Random();
854 textureItem.AssetID = textureAsset.FullID;
855 textureItem.Description = assetDescription;
856 textureItem.Name = assetName + " - Texture " + (i + 1).ToString();
857 textureItem.AssetType = (int)AssetType.Texture;
858 textureItem.InvType = (int)InventoryType.Texture;
859 textureItem.Folder = textureUploadFolder.ID;
860 textureItem.CurrentPermissions
861 = (uint)(PermissionMask.Move | PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer | PermissionMask.Export);
862 textureItem.BasePermissions = (uint)PermissionMask.All | (uint)PermissionMask.Export;
863 textureItem.EveryOnePermissions = 0;
864 textureItem.NextPermissions = (uint)PermissionMask.All;
865 textureItem.CreationDate = Util.UnixTimeSinceEpoch();
866 m_Scene.InventoryService.AddItem(textureItem);
867 itemsToUpdate.Add(textureItem);
868
869 m_log.DebugFormat(
870 "[BUNCH OF CAPS]: Created new inventory item '{0}' ({1}) for texture uploaded with mesh object {2}",
871 textureItem.Name, textureItem.ID, assetName);
872 }
873 }
874
875 if (clientInv != null && (foldersToUpdate.Count > 0 || itemsToUpdate.Count > 0))
876 {
877 clientInv.SendBulkUpdateInventory(foldersToUpdate.ToArray(), itemsToUpdate.ToArray());
878 }
879=======
880 if (assetType == "mesh") // this code for now is for mesh models uploads only 791 if (assetType == "mesh") // this code for now is for mesh models uploads only
881 { 792 {
882 inType = (sbyte)InventoryType.Object; 793 inType = (sbyte)InventoryType.Object;
883 assType = (sbyte)AssetType.Object; 794 assType = (sbyte)AssetType.Object;
884>>>>>>> avn/ubitvar
885 795
886 List<Vector3> positions = new List<Vector3>(); 796 List<Vector3> positions = new List<Vector3>();
887 List<Quaternion> rotations = new List<Quaternion>(); 797 List<Quaternion> rotations = new List<Quaternion>();
@@ -1467,24 +1377,17 @@ namespace OpenSim.Region.ClientStack.Linden
1467 { 1377 {
1468 string message; 1378 string message;
1469 copyItem = m_Scene.GiveInventoryItem(m_HostCapsObj.AgentID, item.Owner, itemID, folderID, out message); 1379 copyItem = m_Scene.GiveInventoryItem(m_HostCapsObj.AgentID, item.Owner, itemID, folderID, out message);
1470 if (client != null) 1380 if (copyItem != null && client != null)
1471 { 1381 {
1472 if (copyItem != null) 1382 m_log.InfoFormat("[CAPS]: CopyInventoryFromNotecard, ItemID:{0}, FolderID:{1}", copyItem.ID, copyItem.Folder);
1473 { 1383 client.SendBulkUpdateInventory(copyItem);
1474 m_log.InfoFormat("[CAPS]: CopyInventoryFromNotecard, ItemID:{0}, FolderID:{1}", copyItem.ID, copyItem.Folder);
1475 client.SendBulkUpdateInventory(copyItem);
1476 }
1477 else
1478 {
1479 client.SendAgentAlertMessage(message, false);
1480 }
1481 } 1384 }
1482 } 1385 }
1483 else 1386 else
1484 { 1387 {
1485 m_log.ErrorFormat("[CAPS]: CopyInventoryFromNotecard - Failed to retrieve item {0} from notecard {1}", itemID, notecardID); 1388 m_log.ErrorFormat("[CAPS]: CopyInventoryFromNotecard - Failed to retrieve item {0} from notecard {1}", itemID, notecardID);
1486 if (client != null) 1389 if (client != null)
1487 client.SendAgentAlertMessage("Failed to retrieve item", false); 1390 client.SendAlertMessage("Failed to retrieve item");
1488 } 1391 }
1489 } 1392 }
1490 catch (Exception e) 1393 catch (Exception e)
@@ -1656,14 +1559,13 @@ namespace OpenSim.Region.ClientStack.Linden
1656 string param, IOSHttpRequest httpRequest, 1559 string param, IOSHttpRequest httpRequest,
1657 IOSHttpResponse httpResponse) 1560 IOSHttpResponse httpResponse)
1658 { 1561 {
1659 OSDMap req = (OSDMap)OSDParser.DeserializeLLSDXml(request); 1562// OSDMap req = (OSDMap)OSDParser.DeserializeLLSDXml(request);
1660 OSDMap accessPrefs = (OSDMap)req["access_prefs"];
1661 string desiredMaturity = accessPrefs["max"];
1662
1663 OSDMap resp = new OSDMap(); 1563 OSDMap resp = new OSDMap();
1664 OSDMap respAccessPrefs = new OSDMap(); 1564
1665 respAccessPrefs["max"] = desiredMaturity; // echoing the maturity back means success 1565 OSDMap accessPrefs = new OSDMap();
1666 resp["access_prefs"] = respAccessPrefs; 1566 accessPrefs["max"] = "A";
1567
1568 resp["access_prefs"] = accessPrefs;
1667 1569
1668 string response = OSDParser.SerializeLLSDXmlString(resp); 1570 string response = OSDParser.SerializeLLSDXmlString(resp);
1669 return response; 1571 return response;
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs
index c241075..b735dfa 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs
@@ -40,8 +40,8 @@ using OpenSim.Region.Framework.Interfaces;
40using OpenSim.Region.Framework.Scenes; 40using OpenSim.Region.Framework.Scenes;
41using Caps = OpenSim.Framework.Capabilities.Caps; 41using Caps = OpenSim.Framework.Capabilities.Caps;
42 42
43[assembly: Addin("LindenCaps", OpenSim.VersionInfo.VersionNumber)] 43[assembly: Addin("LindenCaps", "0.1")]
44[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)] 44[assembly: AddinDependency("OpenSim", "0.5")]
45namespace OpenSim.Region.ClientStack.Linden 45namespace OpenSim.Region.ClientStack.Linden
46{ 46{
47 47