diff options
author | Melanie | 2010-07-17 03:18:01 +0100 |
---|---|---|
committer | Melanie | 2010-07-17 03:18:01 +0100 |
commit | 859e3252be87734290c468c04ab13b70808ca708 (patch) | |
tree | 35433df5332b03400c83e1de780005cc609dd521 /OpenSim/Region | |
parent | Merge branch 'careminster-presence-refactor' of ssh://melanie@3dhosting.de/va... (diff) | |
parent | Replace the screenful of code i deleted. (diff) | |
download | opensim-SC-859e3252be87734290c468c04ab13b70808ca708.zip opensim-SC-859e3252be87734290c468c04ab13b70808ca708.tar.gz opensim-SC-859e3252be87734290c468c04ab13b70808ca708.tar.bz2 opensim-SC-859e3252be87734290c468c04ab13b70808ca708.tar.xz |
Merge branch 'careminster-presence-refactor' of ssh://melanie@3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to '')
6 files changed, 67 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 1bf3a66..c300250 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -529,7 +529,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
529 | // find small items. | 529 | // find small items. |
530 | // | 530 | // |
531 | if (!attachment) | 531 | if (!attachment) |
532 | { | ||
532 | group.RootPart.CreateSelected = true; | 533 | group.RootPart.CreateSelected = true; |
534 | foreach (SceneObjectPart child in group.Children.Values) | ||
535 | child.CreateSelected = true; | ||
536 | } | ||
533 | 537 | ||
534 | if (!m_Scene.Permissions.CanRezObject( | 538 | if (!m_Scene.Permissions.CanRezObject( |
535 | group.Children.Count, remoteClient.AgentId, pos) | 539 | group.Children.Count, remoteClient.AgentId, pos) |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index c77efc7..4575068 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -935,6 +935,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
935 | } | 935 | } |
936 | if (part != null && group != null) | 936 | if (part != null && group != null) |
937 | { | 937 | { |
938 | if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId)) | ||
939 | return; | ||
940 | |||
938 | TaskInventoryItem item = group.GetInventoryItem(localID, itemID); | 941 | TaskInventoryItem item = group.GetInventoryItem(localID, itemID); |
939 | if (item == null) | 942 | if (item == null) |
940 | return; | 943 | return; |
@@ -1074,9 +1077,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
1074 | return; | 1077 | return; |
1075 | } | 1078 | } |
1076 | 1079 | ||
1077 | // Only owner can copy | 1080 | TaskInventoryItem item = part.Inventory.GetInventoryItem(itemId); |
1078 | if (remoteClient.AgentId != taskItem.OwnerID) | 1081 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
1079 | return; | 1082 | { |
1083 | // If the item to be moved is no copy, we need to be able to | ||
1084 | // edit the prim. | ||
1085 | if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId)) | ||
1086 | return; | ||
1087 | } | ||
1088 | else | ||
1089 | { | ||
1090 | // If the item is copiable, then we just need to have perms | ||
1091 | // on it. The delete check is a pure rights check | ||
1092 | if (!Permissions.CanDeleteObject(part.UUID, remoteClient.AgentId)) | ||
1093 | return; | ||
1094 | } | ||
1080 | 1095 | ||
1081 | MoveTaskInventoryItem(remoteClient, folderId, part, itemId); | 1096 | MoveTaskInventoryItem(remoteClient, folderId, part, itemId); |
1082 | } | 1097 | } |
@@ -1359,16 +1374,45 @@ namespace OpenSim.Region.Framework.Scenes | |||
1359 | { | 1374 | { |
1360 | agentTransactions.HandleTaskItemUpdateFromTransaction( | 1375 | agentTransactions.HandleTaskItemUpdateFromTransaction( |
1361 | remoteClient, part, transactionID, currentItem); | 1376 | remoteClient, part, transactionID, currentItem); |
1362 | } | 1377 | |
1363 | if (part.Inventory.UpdateInventoryItem(itemInfo)) | ||
1364 | { | ||
1365 | if ((InventoryType)itemInfo.InvType == InventoryType.Notecard) | 1378 | if ((InventoryType)itemInfo.InvType == InventoryType.Notecard) |
1366 | remoteClient.SendAgentAlertMessage("Notecard saved", false); | 1379 | remoteClient.SendAgentAlertMessage("Notecard saved", false); |
1367 | else if ((InventoryType)itemInfo.InvType == InventoryType.LSL) | 1380 | else if ((InventoryType)itemInfo.InvType == InventoryType.LSL) |
1368 | remoteClient.SendAgentAlertMessage("Script saved", false); | 1381 | remoteClient.SendAgentAlertMessage("Script saved", false); |
1369 | else | 1382 | else |
1370 | remoteClient.SendAgentAlertMessage("Item saved", false); | 1383 | remoteClient.SendAgentAlertMessage("Item saved", false); |
1384 | } | ||
1385 | |||
1386 | // Check if we're allowed to mess with permissions | ||
1387 | if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god | ||
1388 | { | ||
1389 | if (remoteClient.AgentId != part.OwnerID) // Not owner | ||
1390 | { | ||
1391 | // Friends and group members can't change any perms | ||
1392 | itemInfo.BasePermissions = currentItem.BasePermissions; | ||
1393 | itemInfo.EveryonePermissions = currentItem.EveryonePermissions; | ||
1394 | itemInfo.GroupPermissions = currentItem.GroupPermissions; | ||
1395 | itemInfo.NextPermissions = currentItem.NextPermissions; | ||
1396 | itemInfo.CurrentPermissions = currentItem.CurrentPermissions; | ||
1397 | } | ||
1398 | else | ||
1399 | { | ||
1400 | // Owner can't change base, and can change other | ||
1401 | // only up to base | ||
1402 | // Base ALWAYS has move | ||
1403 | currentItem.BasePermissions |= (uint)PermissionMask.Move; | ||
1404 | itemInfo.BasePermissions = currentItem.BasePermissions; | ||
1405 | itemInfo.EveryonePermissions &= currentItem.BasePermissions; | ||
1406 | itemInfo.GroupPermissions &= currentItem.BasePermissions; | ||
1407 | itemInfo.CurrentPermissions &= currentItem.BasePermissions; | ||
1408 | itemInfo.NextPermissions &= currentItem.BasePermissions; | ||
1409 | // Next ALWAYS has move | ||
1410 | itemInfo.NextPermissions |= (uint)PermissionMask.Move; | ||
1411 | } | ||
1371 | 1412 | ||
1413 | } | ||
1414 | if (part.Inventory.UpdateInventoryItem(itemInfo)) | ||
1415 | { | ||
1372 | part.GetProperties(remoteClient); | 1416 | part.GetProperties(remoteClient); |
1373 | } | 1417 | } |
1374 | } | 1418 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 87b2d74..b19c443 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -4156,6 +4156,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
4156 | // objects | 4156 | // objects |
4157 | if ((_nextOwnerMask & (uint)PermissionMask.Copy) == 0) | 4157 | if ((_nextOwnerMask & (uint)PermissionMask.Copy) == 0) |
4158 | _nextOwnerMask |= (uint)PermissionMask.Transfer; | 4158 | _nextOwnerMask |= (uint)PermissionMask.Transfer; |
4159 | |||
4160 | _nextOwnerMask |= (uint)PermissionMask.Move; | ||
4161 | |||
4159 | break; | 4162 | break; |
4160 | } | 4163 | } |
4161 | SendFullUpdateToAllClients(); | 4164 | SendFullUpdateToAllClients(); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 0066158..2a3727a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -762,12 +762,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
762 | else if ((InventoryType)item.Type == InventoryType.Notecard) | 762 | else if ((InventoryType)item.Type == InventoryType.Notecard) |
763 | { | 763 | { |
764 | ScenePresence presence = m_part.ParentGroup.Scene.GetScenePresence(item.OwnerID); | 764 | ScenePresence presence = m_part.ParentGroup.Scene.GetScenePresence(item.OwnerID); |
765 | |||
766 | if (presence != null) | ||
767 | { | ||
768 | presence.ControllingClient.SendAgentAlertMessage( | ||
769 | "Notecard saved", false); | ||
770 | } | ||
771 | } | 765 | } |
772 | 766 | ||
773 | m_items[item.ItemID] = item; | 767 | m_items[item.ItemID] = item; |
diff --git a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs index 6b17ce7..7e70db9 100644 --- a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs | |||
@@ -1735,6 +1735,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1735 | if (m_isphysical) | 1735 | if (m_isphysical) |
1736 | { | 1736 | { |
1737 | disableBodySoft(); | 1737 | disableBodySoft(); |
1738 | |||
1739 | if (Body != IntPtr.Zero) | ||
1740 | { | ||
1741 | d.BodySetLinearVel(Body, 0f, 0f, 0f); | ||
1742 | d.BodySetForce(Body, 0, 0, 0); | ||
1743 | enableBodySoft(); | ||
1744 | } | ||
1738 | } | 1745 | } |
1739 | } | 1746 | } |
1740 | else | 1747 | else |
@@ -1756,6 +1763,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1756 | d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); | 1763 | d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); |
1757 | d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); | 1764 | d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); |
1758 | } | 1765 | } |
1766 | /* Uhhh - stop the motion if the object is _selected_!! | ||
1759 | if (m_isphysical) | 1767 | if (m_isphysical) |
1760 | { | 1768 | { |
1761 | if (Body != IntPtr.Zero) | 1769 | if (Body != IntPtr.Zero) |
@@ -1765,6 +1773,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1765 | enableBodySoft(); | 1773 | enableBodySoft(); |
1766 | } | 1774 | } |
1767 | } | 1775 | } |
1776 | */ | ||
1768 | } | 1777 | } |
1769 | 1778 | ||
1770 | resetCollisionAccounting(); | 1779 | resetCollisionAccounting(); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index defe633..b196642 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4177,7 +4177,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4177 | 4177 | ||
4178 | byte[] bucket = new byte[17]; | 4178 | byte[] bucket = new byte[17]; |
4179 | bucket[0] = (byte)assetType; | 4179 | bucket[0] = (byte)assetType; |
4180 | byte[] objBytes = objId.GetBytes(); | 4180 | byte[] objBytes = agentItem.ID.GetBytes(); |
4181 | Array.Copy(objBytes, 0, bucket, 1, 16); | 4181 | Array.Copy(objBytes, 0, bucket, 1, 16); |
4182 | 4182 | ||
4183 | Console.WriteLine("Giving inventory"); | 4183 | Console.WriteLine("Giving inventory"); |