diff options
Diffstat (limited to 'OpenSim/Region/ClientStack')
4 files changed, 175 insertions, 25 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 6786ac5..d3bb0bc 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -595,21 +595,25 @@ namespace OpenSim.Region.ClientStack.Linden | |||
595 | Vector3 scale = inner_instance_list["scale"].AsVector3(); | 595 | Vector3 scale = inner_instance_list["scale"].AsVector3(); |
596 | Quaternion rotation = inner_instance_list["rotation"].AsQuaternion(); | 596 | Quaternion rotation = inner_instance_list["rotation"].AsQuaternion(); |
597 | 597 | ||
598 | // no longer used - begin ------------------------ | ||
598 | // int physicsShapeType = inner_instance_list["physics_shape_type"].AsInteger(); | 599 | // int physicsShapeType = inner_instance_list["physics_shape_type"].AsInteger(); |
599 | // int material = inner_instance_list["material"].AsInteger(); | 600 | // int material = inner_instance_list["material"].AsInteger(); |
600 | // int mesh = inner_instance_list["mesh"].AsInteger(); | 601 | // int mesh = inner_instance_list["mesh"].AsInteger(); |
601 | 602 | ||
602 | OSDMap permissions = (OSDMap)inner_instance_list["permissions"]; | 603 | // OSDMap permissions = (OSDMap)inner_instance_list["permissions"]; |
603 | int base_mask = permissions["base_mask"].AsInteger(); | 604 | // int base_mask = permissions["base_mask"].AsInteger(); |
604 | int everyone_mask = permissions["everyone_mask"].AsInteger(); | 605 | // int everyone_mask = permissions["everyone_mask"].AsInteger(); |
605 | UUID creator_id = permissions["creator_id"].AsUUID(); | 606 | // UUID creator_id = permissions["creator_id"].AsUUID(); |
606 | UUID group_id = permissions["group_id"].AsUUID(); | 607 | // UUID group_id = permissions["group_id"].AsUUID(); |
607 | int group_mask = permissions["group_mask"].AsInteger(); | 608 | // int group_mask = permissions["group_mask"].AsInteger(); |
608 | // bool is_owner_group = permissions["is_owner_group"].AsBoolean(); | 609 | // bool is_owner_group = permissions["is_owner_group"].AsBoolean(); |
609 | // UUID last_owner_id = permissions["last_owner_id"].AsUUID(); | 610 | // UUID last_owner_id = permissions["last_owner_id"].AsUUID(); |
610 | int next_owner_mask = permissions["next_owner_mask"].AsInteger(); | 611 | // int next_owner_mask = permissions["next_owner_mask"].AsInteger(); |
611 | UUID owner_id = permissions["owner_id"].AsUUID(); | 612 | // UUID owner_id = permissions["owner_id"].AsUUID(); |
612 | int owner_mask = permissions["owner_mask"].AsInteger(); | 613 | // int owner_mask = permissions["owner_mask"].AsInteger(); |
614 | // no longer used - end ------------------------ | ||
615 | |||
616 | UUID owner_id = m_HostCapsObj.AgentID; | ||
613 | 617 | ||
614 | SceneObjectPart prim | 618 | SceneObjectPart prim |
615 | = new SceneObjectPart(owner_id, pbs, position, Quaternion.Identity, Vector3.Zero); | 619 | = new SceneObjectPart(owner_id, pbs, position, Quaternion.Identity, Vector3.Zero); |
@@ -619,19 +623,19 @@ namespace OpenSim.Region.ClientStack.Linden | |||
619 | rotations.Add(rotation); | 623 | rotations.Add(rotation); |
620 | positions.Add(position); | 624 | positions.Add(position); |
621 | prim.UUID = UUID.Random(); | 625 | prim.UUID = UUID.Random(); |
622 | prim.CreatorID = creator_id; | 626 | prim.CreatorID = owner_id; |
623 | prim.OwnerID = owner_id; | 627 | prim.OwnerID = owner_id; |
624 | prim.GroupID = group_id; | 628 | prim.GroupID = UUID.Zero; |
625 | prim.LastOwnerID = prim.OwnerID; | 629 | prim.LastOwnerID = prim.OwnerID; |
626 | prim.CreationDate = Util.UnixTimeSinceEpoch(); | 630 | prim.CreationDate = Util.UnixTimeSinceEpoch(); |
627 | prim.Name = assetName; | 631 | prim.Name = assetName; |
628 | prim.Description = ""; | 632 | prim.Description = ""; |
629 | 633 | ||
630 | prim.BaseMask = (uint)base_mask; | 634 | // prim.BaseMask = (uint)base_mask; |
631 | prim.EveryoneMask = (uint)everyone_mask; | 635 | // prim.EveryoneMask = (uint)everyone_mask; |
632 | prim.GroupMask = (uint)group_mask; | 636 | // prim.GroupMask = (uint)group_mask; |
633 | prim.NextOwnerMask = (uint)next_owner_mask; | 637 | // prim.NextOwnerMask = (uint)next_owner_mask; |
634 | prim.OwnerMask = (uint)owner_mask; | 638 | // prim.OwnerMask = (uint)owner_mask; |
635 | 639 | ||
636 | if (grp == null) | 640 | if (grp == null) |
637 | grp = new SceneObjectGroup(prim); | 641 | grp = new SceneObjectGroup(prim); |
@@ -1123,4 +1127,4 @@ namespace OpenSim.Region.ClientStack.Linden | |||
1123 | } | 1127 | } |
1124 | } | 1128 | } |
1125 | 1129 | ||
1126 | } | 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 ecf10e4..99552f1 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -7614,13 +7614,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7614 | IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>(); | 7614 | IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>(); |
7615 | if (invAccess != null) | 7615 | if (invAccess != null) |
7616 | { | 7616 | { |
7617 | if (!invAccess.GetAgentInventoryItem(this, itemID, requestID)) | 7617 | if (!invAccess.CanGetAgentInventoryItem(this, itemID, requestID)) |
7618 | return false; | 7618 | return false; |
7619 | |||
7620 | } | 7619 | } |
7621 | else | 7620 | else |
7621 | { | ||
7622 | return false; | 7622 | return false; |
7623 | 7623 | } | |
7624 | } | 7624 | } |
7625 | } | 7625 | } |
7626 | } | 7626 | } |
@@ -7634,7 +7634,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7634 | { | 7634 | { |
7635 | AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; | 7635 | AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; |
7636 | 7636 | ||
7637 | |||
7638 | // m_log.Debug("upload request " + request.ToString()); | 7637 | // m_log.Debug("upload request " + request.ToString()); |
7639 | // m_log.Debug("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToString()); | 7638 | // m_log.Debug("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToString()); |
7640 | UUID temp = UUID.Combine(request.AssetBlock.TransactionID, SecureSessionId); | 7639 | UUID temp = UUID.Combine(request.AssetBlock.TransactionID, SecureSessionId); |