From 349a17f664f661acf97896d4b778368edb822044 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sat, 17 May 2008 00:16:16 +0000 Subject: * Tweaked patch mantis 1302 and committing it. --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 23 ++++++++++++++ .../Environment/Modules/World/NPC/NPCAvatar.cs | 17 +++++++++- .../Modules/World/Permissions/PermissionsModule.cs | 4 +-- .../Region/Environment/Scenes/Scene.Inventory.cs | 2 +- .../Scenes/SceneObjectGroup.Inventory.cs | 4 +-- .../Scenes/SceneObjectPart.Inventory.cs | 37 ++++++++++++++++++---- .../Region/Examples/SimpleModule/MyNpcCharacter.cs | 15 +++++++++ 7 files changed, 89 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 180a806..a86941f 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -129,6 +129,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP protected LLVector3 m_startpos; protected EndPoint m_userEndPoint; protected EndPoint m_proxyEndPoint; + protected LLUUID m_activeGroupID = LLUUID.Zero; + protected string m_activeGroupName = String.Empty; + protected ulong m_activeGroupPowers = 0; /* Instantiated Designated Event Delegates */ //- used so we don't create new objects for each incoming packet and then toss it out later */ @@ -274,6 +277,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP get { return m_agentId; } } + public LLUUID ActiveGroupId + { + get { return m_activeGroupID; } + } + + public string ActiveGroupName + { + get { return m_activeGroupName; } + } + + public ulong ActiveGroupPowers + { + get { return m_activeGroupPowers; } + } + /// /// This is a utility method used by single states to not duplicate kicks and blue card of death messages. /// @@ -1691,6 +1709,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendAgentDataUpdate(LLUUID agentid, LLUUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle) { + + m_activeGroupID = activegroupid; + m_activeGroupName = groupname; + m_activeGroupPowers = grouppowers; + AgentDataUpdatePacket sendAgentDataUpdate = (AgentDataUpdatePacket)PacketPool.Instance.GetPacket(PacketType.AgentDataUpdate); sendAgentDataUpdate.AgentData.ActiveGroupID = activegroupid; sendAgentDataUpdate.AgentData.AgentID = agentid; diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index f37e12a..815a505 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs @@ -331,6 +331,21 @@ namespace OpenSim.Region.Environment.Modules.World.NPC set { } } + public LLUUID ActiveGroupId + { + get { return LLUUID.Zero; } + } + + public string ActiveGroupName + { + get { return String.Empty; } + } + + public ulong ActiveGroupPowers + { + get { return 0; } + } + public virtual int NextAnimationSequenceNumber { get { return 1; } @@ -743,4 +758,4 @@ namespace OpenSim.Region.Environment.Modules.World.NPC } #endregion } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs index 43e8f36..a319119 100644 --- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs @@ -882,7 +882,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; - return true; + return false; } private bool CanViewNotecard(LLUUID notecard, LLUUID objectID, LLUUID user, Scene scene) @@ -890,7 +890,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; - return true; + return false; } #endregion diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 88f0cb4..8b94100 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -769,7 +769,7 @@ namespace OpenSim.Region.Environment.Scenes { if (XferManager != null) { - group.RequestInventoryFile(primLocalID, XferManager); + group.RequestInventoryFile(remoteClient, primLocalID, XferManager); } } } diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs index c26ff51..d35765c 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs @@ -157,12 +157,12 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void RequestInventoryFile(uint localID, IXfer xferManager) + public void RequestInventoryFile(IClientAPI client, uint localID, IXfer xferManager) { SceneObjectPart part = GetChildPart(localID); if (part != null) { - part.RequestInventoryFile(xferManager); + part.RequestInventoryFile(client, xferManager); } else { diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index a9dc9cf..8c5737c 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs @@ -484,7 +484,7 @@ namespace OpenSim.Region.Environment.Scenes /// Serialize all the metadata for the items in this prim's inventory ready for sending to the client /// /// - public void RequestInventoryFile(IXfer xferManager) + public void RequestInventoryFile(IClientAPI client, IXfer xferManager) { byte[] fileData = new byte[0]; @@ -497,23 +497,45 @@ namespace OpenSim.Region.Environment.Scenes { foreach (TaskInventoryItem item in m_taskInventory.Values) { + LLUUID ownerID=item.OwnerID; + uint everyoneMask=0; + uint baseMask=item.BaseMask; + uint ownerMask=item.OwnerMask; + + if(item.InvType == 10) // Script + { + if((item.OwnerID != client.AgentId) && m_parentGroup.Scene.ExternalChecks.ExternalChecksCanViewScript(item.ItemID, UUID, client.AgentId)) + { + ownerID=client.AgentId; + baseMask=0x7fffffff; + ownerMask=0x7fffffff; + everyoneMask=(uint)(PermissionMask.Move | PermissionMask.Transfer); + } + if((item.OwnerID != client.AgentId) && m_parentGroup.Scene.ExternalChecks.ExternalChecksCanEditScript(item.ItemID, UUID, client.AgentId)) + { + ownerID=client.AgentId; + baseMask=0x7fffffff; + ownerMask=0x7fffffff; + everyoneMask=(uint)(PermissionMask.Move | PermissionMask.Transfer | PermissionMask.Modify); + } + } + invString.AddItemStart(); invString.AddNameValueLine("item_id", item.ItemID.ToString()); invString.AddNameValueLine("parent_id", UUID.ToString()); invString.AddPermissionsStart(); - invString.AddNameValueLine("base_mask", Helpers.UIntToHexString(item.BaseMask)); - invString.AddNameValueLine("owner_mask", Helpers.UIntToHexString(item.OwnerMask)); - invString.AddNameValueLine("group_mask", "00000000"); - invString.AddNameValueLine("everyone_mask", "00000000"); + invString.AddNameValueLine("base_mask", Helpers.UIntToHexString(baseMask)); + invString.AddNameValueLine("owner_mask", Helpers.UIntToHexString(ownerMask)); + invString.AddNameValueLine("group_mask", Helpers.UIntToHexString(0)); + invString.AddNameValueLine("everyone_mask", Helpers.UIntToHexString(everyoneMask)); invString.AddNameValueLine("next_owner_mask", Helpers.UIntToHexString(item.NextOwnerMask)); invString.AddNameValueLine("creator_id", item.CreatorID.ToString()); - invString.AddNameValueLine("owner_id", item.OwnerID.ToString()); + invString.AddNameValueLine("owner_id", ownerID.ToString()); invString.AddNameValueLine("last_owner_id", item.LastOwnerID.ToString()); -// invString.AddNameValueLine("last_owner_id", item.OwnerID.ToString()); invString.AddNameValueLine("group_id", item.GroupID.ToString()); invString.AddSectionEnd(); @@ -538,6 +560,7 @@ namespace OpenSim.Region.Environment.Scenes fileData = Helpers.StringToField(invString.BuildString); + //Console.WriteLine(Helpers.FieldToUTF8String(fileData)); //m_log.Debug("[PRIM INVENTORY]: RequestInventoryFile fileData: " + Helpers.FieldToUTF8String(fileData)); if (fileData.Length > 2) diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 78b5d1f..ca8636f 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -246,6 +246,21 @@ namespace OpenSim.Region.Examples.SimpleModule set { } } + public LLUUID ActiveGroupId + { + get { return LLUUID.Zero; } + } + + public string ActiveGroupName + { + get { return String.Empty; } + } + + public ulong ActiveGroupPowers + { + get { return 0; } + } + public virtual int NextAnimationSequenceNumber { get { return 1; } -- cgit v1.1