From e9153e1d1aae50024d8cd05fe14a9bce34343a0e Mon Sep 17 00:00:00 2001 From: teravus Date: Thu, 15 Nov 2012 10:05:16 -0500 Subject: Revert "Merge master into teravuswork", it should have been avination, not master. This reverts commit dfac269032300872c4d0dc507f4f9062d102b0f4, reversing changes made to 619c39e5144f15aca129d6d999bcc5c34133ee64. --- .../Avatar/Attachments/AttachmentsCommandModule.cs | 2 +- .../Avatar/Attachments/TempAttachmentsModule.cs | 18 ++--- .../OptionalModules/Avatar/Chat/IRCConnector.cs | 6 +- .../Avatar/Concierge/ConciergeModule.cs | 5 +- .../Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | 2 +- .../Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs | 2 +- .../Avatar/XmlRpcGroups/GroupsMessagingModule.cs | 84 ++-------------------- .../Avatar/XmlRpcGroups/GroupsModule.cs | 29 -------- 8 files changed, 24 insertions(+), 124 deletions(-) (limited to 'OpenSim/Region/OptionalModules/Avatar') diff --git a/OpenSim/Region/OptionalModules/Avatar/Attachments/AttachmentsCommandModule.cs b/OpenSim/Region/OptionalModules/Avatar/Attachments/AttachmentsCommandModule.cs index 68bcb4a..d68aabc 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Attachments/AttachmentsCommandModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Attachments/AttachmentsCommandModule.cs @@ -146,7 +146,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments sb.AppendFormat("Attachments for {0}\n", sp.Name); ConsoleDisplayTable ct = new ConsoleDisplayTable() { Indent = 2 }; - ct.Columns.Add(new ConsoleDisplayTableColumn("Attachment Name", 50)); + ct.Columns.Add(new ConsoleDisplayTableColumn("Attachment Name", 36)); ct.Columns.Add(new ConsoleDisplayTableColumn("Local ID", 10)); ct.Columns.Add(new ConsoleDisplayTableColumn("Item ID", 36)); ct.Columns.Add(new ConsoleDisplayTableColumn("Attach Point", 14)); diff --git a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs index 17971e3..31d0034 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs @@ -130,37 +130,37 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments SendConsoleOutput(agentID, String.Format("auto_grant_attach_perms set to {0}", val)); } - private int llAttachToAvatarTemp(UUID host, UUID script, int attachmentPoint) + private void llAttachToAvatarTemp(UUID host, UUID script, int attachmentPoint) { SceneObjectPart hostPart = m_scene.GetSceneObjectPart(host); if (hostPart == null) - return 0; + return; if (hostPart.ParentGroup.IsAttachment) - return 0; + return; IAttachmentsModule attachmentsModule = m_scene.RequestModuleInterface(); if (attachmentsModule == null) - return 0; + return; TaskInventoryItem item = hostPart.Inventory.GetInventoryItem(script); if (item == null) - return 0; + return; if ((item.PermsMask & 32) == 0) // PERMISSION_ATTACH - return 0; + return; ScenePresence target; if (!m_scene.TryGetScenePresence(item.PermsGranter, out target)) - return 0; + return; if (target.UUID != hostPart.ParentGroup.OwnerID) { uint effectivePerms = hostPart.ParentGroup.GetEffectivePermissions(); if ((effectivePerms & (uint)PermissionMask.Transfer) == 0) - return 0; + return; hostPart.ParentGroup.SetOwnerId(target.UUID); hostPart.ParentGroup.SetRootPartOwner(hostPart.ParentGroup.RootPart, target.UUID, target.ControllingClient.ActiveGroupId); @@ -183,7 +183,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments hostPart.ParentGroup.RootPart.ScheduleFullUpdate(); } - return attachmentsModule.AttachObject(target, hostPart.ParentGroup, (uint)attachmentPoint, false, true, true) ? 1 : 0; + attachmentsModule.AttachObject(target, hostPart.ParentGroup, (uint)attachmentPoint, false, true, true); } } } diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs index a014798..ca956fb 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs @@ -231,12 +231,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat if (m_server == null || m_baseNick == null || m_ircChannel == null || m_user == null) throw new Exception("Invalid connector configuration"); - // Generate an initial nickname + // Generate an initial nickname if randomizing is enabled if (m_randomizeNick) + { m_nick = m_baseNick + Util.RandomClass.Next(1, 99); - else - m_nick = m_baseNick; + } m_log.InfoFormat("[IRC-Connector-{0}]: Initialization complete", idn); diff --git a/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs b/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs index 5c3be29..e22618d 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs @@ -546,9 +546,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge c.SenderUUID = UUID.Zero; c.Scene = agent.Scene; - agent.ControllingClient.SendChatMessage( - msg, (byte) ChatTypeEnum.Say, PosOfGod, m_whoami, UUID.Zero, UUID.Zero, - (byte)ChatSourceType.Object, (byte)ChatAudibleLevel.Fully); + agent.ControllingClient.SendChatMessage(msg, (byte) ChatTypeEnum.Say, PosOfGod, m_whoami, UUID.Zero, + (byte)ChatSourceType.Object, (byte)ChatAudibleLevel.Fully); } private static void checkStringParameters(XmlRpcRequest request, string[] param) diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs index f292a75..7b20446 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs @@ -447,7 +447,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice // settings allow voice, then whether parcel allows // voice, if all do retrieve or obtain the parcel // voice channel - LandData land = scene.GetLandData(avatar.AbsolutePosition); + LandData land = scene.GetLandData(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); //m_log.DebugFormat("[FreeSwitchVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": request: {4}, path: {5}, param: {6}", // scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, request, path, param); diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs index 8a8a31c..a30a38d 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs @@ -623,7 +623,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice // settings allow voice, then whether parcel allows // voice, if all do retrieve or obtain the parcel // voice channel - LandData land = scene.GetLandData(avatar.AbsolutePosition); + LandData land = scene.GetLandData(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); // m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": request: {4}, path: {5}, param: {6}", // scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, request, path, param); diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs index 1528330..10b83e6 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs @@ -27,7 +27,6 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Reflection; using log4net; using Mono.Addins; @@ -37,8 +36,6 @@ using OpenMetaverse.StructuredData; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; -using OpenSim.Services.Interfaces; -using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo; namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { @@ -48,7 +45,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private List m_sceneList = new List(); - private IPresenceService m_presenceService; private IMessageTransferModule m_msgTransferModule = null; @@ -58,27 +54,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups private bool m_groupMessagingEnabled = false; private bool m_debugEnabled = true; - /// - /// If enabled, module only tries to send group IMs to online users by querying cached presence information. - /// - private bool m_messageOnlineAgentsOnly; - - /// - /// Cache for online users. - /// - /// - /// Group ID is key, presence information for online members is value. - /// Will only be non-null if m_messageOnlineAgentsOnly = true - /// We cache here so that group messages don't constantly have to re-request the online user list to avoid - /// attempted expensive sending of messages to offline users. - /// The tradeoff is that a user that comes online will not receive messages consistently from all other users - /// until caches have updated. - /// Therefore, we set the cache expiry to just 20 seconds. - /// - private ExpiringCache m_usersOnlineCache; - - private int m_usersOnlineCacheExpirySeconds = 20; - #region IRegionModuleBase Members public void Initialise(IConfigSource config) @@ -108,17 +83,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups return; } - m_messageOnlineAgentsOnly = groupsConfig.GetBoolean("MessageOnlineUsersOnly", false); - - if (m_messageOnlineAgentsOnly) - m_usersOnlineCache = new ExpiringCache(); - m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", true); } - m_log.InfoFormat( - "[GROUPS-MESSAGING]: GroupsMessagingModule enabled with MessageOnlineOnly = {0}, DebugEnabled = {1}", - m_messageOnlineAgentsOnly, m_debugEnabled); + m_log.Info("[GROUPS-MESSAGING]: GroupsMessagingModule starting up"); } public void AddRegion(Scene scene) @@ -158,8 +126,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups return; } - if (m_presenceService == null) - m_presenceService = scene.PresenceService; m_sceneList.Add(scene); @@ -241,42 +207,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups public void SendMessageToGroup(GridInstantMessage im, UUID groupID) { List groupMembers = m_groupData.GetGroupMembers(new UUID(im.fromAgentID), groupID); - int groupMembersCount = groupMembers.Count; - - if (m_messageOnlineAgentsOnly) - { - string[] t1 = groupMembers.ConvertAll(gmd => gmd.AgentID.ToString()).ToArray(); - - // We cache in order not to overwhlem the presence service on large grids with many groups. This does - // mean that members coming online will not see all group members until after m_usersOnlineCacheExpirySeconds has elapsed. - // (assuming this is the same across all grid simulators). - PresenceInfo[] onlineAgents; - if (!m_usersOnlineCache.TryGetValue(groupID, out onlineAgents)) - { - onlineAgents = m_presenceService.GetAgents(t1); - m_usersOnlineCache.Add(groupID, onlineAgents, m_usersOnlineCacheExpirySeconds); - } - - HashSet onlineAgentsUuidSet = new HashSet(); - Array.ForEach(onlineAgents, pi => onlineAgentsUuidSet.Add(pi.UserID)); - - groupMembers = groupMembers.Where(gmd => onlineAgentsUuidSet.Contains(gmd.AgentID.ToString())).ToList(); - - // if (m_debugEnabled) -// m_log.DebugFormat( -// "[GROUPS-MESSAGING]: SendMessageToGroup called for group {0} with {1} visible members, {2} online", -// groupID, groupMembersCount, groupMembers.Count()); - } - else - { - if (m_debugEnabled) - m_log.DebugFormat( - "[GROUPS-MESSAGING]: SendMessageToGroup called for group {0} with {1} visible members", - groupID, groupMembers.Count); - } - - int requestStartTick = Environment.TickCount; - + + if (m_debugEnabled) + m_log.DebugFormat( + "[GROUPS-MESSAGING]: SendMessageToGroup called for group {0} with {1} visible members", + groupID, groupMembers.Count); + foreach (GroupMembersData member in groupMembers) { if (m_groupData.hasAgentDroppedGroupChatSession(member.AgentID, groupID)) @@ -318,12 +254,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups ProcessMessageFromGroupSession(msg); } } - - // Temporary for assessing how long it still takes to send messages to large online groups. - if (m_messageOnlineAgentsOnly) - m_log.DebugFormat( - "[GROUPS-MESSAGING]: SendMessageToGroup for group {0} with {1} visible members, {2} online took {3}ms", - groupID, groupMembersCount, groupMembers.Count(), Environment.TickCount - requestStartTick); } #region SimGridEventHandlers diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 79e9994..65bd26c 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -123,36 +123,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups public void AddRegion(Scene scene) { if (m_groupsEnabled) - { scene.RegisterModuleInterface(this); - scene.AddCommand( - "debug", - this, - "debug groups verbose", - "debug groups verbose ", - "This setting turns on very verbose groups debugging", - HandleDebugGroupsVerbose); - } - } - - private void HandleDebugGroupsVerbose(object modules, string[] args) - { - if (args.Length < 4) - { - MainConsole.Instance.Output("Usage: debug groups verbose "); - return; - } - - bool verbose = false; - if (!bool.TryParse(args[3], out verbose)) - { - MainConsole.Instance.Output("Usage: debug groups verbose "); - return; - } - - m_debugEnabled = verbose; - - MainConsole.Instance.OutputFormat("{0} verbose logging set to {1}", Name, m_debugEnabled); } public void RegionLoaded(Scene scene) -- cgit v1.1