aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
diff options
context:
space:
mode:
authorMelanie Thielker2014-10-12 00:08:06 +0200
committerMelanie Thielker2014-10-12 00:08:06 +0200
commite0d5cefc69b3660bf5d6c9594c0d9f67036899d6 (patch)
tree89f9b4c0b8f26fa070bab04252c53949f3174268 /OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
parentMerge branch 'ubitworkmaster' (diff)
parentadd simulator features AvatarSkeleton and AnimationSet report (diff)
downloadopensim-SC-e0d5cefc69b3660bf5d6c9594c0d9f67036899d6.zip
opensim-SC-e0d5cefc69b3660bf5d6c9594c0d9f67036899d6.tar.gz
opensim-SC-e0d5cefc69b3660bf5d6c9594c0d9f67036899d6.tar.bz2
opensim-SC-e0d5cefc69b3660bf5d6c9594c0d9f67036899d6.tar.xz
Merge branch 'ubitworkmaster'
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs71
1 files changed, 66 insertions, 5 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index 75634e0..ab8f0c9 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -580,6 +580,7 @@ namespace OpenSim.Region.ClientStack.Linden
580 string error; 580 string error;
581 int modelcost; 581 int modelcost;
582 582
583
583 if (!m_ModelCost.MeshModelCost(llsdRequest.asset_resources, baseCost, out modelcost, 584 if (!m_ModelCost.MeshModelCost(llsdRequest.asset_resources, baseCost, out modelcost,
584 meshcostdata, out error, ref warning)) 585 meshcostdata, out error, ref warning))
585 { 586 {
@@ -797,7 +798,7 @@ namespace OpenSim.Region.ClientStack.Linden
797 OSDMap request = (OSDMap)OSDParser.DeserializeLLSDXml(data); 798 OSDMap request = (OSDMap)OSDParser.DeserializeLLSDXml(data);
798 799
799 // compare and get updated information 800 // compare and get updated information
800 801/* does nothing still we do need something to avoid special viewer to upload something diferent from the cost estimation
801 bool mismatchError = true; 802 bool mismatchError = true;
802 803
803 while (mismatchError) 804 while (mismatchError)
@@ -813,7 +814,7 @@ namespace OpenSim.Region.ClientStack.Linden
813 814
814 return; 815 return;
815 } 816 }
816 817*/
817 OSDArray instance_list = (OSDArray)request["instance_list"]; 818 OSDArray instance_list = (OSDArray)request["instance_list"];
818 OSDArray mesh_list = (OSDArray)request["mesh_list"]; 819 OSDArray mesh_list = (OSDArray)request["mesh_list"];
819 OSDArray texture_list = (OSDArray)request["texture_list"]; 820 OSDArray texture_list = (OSDArray)request["texture_list"];
@@ -827,7 +828,7 @@ namespace OpenSim.Region.ClientStack.Linden
827 List<UUID> textures = new List<UUID>(); 828 List<UUID> textures = new List<UUID>();
828 829
829 830
830 if (doTextInv) 831// if (doTextInv)
831 m_Scene.TryGetClient(m_HostCapsObj.AgentID, out client); 832 m_Scene.TryGetClient(m_HostCapsObj.AgentID, out client);
832 833
833 if(client == null) // don't put textures in inventory if there is no client 834 if(client == null) // don't put textures in inventory if there is no client
@@ -875,14 +876,73 @@ namespace OpenSim.Region.ClientStack.Linden
875 876
876 // create and store meshs assets 877 // create and store meshs assets
877 List<UUID> meshAssets = new List<UUID>(); 878 List<UUID> meshAssets = new List<UUID>();
879 List<bool> meshAvatarSkeletons = new List<bool>();
880 List<bool> meshAvatarColliders = new List<bool>();
881
882 bool curAvSkeleton;
883 bool curAvCollider;
878 for (int i = 0; i < mesh_list.Count; i++) 884 for (int i = 0; i < mesh_list.Count; i++)
879 { 885 {
886 curAvSkeleton = false;
887 curAvCollider = false;
888
889 // we do need to parse the mesh now
890 OSD osd = OSDParser.DeserializeLLSDBinary(mesh_list[i]);
891 if (osd is OSDMap)
892 {
893 OSDMap mosd = (OSDMap)osd;
894 if (mosd.ContainsKey("skeleton"))
895 {
896 OSDMap skeleton = (OSDMap)mosd["skeleton"];
897 int sksize = skeleton["size"].AsInteger();
898 if (sksize > 0)
899 curAvSkeleton = true;
900 }
901 }
902
880 AssetBase meshAsset = new AssetBase(UUID.Random(), assetName, (sbyte)AssetType.Mesh, creatorIDstr); 903 AssetBase meshAsset = new AssetBase(UUID.Random(), assetName, (sbyte)AssetType.Mesh, creatorIDstr);
881 meshAsset.Data = mesh_list[i].AsBinary(); 904 meshAsset.Data = mesh_list[i].AsBinary();
882 if (istest) 905 if (istest)
883 meshAsset.Local = true; 906 meshAsset.Local = true;
884 m_assetService.Store(meshAsset); 907 m_assetService.Store(meshAsset);
885 meshAssets.Add(meshAsset.FullID); 908 meshAssets.Add(meshAsset.FullID);
909 meshAvatarSkeletons.Add(curAvSkeleton);
910 meshAvatarColliders.Add(curAvCollider);
911
912 // test code
913 if (curAvSkeleton && client != null)
914 {
915 string name = assetName;
916 if (name.Length > 25)
917 name = name.Substring(0, 24);
918 name += "_Mesh#" + i.ToString();
919 InventoryItemBase meshitem = new InventoryItemBase();
920 meshitem.Owner = m_HostCapsObj.AgentID;
921 meshitem.CreatorId = creatorIDstr;
922 meshitem.CreatorData = String.Empty;
923 meshitem.ID = UUID.Random();
924 meshitem.AssetID = meshAsset.FullID;
925 meshitem.Description = "mesh ";
926 meshitem.Name = name;
927 meshitem.AssetType = (int)AssetType.Mesh;
928 meshitem.InvType = (int)InventoryType.Mesh;
929 // meshitem.Folder = UUID.Zero; // send to default
930
931 meshitem.Folder = parentFolder; // dont let it go to folder Meshes that viewers dont show
932
933 // If we set PermissionMask.All then when we rez the item the next permissions will replace the current
934 // (owner) permissions. This becomes a problem if next permissions are changed.
935 meshitem.CurrentPermissions
936 = (uint)(PermissionMask.Move | PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer);
937
938 meshitem.BasePermissions = (uint)PermissionMask.All;
939 meshitem.EveryOnePermissions = 0;
940 meshitem.NextPermissions = (uint)PermissionMask.All;
941 meshitem.CreationDate = Util.UnixTimeSinceEpoch();
942
943 m_Scene.AddInventoryItem(client, meshitem);
944 meshitem = null;
945 }
886 } 946 }
887 947
888 int skipedMeshs = 0; 948 int skipedMeshs = 0;
@@ -1540,7 +1600,7 @@ namespace OpenSim.Region.ClientStack.Linden
1540 private int m_nreqmeshs; 1600 private int m_nreqmeshs;
1541 private int m_nreqinstances; 1601 private int m_nreqinstances;
1542 private bool m_IsAtestUpload; 1602 private bool m_IsAtestUpload;
1543 1603
1544 public AssetUploader(string assetName, string description, UUID assetID, UUID inventoryItem, 1604 public AssetUploader(string assetName, string description, UUID assetID, UUID inventoryItem,
1545 UUID parentFolderID, string invType, string assetType, string path, 1605 UUID parentFolderID, string invType, string assetType, string path,
1546 IHttpServer httpServer, bool dumpAssetsToFile, 1606 IHttpServer httpServer, bool dumpAssetsToFile,
@@ -1608,7 +1668,8 @@ namespace OpenSim.Region.ClientStack.Linden
1608 if (handlerUpLoad != null) 1668 if (handlerUpLoad != null)
1609 { 1669 {
1610 handlerUpLoad(m_assetName, m_assetDes, newAssetID, inv, parentFolder, data, m_invType, m_assetType, 1670 handlerUpLoad(m_assetName, m_assetDes, newAssetID, inv, parentFolder, data, m_invType, m_assetType,
1611 m_cost, m_texturesFolder, m_nreqtextures, m_nreqmeshs, m_nreqinstances, m_IsAtestUpload, ref m_error); 1671 m_cost, m_texturesFolder, m_nreqtextures, m_nreqmeshs, m_nreqinstances, m_IsAtestUpload,
1672 ref m_error);
1612 } 1673 }
1613 if (m_IsAtestUpload) 1674 if (m_IsAtestUpload)
1614 { 1675 {