From 1777324a862a41c57d12bd6180129a30d9653841 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 1 Jul 2016 17:31:31 +0100 Subject: [PATCH 01/14] cleanup a bit AgentGroupDataUpdate sending --- OpenSim/Addons/Groups/GroupsModule.cs | 6 +- .../ClientStack/Linden/UDP/LLClientView.cs | 63 +++++++++---------- .../Avatar/XmlRpcGroups/GroupsModule.cs | 5 +- 3 files changed, 32 insertions(+), 42 deletions(-) diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs index 13b7123a64..11a2a127e6 100644 --- a/OpenSim/Addons/Groups/GroupsModule.cs +++ b/OpenSim/Addons/Groups/GroupsModule.cs @@ -1277,13 +1277,9 @@ namespace OpenSim.Groups SendDataUpdate(remoteClient, tellOthers); GroupMembershipData[] membershipArray = GetProfileListedGroupMemberships(remoteClient, agentID); - IEventQueue eq = remoteClient.Scene.RequestModuleInterface(); - if (eq != null) - eq.GroupMembershipData(agentID, membershipArray); - else - remoteClient.SendGroupMembership(membershipArray); remoteClient.RefreshGroupMembership(); + remoteClient.SendAgentGroupDataUpdate(agentID, membershipArray); } /// diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index cc2d1e212d..12f6fbd4cc 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -2777,11 +2777,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP Groupupdate.GroupData = Groups; Groupupdate.AgentData = new AgentGroupDataUpdatePacket.AgentDataBlock(); Groupupdate.AgentData.AgentID = AgentId; - //OutPacket(Groupupdate, ThrottleOutPacketType.Task); + IEventQueue eq = Scene.RequestModuleInterface(); try { - IEventQueue eq = Scene.RequestModuleInterface(); if (eq != null) { eq.GroupMembership(Groupupdate, this.AgentId); @@ -2791,8 +2790,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP { m_log.Error("Unable to send group membership data via eventqueue - exception: " + ex.ToString()); m_log.Warn("sending group membership data via UDP"); - OutPacket(Groupupdate, ThrottleOutPacketType.Task); + eq = null; } + + if(eq == null) // udp if no eq + OutPacket(Groupupdate, ThrottleOutPacketType.Task); + } public void SendPartPhysicsProprieties(ISceneEntity entity) @@ -3423,41 +3426,35 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendAgentGroupDataUpdate(UUID avatarID, GroupMembershipData[] data) { + if(avatarID != AgentId) + m_log.Debug("[CLIENT]: SendAgentGroupDataUpdate avatarID != AgentId"); + IEventQueue eq = this.Scene.RequestModuleInterface(); - - // use UDP if no caps - if (eq == null) + if(eq != null) { - SendGroupMembership(data); + eq.GroupMembershipData(avatarID,data); } - - OSDMap llsd = new OSDMap(3); - OSDArray AgentData = new OSDArray(1); - OSDMap AgentDataMap = new OSDMap(1); - AgentDataMap.Add("AgentID", OSD.FromUUID(this.AgentId)); - AgentDataMap.Add("AvatarID", OSD.FromUUID(avatarID)); - AgentData.Add(AgentDataMap); - llsd.Add("AgentData", AgentData); - OSDArray GroupData = new OSDArray(data.Length); - OSDArray NewGroupData = new OSDArray(data.Length); - foreach (GroupMembershipData m in data) + else { - OSDMap GroupDataMap = new OSDMap(6); - OSDMap NewGroupDataMap = new OSDMap(1); - GroupDataMap.Add("GroupPowers", OSD.FromULong(m.GroupPowers)); - GroupDataMap.Add("AcceptNotices", OSD.FromBoolean(m.AcceptNotices)); - GroupDataMap.Add("GroupTitle", OSD.FromString(m.GroupTitle)); - GroupDataMap.Add("GroupID", OSD.FromUUID(m.GroupID)); - GroupDataMap.Add("GroupName", OSD.FromString(m.GroupName)); - GroupDataMap.Add("GroupInsigniaID", OSD.FromUUID(m.GroupPicture)); - NewGroupDataMap.Add("ListInProfile", OSD.FromBoolean(m.ListInProfile)); - GroupData.Add(GroupDataMap); - NewGroupData.Add(NewGroupDataMap); + // use UDP if no caps + AgentGroupDataUpdatePacket Groupupdate = new AgentGroupDataUpdatePacket(); + AgentGroupDataUpdatePacket.GroupDataBlock[] Groups = new AgentGroupDataUpdatePacket.GroupDataBlock[data.Length]; + for (int i = 0; i < data.Length; i++) + { + AgentGroupDataUpdatePacket.GroupDataBlock Group = new AgentGroupDataUpdatePacket.GroupDataBlock(); + Group.AcceptNotices = data[i].AcceptNotices; + Group.Contribution = data[i].Contribution; + Group.GroupID = data[i].GroupID; + Group.GroupInsigniaID = data[i].GroupPicture; + Group.GroupName = Util.StringToBytes256(data[i].GroupName); + Group.GroupPowers = data[i].GroupPowers; + Groups[i] = Group; + } + Groupupdate.GroupData = Groups; + Groupupdate.AgentData = new AgentGroupDataUpdatePacket.AgentDataBlock(); + Groupupdate.AgentData.AgentID = avatarID; + OutPacket(Groupupdate, ThrottleOutPacketType.Task); } - llsd.Add("GroupData", GroupData); - llsd.Add("NewGroupData", NewGroupData); - - eq.Enqueue(BuildEvent("AgentGroupDataUpdate", llsd), this.AgentId); } public void SendJoinGroupReply(UUID groupID, bool success) diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 2617723af6..343935d360 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -1409,12 +1409,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups GroupMembershipData[] membershipArray = GetProfileListedGroupMemberships(remoteClient, agentID); IEventQueue eq = remoteClient.Scene.RequestModuleInterface(); - if (eq != null) - eq.GroupMembershipData(agentID, membershipArray); - else - remoteClient.SendGroupMembership(membershipArray); remoteClient.RefreshGroupMembership(); + remoteClient.SendAgentGroupDataUpdate(agentID, membershipArray); } /// From aa744eecf2bc474509a1703028d681b27111ce84 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 1 Jul 2016 18:19:09 +0100 Subject: [PATCH 02/14] add a few methods to modify clientview group powers --- OpenSim/Framework/IClientAPI.cs | 3 + .../ClientStack/Linden/UDP/LLClientView.cs | 89 ++++++++++++++----- .../Server/IRCClientView.cs | 16 ++++ .../OptionalModules/World/NPC/NPCAvatar.cs | 12 +++ OpenSim/Tests/Common/Mock/TestClient.cs | 12 +++ 5 files changed, 108 insertions(+), 24 deletions(-) diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index c949c04194..d9932eb544 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -1473,6 +1473,9 @@ namespace OpenSim.Framework void SendAgentDropGroup(UUID groupID); void RefreshGroupMembership(); + void UpdateGroupMembership(GroupMembershipData[] data); + void GroupMembershipRemove(UUID GroupID); + void GroupMembershipAddReplace(UUID GroupID,ulong GroupPowers); void SendAvatarNotesReply(UUID targetID, string text); void SendAvatarPicksReply(UUID targetID, Dictionary picks); void SendPickInfoReply(UUID pickID,UUID creatorID, bool topPick, UUID parcelID, string name, string desc, UUID snapshotID, string user, string originalName, string simName, Vector3 posGlobal, int sortOrder, bool enabled); diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 12f6fbd4cc..16cb4ac55b 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -2755,29 +2755,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendGroupMembership(GroupMembershipData[] GroupMembership) { - m_groupPowers.Clear(); + // maybe removed in future, use SendAgentGroupDataUpdate instead ( but make sure to update groupPowers ) AgentGroupDataUpdatePacket Groupupdate = new AgentGroupDataUpdatePacket(); AgentGroupDataUpdatePacket.GroupDataBlock[] Groups = new AgentGroupDataUpdatePacket.GroupDataBlock[GroupMembership.Length]; - for (int i = 0; i < GroupMembership.Length; i++) + + lock(m_groupPowers) { - m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers; - - AgentGroupDataUpdatePacket.GroupDataBlock Group = new AgentGroupDataUpdatePacket.GroupDataBlock(); - Group.AcceptNotices = GroupMembership[i].AcceptNotices; - Group.Contribution = GroupMembership[i].Contribution; - Group.GroupID = GroupMembership[i].GroupID; - Group.GroupInsigniaID = GroupMembership[i].GroupPicture; - Group.GroupName = Util.StringToBytes256(GroupMembership[i].GroupName); - Group.GroupPowers = GroupMembership[i].GroupPowers; - Groups[i] = Group; + m_groupPowers.Clear(); + for (int i = 0; i < GroupMembership.Length; i++) + { + m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers; + AgentGroupDataUpdatePacket.GroupDataBlock Group = new AgentGroupDataUpdatePacket.GroupDataBlock(); + Group.AcceptNotices = GroupMembership[i].AcceptNotices; + Group.Contribution = GroupMembership[i].Contribution; + Group.GroupID = GroupMembership[i].GroupID; + Group.GroupInsigniaID = GroupMembership[i].GroupPicture; + Group.GroupName = Util.StringToBytes256(GroupMembership[i].GroupName); + Group.GroupPowers = GroupMembership[i].GroupPowers; + Groups[i] = Group; + } } + Groupupdate.GroupData = Groups; Groupupdate.AgentData = new AgentGroupDataUpdatePacket.AgentDataBlock(); Groupupdate.AgentData.AgentID = AgentId; - + IEventQueue eq = Scene.RequestModuleInterface(); try { @@ -5639,9 +5644,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (groupID == ActiveGroupId) return ActiveGroupPowers; - if (m_groupPowers.ContainsKey(groupID)) - return m_groupPowers[groupID]; - + lock(m_groupPowers) + { + if (m_groupPowers.ContainsKey(groupID)) + return m_groupPowers[groupID]; + } return 0; } @@ -12952,23 +12959,57 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void RefreshGroupMembership() { - if (m_GroupsModule != null) + lock(m_groupPowers) { - GroupMembershipData[] GroupMembership = + if (m_GroupsModule != null) + { + GroupMembershipData[] GroupMembership = m_GroupsModule.GetMembershipData(AgentId); - m_groupPowers.Clear(); - - if (GroupMembership != null) - { - for (int i = 0; i < GroupMembership.Length; i++) + m_groupPowers.Clear(); + + if (GroupMembership != null) { - m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers; + for (int i = 0; i < GroupMembership.Length; i++) + { + m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers; + } } } } } + public void UpdateGroupMembership(GroupMembershipData[] data) + { + lock(m_groupPowers) + { + m_groupPowers.Clear(); + + if (data != null) + { + for (int i = 0; i < data.Length; i++) + m_groupPowers[data[i].GroupID] = data[i].GroupPowers; + } + } + } + + public void GroupMembershipRemove(UUID GroupID) + { + lock(m_groupPowers) + { + if(m_groupPowers.ContainsKey(GroupID)) + m_groupPowers.Remove(GroupID); + } + } + + public void GroupMembershipAddReplace(UUID GroupID,ulong GroupPowers) + { + lock(m_groupPowers) + { + m_groupPowers[GroupID] = GroupPowers; + } + } + public string Report() { return m_udpClient.GetStats(); diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index f19cd4792f..f34dbe8b0c 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -1626,6 +1626,22 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server } + public void UpdateGroupMembership(GroupMembershipData[] data) + { + + } + + public void GroupMembershipRemove(UUID GroupID) + { + + } + + public void GroupMembershipAddReplace(UUID GroupID,ulong GroupPowers) + { + + } + + public void SendAvatarNotesReply(UUID targetID, string text) { diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 43b4e0274c..bdac6aa6a1 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -1255,6 +1255,18 @@ namespace OpenSim.Region.OptionalModules.World.NPC { } + public void UpdateGroupMembership(GroupMembershipData[] data) + { + } + + public void GroupMembershipRemove(UUID GroupID) + { + } + + public void GroupMembershipAddReplace(UUID GroupID,ulong GroupPowers) + { + } + public void SendUseCachedMuteList() { } diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 1d8e38f499..98a98c069c 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1281,6 +1281,18 @@ namespace OpenSim.Tests.Common { } + public void UpdateGroupMembership(GroupMembershipData[] data) + { + } + + public void GroupMembershipRemove(UUID GroupID) + { + } + + public void GroupMembershipAddReplace(UUID GroupID,ulong GroupPowers) + { + } + public void SendUseCachedMuteList() { } From 7b7483ec7e69ef7a9fb5e82ce6f03a68103ef63a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 1 Jul 2016 18:38:38 +0100 Subject: [PATCH 03/14] save one call to grid to get agent groups powers (xmlrpcgoups only for now --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 2 +- .../Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 16cb4ac55b..29c4d91518 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -12988,7 +12988,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (data != null) { for (int i = 0; i < data.Length; i++) - m_groupPowers[data[i].GroupID] = data[i].GroupPowers; + m_groupPowers[data[i].GroupID] = data[i].GroupPowers; } } } diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 343935d360..27645e4da2 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -1408,9 +1408,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups SendDataUpdate(remoteClient, tellOthers); GroupMembershipData[] membershipArray = GetProfileListedGroupMemberships(remoteClient, agentID); - IEventQueue eq = remoteClient.Scene.RequestModuleInterface(); + remoteClient.UpdateGroupMembership(membershipArray); - remoteClient.RefreshGroupMembership(); remoteClient.SendAgentGroupDataUpdate(agentID, membershipArray); } From 3af437c8bcd8590295f7cf6927cde0bcff9fa3b7 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 1 Jul 2016 19:20:04 +0100 Subject: [PATCH 04/14] cleanup a bit --- .../Caps/EventQueue/EventQueueGetModule.cs | 6 --- .../Caps/EventQueue/EventQueueHelper.cs | 34 ------------- .../ClientStack/Linden/UDP/LLClientView.cs | 48 +------------------ .../Common/Mock/TestEventQueueGetModule.cs | 5 -- 4 files changed, 2 insertions(+), 91 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index 9a1cef40fd..cc614f3297 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs @@ -579,12 +579,6 @@ namespace OpenSim.Region.ClientStack.Linden Enqueue(item, avatarID); } - public void GroupMembership(AgentGroupDataUpdatePacket groupUpdate, UUID avatarID) - { - OSD item = EventQueueHelper.GroupMembership(groupUpdate); - Enqueue(item, avatarID); - } - public void GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data) { OSD item = EventQueueHelper.GroupMembershipData(receiverAgent, data); diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs index 29d8b8501c..8beeb95b09 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs @@ -333,40 +333,6 @@ namespace OpenSim.Region.ClientStack.Linden return chatterBoxSessionAgentListUpdates; } - public static OSD GroupMembership(AgentGroupDataUpdatePacket groupUpdatePacket) - { - OSDMap groupUpdate = new OSDMap(); - groupUpdate.Add("message", OSD.FromString("AgentGroupDataUpdate")); - - OSDMap body = new OSDMap(); - OSDArray agentData = new OSDArray(); - OSDMap agentDataMap = new OSDMap(); - agentDataMap.Add("AgentID", OSD.FromUUID(groupUpdatePacket.AgentData.AgentID)); - agentData.Add(agentDataMap); - body.Add("AgentData", agentData); - - OSDArray groupData = new OSDArray(); - - foreach (AgentGroupDataUpdatePacket.GroupDataBlock groupDataBlock in groupUpdatePacket.GroupData) - { - OSDMap groupDataMap = new OSDMap(); - groupDataMap.Add("ListInProfile", OSD.FromBoolean(false)); - groupDataMap.Add("GroupID", OSD.FromUUID(groupDataBlock.GroupID)); - groupDataMap.Add("GroupInsigniaID", OSD.FromUUID(groupDataBlock.GroupInsigniaID)); - groupDataMap.Add("Contribution", OSD.FromInteger(groupDataBlock.Contribution)); - groupDataMap.Add("GroupPowers", OSD.FromBinary(ulongToByteArray(groupDataBlock.GroupPowers))); - groupDataMap.Add("GroupName", OSD.FromString(Utils.BytesToString(groupDataBlock.GroupName))); - groupDataMap.Add("AcceptNotices", OSD.FromBoolean(groupDataBlock.AcceptNotices)); - - groupData.Add(groupDataMap); - - } - body.Add("GroupData", groupData); - groupUpdate.Add("body", body); - - return groupUpdate; - } - public static OSD GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data) { OSDArray AgentData = new OSDArray(1); diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 29c4d91518..22b11e6ea3 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -2756,51 +2756,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendGroupMembership(GroupMembershipData[] GroupMembership) { - // maybe removed in future, use SendAgentGroupDataUpdate instead ( but make sure to update groupPowers ) - AgentGroupDataUpdatePacket Groupupdate = new AgentGroupDataUpdatePacket(); - AgentGroupDataUpdatePacket.GroupDataBlock[] Groups = new AgentGroupDataUpdatePacket.GroupDataBlock[GroupMembership.Length]; - - lock(m_groupPowers) - { - m_groupPowers.Clear(); - - for (int i = 0; i < GroupMembership.Length; i++) - { - m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers; - - AgentGroupDataUpdatePacket.GroupDataBlock Group = new AgentGroupDataUpdatePacket.GroupDataBlock(); - Group.AcceptNotices = GroupMembership[i].AcceptNotices; - Group.Contribution = GroupMembership[i].Contribution; - Group.GroupID = GroupMembership[i].GroupID; - Group.GroupInsigniaID = GroupMembership[i].GroupPicture; - Group.GroupName = Util.StringToBytes256(GroupMembership[i].GroupName); - Group.GroupPowers = GroupMembership[i].GroupPowers; - Groups[i] = Group; - } - } - - Groupupdate.GroupData = Groups; - Groupupdate.AgentData = new AgentGroupDataUpdatePacket.AgentDataBlock(); - Groupupdate.AgentData.AgentID = AgentId; - - IEventQueue eq = Scene.RequestModuleInterface(); - try - { - if (eq != null) - { - eq.GroupMembership(Groupupdate, this.AgentId); - } - } - catch (Exception ex) - { - m_log.Error("Unable to send group membership data via eventqueue - exception: " + ex.ToString()); - m_log.Warn("sending group membership data via UDP"); - eq = null; - } - - if(eq == null) // udp if no eq - OutPacket(Groupupdate, ThrottleOutPacketType.Task); - + UpdateGroupMembership(GroupMembership); + SendAgentGroupDataUpdate(AgentId,GroupMembership); } public void SendPartPhysicsProprieties(ISceneEntity entity) @@ -11015,7 +10972,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (m_GroupsModule != null) { m_GroupsModule.ActivateGroup(this, activateGroupPacket.AgentData.GroupID); - m_GroupsModule.SendAgentGroupDataUpdate(this); } return true; diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs index 332d59c45d..6ed9a16c5b 100644 --- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs @@ -157,11 +157,6 @@ namespace OpenSim.Tests.Common AddEvent(avatarID, "ParcelProperties", parcelPropertiesMessage); } - public void GroupMembership (OpenMetaverse.Packets.AgentGroupDataUpdatePacket groupUpdate, UUID avatarID) - { - AddEvent(avatarID, "GroupMembership", groupUpdate); - } - public void GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data) { AddEvent(receiverAgent, "AgentGroupDataUpdate", data); From 07c8e79b0335437b5acbfdd040228015b1b1fb2f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 1 Jul 2016 19:32:14 +0100 Subject: [PATCH 05/14] missing file --- OpenSim/Region/Framework/Interfaces/IEventQueue.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs index f4014db897..4361310f34 100644 --- a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs +++ b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs @@ -58,7 +58,6 @@ namespace OpenSim.Region.Framework.Interfaces void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID fromAgent, UUID anotherAgent, bool canVoiceChat, bool isModerator, bool textMute); void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID); - void GroupMembership(AgentGroupDataUpdatePacket groupUpdate, UUID avatarID); void GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data); OSD ScriptRunningEvent(UUID objectID, UUID itemID, bool running, bool mono); OSD BuildEvent(string eventName, OSD eventBody); From 057bc648f3c30d3a82e075749eb0be1f33568084 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 1 Jul 2016 23:26:16 +0100 Subject: [PATCH 06/14] xmlrpcgroups: make use of a forgotten GetMemberGroupProfilemethod, put back xmlrpc cache since it is necessary to prevent folish viewers flooding --- .../Avatar/XmlRpcGroups/GroupsModule.cs | 5 +++- .../XmlRpcGroups/IGroupsServicesConnector.cs | 3 +- .../XmlRpcGroupsServicesConnectorModule.cs | 30 +++++++++++-------- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 27645e4da2..11f53dd311 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -785,6 +785,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); +/* GroupProfileData profile = new GroupProfileData(); @@ -813,7 +814,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups profile.MemberTitle = memberInfo.GroupTitle; profile.PowersMask = memberInfo.GroupPowers; } - +*/ + UUID agent = GetRequestingAgentID(remoteClient); + GroupProfileData profile = m_groupData.GetMemberGroupProfile(agent, groupID, agent); return profile; } diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs index 6b5b40a507..cff3212d5e 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs @@ -51,7 +51,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups /// GroupID may be specified instead, in which case this parmeter will be null. /// GroupRecord GetGroupRecord(UUID RequestingAgentID, UUID GroupID, string GroupName); - + GroupProfileData GetMemberGroupProfile(UUID requestingAgentID, UUID GroupID, UUID AgentID); + List FindGroups(UUID RequestingAgentID, string search); List GetGroupMembers(UUID RequestingAgentID, UUID GroupID); diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs index acb37f604e..2dda3a18bc 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs @@ -181,9 +181,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups m_cacheTimeout = groupsConfig.GetInt("GroupsCacheTimeout", 30); - // disable cache until it is fixed - m_cacheTimeout = 0; - if (m_cacheTimeout == 0) { m_log.WarnFormat("[XMLRPC-GROUPS-CONNECTOR]: Groups Cache Disabled."); @@ -385,10 +382,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups GroupMembershipData MemberInfo = GetAgentGroupMembership(requestingAgentID, AgentID, GroupID); GroupProfileData MemberGroupProfile = GroupProfileHashtableToGroupProfileData(respData); - - MemberGroupProfile.MemberTitle = MemberInfo.GroupTitle; - MemberGroupProfile.PowersMask = MemberInfo.GroupPowers; - + if(MemberInfo != null) + { + MemberGroupProfile.MemberTitle = MemberInfo.GroupTitle; + MemberGroupProfile.PowersMask = MemberInfo.GroupPowers; + } return MemberGroupProfile; } @@ -977,12 +975,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups try { - resp = req.Send(m_groupsServerURI, 30000); - - if ((m_cacheTimeout > 0) && (CacheKey != null)) - { - m_memoryCache.AddOrUpdate(CacheKey, resp, TimeSpan.FromSeconds(m_cacheTimeout)); - } + resp = req.Send(m_groupsServerURI); } catch (Exception e) { @@ -1004,12 +997,22 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups m_log.WarnFormat("[XMLRPC-GROUPS-CONNECTOR]: {0} :: {1}", key, param[key].ToString()); } } + + if ((m_cacheTimeout > 0) && (CacheKey != null)) + { + m_memoryCache.AddOrUpdate(CacheKey, resp, 10.0); + } Hashtable respData = new Hashtable(); respData.Add("error", e.ToString()); return respData; } } + if ((m_cacheTimeout > 0) && (CacheKey != null)) + { + m_memoryCache.AddOrUpdate(CacheKey, resp, TimeSpan.FromSeconds(m_cacheTimeout)); + } + if (resp.Value is Hashtable) { Hashtable respData = (Hashtable)resp.Value; @@ -1138,6 +1141,7 @@ namespace Nwc.XmlRpc request.ContentType = "text/xml"; request.AllowWriteStreamBuffering = true; request.KeepAlive = !_disableKeepAlive; + request.Timeout = 30000; using (Stream stream = request.GetRequestStream()) { From 7991bb08f163f3697c5ff87ebafcf78b8e19d3f6 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 2 Jul 2016 00:18:29 +0100 Subject: [PATCH 07/14] reduce absurd viewers blind retries of GroupProfileRequest --- .../ClientStack/Linden/UDP/LLClientView.cs | 93 +++++++++++-------- 1 file changed, 55 insertions(+), 38 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 22b11e6ea3..1dfd5b4c08 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -11096,11 +11096,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return true; } + + UUID lastGroupProfileRequestID = UUID.Zero; + double lastGroupProfileRequestTS = Util.GetTimeStampMS(); + private bool HandleGroupProfileRequest(IClientAPI sender, Packet Pack) { + if(m_GroupsModule == null) + return true; + GroupProfileRequestPacket groupProfileRequest = (GroupProfileRequestPacket)Pack; + #region Packet Session and User Check if (m_checkPackets) { @@ -11110,50 +11118,59 @@ namespace OpenSim.Region.ClientStack.LindenUDP } #endregion - if (m_GroupsModule != null) + UUID grpID = groupProfileRequest.GroupData.GroupID; + double ts = Util.GetTimeStampMS(); + if(grpID == lastGroupProfileRequestID && ts - lastGroupProfileRequestTS < 10000) + return true; + + lastGroupProfileRequestID = grpID; + lastGroupProfileRequestTS = ts; + + GroupProfileReplyPacket groupProfileReply = (GroupProfileReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupProfileReply); + + groupProfileReply.AgentData = new GroupProfileReplyPacket.AgentDataBlock(); + groupProfileReply.GroupData = new GroupProfileReplyPacket.GroupDataBlock(); + groupProfileReply.AgentData.AgentID = AgentId; + + GroupProfileData d = m_GroupsModule.GroupProfileRequest(this, + groupProfileRequest.GroupData.GroupID); + + groupProfileReply.GroupData.GroupID = d.GroupID; + groupProfileReply.GroupData.Name = Util.StringToBytes256(d.Name); + groupProfileReply.GroupData.Charter = Util.StringToBytes1024(d.Charter); + groupProfileReply.GroupData.ShowInList = d.ShowInList; + groupProfileReply.GroupData.MemberTitle = Util.StringToBytes256(d.MemberTitle); + groupProfileReply.GroupData.PowersMask = d.PowersMask; + groupProfileReply.GroupData.InsigniaID = d.InsigniaID; + groupProfileReply.GroupData.FounderID = d.FounderID; + groupProfileReply.GroupData.MembershipFee = d.MembershipFee; + groupProfileReply.GroupData.OpenEnrollment = d.OpenEnrollment; + groupProfileReply.GroupData.Money = d.Money; + groupProfileReply.GroupData.GroupMembershipCount = d.GroupMembershipCount; + groupProfileReply.GroupData.GroupRolesCount = d.GroupRolesCount; + groupProfileReply.GroupData.AllowPublish = d.AllowPublish; + groupProfileReply.GroupData.MaturePublish = d.MaturePublish; + groupProfileReply.GroupData.OwnerRole = d.OwnerRole; + + Scene scene = (Scene)m_scene; + if (scene.Permissions.IsGod(sender.AgentId) && (!sender.IsGroupMember(groupProfileRequest.GroupData.GroupID))) { - GroupProfileReplyPacket groupProfileReply = (GroupProfileReplyPacket)PacketPool.Instance.GetPacket(PacketType.GroupProfileReply); - - groupProfileReply.AgentData = new GroupProfileReplyPacket.AgentDataBlock(); - groupProfileReply.GroupData = new GroupProfileReplyPacket.GroupDataBlock(); - groupProfileReply.AgentData.AgentID = AgentId; - - GroupProfileData d = m_GroupsModule.GroupProfileRequest(this, - groupProfileRequest.GroupData.GroupID); - - groupProfileReply.GroupData.GroupID = d.GroupID; - groupProfileReply.GroupData.Name = Util.StringToBytes256(d.Name); - groupProfileReply.GroupData.Charter = Util.StringToBytes1024(d.Charter); - groupProfileReply.GroupData.ShowInList = d.ShowInList; - groupProfileReply.GroupData.MemberTitle = Util.StringToBytes256(d.MemberTitle); - groupProfileReply.GroupData.PowersMask = d.PowersMask; - groupProfileReply.GroupData.InsigniaID = d.InsigniaID; - groupProfileReply.GroupData.FounderID = d.FounderID; - groupProfileReply.GroupData.MembershipFee = d.MembershipFee; - groupProfileReply.GroupData.OpenEnrollment = d.OpenEnrollment; - groupProfileReply.GroupData.Money = d.Money; - groupProfileReply.GroupData.GroupMembershipCount = d.GroupMembershipCount; - groupProfileReply.GroupData.GroupRolesCount = d.GroupRolesCount; - groupProfileReply.GroupData.AllowPublish = d.AllowPublish; - groupProfileReply.GroupData.MaturePublish = d.MaturePublish; - groupProfileReply.GroupData.OwnerRole = d.OwnerRole; - - Scene scene = (Scene)m_scene; - if (scene.Permissions.IsGod(sender.AgentId) && (!sender.IsGroupMember(groupProfileRequest.GroupData.GroupID))) + ScenePresence p; + if (scene.TryGetScenePresence(sender.AgentId, out p)) { - ScenePresence p; - if (scene.TryGetScenePresence(sender.AgentId, out p)) + if (p.GodLevel >= 200) { - if (p.GodLevel >= 200) - { - groupProfileReply.GroupData.OpenEnrollment = true; - groupProfileReply.GroupData.MembershipFee = 0; - } + groupProfileReply.GroupData.OpenEnrollment = true; + groupProfileReply.GroupData.MembershipFee = 0; } } - - OutPacket(groupProfileReply, ThrottleOutPacketType.Task); } + + OutPacket(groupProfileReply, ThrottleOutPacketType.Task); + + if(grpID == lastGroupProfileRequestID) + lastGroupProfileRequestTS = Util.GetTimeStampMS() - 7000; + return true; } private bool HandleGroupMembersRequest(IClientAPI sender, Packet Pack) From cd34f978fb6603885a54a24b0513f2d45b749282 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 2 Jul 2016 01:01:29 +0100 Subject: [PATCH 08/14] revert to previus GroupProfileRequest because floatsam groups server seems to return wrong values for GroupMembershipCount and GroupRolesCount. this should be fixed because we are getting the full lists just to count number of entries --- .../OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 11f53dd311..cb6ceb5dfc 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -785,10 +785,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); -/* GroupProfileData profile = new GroupProfileData(); - GroupRecord groupInfo = m_groupData.GetGroupRecord(GetRequestingAgentID(remoteClient), groupID, null); if (groupInfo != null) { @@ -814,9 +812,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups profile.MemberTitle = memberInfo.GroupTitle; profile.PowersMask = memberInfo.GroupPowers; } -*/ +/* + this should save xmlrpc calls, but seems to return wrong GroupMembershipCount and GroupRolesCount UUID agent = GetRequestingAgentID(remoteClient); GroupProfileData profile = m_groupData.GetMemberGroupProfile(agent, groupID, agent); +*/ return profile; } From a6ee06d630f7dfb896129d24b8443cb2d84608f3 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 2 Jul 2016 13:53:17 +0100 Subject: [PATCH 09/14] dont send bad profiles to viewer --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 1dfd5b4c08..4a48a80645 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -11135,6 +11135,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP GroupProfileData d = m_GroupsModule.GroupProfileRequest(this, groupProfileRequest.GroupData.GroupID); + if(d.GroupID == UUID.Zero) // don't send broken data + return true; + groupProfileReply.GroupData.GroupID = d.GroupID; groupProfileReply.GroupData.Name = Util.StringToBytes256(d.Name); groupProfileReply.GroupData.Charter = Util.StringToBytes1024(d.Charter); From a443dcce8974a8ed197ad144599050f75e6aee25 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 3 Jul 2016 10:22:14 +0100 Subject: [PATCH 10/14] try to place avatars on a nicer location, when they arrive into a banned parcel --- OpenSim/Region/Framework/Scenes/Scene.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a75b460cd2..5290abb8c7 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4309,14 +4309,14 @@ namespace OpenSim.Region.Framework.Scenes if (banned || restricted) { ILandObject nearestParcel = GetNearestAllowedParcel(agentID, posX, posY); + Vector2? newPosition = null; if (nearestParcel != null) { //Move agent to nearest allowed - Vector2 newPosition = GetParcelSafeCorner(nearestParcel); - posX = newPosition.X; - posY = newPosition.Y; +// Vector2 newPosition = GetParcelSafeCorner(nearestParcel); + newPosition = nearestParcel.GetNearestPoint(new Vector3(posX, posY,0)); } - else + if(newPosition == null) { if (banned) { @@ -4329,6 +4329,11 @@ namespace OpenSim.Region.Framework.Scenes } return false; } + else + { + posX = newPosition.Value.X; + posY = newPosition.Value.Y; + } } reason = ""; return true; From 42dd02fc321a52179dda89a49d4bee2e9c18be45 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 3 Jul 2016 15:47:20 +0100 Subject: [PATCH 11/14] scale down position X and Y acording to region size on sending coarse Updates. Viewers need to scale up by same amount. --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index f9f795f0b4..90ee1d19f2 100755 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -242,6 +242,19 @@ namespace OpenSim.Region.Framework.Scenes coarseLocations = new List(); avatarUUIDs = new List(); + // coarse locations are sent as BYTE, so limited to the 255m max of normal regions + // try to work around that scale down X and Y acording to region size, so reducing the resolution + // + // viewers need to scale up + float scaleX = m_parentScene.RegionInfo.RegionSizeX / Constants.RegionSize; + if (scaleX == 0) + scaleX = 1.0f; + scaleX = 1.0f / scaleX; + float scaleY = m_parentScene.RegionInfo.RegionSizeY / Constants.RegionSize; + if (scaleY == 0) + scaleY = 1.0f; + scaleY = 1.0f / scaleY; + List presences = GetScenePresences(); for (int i = 0; i < Math.Min(presences.Count, maxLocations); ++i) { @@ -250,9 +263,11 @@ namespace OpenSim.Region.Framework.Scenes // If this presence is a child agent, we don't want its coarse locations if (sp.IsChildAgent) continue; + Vector3 pos = sp.AbsolutePosition; + pos.X *= scaleX; + pos.Y *= scaleY; - coarseLocations.Add(sp.AbsolutePosition); - + coarseLocations.Add(pos); avatarUUIDs.Add(sp.UUID); } } From 58135ef52c4b03041405bf94cb4b563e7baaea5c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 3 Jul 2016 19:39:13 +0100 Subject: [PATCH 12/14] fix a lost region size of 256m --- .../CoreModules/World/Permissions/PermissionsModule.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index c83454e626..303f8a8899 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -1303,7 +1303,11 @@ namespace OpenSim.Region.CoreModules.World.Permissions DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; - if ((newPoint.X > 257f || newPoint.X < -1f || newPoint.Y > 257f || newPoint.Y < -1f)) + + // allow outide region?? + if (newPoint.X < -1f || newPoint.Y < -1f) + return true; + if (newPoint.X > scene.RegionInfo.RegionSizeX + 1.0f || newPoint.Y > scene.RegionInfo.RegionSizeY + 1.0f) { return true; } From b3d8e35d67f40821ece0ffac5d3e46a7155b0a9e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 3 Jul 2016 19:49:53 +0100 Subject: [PATCH 13/14] dont try to check CanObjectEntry on a attachment in llSetPos() --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 32b3bb7ba0..064eb0a993 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2680,7 +2680,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (part.ParentGroup.RootPart == part) { SceneObjectGroup parent = part.ParentGroup; - if (!World.Permissions.CanObjectEntry(parent.UUID, false, (Vector3)toPos)) + if (!parent.IsAttachment && !World.Permissions.CanObjectEntry(parent.UUID, false, (Vector3)toPos)) return; parent.UpdateGroupPosition((Vector3)toPos); } From e00603f78ad10b86abf25b432f6ebfea38506b34 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 3 Jul 2016 12:17:19 -0700 Subject: [PATCH 14/14] New config var: DisableObjectTransfer. If set to True, objects never cross; instead they stay in the region, possibly placed outside its borders. --- OpenSim/Region/Framework/Scenes/Scene.cs | 7 +++++++ OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 1 + bin/OpenSimDefaults.ini | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5290abb8c7..0d19e94582 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -250,6 +250,12 @@ namespace OpenSim.Region.Framework.Scenes /// public int m_linksetPhysCapacity = 0; + /// + /// When placed outside the region's border, do we transfer the objects or + /// do we keep simulating them here? + /// + public bool DisableObjectTransfer { get; set; } + public bool m_useFlySlow; public bool m_useTrashOnDelete = true; @@ -1155,6 +1161,7 @@ namespace OpenSim.Region.Framework.Scenes if (entityTransferConfig != null) { AllowAvatarCrossing = entityTransferConfig.GetBoolean("AllowAvatarCrossing", AllowAvatarCrossing); + DisableObjectTransfer = entityTransferConfig.GetBoolean("DisableObjectTransfer", false); } #region Interest Management diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index e226196fb9..cb1bf55ebd 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -556,6 +556,7 @@ namespace OpenSim.Region.Framework.Scenes && !Scene.PositionIsInCurrentRegion(val) && !IsAttachmentCheckFull() && !Scene.LoadingPrims + && !Scene.DisableObjectTransfer ) { if (!inTransit) diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index a55d76275d..841a761a54 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -800,6 +800,10 @@ ; Allow avatars to cross into and out of the region. AllowAvatarCrossing = true + ; This disables border transfers for objects. When true, objects can be placed outside + ; the region's border without being transferred to another simulator. + DisableObjectTransfer = false + ; Minimum user level required for HyperGrid teleports LevelHGTeleport = 0