diff options
author | teravus | 2012-11-15 10:05:16 -0500 |
---|---|---|
committer | teravus | 2012-11-15 10:05:16 -0500 |
commit | e9153e1d1aae50024d8cd05fe14a9bce34343a0e (patch) | |
tree | bc111d34f95a26b99c7e34d9e495dc14d1802cc3 /OpenSim/Region/OptionalModules | |
parent | Merge master into teravuswork (diff) | |
download | opensim-SC-e9153e1d1aae50024d8cd05fe14a9bce34343a0e.zip opensim-SC-e9153e1d1aae50024d8cd05fe14a9bce34343a0e.tar.gz opensim-SC-e9153e1d1aae50024d8cd05fe14a9bce34343a0e.tar.bz2 opensim-SC-e9153e1d1aae50024d8cd05fe14a9bce34343a0e.tar.xz |
Revert "Merge master into teravuswork", it should have been avination, not master.
This reverts commit dfac269032300872c4d0dc507f4f9062d102b0f4, reversing
changes made to 619c39e5144f15aca129d6d999bcc5c34133ee64.
Diffstat (limited to '')
17 files changed, 56 insertions, 237 deletions
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 254eeb4..28b8293 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -891,10 +891,10 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
891 | 891 | ||
892 | public void Close() | 892 | public void Close() |
893 | { | 893 | { |
894 | Close(true, false); | 894 | Close(true); |
895 | } | 895 | } |
896 | 896 | ||
897 | public void Close(bool sendStop, bool force) | 897 | public void Close(bool sendStop) |
898 | { | 898 | { |
899 | Disconnect(); | 899 | Disconnect(); |
900 | } | 900 | } |
@@ -959,8 +959,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
959 | 959 | ||
960 | } | 960 | } |
961 | 961 | ||
962 | public void SendChatMessage( | 962 | public void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, byte source, byte audible) |
963 | string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, UUID ownerID, byte source, byte audible) | ||
964 | { | 963 | { |
965 | if (audible > 0 && message.Length > 0) | 964 | if (audible > 0 && message.Length > 0) |
966 | IRC_SendChannelPrivmsg(fromName, message); | 965 | IRC_SendChannelPrivmsg(fromName, message); |
diff --git a/OpenSim/Region/OptionalModules/Asset/AssetInfoModule.cs b/OpenSim/Region/OptionalModules/Asset/AssetInfoModule.cs index 7639c6c..41ec14f 100644 --- a/OpenSim/Region/OptionalModules/Asset/AssetInfoModule.cs +++ b/OpenSim/Region/OptionalModules/Asset/AssetInfoModule.cs | |||
@@ -127,9 +127,6 @@ namespace OpenSim.Region.OptionalModules.Asset | |||
127 | } | 127 | } |
128 | 128 | ||
129 | string fileName = rawAssetId; | 129 | string fileName = rawAssetId; |
130 | |||
131 | if (!ConsoleUtil.CheckFileDoesNotExist(MainConsole.Instance, fileName)) | ||
132 | return; | ||
133 | 130 | ||
134 | using (FileStream fs = new FileStream(fileName, FileMode.CreateNew)) | 131 | using (FileStream fs = new FileStream(fileName, FileMode.CreateNew)) |
135 | { | 132 | { |
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 | |||
146 | sb.AppendFormat("Attachments for {0}\n", sp.Name); | 146 | sb.AppendFormat("Attachments for {0}\n", sp.Name); |
147 | 147 | ||
148 | ConsoleDisplayTable ct = new ConsoleDisplayTable() { Indent = 2 }; | 148 | ConsoleDisplayTable ct = new ConsoleDisplayTable() { Indent = 2 }; |
149 | ct.Columns.Add(new ConsoleDisplayTableColumn("Attachment Name", 50)); | 149 | ct.Columns.Add(new ConsoleDisplayTableColumn("Attachment Name", 36)); |
150 | ct.Columns.Add(new ConsoleDisplayTableColumn("Local ID", 10)); | 150 | ct.Columns.Add(new ConsoleDisplayTableColumn("Local ID", 10)); |
151 | ct.Columns.Add(new ConsoleDisplayTableColumn("Item ID", 36)); | 151 | ct.Columns.Add(new ConsoleDisplayTableColumn("Item ID", 36)); |
152 | ct.Columns.Add(new ConsoleDisplayTableColumn("Attach Point", 14)); | 152 | 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 | |||
130 | SendConsoleOutput(agentID, String.Format("auto_grant_attach_perms set to {0}", val)); | 130 | SendConsoleOutput(agentID, String.Format("auto_grant_attach_perms set to {0}", val)); |
131 | } | 131 | } |
132 | 132 | ||
133 | private int llAttachToAvatarTemp(UUID host, UUID script, int attachmentPoint) | 133 | private void llAttachToAvatarTemp(UUID host, UUID script, int attachmentPoint) |
134 | { | 134 | { |
135 | SceneObjectPart hostPart = m_scene.GetSceneObjectPart(host); | 135 | SceneObjectPart hostPart = m_scene.GetSceneObjectPart(host); |
136 | 136 | ||
137 | if (hostPart == null) | 137 | if (hostPart == null) |
138 | return 0; | 138 | return; |
139 | 139 | ||
140 | if (hostPart.ParentGroup.IsAttachment) | 140 | if (hostPart.ParentGroup.IsAttachment) |
141 | return 0; | 141 | return; |
142 | 142 | ||
143 | IAttachmentsModule attachmentsModule = m_scene.RequestModuleInterface<IAttachmentsModule>(); | 143 | IAttachmentsModule attachmentsModule = m_scene.RequestModuleInterface<IAttachmentsModule>(); |
144 | if (attachmentsModule == null) | 144 | if (attachmentsModule == null) |
145 | return 0; | 145 | return; |
146 | 146 | ||
147 | TaskInventoryItem item = hostPart.Inventory.GetInventoryItem(script); | 147 | TaskInventoryItem item = hostPart.Inventory.GetInventoryItem(script); |
148 | if (item == null) | 148 | if (item == null) |
149 | return 0; | 149 | return; |
150 | 150 | ||
151 | if ((item.PermsMask & 32) == 0) // PERMISSION_ATTACH | 151 | if ((item.PermsMask & 32) == 0) // PERMISSION_ATTACH |
152 | return 0; | 152 | return; |
153 | 153 | ||
154 | ScenePresence target; | 154 | ScenePresence target; |
155 | if (!m_scene.TryGetScenePresence(item.PermsGranter, out target)) | 155 | if (!m_scene.TryGetScenePresence(item.PermsGranter, out target)) |
156 | return 0; | 156 | return; |
157 | 157 | ||
158 | if (target.UUID != hostPart.ParentGroup.OwnerID) | 158 | if (target.UUID != hostPart.ParentGroup.OwnerID) |
159 | { | 159 | { |
160 | uint effectivePerms = hostPart.ParentGroup.GetEffectivePermissions(); | 160 | uint effectivePerms = hostPart.ParentGroup.GetEffectivePermissions(); |
161 | 161 | ||
162 | if ((effectivePerms & (uint)PermissionMask.Transfer) == 0) | 162 | if ((effectivePerms & (uint)PermissionMask.Transfer) == 0) |
163 | return 0; | 163 | return; |
164 | 164 | ||
165 | hostPart.ParentGroup.SetOwnerId(target.UUID); | 165 | hostPart.ParentGroup.SetOwnerId(target.UUID); |
166 | hostPart.ParentGroup.SetRootPartOwner(hostPart.ParentGroup.RootPart, target.UUID, target.ControllingClient.ActiveGroupId); | 166 | hostPart.ParentGroup.SetRootPartOwner(hostPart.ParentGroup.RootPart, target.UUID, target.ControllingClient.ActiveGroupId); |
@@ -183,7 +183,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments | |||
183 | hostPart.ParentGroup.RootPart.ScheduleFullUpdate(); | 183 | hostPart.ParentGroup.RootPart.ScheduleFullUpdate(); |
184 | } | 184 | } |
185 | 185 | ||
186 | return attachmentsModule.AttachObject(target, hostPart.ParentGroup, (uint)attachmentPoint, false, true, true) ? 1 : 0; | 186 | attachmentsModule.AttachObject(target, hostPart.ParentGroup, (uint)attachmentPoint, false, true, true); |
187 | } | 187 | } |
188 | } | 188 | } |
189 | } | 189 | } |
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 | |||
231 | if (m_server == null || m_baseNick == null || m_ircChannel == null || m_user == null) | 231 | if (m_server == null || m_baseNick == null || m_ircChannel == null || m_user == null) |
232 | throw new Exception("Invalid connector configuration"); | 232 | throw new Exception("Invalid connector configuration"); |
233 | 233 | ||
234 | // Generate an initial nickname | 234 | // Generate an initial nickname if randomizing is enabled |
235 | 235 | ||
236 | if (m_randomizeNick) | 236 | if (m_randomizeNick) |
237 | { | ||
237 | m_nick = m_baseNick + Util.RandomClass.Next(1, 99); | 238 | m_nick = m_baseNick + Util.RandomClass.Next(1, 99); |
238 | else | 239 | } |
239 | m_nick = m_baseNick; | ||
240 | 240 | ||
241 | m_log.InfoFormat("[IRC-Connector-{0}]: Initialization complete", idn); | 241 | m_log.InfoFormat("[IRC-Connector-{0}]: Initialization complete", idn); |
242 | 242 | ||
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 | |||
546 | c.SenderUUID = UUID.Zero; | 546 | c.SenderUUID = UUID.Zero; |
547 | c.Scene = agent.Scene; | 547 | c.Scene = agent.Scene; |
548 | 548 | ||
549 | agent.ControllingClient.SendChatMessage( | 549 | agent.ControllingClient.SendChatMessage(msg, (byte) ChatTypeEnum.Say, PosOfGod, m_whoami, UUID.Zero, |
550 | msg, (byte) ChatTypeEnum.Say, PosOfGod, m_whoami, UUID.Zero, UUID.Zero, | 550 | (byte)ChatSourceType.Object, (byte)ChatAudibleLevel.Fully); |
551 | (byte)ChatSourceType.Object, (byte)ChatAudibleLevel.Fully); | ||
552 | } | 551 | } |
553 | 552 | ||
554 | private static void checkStringParameters(XmlRpcRequest request, string[] param) | 553 | 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 | |||
447 | // settings allow voice, then whether parcel allows | 447 | // settings allow voice, then whether parcel allows |
448 | // voice, if all do retrieve or obtain the parcel | 448 | // voice, if all do retrieve or obtain the parcel |
449 | // voice channel | 449 | // voice channel |
450 | LandData land = scene.GetLandData(avatar.AbsolutePosition); | 450 | LandData land = scene.GetLandData(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); |
451 | 451 | ||
452 | //m_log.DebugFormat("[FreeSwitchVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": request: {4}, path: {5}, param: {6}", | 452 | //m_log.DebugFormat("[FreeSwitchVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": request: {4}, path: {5}, param: {6}", |
453 | // scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, request, path, param); | 453 | // 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 | |||
623 | // settings allow voice, then whether parcel allows | 623 | // settings allow voice, then whether parcel allows |
624 | // voice, if all do retrieve or obtain the parcel | 624 | // voice, if all do retrieve or obtain the parcel |
625 | // voice channel | 625 | // voice channel |
626 | LandData land = scene.GetLandData(avatar.AbsolutePosition); | 626 | LandData land = scene.GetLandData(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); |
627 | 627 | ||
628 | // m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": request: {4}, path: {5}, param: {6}", | 628 | // m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": request: {4}, path: {5}, param: {6}", |
629 | // scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, request, path, param); | 629 | // 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 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Linq; | ||
31 | using System.Reflection; | 30 | using System.Reflection; |
32 | using log4net; | 31 | using log4net; |
33 | using Mono.Addins; | 32 | using Mono.Addins; |
@@ -37,8 +36,6 @@ using OpenMetaverse.StructuredData; | |||
37 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
38 | using OpenSim.Region.Framework.Interfaces; | 37 | using OpenSim.Region.Framework.Interfaces; |
39 | using OpenSim.Region.Framework.Scenes; | 38 | using OpenSim.Region.Framework.Scenes; |
40 | using OpenSim.Services.Interfaces; | ||
41 | using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo; | ||
42 | 39 | ||
43 | namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | 40 | namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups |
44 | { | 41 | { |
@@ -48,7 +45,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | 46 | ||
50 | private List<Scene> m_sceneList = new List<Scene>(); | 47 | private List<Scene> m_sceneList = new List<Scene>(); |
51 | private IPresenceService m_presenceService; | ||
52 | 48 | ||
53 | private IMessageTransferModule m_msgTransferModule = null; | 49 | private IMessageTransferModule m_msgTransferModule = null; |
54 | 50 | ||
@@ -58,27 +54,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
58 | private bool m_groupMessagingEnabled = false; | 54 | private bool m_groupMessagingEnabled = false; |
59 | private bool m_debugEnabled = true; | 55 | private bool m_debugEnabled = true; |
60 | 56 | ||
61 | /// <summary> | ||
62 | /// If enabled, module only tries to send group IMs to online users by querying cached presence information. | ||
63 | /// </summary> | ||
64 | private bool m_messageOnlineAgentsOnly; | ||
65 | |||
66 | /// <summary> | ||
67 | /// Cache for online users. | ||
68 | /// </summary> | ||
69 | /// <remarks> | ||
70 | /// Group ID is key, presence information for online members is value. | ||
71 | /// Will only be non-null if m_messageOnlineAgentsOnly = true | ||
72 | /// We cache here so that group messages don't constantly have to re-request the online user list to avoid | ||
73 | /// attempted expensive sending of messages to offline users. | ||
74 | /// The tradeoff is that a user that comes online will not receive messages consistently from all other users | ||
75 | /// until caches have updated. | ||
76 | /// Therefore, we set the cache expiry to just 20 seconds. | ||
77 | /// </remarks> | ||
78 | private ExpiringCache<UUID, PresenceInfo[]> m_usersOnlineCache; | ||
79 | |||
80 | private int m_usersOnlineCacheExpirySeconds = 20; | ||
81 | |||
82 | #region IRegionModuleBase Members | 57 | #region IRegionModuleBase Members |
83 | 58 | ||
84 | public void Initialise(IConfigSource config) | 59 | public void Initialise(IConfigSource config) |
@@ -108,17 +83,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
108 | return; | 83 | return; |
109 | } | 84 | } |
110 | 85 | ||
111 | m_messageOnlineAgentsOnly = groupsConfig.GetBoolean("MessageOnlineUsersOnly", false); | ||
112 | |||
113 | if (m_messageOnlineAgentsOnly) | ||
114 | m_usersOnlineCache = new ExpiringCache<UUID, PresenceInfo[]>(); | ||
115 | |||
116 | m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", true); | 86 | m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", true); |
117 | } | 87 | } |
118 | 88 | ||
119 | m_log.InfoFormat( | 89 | m_log.Info("[GROUPS-MESSAGING]: GroupsMessagingModule starting up"); |
120 | "[GROUPS-MESSAGING]: GroupsMessagingModule enabled with MessageOnlineOnly = {0}, DebugEnabled = {1}", | ||
121 | m_messageOnlineAgentsOnly, m_debugEnabled); | ||
122 | } | 90 | } |
123 | 91 | ||
124 | public void AddRegion(Scene scene) | 92 | public void AddRegion(Scene scene) |
@@ -158,8 +126,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
158 | return; | 126 | return; |
159 | } | 127 | } |
160 | 128 | ||
161 | if (m_presenceService == null) | ||
162 | m_presenceService = scene.PresenceService; | ||
163 | 129 | ||
164 | m_sceneList.Add(scene); | 130 | m_sceneList.Add(scene); |
165 | 131 | ||
@@ -241,42 +207,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
241 | public void SendMessageToGroup(GridInstantMessage im, UUID groupID) | 207 | public void SendMessageToGroup(GridInstantMessage im, UUID groupID) |
242 | { | 208 | { |
243 | List<GroupMembersData> groupMembers = m_groupData.GetGroupMembers(new UUID(im.fromAgentID), groupID); | 209 | List<GroupMembersData> groupMembers = m_groupData.GetGroupMembers(new UUID(im.fromAgentID), groupID); |
244 | int groupMembersCount = groupMembers.Count; | 210 | |
245 | 211 | if (m_debugEnabled) | |
246 | if (m_messageOnlineAgentsOnly) | 212 | m_log.DebugFormat( |
247 | { | 213 | "[GROUPS-MESSAGING]: SendMessageToGroup called for group {0} with {1} visible members", |
248 | string[] t1 = groupMembers.ConvertAll<string>(gmd => gmd.AgentID.ToString()).ToArray(); | 214 | groupID, groupMembers.Count); |
249 | 215 | ||
250 | // We cache in order not to overwhlem the presence service on large grids with many groups. This does | ||
251 | // mean that members coming online will not see all group members until after m_usersOnlineCacheExpirySeconds has elapsed. | ||
252 | // (assuming this is the same across all grid simulators). | ||
253 | PresenceInfo[] onlineAgents; | ||
254 | if (!m_usersOnlineCache.TryGetValue(groupID, out onlineAgents)) | ||
255 | { | ||
256 | onlineAgents = m_presenceService.GetAgents(t1); | ||
257 | m_usersOnlineCache.Add(groupID, onlineAgents, m_usersOnlineCacheExpirySeconds); | ||
258 | } | ||
259 | |||
260 | HashSet<string> onlineAgentsUuidSet = new HashSet<string>(); | ||
261 | Array.ForEach<PresenceInfo>(onlineAgents, pi => onlineAgentsUuidSet.Add(pi.UserID)); | ||
262 | |||
263 | groupMembers = groupMembers.Where(gmd => onlineAgentsUuidSet.Contains(gmd.AgentID.ToString())).ToList(); | ||
264 | |||
265 | // if (m_debugEnabled) | ||
266 | // m_log.DebugFormat( | ||
267 | // "[GROUPS-MESSAGING]: SendMessageToGroup called for group {0} with {1} visible members, {2} online", | ||
268 | // groupID, groupMembersCount, groupMembers.Count()); | ||
269 | } | ||
270 | else | ||
271 | { | ||
272 | if (m_debugEnabled) | ||
273 | m_log.DebugFormat( | ||
274 | "[GROUPS-MESSAGING]: SendMessageToGroup called for group {0} with {1} visible members", | ||
275 | groupID, groupMembers.Count); | ||
276 | } | ||
277 | |||
278 | int requestStartTick = Environment.TickCount; | ||
279 | |||
280 | foreach (GroupMembersData member in groupMembers) | 216 | foreach (GroupMembersData member in groupMembers) |
281 | { | 217 | { |
282 | if (m_groupData.hasAgentDroppedGroupChatSession(member.AgentID, groupID)) | 218 | if (m_groupData.hasAgentDroppedGroupChatSession(member.AgentID, groupID)) |
@@ -318,12 +254,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
318 | ProcessMessageFromGroupSession(msg); | 254 | ProcessMessageFromGroupSession(msg); |
319 | } | 255 | } |
320 | } | 256 | } |
321 | |||
322 | // Temporary for assessing how long it still takes to send messages to large online groups. | ||
323 | if (m_messageOnlineAgentsOnly) | ||
324 | m_log.DebugFormat( | ||
325 | "[GROUPS-MESSAGING]: SendMessageToGroup for group {0} with {1} visible members, {2} online took {3}ms", | ||
326 | groupID, groupMembersCount, groupMembers.Count(), Environment.TickCount - requestStartTick); | ||
327 | } | 257 | } |
328 | 258 | ||
329 | #region SimGridEventHandlers | 259 | #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 | |||
123 | public void AddRegion(Scene scene) | 123 | public void AddRegion(Scene scene) |
124 | { | 124 | { |
125 | if (m_groupsEnabled) | 125 | if (m_groupsEnabled) |
126 | { | ||
127 | scene.RegisterModuleInterface<IGroupsModule>(this); | 126 | scene.RegisterModuleInterface<IGroupsModule>(this); |
128 | scene.AddCommand( | ||
129 | "debug", | ||
130 | this, | ||
131 | "debug groups verbose", | ||
132 | "debug groups verbose <true|false>", | ||
133 | "This setting turns on very verbose groups debugging", | ||
134 | HandleDebugGroupsVerbose); | ||
135 | } | ||
136 | } | ||
137 | |||
138 | private void HandleDebugGroupsVerbose(object modules, string[] args) | ||
139 | { | ||
140 | if (args.Length < 4) | ||
141 | { | ||
142 | MainConsole.Instance.Output("Usage: debug groups verbose <true|false>"); | ||
143 | return; | ||
144 | } | ||
145 | |||
146 | bool verbose = false; | ||
147 | if (!bool.TryParse(args[3], out verbose)) | ||
148 | { | ||
149 | MainConsole.Instance.Output("Usage: debug groups verbose <true|false>"); | ||
150 | return; | ||
151 | } | ||
152 | |||
153 | m_debugEnabled = verbose; | ||
154 | |||
155 | MainConsole.Instance.OutputFormat("{0} verbose logging set to {1}", Name, m_debugEnabled); | ||
156 | } | 127 | } |
157 | 128 | ||
158 | public void RegionLoaded(Scene scene) | 129 | public void RegionLoaded(Scene scene) |
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs index 732c28f..311531c 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreModule.cs | |||
@@ -175,15 +175,14 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore | |||
175 | /// | 175 | /// |
176 | /// </summary> | 176 | /// </summary> |
177 | // ----------------------------------------------------------------- | 177 | // ----------------------------------------------------------------- |
178 | public bool CreateStore(string value, ref UUID result) | 178 | public bool CreateStore(string value, out UUID result) |
179 | { | 179 | { |
180 | if (result == UUID.Zero) | 180 | result = UUID.Zero; |
181 | result = UUID.Random(); | ||
182 | |||
183 | JsonStore map = null; | ||
184 | 181 | ||
185 | if (! m_enabled) return false; | 182 | if (! m_enabled) return false; |
186 | 183 | ||
184 | UUID uuid = UUID.Random(); | ||
185 | JsonStore map = null; | ||
187 | 186 | ||
188 | try | 187 | try |
189 | { | 188 | { |
@@ -196,8 +195,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore | |||
196 | } | 195 | } |
197 | 196 | ||
198 | lock (m_JsonValueStore) | 197 | lock (m_JsonValueStore) |
199 | m_JsonValueStore.Add(result,map); | 198 | m_JsonValueStore.Add(uuid,map); |
200 | 199 | ||
200 | result = uuid; | ||
201 | return true; | 201 | return true; |
202 | } | 202 | } |
203 | 203 | ||
@@ -231,7 +231,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore | |||
231 | if (! m_JsonValueStore.TryGetValue(storeID,out map)) | 231 | if (! m_JsonValueStore.TryGetValue(storeID,out map)) |
232 | { | 232 | { |
233 | m_log.InfoFormat("[JsonStore] Missing store {0}",storeID); | 233 | m_log.InfoFormat("[JsonStore] Missing store {0}",storeID); |
234 | return false; | 234 | return true; |
235 | } | 235 | } |
236 | } | 236 | } |
237 | 237 | ||
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs index 6910d14..eaba816 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs | |||
@@ -227,7 +227,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore | |||
227 | protected UUID JsonCreateStore(UUID hostID, UUID scriptID, string value) | 227 | protected UUID JsonCreateStore(UUID hostID, UUID scriptID, string value) |
228 | { | 228 | { |
229 | UUID uuid = UUID.Zero; | 229 | UUID uuid = UUID.Zero; |
230 | if (! m_store.CreateStore(value, ref uuid)) | 230 | if (! m_store.CreateStore(value, out uuid)) |
231 | GenerateRuntimeError("Failed to create Json store"); | 231 | GenerateRuntimeError("Failed to create Json store"); |
232 | 232 | ||
233 | return uuid; | 233 | return uuid; |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs index 5ed1514..aa23fee 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs | |||
@@ -821,11 +821,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
821 | { | 821 | { |
822 | if (!CanEdit()) | 822 | if (!CanEdit()) |
823 | return; | 823 | return; |
824 | ISoundModule module = m_rootScene.RequestModuleInterface<ISoundModule>(); | 824 | |
825 | if (module != null) | 825 | GetSOP().SendSound(asset.ToString(), volume, true, 0, 0, false, false); |
826 | { | ||
827 | module.SendSound(GetSOP().UUID, asset, volume, true, 0, 0, false, false); | ||
828 | } | ||
829 | } | 826 | } |
830 | 827 | ||
831 | #endregion | 828 | #endregion |
diff --git a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs index bad75f7..fff3a32 100644 --- a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs | |||
@@ -181,7 +181,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady | |||
181 | } | 181 | } |
182 | } | 182 | } |
183 | 183 | ||
184 | void OnOarFileLoaded(Guid requestId, List<UUID> loadedScenes, string message) | 184 | void OnOarFileLoaded(Guid requestId, string message) |
185 | { | 185 | { |
186 | m_oarFileLoading = true; | 186 | m_oarFileLoading = true; |
187 | 187 | ||
diff --git a/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs index dc54c3f..c5c96a9 100644 --- a/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs | |||
@@ -130,25 +130,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.ScriptModuleComms | |||
130 | m_scriptModule.PostScriptEvent(script, "link_message", args); | 130 | m_scriptModule.PostScriptEvent(script, "link_message", args); |
131 | } | 131 | } |
132 | 132 | ||
133 | private static MethodInfo GetMethodInfoFromType(Type target, string meth, bool searchInstanceMethods) | ||
134 | { | ||
135 | BindingFlags getMethodFlags = | ||
136 | BindingFlags.NonPublic | BindingFlags.Public; | ||
137 | |||
138 | if (searchInstanceMethods) | ||
139 | getMethodFlags |= BindingFlags.Instance; | ||
140 | else | ||
141 | getMethodFlags |= BindingFlags.Static; | ||
142 | |||
143 | return target.GetMethod(meth, getMethodFlags); | ||
144 | } | ||
145 | |||
146 | public void RegisterScriptInvocation(object target, string meth) | 133 | public void RegisterScriptInvocation(object target, string meth) |
147 | { | 134 | { |
148 | MethodInfo mi = GetMethodInfoFromType(target.GetType(), meth, true); | 135 | MethodInfo mi = target.GetType().GetMethod(meth, |
136 | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); | ||
149 | if (mi == null) | 137 | if (mi == null) |
150 | { | 138 | { |
151 | m_log.WarnFormat("[MODULE COMMANDS] Failed to register method {0}", meth); | 139 | m_log.WarnFormat("[MODULE COMMANDS] Failed to register method {0}",meth); |
152 | return; | 140 | return; |
153 | } | 141 | } |
154 | 142 | ||
@@ -163,71 +151,38 @@ namespace OpenSim.Region.OptionalModules.Scripting.ScriptModuleComms | |||
163 | 151 | ||
164 | public void RegisterScriptInvocation(object target, MethodInfo mi) | 152 | public void RegisterScriptInvocation(object target, MethodInfo mi) |
165 | { | 153 | { |
166 | m_log.DebugFormat("[MODULE COMMANDS] Register method {0} from type {1}", mi.Name, (target is Type) ? ((Type)target).Name : target.GetType().Name); | 154 | m_log.DebugFormat("[MODULE COMMANDS] Register method {0} from type {1}", mi.Name, target.GetType().Name); |
167 | 155 | ||
168 | Type delegateType; | 156 | Type delegateType; |
169 | List<Type> typeArgs = mi.GetParameters() | 157 | var typeArgs = mi.GetParameters() |
170 | .Select(p => p.ParameterType) | 158 | .Select(p => p.ParameterType) |
171 | .ToList(); | 159 | .ToList(); |
172 | 160 | ||
173 | if (mi.ReturnType == typeof(void)) | 161 | if (mi.ReturnType == typeof(void)) |
174 | { | 162 | { |
175 | delegateType = Expression.GetActionType(typeArgs.ToArray()); | 163 | delegateType = Expression.GetActionType(typeArgs.ToArray()); |
176 | } | 164 | } |
177 | else | 165 | else |
178 | { | 166 | { |
179 | typeArgs.Add(mi.ReturnType); | 167 | typeArgs.Add(mi.ReturnType); |
180 | delegateType = Expression.GetFuncType(typeArgs.ToArray()); | 168 | delegateType = Expression.GetFuncType(typeArgs.ToArray()); |
181 | } | 169 | } |
182 | 170 | ||
183 | Delegate fcall; | 171 | Delegate fcall = Delegate.CreateDelegate(delegateType, target, mi); |
184 | if (!(target is Type)) | ||
185 | fcall = Delegate.CreateDelegate(delegateType, target, mi); | ||
186 | else | ||
187 | fcall = Delegate.CreateDelegate(delegateType, (Type)target, mi.Name); | ||
188 | 172 | ||
189 | lock (m_scriptInvocation) | 173 | lock (m_scriptInvocation) |
190 | { | 174 | { |
191 | ParameterInfo[] parameters = fcall.Method.GetParameters(); | 175 | ParameterInfo[] parameters = fcall.Method.GetParameters (); |
192 | if (parameters.Length < 2) // Must have two UUID params | 176 | if (parameters.Length < 2) // Must have two UUID params |
193 | return; | 177 | return; |
194 | 178 | ||
195 | // Hide the first two parameters | 179 | // Hide the first two parameters |
196 | Type[] parmTypes = new Type[parameters.Length - 2]; | 180 | Type[] parmTypes = new Type[parameters.Length - 2]; |
197 | for (int i = 2; i < parameters.Length; i++) | 181 | for (int i = 2 ; i < parameters.Length ; i++) |
198 | parmTypes[i - 2] = parameters[i].ParameterType; | 182 | parmTypes[i - 2] = parameters[i].ParameterType; |
199 | m_scriptInvocation[fcall.Method.Name] = new ScriptInvocationData(fcall.Method.Name, fcall, parmTypes, fcall.Method.ReturnType); | 183 | m_scriptInvocation[fcall.Method.Name] = new ScriptInvocationData(fcall.Method.Name, fcall, parmTypes, fcall.Method.ReturnType); |
200 | } | 184 | } |
201 | } | 185 | } |
202 | |||
203 | public void RegisterScriptInvocation(Type target, string[] methods) | ||
204 | { | ||
205 | foreach (string method in methods) | ||
206 | { | ||
207 | MethodInfo mi = GetMethodInfoFromType(target, method, false); | ||
208 | if (mi == null) | ||
209 | m_log.WarnFormat("[MODULE COMMANDS] Failed to register method {0}", method); | ||
210 | else | ||
211 | RegisterScriptInvocation(target, mi); | ||
212 | } | ||
213 | } | ||
214 | |||
215 | public void RegisterScriptInvocations(IRegionModuleBase target) | ||
216 | { | ||
217 | foreach(MethodInfo method in target.GetType().GetMethods( | ||
218 | BindingFlags.Public | BindingFlags.Instance | | ||
219 | BindingFlags.Static)) | ||
220 | { | ||
221 | if(method.GetCustomAttributes( | ||
222 | typeof(ScriptInvocationAttribute), true).Any()) | ||
223 | { | ||
224 | if(method.IsStatic) | ||
225 | RegisterScriptInvocation(target.GetType(), method); | ||
226 | else | ||
227 | RegisterScriptInvocation(target, method); | ||
228 | } | ||
229 | } | ||
230 | } | ||
231 | 186 | ||
232 | public Delegate[] GetScriptInvocationList() | 187 | public Delegate[] GetScriptInvocationList() |
233 | { | 188 | { |
@@ -330,20 +285,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.ScriptModuleComms | |||
330 | } | 285 | } |
331 | } | 286 | } |
332 | 287 | ||
333 | public void RegisterConstants(IRegionModuleBase target) | ||
334 | { | ||
335 | foreach (FieldInfo field in target.GetType().GetFields( | ||
336 | BindingFlags.Public | BindingFlags.Static | | ||
337 | BindingFlags.Instance)) | ||
338 | { | ||
339 | if (field.GetCustomAttributes( | ||
340 | typeof(ScriptConstantAttribute), true).Any()) | ||
341 | { | ||
342 | RegisterConstant(field.Name, field.GetValue(target)); | ||
343 | } | ||
344 | } | ||
345 | } | ||
346 | |||
347 | /// <summary> | 288 | /// <summary> |
348 | /// Operation to check for a registered constant | 289 | /// Operation to check for a registered constant |
349 | /// </summary> | 290 | /// </summary> |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 3a03101..6c8e2fc 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -148,7 +148,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
148 | OnInstantMessage(this, new GridInstantMessage(m_scene, | 148 | OnInstantMessage(this, new GridInstantMessage(m_scene, |
149 | m_uuid, m_firstname + " " + m_lastname, | 149 | m_uuid, m_firstname + " " + m_lastname, |
150 | target, 0, false, message, | 150 | target, 0, false, message, |
151 | UUID.Zero, false, Position, new byte[0], true)); | 151 | UUID.Zero, false, Position, new byte[0])); |
152 | } | 152 | } |
153 | 153 | ||
154 | public void SendAgentOffline(UUID[] agentIDs) | 154 | public void SendAgentOffline(UUID[] agentIDs) |
@@ -607,15 +607,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
607 | { | 607 | { |
608 | } | 608 | } |
609 | 609 | ||
610 | public virtual void SendChatMessage( | 610 | public virtual void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName, |
611 | string message, byte type, Vector3 fromPos, string fromName, | 611 | UUID fromAgentID, byte source, byte audible) |
612 | UUID fromAgentID, UUID ownerID, byte source, byte audible) | ||
613 | { | 612 | { |
614 | } | 613 | } |
615 | 614 | ||
616 | public virtual void SendChatMessage( | 615 | public virtual void SendChatMessage(byte[] message, byte type, Vector3 fromPos, string fromName, |
617 | byte[] message, byte type, Vector3 fromPos, string fromName, | 616 | UUID fromAgentID, byte source, byte audible) |
618 | UUID fromAgentID, UUID ownerID, byte source, byte audible) | ||
619 | { | 617 | { |
620 | } | 618 | } |
621 | 619 | ||
@@ -911,13 +909,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
911 | 909 | ||
912 | public void Close() | 910 | public void Close() |
913 | { | 911 | { |
914 | Close(true, false); | 912 | Close(true); |
915 | } | 913 | } |
916 | 914 | ||
917 | public void Close(bool sendStop, bool force) | 915 | public void Close(bool sendStop) |
918 | { | 916 | { |
919 | // Remove ourselves from the scene | ||
920 | m_scene.RemoveClient(AgentId, false); | ||
921 | } | 917 | } |
922 | 918 | ||
923 | public void Start() | 919 | public void Start() |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs index 52ed846..9179966 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs | |||
@@ -117,12 +117,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
117 | Assert.That(npc, Is.Not.Null); | 117 | Assert.That(npc, Is.Not.Null); |
118 | Assert.That(npc.Appearance.Texture.FaceTextures[8].TextureID, Is.EqualTo(originalFace8TextureId)); | 118 | Assert.That(npc.Appearance.Texture.FaceTextures[8].TextureID, Is.EqualTo(originalFace8TextureId)); |
119 | Assert.That(m_umMod.GetUserName(npc.UUID), Is.EqualTo(string.Format("{0} {1}", npc.Firstname, npc.Lastname))); | 119 | Assert.That(m_umMod.GetUserName(npc.UUID), Is.EqualTo(string.Format("{0} {1}", npc.Firstname, npc.Lastname))); |
120 | |||
121 | IClientAPI client; | ||
122 | Assert.That(m_scene.TryGetClient(npcId, out client), Is.True); | ||
123 | |||
124 | // Have to account for both SP and NPC. | ||
125 | Assert.That(m_scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(2)); | ||
126 | } | 120 | } |
127 | 121 | ||
128 | [Test] | 122 | [Test] |
@@ -142,11 +136,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
142 | ScenePresence deletedNpc = m_scene.GetScenePresence(npcId); | 136 | ScenePresence deletedNpc = m_scene.GetScenePresence(npcId); |
143 | 137 | ||
144 | Assert.That(deletedNpc, Is.Null); | 138 | Assert.That(deletedNpc, Is.Null); |
145 | IClientAPI client; | ||
146 | Assert.That(m_scene.TryGetClient(npcId, out client), Is.False); | ||
147 | |||
148 | // Have to account for SP still present. | ||
149 | Assert.That(m_scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1)); | ||
150 | } | 139 | } |
151 | 140 | ||
152 | [Test] | 141 | [Test] |