diff options
author | Dan Lake | 2011-07-11 12:23:20 -0700 |
---|---|---|
committer | Dan Lake | 2011-07-11 12:23:20 -0700 |
commit | b9cbe92f30c97d6b402be73c8c6fd8e6894ef05a (patch) | |
tree | 8fd2fa4567e2882e7f5dafdb8cf1de571917f23a /OpenSim/Region/ClientStack/Linden | |
parent | Checkin 32 bit bulletsim shared library for Linux. (diff) | |
parent | minor Tack the prim name on the end of the "experimental mesh proxy generatio... (diff) | |
download | opensim-SC-b9cbe92f30c97d6b402be73c8c6fd8e6894ef05a.zip opensim-SC-b9cbe92f30c97d6b402be73c8c6fd8e6894ef05a.tar.gz opensim-SC-b9cbe92f30c97d6b402be73c8c6fd8e6894ef05a.tar.bz2 opensim-SC-b9cbe92f30c97d6b402be73c8c6fd8e6894ef05a.tar.xz |
Merge branch 'master' into bulletsim
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden')
4 files changed, 355 insertions, 17 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 95713e9..d3bb0bc 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | |||
@@ -1,10 +1,39 @@ | |||
1 | using System; | 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 | |||
28 | using System; | ||
2 | using System.Collections; | 29 | using System.Collections; |
3 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
4 | using System.IO; | 31 | using System.IO; |
5 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Text; | ||
6 | 34 | ||
7 | using OpenMetaverse; | 35 | using OpenMetaverse; |
36 | using OpenMetaverse.StructuredData; | ||
8 | using Nini.Config; | 37 | using Nini.Config; |
9 | using log4net; | 38 | using log4net; |
10 | 39 | ||
@@ -12,11 +41,14 @@ using OpenSim.Framework; | |||
12 | using OpenSim.Framework.Capabilities; | 41 | using OpenSim.Framework.Capabilities; |
13 | using OpenSim.Region.Framework; | 42 | using OpenSim.Region.Framework; |
14 | using OpenSim.Region.Framework.Scenes; | 43 | using OpenSim.Region.Framework.Scenes; |
44 | using OpenSim.Region.Framework.Scenes.Serialization; | ||
15 | using OpenSim.Framework.Servers; | 45 | using OpenSim.Framework.Servers; |
16 | using OpenSim.Framework.Servers.HttpServer; | 46 | using OpenSim.Framework.Servers.HttpServer; |
17 | using OpenSim.Services.Interfaces; | 47 | using OpenSim.Services.Interfaces; |
18 | 48 | ||
19 | using Caps = OpenSim.Framework.Capabilities.Caps; | 49 | using Caps = OpenSim.Framework.Capabilities.Caps; |
50 | using OSDArray = OpenMetaverse.StructuredData.OSDArray; | ||
51 | using OSDMap = OpenMetaverse.StructuredData.OSDMap; | ||
20 | 52 | ||
21 | namespace OpenSim.Region.ClientStack.Linden | 53 | namespace OpenSim.Region.ClientStack.Linden |
22 | { | 54 | { |
@@ -79,7 +111,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
79 | 111 | ||
80 | private bool m_persistBakedTextures = false; | 112 | private bool m_persistBakedTextures = false; |
81 | private IAssetService m_assetService; | 113 | private IAssetService m_assetService; |
82 | private bool m_dumpAssetsToFile; | 114 | private bool m_dumpAssetsToFile = false; |
83 | private string m_regionName; | 115 | private string m_regionName; |
84 | 116 | ||
85 | public BunchOfCaps(Scene scene, Caps caps) | 117 | public BunchOfCaps(Scene scene, Caps caps) |
@@ -439,7 +471,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
439 | } | 471 | } |
440 | 472 | ||
441 | /// <summary> | 473 | /// <summary> |
442 | /// | 474 | /// Convert raw uploaded data into the appropriate asset and item. |
443 | /// </summary> | 475 | /// </summary> |
444 | /// <param name="assetID"></param> | 476 | /// <param name="assetID"></param> |
445 | /// <param name="inventoryItem"></param> | 477 | /// <param name="inventoryItem"></param> |
@@ -448,6 +480,10 @@ namespace OpenSim.Region.ClientStack.Linden | |||
448 | UUID inventoryItem, UUID parentFolder, byte[] data, string inventoryType, | 480 | UUID inventoryItem, UUID parentFolder, byte[] data, string inventoryType, |
449 | string assetType) | 481 | string assetType) |
450 | { | 482 | { |
483 | m_log.DebugFormat( | ||
484 | "Uploaded asset {0} for inventory item {1}, inv type {2}, asset type {3}", | ||
485 | assetID, inventoryItem, inventoryType, assetType); | ||
486 | |||
451 | sbyte assType = 0; | 487 | sbyte assType = 0; |
452 | sbyte inType = 0; | 488 | sbyte inType = 0; |
453 | 489 | ||
@@ -474,6 +510,160 @@ namespace OpenSim.Region.ClientStack.Linden | |||
474 | break; | 510 | break; |
475 | } | 511 | } |
476 | } | 512 | } |
513 | else if (inventoryType == "object") | ||
514 | { | ||
515 | inType = (sbyte)InventoryType.Object; | ||
516 | assType = (sbyte)AssetType.Object; | ||
517 | |||
518 | List<Vector3> positions = new List<Vector3>(); | ||
519 | List<Quaternion> rotations = new List<Quaternion>(); | ||
520 | OSDMap request = (OSDMap)OSDParser.DeserializeLLSDXml(data); | ||
521 | OSDArray instance_list = (OSDArray)request["instance_list"]; | ||
522 | OSDArray mesh_list = (OSDArray)request["mesh_list"]; | ||
523 | OSDArray texture_list = (OSDArray)request["texture_list"]; | ||
524 | SceneObjectGroup grp = null; | ||
525 | |||
526 | List<UUID> textures = new List<UUID>(); | ||
527 | for (int i = 0; i < texture_list.Count; i++) | ||
528 | { | ||
529 | AssetBase textureAsset = new AssetBase(UUID.Random(), assetName, (sbyte)AssetType.Texture, ""); | ||
530 | textureAsset.Data = texture_list[i].AsBinary(); | ||
531 | m_assetService.Store(textureAsset); | ||
532 | textures.Add(textureAsset.FullID); | ||
533 | } | ||
534 | |||
535 | for (int i = 0; i < mesh_list.Count; i++) | ||
536 | { | ||
537 | PrimitiveBaseShape pbs = PrimitiveBaseShape.CreateBox(); | ||
538 | |||
539 | Primitive.TextureEntry textureEntry | ||
540 | = new Primitive.TextureEntry(Primitive.TextureEntry.WHITE_TEXTURE); | ||
541 | OSDMap inner_instance_list = (OSDMap)instance_list[i]; | ||
542 | |||
543 | OSDArray face_list = (OSDArray)inner_instance_list["face_list"]; | ||
544 | for (uint face = 0; face < face_list.Count; face++) | ||
545 | { | ||
546 | OSDMap faceMap = (OSDMap)face_list[(int)face]; | ||
547 | Primitive.TextureEntryFace f = pbs.Textures.CreateFace(face); | ||
548 | if(faceMap.ContainsKey("fullbright")) | ||
549 | f.Fullbright = faceMap["fullbright"].AsBoolean(); | ||
550 | if (faceMap.ContainsKey ("diffuse_color")) | ||
551 | f.RGBA = faceMap["diffuse_color"].AsColor4(); | ||
552 | |||
553 | int textureNum = faceMap["image"].AsInteger(); | ||
554 | float imagerot = faceMap["imagerot"].AsInteger(); | ||
555 | float offsets = (float)faceMap["offsets"].AsReal(); | ||
556 | float offsett = (float)faceMap["offsett"].AsReal(); | ||
557 | float scales = (float)faceMap["scales"].AsReal(); | ||
558 | float scalet = (float)faceMap["scalet"].AsReal(); | ||
559 | |||
560 | if(imagerot != 0) | ||
561 | f.Rotation = imagerot; | ||
562 | |||
563 | if(offsets != 0) | ||
564 | f.OffsetU = offsets; | ||
565 | |||
566 | if (offsett != 0) | ||
567 | f.OffsetV = offsett; | ||
568 | |||
569 | if (scales != 0) | ||
570 | f.RepeatU = scales; | ||
571 | |||
572 | if (scalet != 0) | ||
573 | f.RepeatV = scalet; | ||
574 | |||
575 | if (textures.Count > textureNum) | ||
576 | f.TextureID = textures[textureNum]; | ||
577 | else | ||
578 | f.TextureID = Primitive.TextureEntry.WHITE_TEXTURE; | ||
579 | |||
580 | textureEntry.FaceTextures[face] = f; | ||
581 | } | ||
582 | |||
583 | pbs.TextureEntry = textureEntry.GetBytes(); | ||
584 | |||
585 | AssetBase meshAsset = new AssetBase(UUID.Random(), assetName, (sbyte)AssetType.Mesh, ""); | ||
586 | meshAsset.Data = mesh_list[i].AsBinary(); | ||
587 | m_assetService.Store(meshAsset); | ||
588 | |||
589 | pbs.SculptEntry = true; | ||
590 | pbs.SculptTexture = meshAsset.FullID; | ||
591 | pbs.SculptType = (byte)SculptType.Mesh; | ||
592 | pbs.SculptData = meshAsset.Data; | ||
593 | |||
594 | Vector3 position = inner_instance_list["position"].AsVector3(); | ||
595 | Vector3 scale = inner_instance_list["scale"].AsVector3(); | ||
596 | Quaternion rotation = inner_instance_list["rotation"].AsQuaternion(); | ||
597 | |||
598 | // no longer used - begin ------------------------ | ||
599 | // int physicsShapeType = inner_instance_list["physics_shape_type"].AsInteger(); | ||
600 | // int material = inner_instance_list["material"].AsInteger(); | ||
601 | // int mesh = inner_instance_list["mesh"].AsInteger(); | ||
602 | |||
603 | // OSDMap permissions = (OSDMap)inner_instance_list["permissions"]; | ||
604 | // int base_mask = permissions["base_mask"].AsInteger(); | ||
605 | // int everyone_mask = permissions["everyone_mask"].AsInteger(); | ||
606 | // UUID creator_id = permissions["creator_id"].AsUUID(); | ||
607 | // UUID group_id = permissions["group_id"].AsUUID(); | ||
608 | // int group_mask = permissions["group_mask"].AsInteger(); | ||
609 | // bool is_owner_group = permissions["is_owner_group"].AsBoolean(); | ||
610 | // UUID last_owner_id = permissions["last_owner_id"].AsUUID(); | ||
611 | // int next_owner_mask = permissions["next_owner_mask"].AsInteger(); | ||
612 | // UUID owner_id = permissions["owner_id"].AsUUID(); | ||
613 | // int owner_mask = permissions["owner_mask"].AsInteger(); | ||
614 | // no longer used - end ------------------------ | ||
615 | |||
616 | UUID owner_id = m_HostCapsObj.AgentID; | ||
617 | |||
618 | SceneObjectPart prim | ||
619 | = new SceneObjectPart(owner_id, pbs, position, Quaternion.Identity, Vector3.Zero); | ||
620 | |||
621 | prim.Scale = scale; | ||
622 | prim.OffsetPosition = position; | ||
623 | rotations.Add(rotation); | ||
624 | positions.Add(position); | ||
625 | prim.UUID = UUID.Random(); | ||
626 | prim.CreatorID = owner_id; | ||
627 | prim.OwnerID = owner_id; | ||
628 | prim.GroupID = UUID.Zero; | ||
629 | prim.LastOwnerID = prim.OwnerID; | ||
630 | prim.CreationDate = Util.UnixTimeSinceEpoch(); | ||
631 | prim.Name = assetName; | ||
632 | prim.Description = ""; | ||
633 | |||
634 | // prim.BaseMask = (uint)base_mask; | ||
635 | // prim.EveryoneMask = (uint)everyone_mask; | ||
636 | // prim.GroupMask = (uint)group_mask; | ||
637 | // prim.NextOwnerMask = (uint)next_owner_mask; | ||
638 | // prim.OwnerMask = (uint)owner_mask; | ||
639 | |||
640 | if (grp == null) | ||
641 | grp = new SceneObjectGroup(prim); | ||
642 | else | ||
643 | grp.AddPart(prim); | ||
644 | } | ||
645 | |||
646 | // Fix first link number | ||
647 | if (grp.Parts.Length > 1) | ||
648 | grp.RootPart.LinkNum++; | ||
649 | |||
650 | Vector3 rootPos = positions[0]; | ||
651 | grp.AbsolutePosition = rootPos; | ||
652 | for (int i = 0; i < positions.Count; i++) | ||
653 | { | ||
654 | Vector3 offset = positions[i] - rootPos; | ||
655 | grp.Parts[i].OffsetPosition = offset; | ||
656 | } | ||
657 | |||
658 | for (int i = 0; i < rotations.Count; i++) | ||
659 | { | ||
660 | if (i != 0) | ||
661 | grp.Parts[i].RotationOffset = rotations[i]; | ||
662 | } | ||
663 | |||
664 | grp.UpdateGroupRotationR(rotations[0]); | ||
665 | data = ASCIIEncoding.ASCII.GetBytes(SceneObjectSerializer.ToOriginalXmlFormat(grp)); | ||
666 | } | ||
477 | 667 | ||
478 | AssetBase asset; | 668 | AssetBase asset; |
479 | asset = new AssetBase(assetID, assetName, assType, m_HostCapsObj.AgentID.ToString()); | 669 | asset = new AssetBase(assetID, assetName, assType, m_HostCapsObj.AgentID.ToString()); |
@@ -506,8 +696,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
506 | } | 696 | } |
507 | } | 697 | } |
508 | 698 | ||
509 | |||
510 | |||
511 | /// <summary> | 699 | /// <summary> |
512 | /// | 700 | /// |
513 | /// </summary> | 701 | /// </summary> |
@@ -632,7 +820,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
632 | } | 820 | } |
633 | 821 | ||
634 | /// <summary> | 822 | /// <summary> |
635 | /// | 823 | /// Handle raw asset upload data via the capability. |
636 | /// </summary> | 824 | /// </summary> |
637 | /// <param name="data"></param> | 825 | /// <param name="data"></param> |
638 | /// <param name="path"></param> | 826 | /// <param name="path"></param> |
@@ -670,6 +858,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
670 | 858 | ||
671 | return res; | 859 | return res; |
672 | } | 860 | } |
861 | |||
673 | ///Left this in and commented in case there are unforseen issues | 862 | ///Left this in and commented in case there are unforseen issues |
674 | //private void SaveAssetToFile(string filename, byte[] data) | 863 | //private void SaveAssetToFile(string filename, byte[] data) |
675 | //{ | 864 | //{ |
@@ -679,6 +868,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
679 | // bw.Close(); | 868 | // bw.Close(); |
680 | // fs.Close(); | 869 | // fs.Close(); |
681 | //} | 870 | //} |
871 | |||
682 | private static void SaveAssetToFile(string filename, byte[] data) | 872 | private static void SaveAssetToFile(string filename, byte[] data) |
683 | { | 873 | { |
684 | string assetPath = "UserAssets"; | 874 | string assetPath = "UserAssets"; |
@@ -719,7 +909,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
719 | } | 909 | } |
720 | 910 | ||
721 | /// <summary> | 911 | /// <summary> |
722 | /// | 912 | /// Handle raw uploaded asset data. |
723 | /// </summary> | 913 | /// </summary> |
724 | /// <param name="data"></param> | 914 | /// <param name="data"></param> |
725 | /// <param name="path"></param> | 915 | /// <param name="path"></param> |
@@ -752,6 +942,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
752 | 942 | ||
753 | return res; | 943 | return res; |
754 | } | 944 | } |
945 | |||
755 | ///Left this in and commented in case there are unforseen issues | 946 | ///Left this in and commented in case there are unforseen issues |
756 | //private void SaveAssetToFile(string filename, byte[] data) | 947 | //private void SaveAssetToFile(string filename, byte[] data) |
757 | //{ | 948 | //{ |
@@ -761,6 +952,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
761 | // bw.Close(); | 952 | // bw.Close(); |
762 | // fs.Close(); | 953 | // fs.Close(); |
763 | //} | 954 | //} |
955 | |||
764 | private static void SaveAssetToFile(string filename, byte[] data) | 956 | private static void SaveAssetToFile(string filename, byte[] data) |
765 | { | 957 | { |
766 | string assetPath = "UserAssets"; | 958 | string assetPath = "UserAssets"; |
@@ -839,7 +1031,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
839 | uploadComplete.new_asset = inventoryItemID; | 1031 | uploadComplete.new_asset = inventoryItemID; |
840 | uploadComplete.compiled = errors.Count > 0 ? false : true; | 1032 | uploadComplete.compiled = errors.Count > 0 ? false : true; |
841 | uploadComplete.state = "complete"; | 1033 | uploadComplete.state = "complete"; |
842 | uploadComplete.errors = new OSDArray(); | 1034 | uploadComplete.errors = new OpenSim.Framework.Capabilities.OSDArray(); |
843 | uploadComplete.errors.Array = errors; | 1035 | uploadComplete.errors.Array = errors; |
844 | 1036 | ||
845 | res = LLSDHelpers.SerialiseLLSDReply(uploadComplete); | 1037 | res = LLSDHelpers.SerialiseLLSDReply(uploadComplete); |
@@ -905,7 +1097,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
905 | } | 1097 | } |
906 | 1098 | ||
907 | /// <summary> | 1099 | /// <summary> |
908 | /// | 1100 | /// Handle raw uploaded baked texture data. |
909 | /// </summary> | 1101 | /// </summary> |
910 | /// <param name="data"></param> | 1102 | /// <param name="data"></param> |
911 | /// <param name="path"></param> | 1103 | /// <param name="path"></param> |
@@ -935,4 +1127,4 @@ namespace OpenSim.Region.ClientStack.Linden | |||
935 | } | 1127 | } |
936 | } | 1128 | } |
937 | 1129 | ||
938 | } | 1130 | } \ No newline at end of file |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/MeshUploadFlagModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/MeshUploadFlagModule.cs new file mode 100644 index 0000000..c9d7ae1 --- /dev/null +++ b/OpenSim/Region/ClientStack/Linden/Caps/MeshUploadFlagModule.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 | |||
28 | using System; | ||
29 | using System.Collections; | ||
30 | using System.Reflection; | ||
31 | using log4net; | ||
32 | using Nini.Config; | ||
33 | using Mono.Addins; | ||
34 | using OpenMetaverse; | ||
35 | using OpenMetaverse.StructuredData; | ||
36 | using OpenSim.Framework; | ||
37 | using OpenSim.Framework.Servers.HttpServer; | ||
38 | using OpenSim.Region.Framework.Interfaces; | ||
39 | using OpenSim.Region.Framework.Scenes; | ||
40 | using OpenSim.Services.Interfaces; | ||
41 | using Caps = OpenSim.Framework.Capabilities.Caps; | ||
42 | |||
43 | namespace OpenSim.Region.ClientStack.Linden | ||
44 | { | ||
45 | /// <summary> | ||
46 | /// MeshUploadFlag capability. This is required for uploading Mesh. | ||
47 | /// </summary> | ||
48 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | ||
49 | public class MeshUploadFlagModule : INonSharedRegionModule | ||
50 | { | ||
51 | private static readonly ILog m_log = | ||
52 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
53 | |||
54 | /// <summary> | ||
55 | /// Is this module enabled? | ||
56 | /// </summary> | ||
57 | public bool Enabled { get; private set; } | ||
58 | |||
59 | private Scene m_scene; | ||
60 | private UUID m_agentID; | ||
61 | |||
62 | #region ISharedRegionModule Members | ||
63 | |||
64 | public MeshUploadFlagModule() | ||
65 | { | ||
66 | Enabled = true; | ||
67 | } | ||
68 | |||
69 | public void Initialise(IConfigSource source) | ||
70 | { | ||
71 | IConfig config = source.Configs["Mesh"]; | ||
72 | if (config == null) | ||
73 | { | ||
74 | return; | ||
75 | } | ||
76 | else | ||
77 | { | ||
78 | Enabled = config.GetBoolean("AllowMeshUpload", Enabled); | ||
79 | } | ||
80 | } | ||
81 | |||
82 | public void AddRegion(Scene s) | ||
83 | { | ||
84 | if (!Enabled) | ||
85 | return; | ||
86 | |||
87 | m_scene = s; | ||
88 | m_scene.EventManager.OnRegisterCaps += RegisterCaps; | ||
89 | } | ||
90 | |||
91 | public void RemoveRegion(Scene s) | ||
92 | { | ||
93 | if (!Enabled) | ||
94 | return; | ||
95 | |||
96 | m_scene.EventManager.OnRegisterCaps -= RegisterCaps; | ||
97 | } | ||
98 | |||
99 | public void RegionLoaded(Scene s) | ||
100 | { | ||
101 | } | ||
102 | |||
103 | public void PostInitialise() | ||
104 | { | ||
105 | } | ||
106 | |||
107 | public void Close() { } | ||
108 | |||
109 | public string Name { get { return "MeshUploadFlagModule"; } } | ||
110 | |||
111 | public Type ReplaceableInterface | ||
112 | { | ||
113 | get { return null; } | ||
114 | } | ||
115 | |||
116 | #endregion | ||
117 | |||
118 | public void RegisterCaps(UUID agentID, Caps caps) | ||
119 | { | ||
120 | IRequestHandler reqHandler = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(), MeshUploadFlag); | ||
121 | caps.RegisterHandler("MeshUploadFlag", reqHandler); | ||
122 | m_agentID = agentID; | ||
123 | } | ||
124 | |||
125 | private Hashtable MeshUploadFlag(Hashtable mDhttpMethod) | ||
126 | { | ||
127 | m_log.DebugFormat("[SIMULATOR FEATURES MODULE]: MeshUploadFlag request"); | ||
128 | |||
129 | OSDMap data = new OSDMap(); | ||
130 | ScenePresence sp = m_scene.GetScenePresence(m_agentID); | ||
131 | data["username"] = sp.Firstname + "." + sp.Lastname; | ||
132 | data["display_name_next_update"] = new OSDDate(DateTime.Now); | ||
133 | data["legacy_first_name"] = sp.Firstname; | ||
134 | data["mesh_upload_status"] = "valid"; | ||
135 | data["display_name"] = sp.Firstname + " " + sp.Lastname; | ||
136 | data["legacy_last_name"] = sp.Lastname; | ||
137 | data["id"] = m_agentID; | ||
138 | data["is_display_name_default"] = true; | ||
139 | |||
140 | //Send back data | ||
141 | Hashtable responsedata = new Hashtable(); | ||
142 | responsedata["int_response_code"] = 200; | ||
143 | responsedata["content_type"] = "text/plain"; | ||
144 | responsedata["keepalive"] = false; | ||
145 | responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(data); | ||
146 | return responsedata; | ||
147 | } | ||
148 | } | ||
149 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs index 3809f84..15ed3b3 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs | |||
@@ -250,11 +250,9 @@ namespace OpenSim.Region.ClientStack.Linden | |||
250 | case 0x40: | 250 | case 0x40: |
251 | pbs.ReadProjectionData(extraParam.ExtraParamData, 0); | 251 | pbs.ReadProjectionData(extraParam.ExtraParamData, 0); |
252 | break; | 252 | break; |
253 | |||
254 | } | 253 | } |
255 | |||
256 | |||
257 | } | 254 | } |
255 | |||
258 | pbs.PathBegin = (ushort) obj.PathBegin; | 256 | pbs.PathBegin = (ushort) obj.PathBegin; |
259 | pbs.PathCurve = (byte) obj.PathCurve; | 257 | pbs.PathCurve = (byte) obj.PathCurve; |
260 | pbs.PathEnd = (ushort) obj.PathEnd; | 258 | pbs.PathEnd = (ushort) obj.PathEnd; |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index f53e236..c176c2b 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -7548,13 +7548,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7548 | IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>(); | 7548 | IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>(); |
7549 | if (invAccess != null) | 7549 | if (invAccess != null) |
7550 | { | 7550 | { |
7551 | if (!invAccess.GetAgentInventoryItem(this, itemID, requestID)) | 7551 | if (!invAccess.CanGetAgentInventoryItem(this, itemID, requestID)) |
7552 | return false; | 7552 | return false; |
7553 | |||
7554 | } | 7553 | } |
7555 | else | 7554 | else |
7555 | { | ||
7556 | return false; | 7556 | return false; |
7557 | 7557 | } | |
7558 | } | 7558 | } |
7559 | } | 7559 | } |
7560 | } | 7560 | } |
@@ -7568,7 +7568,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7568 | { | 7568 | { |
7569 | AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; | 7569 | AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; |
7570 | 7570 | ||
7571 | |||
7572 | // m_log.Debug("upload request " + request.ToString()); | 7571 | // m_log.Debug("upload request " + request.ToString()); |
7573 | // m_log.Debug("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToString()); | 7572 | // m_log.Debug("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToString()); |
7574 | UUID temp = UUID.Combine(request.AssetBlock.TransactionID, SecureSessionId); | 7573 | UUID temp = UUID.Combine(request.AssetBlock.TransactionID, SecureSessionId); |