aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs105
-rw-r--r--OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs3
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs17
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs7
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs9
5 files changed, 113 insertions, 28 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index d41deb0..3262419 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -7078,32 +7078,90 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7078 taskID = new UUID(transfer.TransferInfo.Params, 48); 7078 taskID = new UUID(transfer.TransferInfo.Params, 48);
7079 UUID itemID = new UUID(transfer.TransferInfo.Params, 64); 7079 UUID itemID = new UUID(transfer.TransferInfo.Params, 64);
7080 UUID requestID = new UUID(transfer.TransferInfo.Params, 80); 7080 UUID requestID = new UUID(transfer.TransferInfo.Params, 80);
7081
7082// m_log.DebugFormat(
7083// "[CLIENT]: Got request for asset {0} from item {1} in prim {2} by {3}",
7084// requestID, itemID, taskID, Name);
7085
7081 if (!(((Scene)m_scene).Permissions.BypassPermissions())) 7086 if (!(((Scene)m_scene).Permissions.BypassPermissions()))
7082 { 7087 {
7083 if (taskID != UUID.Zero) // Prim 7088 if (taskID != UUID.Zero) // Prim
7084 { 7089 {
7085 SceneObjectPart part = ((Scene)m_scene).GetSceneObjectPart(taskID); 7090 SceneObjectPart part = ((Scene)m_scene).GetSceneObjectPart(taskID);
7091
7086 if (part == null) 7092 if (part == null)
7093 {
7094 m_log.WarnFormat(
7095 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but prim does not exist",
7096 Name, requestID, itemID, taskID);
7087 return true; 7097 return true;
7098 }
7088 7099
7089 if (part.OwnerID != AgentId) 7100 TaskInventoryItem tii = part.Inventory.GetInventoryItem(itemID);
7090 return true; 7101 if (tii == null)
7091 7102 {
7092 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) 7103 m_log.WarnFormat(
7093 return true; 7104 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item does not exist",
7094 7105 Name, requestID, itemID, taskID);
7095 TaskInventoryItem ti = part.Inventory.GetInventoryItem(itemID);
7096 if (ti == null)
7097 return true;
7098
7099 if (ti.OwnerID != AgentId)
7100 return true;
7101
7102 if ((ti.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
7103 return true;
7104
7105 if (ti.AssetID != requestID)
7106 return true; 7106 return true;
7107 }
7108
7109 if (tii.Type == (int)AssetType.LSLText)
7110 {
7111 if (!((Scene)m_scene).Permissions.CanEditScript(itemID, taskID, AgentId))
7112 return true;
7113 }
7114 else if (tii.Type == (int)AssetType.Notecard)
7115 {
7116 if (!((Scene)m_scene).Permissions.CanEditNotecard(itemID, taskID, AgentId))
7117 return true;
7118 }
7119 else
7120 {
7121 // TODO: Change this code to allow items other than notecards and scripts to be successfully
7122 // shared with group. In fact, this whole block of permissions checking should move to an IPermissionsModule
7123 if (part.OwnerID != AgentId)
7124 {
7125 m_log.WarnFormat(
7126 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the prim is owned by {4}",
7127 Name, requestID, itemID, taskID, part.OwnerID);
7128 return true;
7129 }
7130
7131 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
7132 {
7133 m_log.WarnFormat(
7134 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but modify permissions are not set",
7135 Name, requestID, itemID, taskID);
7136 return true;
7137 }
7138
7139 if (tii.OwnerID != AgentId)
7140 {
7141 m_log.WarnFormat(
7142 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the item is owned by {4}",
7143 Name, requestID, itemID, taskID, tii.OwnerID);
7144 return true;
7145 }
7146
7147 if ((
7148 tii.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
7149 != ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
7150 {
7151 m_log.WarnFormat(
7152 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item permissions are not modify/copy/transfer",
7153 Name, requestID, itemID, taskID);
7154 return true;
7155 }
7156
7157 if (tii.AssetID != requestID)
7158 {
7159 m_log.WarnFormat(
7160 "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but this does not match item's asset {4}",
7161 Name, requestID, itemID, taskID, tii.AssetID);
7162 return true;
7163 }
7164 }
7107 } 7165 }
7108 else // Agent 7166 else // Agent
7109 { 7167 {
@@ -7123,7 +7181,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7123 // only to notecards and scripts. All 7181 // only to notecards and scripts. All
7124 // other asset types are always available 7182 // other asset types are always available
7125 // 7183 //
7126 if (assetRequestItem.AssetType == 10) 7184 if (assetRequestItem.AssetType == (int)AssetType.LSLText)
7127 { 7185 {
7128 if (!((Scene)m_scene).Permissions.CanViewScript(itemID, UUID.Zero, AgentId)) 7186 if (!((Scene)m_scene).Permissions.CanViewScript(itemID, UUID.Zero, AgentId))
7129 { 7187 {
@@ -7131,7 +7189,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7131 return true; 7189 return true;
7132 } 7190 }
7133 } 7191 }
7134 else if (assetRequestItem.AssetType == 7) 7192 else if (assetRequestItem.AssetType == (int)AssetType.Notecard)
7135 { 7193 {
7136 if (!((Scene)m_scene).Permissions.CanViewNotecard(itemID, UUID.Zero, AgentId)) 7194 if (!((Scene)m_scene).Permissions.CanViewNotecard(itemID, UUID.Zero, AgentId))
7137 { 7195 {
@@ -7141,7 +7199,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7141 } 7199 }
7142 7200
7143 if (assetRequestItem.AssetID != requestID) 7201 if (assetRequestItem.AssetID != requestID)
7202 {
7203 m_log.WarnFormat(
7204 "[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}",
7205 Name, requestID, itemID, assetRequestItem.AssetID);
7144 return true; 7206 return true;
7207 }
7145 } 7208 }
7146 } 7209 }
7147 } 7210 }
@@ -11376,7 +11439,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11376 // } 11439 // }
11377 } 11440 }
11378 11441
11379 //m_log.DebugFormat("[LLCLIENTVIEW]: {0} requesting asset {1}", Name, requestID); 11442// m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID);
11380 11443
11381 m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived); 11444 m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived);
11382 } 11445 }
@@ -11744,4 +11807,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11744 OutPacket(dialog, ThrottleOutPacketType.Task); 11807 OutPacket(dialog, ThrottleOutPacketType.Task);
11745 } 11808 }
11746 } 11809 }
11747} 11810} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs
index 012d581..d30e954 100644
--- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs
+++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs
@@ -181,7 +181,10 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
181 Manager.MyScene.AssetService.Store(asset); 181 Manager.MyScene.AssetService.Store(asset);
182 182
183 if (part.Inventory.UpdateInventoryItem(item)) 183 if (part.Inventory.UpdateInventoryItem(item))
184 {
185 remoteClient.SendAgentAlertMessage("Notecard saved", false);
184 part.GetProperties(remoteClient); 186 part.GetProperties(remoteClient);
187 }
185 } 188 }
186 } 189 }
187 } 190 }
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index d940564..01359f0 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -1079,7 +1079,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1079 1079
1080 if ((part.GroupMask & (uint)PermissionMask.Modify) == 0) 1080 if ((part.GroupMask & (uint)PermissionMask.Modify) == 0)
1081 return false; 1081 return false;
1082 } else { 1082 }
1083 else
1084 {
1083 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) 1085 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
1084 return false; 1086 return false;
1085 } 1087 }
@@ -1095,7 +1097,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1095 return false; 1097 return false;
1096 1098
1097 if (!IsGroupMember(ti.GroupID, user, 0)) 1099 if (!IsGroupMember(ti.GroupID, user, 0))
1098 return false; 1100 return false;
1099 } 1101 }
1100 1102
1101 // Require full perms 1103 // Require full perms
@@ -1593,14 +1595,16 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1593 if (part.OwnerID != user) 1595 if (part.OwnerID != user)
1594 { 1596 {
1595 if (part.GroupID == UUID.Zero) 1597 if (part.GroupID == UUID.Zero)
1596 return false; 1598 return false;
1597 1599
1598 if (!IsGroupMember(part.GroupID, user, 0)) 1600 if (!IsGroupMember(part.GroupID, user, 0))
1599 return false; 1601 return false;
1600 1602
1601 if ((part.GroupMask & (uint)PermissionMask.Modify) == 0) 1603 if ((part.GroupMask & (uint)PermissionMask.Modify) == 0)
1602 return false; 1604 return false;
1603 } else { 1605 }
1606 else
1607 {
1604 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) 1608 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
1605 return false; 1609 return false;
1606 } 1610 }
@@ -1855,7 +1859,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1855 return GenericObjectPermission(agentID, prim, false); 1859 return GenericObjectPermission(agentID, prim, false);
1856 } 1860 }
1857 1861
1858 private bool CanCompileScript(UUID ownerUUID, int scriptType, Scene scene) { 1862 private bool CanCompileScript(UUID ownerUUID, int scriptType, Scene scene)
1863 {
1859 //m_log.DebugFormat("check if {0} is allowed to compile {1}", ownerUUID, scriptType); 1864 //m_log.DebugFormat("check if {0} is allowed to compile {1}", ownerUUID, scriptType);
1860 switch (scriptType) { 1865 switch (scriptType) {
1861 case 0: 1866 case 0:
@@ -1889,4 +1894,4 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1889 return(false); 1894 return(false);
1890 } 1895 }
1891 } 1896 }
1892} 1897} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 2f1a189..e6e414f 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -202,7 +202,9 @@ namespace OpenSim.Region.Framework.Scenes
202 202
203 // Update item with new asset 203 // Update item with new asset
204 item.AssetID = asset.FullID; 204 item.AssetID = asset.FullID;
205 group.UpdateInventoryItem(item); 205 if (group.UpdateInventoryItem(item))
206 remoteClient.SendAgentAlertMessage("Notecard saved", false);
207
206 part.GetProperties(remoteClient); 208 part.GetProperties(remoteClient);
207 209
208 // Trigger rerunning of script (use TriggerRezScript event, see RezScript) 210 // Trigger rerunning of script (use TriggerRezScript event, see RezScript)
@@ -1229,7 +1231,10 @@ namespace OpenSim.Region.Framework.Scenes
1229 remoteClient, part, transactionID, currentItem); 1231 remoteClient, part, transactionID, currentItem);
1230 } 1232 }
1231 if (part.Inventory.UpdateInventoryItem(itemInfo)) 1233 if (part.Inventory.UpdateInventoryItem(itemInfo))
1234 {
1235 remoteClient.SendAgentAlertMessage("Notecard saved", false);
1232 part.GetProperties(remoteClient); 1236 part.GetProperties(remoteClient);
1237 }
1233 } 1238 }
1234 } 1239 }
1235 else 1240 else
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
index 2296379..4d7ead6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
@@ -302,6 +302,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
302 float dz; 302 float dz;
303 303
304 Quaternion q = SensePoint.RotationOffset; 304 Quaternion q = SensePoint.RotationOffset;
305 if (SensePoint.ParentGroup.RootPart.IsAttachment)
306 {
307 // In attachments, the sensor cone always orients with the
308 // avatar rotation. This may include a nonzero elevation if
309 // in mouselook.
310
311 ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.RootPart.AttachedAvatar);
312 q = avatar.Rotation;
313 }
305 LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); 314 LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W);
306 LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r); 315 LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r);
307 double mag_fwd = LSL_Types.Vector3.Mag(forward_dir); 316 double mag_fwd = LSL_Types.Vector3.Mag(forward_dir);