diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 16178e6..deeacf5 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | |||
@@ -61,7 +61,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
61 | string assetName, string description, UUID assetID, UUID inventoryItem, UUID parentFolder, | 61 | string assetName, string description, UUID assetID, UUID inventoryItem, UUID parentFolder, |
62 | byte[] data, string inventoryType, string assetType, | 62 | byte[] data, string inventoryType, string assetType, |
63 | int cost, UUID texturesFolder, int nreqtextures, int nreqmeshs, int nreqinstances, | 63 | int cost, UUID texturesFolder, int nreqtextures, int nreqmeshs, int nreqinstances, |
64 | bool IsAtestUpload, ref string error, ref int nextOwnerMask, ref int groupMask, ref int everyoneMask); | 64 | bool IsAtestUpload, ref string error, ref int nextOwnerMask, ref int groupMask, ref int everyoneMask, int[] meshesSides); |
65 | 65 | ||
66 | public delegate UUID UpdateItem(UUID itemID, byte[] data); | 66 | public delegate UUID UpdateItem(UUID itemID, byte[] data); |
67 | 67 | ||
@@ -529,6 +529,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
529 | int nreqmeshs= 0; | 529 | int nreqmeshs= 0; |
530 | int nreqinstances = 0; | 530 | int nreqinstances = 0; |
531 | bool IsAtestUpload = false; | 531 | bool IsAtestUpload = false; |
532 | int[] meshesSides = null; | ||
532 | 533 | ||
533 | string assetName = llsdRequest.name; | 534 | string assetName = llsdRequest.name; |
534 | 535 | ||
@@ -578,9 +579,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
578 | string error; | 579 | string error; |
579 | int modelcost; | 580 | int modelcost; |
580 | 581 | ||
581 | |||
582 | if (!m_ModelCost.MeshModelCost(llsdRequest.asset_resources, baseCost, out modelcost, | 582 | if (!m_ModelCost.MeshModelCost(llsdRequest.asset_resources, baseCost, out modelcost, |
583 | meshcostdata, out error, ref warning)) | 583 | meshcostdata, out error, ref warning, out meshesSides)) |
584 | { | 584 | { |
585 | LLSDAssetUploadError resperror = new LLSDAssetUploadError(); | 585 | LLSDAssetUploadError resperror = new LLSDAssetUploadError(); |
586 | resperror.message = error; | 586 | resperror.message = error; |
@@ -668,7 +668,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
668 | new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type, | 668 | new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type, |
669 | llsdRequest.asset_type, uploaderPath, m_HostCapsObj.HttpListener, m_dumpAssetsToFile, cost, | 669 | llsdRequest.asset_type, uploaderPath, m_HostCapsObj.HttpListener, m_dumpAssetsToFile, cost, |
670 | texturesFolder, nreqtextures, nreqmeshs, nreqinstances, IsAtestUpload, | 670 | texturesFolder, nreqtextures, nreqmeshs, nreqinstances, IsAtestUpload, |
671 | llsdRequest.next_owner_mask, llsdRequest.group_mask, llsdRequest.everyone_mask); | 671 | llsdRequest.next_owner_mask, llsdRequest.group_mask, llsdRequest.everyone_mask, meshesSides); |
672 | 672 | ||
673 | m_HostCapsObj.HttpListener.AddStreamHandler( | 673 | m_HostCapsObj.HttpListener.AddStreamHandler( |
674 | new BinaryStreamHandler( | 674 | new BinaryStreamHandler( |
@@ -713,7 +713,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
713 | string assetType, int cost, | 713 | string assetType, int cost, |
714 | UUID texturesFolder, int nreqtextures, int nreqmeshs, int nreqinstances, | 714 | UUID texturesFolder, int nreqtextures, int nreqmeshs, int nreqinstances, |
715 | bool IsAtestUpload, ref string error, | 715 | bool IsAtestUpload, ref string error, |
716 | ref int nextOwnerMask, ref int groupMask, ref int everyoneMask) | 716 | ref int nextOwnerMask, ref int groupMask, ref int everyoneMask, int[] meshesSides) |
717 | { | 717 | { |
718 | lock (m_ModelCost) | 718 | lock (m_ModelCost) |
719 | m_FileAgentInventoryState = FileAgentInventoryState.processUpload; | 719 | m_FileAgentInventoryState = FileAgentInventoryState.processUpload; |
@@ -967,7 +967,12 @@ namespace OpenSim.Region.ClientStack.Linden | |||
967 | { | 967 | { |
968 | int meshindx = inner_instance_list["mesh"].AsInteger(); | 968 | int meshindx = inner_instance_list["mesh"].AsInteger(); |
969 | if (meshAssets.Count > meshindx) | 969 | if (meshAssets.Count > meshindx) |
970 | pbs = PrimitiveBaseShape.CreateMesh(face_list.Count, meshAssets[meshindx]); | 970 | { |
971 | if(meshesSides != null && meshesSides.Length > meshindx) | ||
972 | pbs = PrimitiveBaseShape.CreateMesh(meshesSides[i], meshAssets[meshindx]); | ||
973 | else | ||
974 | pbs = PrimitiveBaseShape.CreateMesh(face_list.Count, meshAssets[meshindx]); | ||
975 | } | ||
971 | } | 976 | } |
972 | if(pbs == null) // fallback | 977 | if(pbs == null) // fallback |
973 | pbs = PrimitiveBaseShape.CreateBox(); | 978 | pbs = PrimitiveBaseShape.CreateBox(); |
@@ -1025,12 +1030,12 @@ namespace OpenSim.Region.ClientStack.Linden | |||
1025 | Vector3 position = inner_instance_list["position"].AsVector3(); | 1030 | Vector3 position = inner_instance_list["position"].AsVector3(); |
1026 | Quaternion rotation = inner_instance_list["rotation"].AsQuaternion(); | 1031 | Quaternion rotation = inner_instance_list["rotation"].AsQuaternion(); |
1027 | 1032 | ||
1028 | // for now viwers do send fixed defaults | ||
1029 | // but this may change | ||
1030 | // int physicsShapeType = inner_instance_list["physics_shape_type"].AsInteger(); | ||
1031 | byte physicsShapeType = (byte)PhysShapeType.convex; // default is simple convex | 1033 | byte physicsShapeType = (byte)PhysShapeType.convex; // default is simple convex |
1032 | // int material = inner_instance_list["material"].AsInteger(); | 1034 | if (inner_instance_list.ContainsKey("physics_shape_type")) |
1035 | physicsShapeType = (byte)inner_instance_list["physics_shape_type"].AsInteger(); | ||
1033 | byte material = (byte)Material.Wood; | 1036 | byte material = (byte)Material.Wood; |
1037 | if (inner_instance_list.ContainsKey("material")) | ||
1038 | material = (byte)inner_instance_list["material"].AsInteger(); | ||
1034 | 1039 | ||
1035 | SceneObjectPart prim | 1040 | SceneObjectPart prim |
1036 | = new SceneObjectPart(owner_id, pbs, position, Quaternion.Identity, Vector3.Zero); | 1041 | = new SceneObjectPart(owner_id, pbs, position, Quaternion.Identity, Vector3.Zero); |
@@ -2014,13 +2019,13 @@ namespace OpenSim.Region.ClientStack.Linden | |||
2014 | private int m_nextOwnerMask; | 2019 | private int m_nextOwnerMask; |
2015 | private int m_groupMask; | 2020 | private int m_groupMask; |
2016 | private int m_everyoneMask; | 2021 | private int m_everyoneMask; |
2017 | 2022 | private int[] m_meshesSides; | |
2018 | 2023 | ||
2019 | public AssetUploader(string assetName, string description, UUID assetID, UUID inventoryItem, | 2024 | public AssetUploader(string assetName, string description, UUID assetID, UUID inventoryItem, |
2020 | UUID parentFolderID, string invType, string assetType, string path, | 2025 | UUID parentFolderID, string invType, string assetType, string path, |
2021 | IHttpServer httpServer, bool dumpAssetsToFile, | 2026 | IHttpServer httpServer, bool dumpAssetsToFile, |
2022 | int totalCost, UUID texturesFolder, int nreqtextures, int nreqmeshs, int nreqinstances, | 2027 | int totalCost, UUID texturesFolder, int nreqtextures, int nreqmeshs, int nreqinstances, |
2023 | bool IsAtestUpload, int nextOwnerMask, int groupMask, int everyoneMask) | 2028 | bool IsAtestUpload, int nextOwnerMask, int groupMask, int everyoneMask, int[] meshesSides) |
2024 | { | 2029 | { |
2025 | m_assetName = assetName; | 2030 | m_assetName = assetName; |
2026 | m_assetDes = description; | 2031 | m_assetDes = description; |
@@ -2048,6 +2053,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
2048 | m_nextOwnerMask = nextOwnerMask; | 2053 | m_nextOwnerMask = nextOwnerMask; |
2049 | m_groupMask = groupMask; | 2054 | m_groupMask = groupMask; |
2050 | m_everyoneMask = everyoneMask; | 2055 | m_everyoneMask = everyoneMask; |
2056 | |||
2057 | m_meshesSides = meshesSides; | ||
2051 | } | 2058 | } |
2052 | 2059 | ||
2053 | /// <summary> | 2060 | /// <summary> |
@@ -2088,7 +2095,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
2088 | { | 2095 | { |
2089 | handlerUpLoad(m_assetName, m_assetDes, newAssetID, inv, parentFolder, data, m_invType, m_assetType, | 2096 | handlerUpLoad(m_assetName, m_assetDes, newAssetID, inv, parentFolder, data, m_invType, m_assetType, |
2090 | m_cost, m_texturesFolder, m_nreqtextures, m_nreqmeshs, m_nreqinstances, m_IsAtestUpload, | 2097 | m_cost, m_texturesFolder, m_nreqtextures, m_nreqmeshs, m_nreqinstances, m_IsAtestUpload, |
2091 | ref m_error, ref m_nextOwnerMask, ref m_groupMask, ref m_everyoneMask); | 2098 | ref m_error, ref m_nextOwnerMask, ref m_groupMask, ref m_everyoneMask, m_meshesSides); |
2092 | } | 2099 | } |
2093 | 2100 | ||
2094 | uploadComplete.new_next_owner_mask = m_nextOwnerMask; | 2101 | uploadComplete.new_next_owner_mask = m_nextOwnerMask; |