diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs index ccd4da6424..1afdd0fba3 100644 --- a/OpenSim/Addons/Groups/GroupsModule.cs +++ b/OpenSim/Addons/Groups/GroupsModule.cs @@ -1276,13 +1276,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/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/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 cc2d1e212d..4a48a80645 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -2755,44 +2755,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendGroupMembership(GroupMembershipData[] GroupMembership) { - m_groupPowers.Clear(); - AgentGroupDataUpdatePacket Groupupdate = new AgentGroupDataUpdatePacket(); - AgentGroupDataUpdatePacket.GroupDataBlock[] Groups = new AgentGroupDataUpdatePacket.GroupDataBlock[GroupMembership.Length]; - 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; - //OutPacket(Groupupdate, ThrottleOutPacketType.Task); - - try - { - IEventQueue eq = Scene.RequestModuleInterface(); - 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"); - OutPacket(Groupupdate, ThrottleOutPacketType.Task); - } + UpdateGroupMembership(GroupMembership); + SendAgentGroupDataUpdate(AgentId,GroupMembership); } public void SendPartPhysicsProprieties(ISceneEntity entity) @@ -3423,41 +3388,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) @@ -5642,9 +5601,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; } @@ -11011,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; @@ -11136,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) { @@ -11150,50 +11118,62 @@ 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); + + 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); + 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) @@ -12955,23 +12935,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/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 8c1a62867f..06900f06b4 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -1302,7 +1302,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; } 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); diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a75b460cd2..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 @@ -4309,14 +4316,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 +4336,11 @@ namespace OpenSim.Region.Framework.Scenes } return false; } + else + { + posX = newPosition.Value.X; + posY = newPosition.Value.Y; + } } reason = ""; return true; 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); } } 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/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/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index ec34e39b90..ddeac6689a 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -786,7 +786,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups GroupProfileData profile = new GroupProfileData(); - GroupRecord groupInfo = m_groupData.GetGroupRecord(GetRequestingAgentID(remoteClient), groupID, null); if (groupInfo != null) { @@ -812,7 +811,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; } @@ -1407,13 +1410,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups 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.UpdateGroupMembership(membershipArray); - remoteClient.RefreshGroupMembership(); + remoteClient.SendAgentGroupDataUpdate(agentID, membershipArray); } /// 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()) { 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/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); } 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() { } 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); 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