aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Avatar
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar')
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs6
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Chat/IRCBridgeModule.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs4
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs41
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs8
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs37
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs1390
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs141
10 files changed, 1534 insertions, 99 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs
index b3fa07f..66265d8 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs
@@ -483,12 +483,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
483 case "%host" : 483 case "%host" :
484 result = result.Replace(vvar, rs.Host); 484 result = result.Replace(vvar, rs.Host);
485 break; 485 break;
486 case "%master1" :
487 result = result.Replace(vvar, rs.MA1);
488 break;
489 case "%master2" :
490 result = result.Replace(vvar, rs.MA2);
491 break;
492 case "%locx" : 486 case "%locx" :
493 result = result.Replace(vvar, rs.LocX); 487 result = result.Replace(vvar, rs.LocX);
494 break; 488 break;
diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/IRCBridgeModule.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/IRCBridgeModule.cs
index e664b44..d49a489 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Chat/IRCBridgeModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Chat/IRCBridgeModule.cs
@@ -109,7 +109,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
109 } 109 }
110 else 110 else
111 { 111 {
112 m_log.WarnFormat("[IRC-Bridge] Not enabled. Connect for region {0} ignored", scene.RegionInfo.RegionName); 112 //m_log.DebugFormat("[IRC-Bridge] Not enabled. Connect for region {0} ignored", scene.RegionInfo.RegionName);
113 } 113 }
114 } 114 }
115 115
diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs
index 773507c..53b103e 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs
@@ -57,8 +57,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
57 internal string Host = String.Empty; 57 internal string Host = String.Empty;
58 internal string LocX = String.Empty; 58 internal string LocX = String.Empty;
59 internal string LocY = String.Empty; 59 internal string LocY = String.Empty;
60 internal string MA1 = String.Empty;
61 internal string MA2 = String.Empty;
62 internal string IDK = String.Empty; 60 internal string IDK = String.Empty;
63 61
64 // System values - used only be the IRC classes themselves 62 // System values - used only be the IRC classes themselves
@@ -85,8 +83,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
85 Host = scene.RegionInfo.ExternalHostName; 83 Host = scene.RegionInfo.ExternalHostName;
86 LocX = Convert.ToString(scene.RegionInfo.RegionLocX); 84 LocX = Convert.ToString(scene.RegionInfo.RegionLocX);
87 LocY = Convert.ToString(scene.RegionInfo.RegionLocY); 85 LocY = Convert.ToString(scene.RegionInfo.RegionLocY);
88 MA1 = scene.RegionInfo.MasterAvatarFirstName;
89 MA2 = scene.RegionInfo.MasterAvatarLastName;
90 IDK = Convert.ToString(_idk_++); 86 IDK = Convert.ToString(_idk_++);
91 87
92 // OpenChannel conditionally establishes a connection to the 88 // OpenChannel conditionally establishes a connection to the
diff --git a/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs b/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs
index c864993..2fcc477 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs
@@ -318,9 +318,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
318 { 318 {
319 Scene scene = client.Scene as Scene; 319 Scene scene = client.Scene as Scene;
320 m_log.DebugFormat("[Concierge]: {0} logs off from {1}", client.Name, scene.RegionInfo.RegionName); 320 m_log.DebugFormat("[Concierge]: {0} logs off from {1}", client.Name, scene.RegionInfo.RegionName);
321 List<ScenePresence> avs = scene.GetAvatars(); 321 AnnounceToAgentsRegion(scene, String.Format(m_announceLeaving, client.Name, scene.RegionInfo.RegionName, scene.GetRootAgentCount()));
322 AnnounceToAgentsRegion(scene, String.Format(m_announceLeaving, client.Name, scene.RegionInfo.RegionName, avs.Count)); 322 UpdateBroker(scene);
323 UpdateBroker(scene, avs);
324 } 323 }
325 } 324 }
326 325
@@ -331,11 +330,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
331 { 330 {
332 Scene scene = agent.Scene; 331 Scene scene = agent.Scene;
333 m_log.DebugFormat("[Concierge]: {0} enters {1}", agent.Name, scene.RegionInfo.RegionName); 332 m_log.DebugFormat("[Concierge]: {0} enters {1}", agent.Name, scene.RegionInfo.RegionName);
334 List<ScenePresence> avs = scene.GetAvatars();
335 WelcomeAvatar(agent, scene); 333 WelcomeAvatar(agent, scene);
336 AnnounceToAgentsRegion(scene, String.Format(m_announceEntering, agent.Name, 334 AnnounceToAgentsRegion(scene, String.Format(m_announceEntering, agent.Name,
337 scene.RegionInfo.RegionName, avs.Count)); 335 scene.RegionInfo.RegionName, scene.GetRootAgentCount()));
338 UpdateBroker(scene, avs); 336 UpdateBroker(scene);
339 } 337 }
340 } 338 }
341 339
@@ -346,10 +344,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
346 { 344 {
347 Scene scene = agent.Scene; 345 Scene scene = agent.Scene;
348 m_log.DebugFormat("[Concierge]: {0} leaves {1}", agent.Name, scene.RegionInfo.RegionName); 346 m_log.DebugFormat("[Concierge]: {0} leaves {1}", agent.Name, scene.RegionInfo.RegionName);
349 List<ScenePresence> avs = scene.GetAvatars();
350 AnnounceToAgentsRegion(scene, String.Format(m_announceLeaving, agent.Name, 347 AnnounceToAgentsRegion(scene, String.Format(m_announceLeaving, agent.Name,
351 scene.RegionInfo.RegionName, avs.Count)); 348 scene.RegionInfo.RegionName, scene.GetRootAgentCount()));
352 UpdateBroker(scene, avs); 349 UpdateBroker(scene);
353 } 350 }
354 } 351 }
355 352
@@ -368,7 +365,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
368 } 365 }
369 } 366 }
370 367
371 protected void UpdateBroker(IScene scene, List<ScenePresence> avatars) 368 protected void UpdateBroker(Scene scene)
372 { 369 {
373 if (String.IsNullOrEmpty(m_brokerURI)) 370 if (String.IsNullOrEmpty(m_brokerURI))
374 return; 371 return;
@@ -377,24 +374,18 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
377 374
378 // create XML sniplet 375 // create XML sniplet
379 StringBuilder list = new StringBuilder(); 376 StringBuilder list = new StringBuilder();
380 if (0 == avatars.Count) 377 list.Append(String.Format("<avatars count=\"{0}\" region_name=\"{1}\" region_uuid=\"{2}\" timestamp=\"{3}\">\n",
381 { 378 scene.GetRootAgentCount(), scene.RegionInfo.RegionName,
382 list.Append(String.Format("<avatars count=\"0\" region_name=\"{0}\" region_uuid=\"{1}\" timestamp=\"{2}\" />", 379 scene.RegionInfo.RegionID,
383 scene.RegionInfo.RegionName, scene.RegionInfo.RegionID,
384 DateTime.UtcNow.ToString("s"))); 380 DateTime.UtcNow.ToString("s")));
385 } 381 scene.ForEachScenePresence(delegate(ScenePresence sp)
386 else
387 { 382 {
388 list.Append(String.Format("<avatars count=\"{0}\" region_name=\"{1}\" region_uuid=\"{2}\" timestamp=\"{3}\">\n", 383 if (!sp.IsChildAgent)
389 avatars.Count, scene.RegionInfo.RegionName,
390 scene.RegionInfo.RegionID,
391 DateTime.UtcNow.ToString("s")));
392 foreach (ScenePresence av in avatars)
393 { 384 {
394 list.Append(String.Format(" <avatar name=\"{0}\" uuid=\"{1}\" />\n", av.Name, av.UUID)); 385 list.Append(String.Format(" <avatar name=\"{0}\" uuid=\"{1}\" />\n", sp.Name, sp.UUID));
386 list.Append("</avatars>");
395 } 387 }
396 list.Append("</avatars>"); 388 });
397 }
398 string payload = list.ToString(); 389 string payload = list.ToString();
399 390
400 // post via REST to broker 391 // post via REST to broker
@@ -529,7 +520,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
529 // protected void AnnounceToAgentsRegion(Scene scene, string msg) 520 // protected void AnnounceToAgentsRegion(Scene scene, string msg)
530 // { 521 // {
531 // ScenePresence agent = null; 522 // ScenePresence agent = null;
532 // if ((client.Scene is Scene) && (client.Scene as Scene).TryGetAvatar(client.AgentId, out agent)) 523 // if ((client.Scene is Scene) && (client.Scene as Scene).TryGetScenePresence(client.AgentId, out agent))
533 // AnnounceToAgentsRegion(agent, msg); 524 // AnnounceToAgentsRegion(agent, msg);
534 // else 525 // else
535 // m_log.DebugFormat("[Concierge]: could not find an agent for client {0}", client.Name); 526 // m_log.DebugFormat("[Concierge]: could not find an agent for client {0}", client.Name);
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
index 35819a6..242bc3f 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
@@ -41,7 +41,7 @@ using log4net;
41using Nini.Config; 41using Nini.Config;
42using Nwc.XmlRpc; 42using Nwc.XmlRpc;
43using OpenSim.Framework; 43using OpenSim.Framework;
44using OpenSim.Framework.Communications.Cache; 44
45using OpenSim.Framework.Capabilities; 45using OpenSim.Framework.Capabilities;
46using OpenSim.Framework.Servers; 46using OpenSim.Framework.Servers;
47using OpenSim.Framework.Servers.HttpServer; 47using OpenSim.Framework.Servers.HttpServer;
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
index cb76200..34d0e24 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
@@ -39,7 +39,7 @@ using log4net;
39using Nini.Config; 39using Nini.Config;
40using Nwc.XmlRpc; 40using Nwc.XmlRpc;
41using OpenSim.Framework; 41using OpenSim.Framework;
42using OpenSim.Framework.Communications.Cache; 42
43using OpenSim.Framework.Capabilities; 43using OpenSim.Framework.Capabilities;
44using OpenSim.Framework.Servers; 44using OpenSim.Framework.Servers;
45using OpenSim.Framework.Servers.HttpServer; 45using OpenSim.Framework.Servers.HttpServer;
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
index 06aad91..185d44d 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
@@ -137,6 +137,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
137 137
138 scene.EventManager.OnNewClient += OnNewClient; 138 scene.EventManager.OnNewClient += OnNewClient;
139 scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; 139 scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
140 scene.EventManager.OnClientLogin += OnClientLogin;
140 } 141 }
141 142
142 public void RemoveRegion(Scene scene) 143 public void RemoveRegion(Scene scene)
@@ -260,6 +261,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
260 261
261 #region SimGridEventHandlers 262 #region SimGridEventHandlers
262 263
264 void OnClientLogin(IClientAPI client)
265 {
266 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: OnInstantMessage registered for {0}", client.Name);
267
268
269 }
270
263 private void OnNewClient(IClientAPI client) 271 private void OnNewClient(IClientAPI client)
264 { 272 {
265 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: OnInstantMessage registered for {0}", client.Name); 273 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: OnInstantMessage registered for {0}", client.Name);
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index edd5af7..56c0d98 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -43,6 +43,8 @@ using OpenSim.Region.CoreModules.Framework.EventQueue;
43using OpenSim.Region.Framework.Interfaces; 43using OpenSim.Region.Framework.Interfaces;
44using OpenSim.Region.Framework.Scenes; 44using OpenSim.Region.Framework.Scenes;
45 45
46using OpenSim.Services.Interfaces;
47
46using Caps = OpenSim.Framework.Capabilities.Caps; 48using Caps = OpenSim.Framework.Capabilities.Caps;
47using DirFindFlags = OpenMetaverse.DirectoryManager.DirFindFlags; 49using DirFindFlags = OpenMetaverse.DirectoryManager.DirFindFlags;
48 50
@@ -174,7 +176,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
174 176
175 scene.EventManager.OnNewClient += OnNewClient; 177 scene.EventManager.OnNewClient += OnNewClient;
176 scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; 178 scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
177
178 // The InstantMessageModule itself doesn't do this, 179 // The InstantMessageModule itself doesn't do this,
179 // so lets see if things explode if we don't do it 180 // so lets see if things explode if we don't do it
180 // scene.EventManager.OnClientClosed += OnClientClosed; 181 // scene.EventManager.OnClientClosed += OnClientClosed;
@@ -283,7 +284,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
283 } 284 }
284 */ 285 */
285 286
286
287 void OnDirFindQuery(IClientAPI remoteClient, UUID queryID, string queryText, uint queryFlags, int queryStart) 287 void OnDirFindQuery(IClientAPI remoteClient, UUID queryID, string queryText, uint queryFlags, int queryStart)
288 { 288 {
289 if (((DirFindFlags)queryFlags & DirFindFlags.Groups) == DirFindFlags.Groups) 289 if (((DirFindFlags)queryFlags & DirFindFlags.Groups) == DirFindFlags.Groups)
@@ -467,10 +467,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
467 { 467 {
468 if (m_debugEnabled) 468 if (m_debugEnabled)
469 { 469 {
470 UserProfileData targetUserProfile = m_sceneList[0].CommsManager.UserService.GetUserProfile(member.AgentID); 470 UserAccount targetUser = m_sceneList[0].UserAccountService.GetUserAccount(remoteClient.Scene.RegionInfo.ScopeID, member.AgentID);
471 if (targetUserProfile != null) 471 if (targetUser != null)
472 { 472 {
473 m_log.DebugFormat("[GROUPS]: Prepping group notice {0} for agent: {1} who Accepts Notices ({2})", NoticeID, targetUserProfile.Name, member.AcceptNotices); 473 m_log.DebugFormat("[GROUPS]: Prepping group notice {0} for agent: {1} who Accepts Notices ({2})", NoticeID, targetUser.FirstName + " " + targetUser.LastName, member.AcceptNotices);
474 } 474 }
475 else 475 else
476 { 476 {
@@ -718,7 +718,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
718 return UUID.Zero; 718 return UUID.Zero;
719 } 719 }
720 // is there is a money module present ? 720 // is there is a money module present ?
721 IMoneyModule money=remoteClient.Scene.RequestModuleInterface<IMoneyModule>(); 721 IMoneyModule money = remoteClient.Scene.RequestModuleInterface<IMoneyModule>();
722 if (money != null) 722 if (money != null)
723 { 723 {
724 // do the transaction, that is if the agent has got sufficient funds 724 // do the transaction, that is if the agent has got sufficient funds
@@ -726,7 +726,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
726 remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have got issuficient funds to create a group."); 726 remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have got issuficient funds to create a group.");
727 return UUID.Zero; 727 return UUID.Zero;
728 } 728 }
729 money.ApplyGroupCreationCharge(remoteClient.AgentId); 729 money.ApplyGroupCreationCharge(GetRequestingAgentID(remoteClient));
730 } 730 }
731 UUID groupID = m_groupData.CreateGroup(GetRequestingAgentID(remoteClient), name, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, GetRequestingAgentID(remoteClient)); 731 UUID groupID = m_groupData.CreateGroup(GetRequestingAgentID(remoteClient), name, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, GetRequestingAgentID(remoteClient));
732 732
@@ -957,13 +957,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
957 remoteClient.SendEjectGroupMemberReply(GetRequestingAgentID(remoteClient), groupID, true); 957 remoteClient.SendEjectGroupMemberReply(GetRequestingAgentID(remoteClient), groupID, true);
958 958
959 GroupRecord groupInfo = m_groupData.GetGroupRecord(GetRequestingAgentID(remoteClient), groupID, null); 959 GroupRecord groupInfo = m_groupData.GetGroupRecord(GetRequestingAgentID(remoteClient), groupID, null);
960 UserProfileData userProfile = m_sceneList[0].CommsManager.UserService.GetUserProfile(ejecteeID);
961 960
962 if ((groupInfo == null) || (userProfile == null)) 961 UserAccount account = m_sceneList[0].UserAccountService.GetUserAccount(remoteClient.Scene.RegionInfo.ScopeID, ejecteeID);
962 if ((groupInfo == null) || (account == null))
963 { 963 {
964 return; 964 return;
965 } 965 }
966
967 966
968 // Send Message to Ejectee 967 // Send Message to Ejectee
969 GridInstantMessage msg = new GridInstantMessage(); 968 GridInstantMessage msg = new GridInstantMessage();
@@ -999,9 +998,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
999 msg.toAgentID = GetRequestingAgentID(remoteClient).Guid; 998 msg.toAgentID = GetRequestingAgentID(remoteClient).Guid;
1000 msg.timestamp = 0; 999 msg.timestamp = 0;
1001 msg.fromAgentName = remoteClient.Name; 1000 msg.fromAgentName = remoteClient.Name;
1002 if (userProfile != null) 1001 if (account != null)
1003 { 1002 {
1004 msg.message = string.Format("{2} has been ejected from '{1}' by {0}.", remoteClient.Name, groupInfo.GroupName, userProfile.Name); 1003 msg.message = string.Format("{2} has been ejected from '{1}' by {0}.", remoteClient.Name, groupInfo.GroupName, account.FirstName + " " + account.LastName);
1005 } 1004 }
1006 else 1005 else
1007 { 1006 {
@@ -1116,7 +1115,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1116 1115
1117 foreach (GroupMembershipData membership in data) 1116 foreach (GroupMembershipData membership in data)
1118 { 1117 {
1119 if (remoteClient.AgentId != dataForAgentID) 1118 if (GetRequestingAgentID(remoteClient) != dataForAgentID)
1120 { 1119 {
1121 if (!membership.ListInProfile) 1120 if (!membership.ListInProfile)
1122 { 1121 {
@@ -1155,7 +1154,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1155 1154
1156 if (queue != null) 1155 if (queue != null)
1157 { 1156 {
1158 queue.Enqueue(EventQueueHelper.buildEvent("AgentGroupDataUpdate", llDataStruct), remoteClient.AgentId); 1157 queue.Enqueue(EventQueueHelper.buildEvent("AgentGroupDataUpdate", llDataStruct), GetRequestingAgentID(remoteClient));
1159 } 1158 }
1160 1159
1161 } 1160 }
@@ -1262,12 +1261,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1262 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 1261 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
1263 1262
1264 // TODO: All the client update functions need to be reexamined because most do too much and send too much stuff 1263 // TODO: All the client update functions need to be reexamined because most do too much and send too much stuff
1265 UserProfileData userProfile = m_sceneList[0].CommsManager.UserService.GetUserProfile(dataForAgentID); 1264 UserAccount account = m_sceneList[0].UserAccountService.GetUserAccount(remoteClient.Scene.RegionInfo.ScopeID, dataForAgentID);
1266 string firstname, lastname; 1265 string firstname, lastname;
1267 if (userProfile != null) 1266 if (account != null)
1268 { 1267 {
1269 firstname = userProfile.FirstName; 1268 firstname = account.FirstName;
1270 lastname = userProfile.SurName; 1269 lastname = account.LastName;
1271 } 1270 }
1272 else 1271 else
1273 { 1272 {
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs
new file mode 100644
index 0000000..9363205
--- /dev/null
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs
@@ -0,0 +1,1390 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections;
30using System.Collections.Generic;
31using System.Collections.Specialized;
32using System.Reflection;
33
34using Nwc.XmlRpc;
35
36using log4net;
37using Mono.Addins;
38using Nini.Config;
39
40using OpenMetaverse;
41using OpenMetaverse.StructuredData;
42
43using OpenSim.Framework;
44using OpenSim.Framework.Communications;
45using OpenSim.Region.Framework.Interfaces;
46using OpenSim.Services.Interfaces;
47
48/***************************************************************************
49 * Simian Data Map
50 * ===============
51 *
52 * OwnerID -> Type -> Key
53 * -----------------------
54 *
55 * UserID -> Group -> ActiveGroup
56 * + GroupID
57 *
58 * UserID -> GroupSessionDropped -> GroupID
59 * UserID -> GroupSessionInvited -> GroupID
60 *
61 * UserID -> GroupMember -> GroupID
62 * + SelectedRoleID [UUID]
63 * + AcceptNotices [bool]
64 * + ListInProfile [bool]
65 * + Contribution [int]
66 *
67 * UserID -> GroupRole[GroupID] -> RoleID
68 *
69 *
70 * GroupID -> Group -> GroupName
71 * + Charter
72 * + ShowInList
73 * + InsigniaID
74 * + MembershipFee
75 * + OpenEnrollment
76 * + AllowPublish
77 * + MaturePublish
78 * + FounderID
79 * + EveryonePowers
80 * + OwnerRoleID
81 * + OwnersPowers
82 *
83 * GroupID -> GroupRole -> RoleID
84 * + Name
85 * + Description
86 * + Title
87 * + Powers
88 *
89 * GroupID -> GroupMemberInvite -> InviteID
90 * + AgentID
91 * + RoleID
92 *
93 * GroupID -> GroupNotice -> NoticeID
94 * + TimeStamp [uint]
95 * + FromName [string]
96 * + Subject [string]
97 * + Message [string]
98 * + BinaryBucket [byte[]]
99 *
100 * */
101
102namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
103{
104 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
105 public class SimianGroupsServicesConnectorModule : ISharedRegionModule, IGroupsServicesConnector
106 {
107 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
108
109 public const GroupPowers m_DefaultEveryonePowers = GroupPowers.AllowSetHome |
110 GroupPowers.Accountable |
111 GroupPowers.JoinChat |
112 GroupPowers.AllowVoiceChat |
113 GroupPowers.ReceiveNotices |
114 GroupPowers.StartProposal |
115 GroupPowers.VoteOnProposal;
116
117 // Would this be cleaner as (GroupPowers)ulong.MaxValue;
118 public const GroupPowers m_DefaultOwnerPowers = GroupPowers.Accountable
119 | GroupPowers.AllowEditLand
120 | GroupPowers.AllowFly
121 | GroupPowers.AllowLandmark
122 | GroupPowers.AllowRez
123 | GroupPowers.AllowSetHome
124 | GroupPowers.AllowVoiceChat
125 | GroupPowers.AssignMember
126 | GroupPowers.AssignMemberLimited
127 | GroupPowers.ChangeActions
128 | GroupPowers.ChangeIdentity
129 | GroupPowers.ChangeMedia
130 | GroupPowers.ChangeOptions
131 | GroupPowers.CreateRole
132 | GroupPowers.DeedObject
133 | GroupPowers.DeleteRole
134 | GroupPowers.Eject
135 | GroupPowers.FindPlaces
136 | GroupPowers.Invite
137 | GroupPowers.JoinChat
138 | GroupPowers.LandChangeIdentity
139 | GroupPowers.LandDeed
140 | GroupPowers.LandDivideJoin
141 | GroupPowers.LandEdit
142 | GroupPowers.LandEjectAndFreeze
143 | GroupPowers.LandGardening
144 | GroupPowers.LandManageAllowed
145 | GroupPowers.LandManageBanned
146 | GroupPowers.LandManagePasses
147 | GroupPowers.LandOptions
148 | GroupPowers.LandRelease
149 | GroupPowers.LandSetSale
150 | GroupPowers.ModerateChat
151 | GroupPowers.ObjectManipulate
152 | GroupPowers.ObjectSetForSale
153 | GroupPowers.ReceiveNotices
154 | GroupPowers.RemoveMember
155 | GroupPowers.ReturnGroupOwned
156 | GroupPowers.ReturnGroupSet
157 | GroupPowers.ReturnNonGroup
158 | GroupPowers.RoleProperties
159 | GroupPowers.SendNotices
160 | GroupPowers.SetLandingPoint
161 | GroupPowers.StartProposal
162 | GroupPowers.VoteOnProposal;
163
164 private bool m_connectorEnabled = false;
165
166 private string m_groupsServerURI = string.Empty;
167
168 private bool m_debugEnabled = false;
169
170 private ExpiringCache<string, OSDMap> m_memoryCache;
171 private int m_cacheTimeout = 30;
172
173 // private IUserAccountService m_accountService = null;
174
175
176 #region IRegionModuleBase Members
177
178 public string Name
179 {
180 get { return "SimianGroupsServicesConnector"; }
181 }
182
183 // this module is not intended to be replaced, but there should only be 1 of them.
184 public Type ReplaceableInterface
185 {
186 get { return null; }
187 }
188
189 public void Initialise(IConfigSource config)
190 {
191 IConfig groupsConfig = config.Configs["Groups"];
192
193 if (groupsConfig == null)
194 {
195 // Do not run this module by default.
196 return;
197 }
198 else
199 {
200 // if groups aren't enabled, we're not needed.
201 // if we're not specified as the connector to use, then we're not wanted
202 if ((groupsConfig.GetBoolean("Enabled", false) == false)
203 || (groupsConfig.GetString("ServicesConnectorModule", "Default") != Name))
204 {
205 m_connectorEnabled = false;
206 return;
207 }
208
209 m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR]: Initializing {0}", this.Name);
210
211 m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty);
212 if ((m_groupsServerURI == null) ||
213 (m_groupsServerURI == string.Empty))
214 {
215 m_log.ErrorFormat("Please specify a valid Simian Server for GroupsServerURI in OpenSim.ini, [Groups]");
216 m_connectorEnabled = false;
217 return;
218 }
219
220
221 m_cacheTimeout = groupsConfig.GetInt("GroupsCacheTimeout", 30);
222 if (m_cacheTimeout == 0)
223 {
224 m_log.WarnFormat("[SIMIAN-GROUPS-CONNECTOR] Groups Cache Disabled.");
225 }
226 else
227 {
228 m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] Groups Cache Timeout set to {0}.", m_cacheTimeout);
229 }
230
231
232
233 m_memoryCache = new ExpiringCache<string,OSDMap>();
234
235
236 // If we got all the config options we need, lets start'er'up
237 m_connectorEnabled = true;
238
239 m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", true);
240
241 }
242 }
243
244 public void Close()
245 {
246 m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR]: Closing {0}", this.Name);
247 }
248
249 public void AddRegion(OpenSim.Region.Framework.Scenes.Scene scene)
250 {
251 if (m_connectorEnabled)
252 {
253 scene.RegisterModuleInterface<IGroupsServicesConnector>(this);
254 }
255 }
256
257 public void RemoveRegion(OpenSim.Region.Framework.Scenes.Scene scene)
258 {
259 if (scene.RequestModuleInterface<IGroupsServicesConnector>() == this)
260 {
261 scene.UnregisterModuleInterface<IGroupsServicesConnector>(this);
262 }
263 }
264
265 public void RegionLoaded(OpenSim.Region.Framework.Scenes.Scene scene)
266 {
267 // TODO: May want to consider listenning for Agent Connections so we can pre-cache group info
268 // scene.EventManager.OnNewClient += OnNewClient;
269 }
270
271 #endregion
272
273 #region ISharedRegionModule Members
274
275 public void PostInitialise()
276 {
277 // NoOp
278 }
279
280 #endregion
281
282
283
284
285 #region IGroupsServicesConnector Members
286
287 /// <summary>
288 /// Create a Group, including Everyone and Owners Role, place FounderID in both groups, select Owner as selected role, and newly created group as agent's active role.
289 /// </summary>
290 public UUID CreateGroup(UUID requestingAgentID, string name, string charter, bool showInList, UUID insigniaID,
291 int membershipFee, bool openEnrollment, bool allowPublish,
292 bool maturePublish, UUID founderID)
293 {
294 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
295
296 UUID GroupID = UUID.Random();
297 UUID OwnerRoleID = UUID.Random();
298
299 OSDMap GroupInfoMap = new OSDMap();
300 GroupInfoMap["Charter"] = OSD.FromString(charter);
301 GroupInfoMap["ShowInList"] = OSD.FromBoolean(showInList);
302 GroupInfoMap["InsigniaID"] = OSD.FromUUID(insigniaID);
303 GroupInfoMap["MembershipFee"] = OSD.FromInteger(0);
304 GroupInfoMap["OpenEnrollment"] = OSD.FromBoolean(openEnrollment);
305 GroupInfoMap["AllowPublish"] = OSD.FromBoolean(allowPublish);
306 GroupInfoMap["MaturePublish"] = OSD.FromBoolean(maturePublish);
307 GroupInfoMap["FounderID"] = OSD.FromUUID(founderID);
308 GroupInfoMap["EveryonePowers"] = OSD.FromULong((ulong)m_DefaultEveryonePowers);
309 GroupInfoMap["OwnerRoleID"] = OSD.FromUUID(OwnerRoleID);
310 GroupInfoMap["OwnersPowers"] = OSD.FromULong((ulong)m_DefaultOwnerPowers);
311
312 if(SimianAddGeneric(GroupID, "Group", name, GroupInfoMap))
313 {
314 AddGroupRole(requestingAgentID, GroupID, UUID.Zero, "Everyone", "Members of " + name, "Member of " + name, (ulong)m_DefaultEveryonePowers);
315 AddGroupRole(requestingAgentID, GroupID, OwnerRoleID, "Owners", "Owners of " + name, "Owner of " + name, (ulong)m_DefaultOwnerPowers);
316
317 AddAgentToGroup(requestingAgentID, requestingAgentID, GroupID, OwnerRoleID);
318
319 return GroupID;
320 }
321 else
322 {
323 return UUID.Zero;
324 }
325 }
326
327
328 public void UpdateGroup(UUID requestingAgentID, UUID groupID, string charter, bool showInList,
329 UUID insigniaID, int membershipFee, bool openEnrollment,
330 bool allowPublish, bool maturePublish)
331 {
332 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
333 // TODO: Check to make sure requestingAgentID has permission to update group
334
335 string GroupName;
336 OSDMap GroupInfoMap;
337 if( SimianGetFirstGenericEntry(groupID, "GroupInfo", out GroupName, out GroupInfoMap) )
338 {
339 GroupInfoMap["Charter"] = OSD.FromString(charter);
340 GroupInfoMap["ShowInList"] = OSD.FromBoolean(showInList);
341 GroupInfoMap["InsigniaID"] = OSD.FromUUID(insigniaID);
342 GroupInfoMap["MembershipFee"] = OSD.FromInteger(0);
343 GroupInfoMap["OpenEnrollment"] = OSD.FromBoolean(openEnrollment);
344 GroupInfoMap["AllowPublish"] = OSD.FromBoolean(allowPublish);
345 GroupInfoMap["MaturePublish"] = OSD.FromBoolean(maturePublish);
346
347 SimianAddGeneric(groupID, "Group", GroupName, GroupInfoMap);
348 }
349
350 }
351
352
353 public void AddGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description,
354 string title, ulong powers)
355 {
356 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
357
358 OSDMap GroupRoleInfo = new OSDMap();
359 GroupRoleInfo["Name"] = OSD.FromString(name);
360 GroupRoleInfo["Description"] = OSD.FromString(description);
361 GroupRoleInfo["Title"] = OSD.FromString(title);
362 GroupRoleInfo["Powers"] = OSD.FromULong((ulong)powers);
363
364 // TODO: Add security, make sure that requestingAgentID has permision to add roles
365 SimianAddGeneric(groupID, "GroupRole", roleID.ToString(), GroupRoleInfo);
366 }
367
368 public void RemoveGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID)
369 {
370 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
371
372 // TODO: Add security
373
374 // Can't delete the Everyone Role
375 if (roleID != UUID.Zero)
376 {
377 // Remove all GroupRole Members from Role
378 Dictionary<UUID, OSDMap> GroupRoleMembers;
379 string GroupRoleMemberType = "GroupRole" + groupID.ToString();
380 if (SimianGetGenericEntries(GroupRoleMemberType, roleID.ToString(), out GroupRoleMembers))
381 {
382 foreach(UUID UserID in GroupRoleMembers.Keys)
383 {
384 EnsureRoleNotSelectedByMember(groupID, roleID, UserID);
385
386 SimianRemoveGenericEntry(UserID, GroupRoleMemberType, roleID.ToString());
387 }
388 }
389
390 // Remove role
391 SimianRemoveGenericEntry(groupID, "GroupRole", roleID.ToString());
392 }
393 }
394
395
396 public void UpdateGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description,
397 string title, ulong powers)
398 {
399 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
400
401 // TODO: Security, check that requestingAgentID is allowed to update group roles
402
403 OSDMap GroupRoleInfo;
404 if (SimianGetGenericEntry(groupID, "GroupRole", roleID.ToString(), out GroupRoleInfo))
405 {
406 if (name != null)
407 {
408 GroupRoleInfo["Name"] = OSD.FromString(name);
409 }
410 if (description != null)
411 {
412 GroupRoleInfo["Description"] = OSD.FromString(description);
413 }
414 if (title != null)
415 {
416 GroupRoleInfo["Title"] = OSD.FromString(title);
417 }
418 GroupRoleInfo["Powers"] = OSD.FromULong((ulong)powers);
419
420 }
421
422
423 SimianAddGeneric(groupID, "GroupRole", roleID.ToString(), GroupRoleInfo);
424 }
425
426 public GroupRecord GetGroupRecord(UUID requestingAgentID, UUID groupID, string groupName)
427 {
428 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
429
430 OSDMap GroupInfoMap = null;
431 if (groupID != UUID.Zero)
432 {
433 if (!SimianGetFirstGenericEntry(groupID, "Group", out groupName, out GroupInfoMap))
434 {
435 return null;
436 }
437 }
438 else if ((groupName != null) && (groupName != string.Empty))
439 {
440 if (!SimianGetFirstGenericEntry("Group", groupName, out groupID, out GroupInfoMap))
441 {
442 return null;
443 }
444 }
445
446 GroupRecord GroupInfo = new GroupRecord();
447
448 GroupInfo.GroupID = groupID;
449 GroupInfo.GroupName = groupName;
450 GroupInfo.Charter = GroupInfoMap["Charter"].AsString();
451 GroupInfo.ShowInList = GroupInfoMap["ShowInList"].AsBoolean();
452 GroupInfo.GroupPicture = GroupInfoMap["InsigniaID"].AsUUID();
453 GroupInfo.MembershipFee = GroupInfoMap["MembershipFee"].AsInteger();
454 GroupInfo.OpenEnrollment = GroupInfoMap["OpenEnrollment"].AsBoolean();
455 GroupInfo.AllowPublish = GroupInfoMap["AllowPublish"].AsBoolean();
456 GroupInfo.MaturePublish = GroupInfoMap["MaturePublish"].AsBoolean();
457 GroupInfo.FounderID = GroupInfoMap["FounderID"].AsUUID();
458 GroupInfo.OwnerRoleID = GroupInfoMap["OwnerRoleID"].AsUUID();
459
460 return GroupInfo;
461
462 }
463
464 public GroupProfileData GetMemberGroupProfile(UUID requestingAgentID, UUID groupID, UUID memberID)
465 {
466 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
467
468 OSDMap groupProfile;
469 string groupName;
470 if (!SimianGetFirstGenericEntry(groupID, "Group", out groupName, out groupProfile))
471 {
472 // GroupProfileData is not nullable
473 return new GroupProfileData();
474 }
475
476 GroupProfileData MemberGroupProfile = new GroupProfileData();
477 MemberGroupProfile.GroupID = groupID;
478 MemberGroupProfile.Name = groupName;
479
480 if (groupProfile["Charter"] != null)
481 {
482 MemberGroupProfile.Charter = groupProfile["Charter"].AsString();
483 }
484
485 MemberGroupProfile.ShowInList = groupProfile["ShowInList"].AsString() == "1";
486 MemberGroupProfile.InsigniaID = groupProfile["InsigniaID"].AsUUID();
487 MemberGroupProfile.MembershipFee = groupProfile["MembershipFee"].AsInteger();
488 MemberGroupProfile.OpenEnrollment = groupProfile["OpenEnrollment"].AsBoolean();
489 MemberGroupProfile.AllowPublish = groupProfile["AllowPublish"].AsBoolean();
490 MemberGroupProfile.MaturePublish = groupProfile["MaturePublish"].AsBoolean();
491 MemberGroupProfile.FounderID = groupProfile["FounderID"].AsUUID();;
492 MemberGroupProfile.OwnerRole = groupProfile["OwnerRoleID"].AsUUID();
493
494 Dictionary<UUID, OSDMap> Members;
495 if (SimianGetGenericEntries("GroupMember",groupID.ToString(), out Members))
496 {
497 MemberGroupProfile.GroupMembershipCount = Members.Count;
498 }
499
500 Dictionary<string, OSDMap> Roles;
501 if (SimianGetGenericEntries(groupID, "GroupRole", out Roles))
502 {
503 MemberGroupProfile.GroupRolesCount = Roles.Count;
504 }
505
506 // TODO: Get Group Money balance from somewhere
507 // group.Money = 0;
508
509 GroupMembershipData MemberInfo = GetAgentGroupMembership(requestingAgentID, memberID, groupID);
510
511 MemberGroupProfile.MemberTitle = MemberInfo.GroupTitle;
512 MemberGroupProfile.PowersMask = MemberInfo.GroupPowers;
513
514 return MemberGroupProfile;
515 }
516
517 public void SetAgentActiveGroup(UUID requestingAgentID, UUID agentID, UUID groupID)
518 {
519 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
520
521 OSDMap ActiveGroup = new OSDMap();
522 ActiveGroup.Add("GroupID", OSD.FromUUID(groupID));
523 SimianAddGeneric(agentID, "Group", "ActiveGroup", ActiveGroup);
524 }
525
526 public void SetAgentActiveGroupRole(UUID requestingAgentID, UUID agentID, UUID groupID, UUID roleID)
527 {
528 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
529
530 OSDMap GroupMemberInfo;
531 if (!SimianGetGenericEntry(agentID, "GroupMember", groupID.ToString(), out GroupMemberInfo))
532 {
533 GroupMemberInfo = new OSDMap();
534 }
535
536 GroupMemberInfo["SelectedRoleID"] = OSD.FromUUID(roleID);
537 SimianAddGeneric(agentID, "GroupMember", groupID.ToString(), GroupMemberInfo);
538 }
539
540 public void SetAgentGroupInfo(UUID requestingAgentID, UUID agentID, UUID groupID, bool acceptNotices, bool listInProfile)
541 {
542 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
543
544 OSDMap GroupMemberInfo;
545 if (!SimianGetGenericEntry(agentID, "GroupMember", groupID.ToString(), out GroupMemberInfo))
546 {
547 GroupMemberInfo = new OSDMap();
548 }
549
550 GroupMemberInfo["AcceptNotices"] = OSD.FromBoolean(acceptNotices);
551 GroupMemberInfo["ListInProfile"] = OSD.FromBoolean(listInProfile);
552 GroupMemberInfo["Contribution"] = OSD.FromInteger(0);
553 GroupMemberInfo["SelectedRole"] = OSD.FromUUID(UUID.Zero);
554 SimianAddGeneric(agentID, "GroupMember", groupID.ToString(), GroupMemberInfo);
555 }
556
557 public void AddAgentToGroupInvite(UUID requestingAgentID, UUID inviteID, UUID groupID, UUID roleID, UUID agentID)
558 {
559 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
560
561 OSDMap Invite = new OSDMap();
562 Invite["AgentID"] = OSD.FromUUID(agentID);
563 Invite["RoleID"] = OSD.FromUUID(roleID);
564
565 SimianAddGeneric(groupID, "GroupMemberInvite", inviteID.ToString(), Invite);
566 }
567
568 public GroupInviteInfo GetAgentToGroupInvite(UUID requestingAgentID, UUID inviteID)
569 {
570 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
571
572 OSDMap GroupMemberInvite;
573 UUID GroupID;
574 if (!SimianGetFirstGenericEntry("GroupMemberInvite", inviteID.ToString(), out GroupID, out GroupMemberInvite))
575 {
576 return null;
577 }
578
579 GroupInviteInfo inviteInfo = new GroupInviteInfo();
580 inviteInfo.InviteID = inviteID;
581 inviteInfo.GroupID = GroupID;
582 inviteInfo.AgentID = GroupMemberInvite["AgentID"].AsUUID();
583 inviteInfo.RoleID = GroupMemberInvite["RoleID"].AsUUID();
584
585 return inviteInfo;
586 }
587
588 public void RemoveAgentToGroupInvite(UUID requestingAgentID, UUID inviteID)
589 {
590 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
591
592 GroupInviteInfo invite = GetAgentToGroupInvite(requestingAgentID, inviteID);
593 SimianRemoveGenericEntry(invite.GroupID, "GroupMemberInvite", inviteID.ToString());
594 }
595
596 public void AddAgentToGroup(UUID requestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID)
597 {
598 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
599
600 // Setup Agent/Group information
601 SetAgentGroupInfo(requestingAgentID, AgentID, GroupID, true, true);
602
603 // Add agent to Everyone Group
604 AddAgentToGroupRole(requestingAgentID, AgentID, GroupID, UUID.Zero);
605
606 // Add agent to Specified Role
607 AddAgentToGroupRole(requestingAgentID, AgentID, GroupID, RoleID);
608
609 // Set selected role in this group to specified role
610 SetAgentActiveGroupRole(requestingAgentID, AgentID, GroupID, RoleID);
611 }
612
613 public void RemoveAgentFromGroup(UUID requestingAgentID, UUID agentID, UUID groupID)
614 {
615 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
616
617 // If current active group is the group the agent is being removed from, change their group to UUID.Zero
618 GroupMembershipData memberActiveMembership = GetAgentActiveMembership(requestingAgentID, agentID);
619 if (memberActiveMembership.GroupID == groupID)
620 {
621 SetAgentActiveGroup(agentID, agentID, UUID.Zero);
622 }
623
624 // Remove Group Member information for this group
625 SimianRemoveGenericEntry(agentID, "GroupMember", groupID.ToString());
626
627 // By using a Simian Generics Type consisting of a prefix and a groupID,
628 // combined with RoleID as key allows us to get a list of roles a particular member
629 // of a group is assigned to.
630 string GroupRoleMemberType = "GroupRole" + groupID.ToString();
631
632 // Take Agent out of all other group roles
633 Dictionary<string, OSDMap> GroupRoles;
634 if (SimianGetGenericEntries(agentID, GroupRoleMemberType, out GroupRoles))
635 {
636 foreach (string roleID in GroupRoles.Keys)
637 {
638 SimianRemoveGenericEntry(agentID, GroupRoleMemberType, roleID);
639 }
640 }
641 }
642
643 public void AddAgentToGroupRole(UUID requestingAgentID, UUID agentID, UUID groupID, UUID roleID)
644 {
645 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
646
647 SimianAddGeneric(agentID, "GroupRole" + groupID.ToString(), roleID.ToString(), new OSDMap());
648 }
649
650 public void RemoveAgentFromGroupRole(UUID requestingAgentID, UUID agentID, UUID groupID, UUID roleID)
651 {
652 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
653
654 // Cannot remove members from the Everyone Role
655 if (roleID != UUID.Zero)
656 {
657 EnsureRoleNotSelectedByMember(groupID, roleID, agentID);
658
659 string GroupRoleMemberType = "GroupRole" + groupID.ToString();
660 SimianRemoveGenericEntry(agentID, GroupRoleMemberType, roleID.ToString());
661 }
662 }
663
664 public List<DirGroupsReplyData> FindGroups(UUID requestingAgentID, string search)
665 {
666 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
667
668 List<DirGroupsReplyData> findings = new List<DirGroupsReplyData>();
669
670 NameValueCollection requestArgs = new NameValueCollection
671 {
672 { "RequestMethod", "GetGenerics" },
673 { "Type", "Group" },
674 { "Key", search },
675 { "Fuzzy", "1" }
676 };
677
678
679 OSDMap response = CachedPostRequest(requestArgs);
680 if (response["Success"].AsBoolean() && response["Entries"] is OSDArray)
681 {
682 OSDArray entryArray = (OSDArray)response["Entries"];
683 foreach (OSDMap entryMap in entryArray)
684 {
685 DirGroupsReplyData data = new DirGroupsReplyData();
686 data.groupID = entryMap["OwnerID"].AsUUID();
687 data.groupName = entryMap["Key"].AsString();
688
689 // TODO: is there a better way to do this?
690 Dictionary<UUID, OSDMap> Members;
691 if (SimianGetGenericEntries("GroupMember", data.groupID.ToString(), out Members))
692 {
693 data.members = Members.Count;
694 }
695 else
696 {
697 data.members = 0;
698 }
699
700 // TODO: sort results?
701 // data.searchOrder = order;
702
703 findings.Add(data);
704 }
705 }
706
707
708 return findings;
709 }
710
711 public GroupMembershipData GetAgentGroupMembership(UUID requestingAgentID, UUID agentID, UUID groupID)
712 {
713 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
714
715 GroupMembershipData data = new GroupMembershipData();
716
717 ///////////////////////////////
718 // Agent Specific Information:
719 //
720 OSDMap UserActiveGroup;
721 if (SimianGetGenericEntry(agentID, "Group", "ActiveGroup", out UserActiveGroup))
722 {
723 data.Active = UserActiveGroup["GroupID"].AsUUID().Equals(groupID);
724 }
725
726 OSDMap UserGroupMemberInfo;
727 if( SimianGetGenericEntry(agentID, "GroupMember", groupID.ToString(), out UserGroupMemberInfo) )
728 {
729 data.AcceptNotices = UserGroupMemberInfo["AcceptNotices"].AsBoolean();
730 data.Contribution = UserGroupMemberInfo["Contribution"].AsInteger();
731 data.ListInProfile = UserGroupMemberInfo["ListInProfile"].AsBoolean();
732 data.ActiveRole = UserGroupMemberInfo["SelectedRoleID"].AsUUID();
733
734 ///////////////////////////////
735 // Role Specific Information:
736 //
737
738 OSDMap GroupRoleInfo;
739 if( SimianGetGenericEntry(groupID, "GroupRole", data.ActiveRole.ToString(), out GroupRoleInfo) )
740 {
741 data.GroupTitle = GroupRoleInfo["Title"].AsString();
742 data.GroupPowers = GroupRoleInfo["Powers"].AsULong();
743 }
744 }
745
746 ///////////////////////////////
747 // Group Specific Information:
748 //
749 OSDMap GroupInfo;
750 string GroupName;
751 if( SimianGetFirstGenericEntry(groupID, "Group", out GroupName, out GroupInfo) )
752 {
753 data.GroupID = groupID;
754 data.AllowPublish = GroupInfo["AllowPublish"].AsBoolean();
755 data.Charter = GroupInfo["Charter"].AsString();
756 data.FounderID = GroupInfo["FounderID"].AsUUID();
757 data.GroupName = GroupName;
758 data.GroupPicture = GroupInfo["InsigniaID"].AsUUID();
759 data.MaturePublish = GroupInfo["MaturePublish"].AsBoolean();
760 data.MembershipFee = GroupInfo["MembershipFee"].AsInteger();
761 data.OpenEnrollment = GroupInfo["OpenEnrollment"].AsBoolean();
762 data.ShowInList = GroupInfo["ShowInList"].AsBoolean();
763 }
764
765 return data;
766 }
767
768 public GroupMembershipData GetAgentActiveMembership(UUID requestingAgentID, UUID agentID)
769 {
770 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
771
772 UUID GroupID = UUID.Zero;
773 OSDMap UserActiveGroup;
774 if (SimianGetGenericEntry(agentID, "Group", "ActiveGroup", out UserActiveGroup))
775 {
776 GroupID = UserActiveGroup["GroupID"].AsUUID();
777 }
778
779 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] Active GroupID : {0}", GroupID.ToString());
780 return GetAgentGroupMembership(requestingAgentID, agentID, GroupID);
781 }
782
783 public List<GroupMembershipData> GetAgentGroupMemberships(UUID requestingAgentID, UUID agentID)
784 {
785 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
786
787 List<GroupMembershipData> memberships = new List<GroupMembershipData>();
788
789 Dictionary<string,OSDMap> GroupMemberShips;
790 if (SimianGetGenericEntries(agentID, "GroupMember", out GroupMemberShips))
791 {
792 foreach (string key in GroupMemberShips.Keys)
793 {
794 memberships.Add(GetAgentGroupMembership(requestingAgentID, agentID, UUID.Parse(key)));
795 }
796 }
797
798 return memberships;
799 }
800
801 public List<GroupRolesData> GetAgentGroupRoles(UUID requestingAgentID, UUID agentID, UUID groupID)
802 {
803 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
804
805 List<GroupRolesData> Roles = new List<GroupRolesData>();
806
807 Dictionary<string, OSDMap> GroupRoles;
808 if (SimianGetGenericEntries(groupID, "GroupRole", out GroupRoles))
809 {
810 Dictionary<string, OSDMap> MemberRoles;
811 if (SimianGetGenericEntries(agentID, "GroupRole" + groupID.ToString(), out MemberRoles))
812 {
813 foreach (KeyValuePair<string, OSDMap> kvp in MemberRoles)
814 {
815 GroupRolesData data = new GroupRolesData();
816 data.RoleID = UUID.Parse(kvp.Key);
817 data.Name = GroupRoles[kvp.Key]["Name"].AsString();
818 data.Description = GroupRoles[kvp.Key]["Description"].AsString();
819 data.Title = GroupRoles[kvp.Key]["Title"].AsString();
820 data.Powers = GroupRoles[kvp.Key]["Powers"].AsULong();
821
822 Roles.Add(data);
823 }
824 }
825 }
826 return Roles;
827 }
828
829 public List<GroupRolesData> GetGroupRoles(UUID requestingAgentID, UUID groupID)
830 {
831 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
832
833 List<GroupRolesData> Roles = new List<GroupRolesData>();
834
835 Dictionary<string, OSDMap> GroupRoles;
836 if (SimianGetGenericEntries(groupID, "GroupRole", out GroupRoles))
837 {
838 foreach (KeyValuePair<string, OSDMap> role in GroupRoles)
839 {
840 GroupRolesData data = new GroupRolesData();
841
842 data.RoleID = UUID.Parse(role.Key);
843
844 data.Name = role.Value["Name"].AsString();
845 data.Description = role.Value["Description"].AsString();
846 data.Title = role.Value["Title"].AsString();
847 data.Powers = role.Value["Powers"].AsULong();
848
849 Dictionary<UUID, OSDMap> GroupRoleMembers;
850 if (SimianGetGenericEntries("GroupRole" + groupID.ToString(), role.Key, out GroupRoleMembers))
851 {
852 data.Members = GroupRoleMembers.Count;
853 }
854 else
855 {
856 data.Members = 0;
857 }
858
859 Roles.Add(data);
860 }
861 }
862
863 return Roles;
864
865 }
866
867
868
869 public List<GroupMembersData> GetGroupMembers(UUID requestingAgentID, UUID GroupID)
870 {
871 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
872
873 List<GroupMembersData> members = new List<GroupMembersData>();
874
875 OSDMap GroupInfo;
876 string GroupName;
877 UUID GroupOwnerRoleID = UUID.Zero;
878 if (!SimianGetFirstGenericEntry(GroupID, "Group", out GroupName, out GroupInfo))
879 {
880 return members;
881 }
882 GroupOwnerRoleID = GroupInfo["OwnerRoleID"].AsUUID();
883
884 // Locally cache group roles, since we'll be needing this data for each member
885 Dictionary<string,OSDMap> GroupRoles;
886 SimianGetGenericEntries(GroupID, "GroupRole", out GroupRoles);
887
888 // Locally cache list of group owners
889 Dictionary<UUID, OSDMap> GroupOwners;
890 SimianGetGenericEntries("GroupRole" + GroupID.ToString(), GroupOwnerRoleID.ToString(), out GroupOwners);
891
892
893 Dictionary<UUID, OSDMap> GroupMembers;
894 if (SimianGetGenericEntries("GroupMember", GroupID.ToString(), out GroupMembers))
895 {
896 foreach (KeyValuePair<UUID, OSDMap> member in GroupMembers)
897 {
898 GroupMembersData data = new GroupMembersData();
899
900 data.AgentID = member.Key;
901
902 UUID SelectedRoleID = member.Value["SelectedRoleID"].AsUUID();
903
904 data.AcceptNotices = member.Value["AcceptNotices"].AsBoolean();
905 data.ListInProfile = member.Value["ListInProfile"].AsBoolean();
906 data.Contribution = member.Value["Contribution"].AsInteger();
907
908 data.IsOwner = GroupOwners.ContainsKey(member.Key);
909
910 OSDMap GroupRoleInfo = GroupRoles[SelectedRoleID.ToString()];
911 data.Title = GroupRoleInfo["Title"].AsString();
912 data.AgentPowers = GroupRoleInfo["Powers"].AsULong();
913
914 members.Add(data);
915 }
916 }
917
918 return members;
919
920 }
921
922 public List<GroupRoleMembersData> GetGroupRoleMembers(UUID requestingAgentID, UUID groupID)
923 {
924 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
925
926 List<GroupRoleMembersData> members = new List<GroupRoleMembersData>();
927
928 Dictionary<string, OSDMap> GroupRoles;
929 if (SimianGetGenericEntries(groupID, "GroupRole", out GroupRoles))
930 {
931 foreach( KeyValuePair<string, OSDMap> Role in GroupRoles )
932 {
933 Dictionary<UUID, OSDMap> GroupRoleMembers;
934 if( SimianGetGenericEntries("GroupRole"+groupID.ToString(), Role.Key, out GroupRoleMembers) )
935 {
936 foreach( KeyValuePair<UUID, OSDMap> GroupRoleMember in GroupRoleMembers )
937 {
938 GroupRoleMembersData data = new GroupRoleMembersData();
939
940 data.MemberID = GroupRoleMember.Key;
941 data.RoleID = UUID.Parse(Role.Key);
942
943 members.Add(data);
944 }
945 }
946 }
947 }
948
949 return members;
950 }
951
952 public List<GroupNoticeData> GetGroupNotices(UUID requestingAgentID, UUID GroupID)
953 {
954 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
955
956 List<GroupNoticeData> values = new List<GroupNoticeData>();
957
958 Dictionary<string, OSDMap> Notices;
959 if (SimianGetGenericEntries(GroupID, "GroupNotice", out Notices))
960 {
961 foreach (KeyValuePair<string, OSDMap> Notice in Notices)
962 {
963 GroupNoticeData data = new GroupNoticeData();
964 data.NoticeID = UUID.Parse(Notice.Key);
965 data.Timestamp = Notice.Value["TimeStamp"].AsUInteger();
966 data.FromName = Notice.Value["FromName"].AsString();
967 data.Subject = Notice.Value["Subject"].AsString();
968 data.HasAttachment = Notice.Value["BinaryBucket"].AsBinary().Length > 0;
969
970 //TODO: Figure out how to get this
971 data.AssetType = 0;
972
973 values.Add(data);
974 }
975 }
976
977 return values;
978
979 }
980 public GroupNoticeInfo GetGroupNotice(UUID requestingAgentID, UUID noticeID)
981 {
982 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
983
984 OSDMap GroupNotice;
985 UUID GroupID;
986 if (SimianGetFirstGenericEntry("GroupNotice", noticeID.ToString(), out GroupID, out GroupNotice))
987 {
988 GroupNoticeInfo data = new GroupNoticeInfo();
989 data.GroupID = GroupID;
990 data.Message = GroupNotice["Message"].AsString();
991 data.BinaryBucket = GroupNotice["BinaryBucket"].AsBinary();
992 data.noticeData.NoticeID = noticeID;
993 data.noticeData.Timestamp = GroupNotice["TimeStamp"].AsUInteger();
994 data.noticeData.FromName = GroupNotice["FromName"].AsString();
995 data.noticeData.Subject = GroupNotice["Subject"].AsString();
996 data.noticeData.HasAttachment = data.BinaryBucket.Length > 0;
997 data.noticeData.AssetType = 0;
998
999 if (data.Message == null)
1000 {
1001 data.Message = string.Empty;
1002 }
1003
1004 return data;
1005 }
1006 return null;
1007 }
1008 public void AddGroupNotice(UUID requestingAgentID, UUID groupID, UUID noticeID, string fromName, string subject, string message, byte[] binaryBucket)
1009 {
1010 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
1011
1012 OSDMap Notice = new OSDMap();
1013 Notice["TimeStamp"] = OSD.FromUInteger((uint)Util.UnixTimeSinceEpoch());
1014 Notice["FromName"] = OSD.FromString(fromName);
1015 Notice["Subject"] = OSD.FromString(subject);
1016 Notice["Message"] = OSD.FromString(message);
1017 Notice["BinaryBucket"] = OSD.FromBinary(binaryBucket);
1018
1019 SimianAddGeneric(groupID, "GroupNotice", noticeID.ToString(), Notice);
1020
1021 }
1022 #endregion
1023
1024 #region GroupSessionTracking
1025
1026 public void ResetAgentGroupChatSessions(UUID agentID)
1027 {
1028 Dictionary<string, OSDMap> agentSessions;
1029
1030 if (SimianGetGenericEntries(agentID, "GroupSessionDropped", out agentSessions))
1031 {
1032 foreach (string GroupID in agentSessions.Keys)
1033 {
1034 SimianRemoveGenericEntry(agentID, "GroupSessionDropped", GroupID);
1035 }
1036 }
1037
1038 if (SimianGetGenericEntries(agentID, "GroupSessionInvited", out agentSessions))
1039 {
1040 foreach (string GroupID in agentSessions.Keys)
1041 {
1042 SimianRemoveGenericEntry(agentID, "GroupSessionInvited", GroupID);
1043 }
1044 }
1045 }
1046
1047 public bool hasAgentDroppedGroupChatSession(UUID agentID, UUID groupID)
1048 {
1049 OSDMap session;
1050 return SimianGetGenericEntry(agentID, "GroupSessionDropped", groupID.ToString(), out session);
1051 }
1052
1053 public void AgentDroppedFromGroupChatSession(UUID agentID, UUID groupID)
1054 {
1055 SimianAddGeneric(agentID, "GroupSessionDropped", groupID.ToString(), new OSDMap());
1056 }
1057
1058 public void AgentInvitedToGroupChatSession(UUID agentID, UUID groupID)
1059 {
1060 SimianAddGeneric(agentID, "GroupSessionInvited", groupID.ToString(), new OSDMap());
1061 }
1062
1063 public bool hasAgentBeenInvitedToGroupChatSession(UUID agentID, UUID groupID)
1064 {
1065 OSDMap session;
1066 return SimianGetGenericEntry(agentID, "GroupSessionDropped", groupID.ToString(), out session);
1067 }
1068
1069 #endregion
1070
1071 private void EnsureRoleNotSelectedByMember(UUID groupID, UUID roleID, UUID userID)
1072 {
1073 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
1074
1075 // If member's SelectedRole is roleID, change their selected role to Everyone
1076 // before removing them from the role
1077 OSDMap UserGroupInfo;
1078 if (SimianGetGenericEntry(userID, "GroupMember", groupID.ToString(), out UserGroupInfo))
1079 {
1080 if (UserGroupInfo["SelectedRoleID"].AsUUID() == roleID)
1081 {
1082 UserGroupInfo["SelectedRoleID"] = OSD.FromUUID(UUID.Zero);
1083 }
1084 SimianAddGeneric(userID, "GroupMember", groupID.ToString(), UserGroupInfo);
1085 }
1086 }
1087
1088
1089 #region Simian Util Methods
1090 private bool SimianAddGeneric(UUID ownerID, string type, string key, OSDMap map)
1091 {
1092 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called ({1},{2},{3})", System.Reflection.MethodBase.GetCurrentMethod().Name, ownerID, type, key);
1093
1094 string value = OSDParser.SerializeJsonString(map);
1095
1096 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] value: {0}", value);
1097
1098 NameValueCollection RequestArgs = new NameValueCollection
1099 {
1100 { "RequestMethod", "AddGeneric" },
1101 { "OwnerID", ownerID.ToString() },
1102 { "Type", type },
1103 { "Key", key },
1104 { "Value", value}
1105 };
1106
1107
1108 OSDMap Response = CachedPostRequest(RequestArgs);
1109 if (Response["Success"].AsBoolean())
1110 {
1111 return true;
1112 }
1113 else
1114 {
1115 m_log.WarnFormat("[SIMIAN GROUPS CONNECTOR]: Error {0}, {1}, {2}, {3}", ownerID, type, key, Response["Message"]);
1116 return false;
1117 }
1118 }
1119
1120 /// <summary>
1121 /// Returns the first of possibly many entries for Owner/Type pair
1122 /// </summary>
1123 private bool SimianGetFirstGenericEntry(UUID ownerID, string type, out string key, out OSDMap map)
1124 {
1125 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called ({1},{2})", System.Reflection.MethodBase.GetCurrentMethod().Name, ownerID, type);
1126
1127 NameValueCollection RequestArgs = new NameValueCollection
1128 {
1129 { "RequestMethod", "GetGenerics" },
1130 { "OwnerID", ownerID.ToString() },
1131 { "Type", type }
1132 };
1133
1134
1135 OSDMap Response = CachedPostRequest(RequestArgs);
1136 if (Response["Success"].AsBoolean() && Response["Entries"] is OSDArray)
1137 {
1138 OSDArray entryArray = (OSDArray)Response["Entries"];
1139 if (entryArray.Count >= 1)
1140 {
1141 OSDMap entryMap = entryArray[0] as OSDMap;
1142 key = entryMap["Key"].AsString();
1143 map = (OSDMap)OSDParser.DeserializeJson(entryMap["Value"].AsString());
1144
1145 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] Generics Result {0}", entryMap["Value"].AsString());
1146
1147 return true;
1148 }
1149 else
1150 {
1151 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] No Generics Results");
1152 }
1153 }
1154 else
1155 {
1156 m_log.WarnFormat("[SIMIAN GROUPS CONNECTOR]: Error retrieving group info ({0})", Response["Message"]);
1157 }
1158 key = null;
1159 map = null;
1160 return false;
1161 }
1162 private bool SimianGetFirstGenericEntry(string type, string key, out UUID ownerID, out OSDMap map)
1163 {
1164 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called ({1},{2})", System.Reflection.MethodBase.GetCurrentMethod().Name, type, key);
1165
1166
1167 NameValueCollection RequestArgs = new NameValueCollection
1168 {
1169 { "RequestMethod", "GetGenerics" },
1170 { "Type", type },
1171 { "Key", key}
1172 };
1173
1174
1175 OSDMap Response = CachedPostRequest(RequestArgs);
1176 if (Response["Success"].AsBoolean() && Response["Entries"] is OSDArray)
1177 {
1178 OSDArray entryArray = (OSDArray)Response["Entries"];
1179 if (entryArray.Count >= 1)
1180 {
1181 OSDMap entryMap = entryArray[0] as OSDMap;
1182 ownerID = entryMap["OwnerID"].AsUUID();
1183 map = (OSDMap)OSDParser.DeserializeJson(entryMap["Value"].AsString());
1184
1185 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] Generics Result {0}", entryMap["Value"].AsString());
1186
1187 return true;
1188 }
1189 else
1190 {
1191 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] No Generics Results");
1192 }
1193 }
1194 else
1195 {
1196 m_log.WarnFormat("[SIMIAN GROUPS CONNECTOR]: Error retrieving group info ({0})", Response["Message"]);
1197 }
1198 ownerID = UUID.Zero;
1199 map = null;
1200 return false;
1201 }
1202
1203 private bool SimianGetGenericEntry(UUID ownerID, string type, string key, out OSDMap map)
1204 {
1205 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called ({1},{2},{3})", System.Reflection.MethodBase.GetCurrentMethod().Name, ownerID, type, key);
1206
1207 NameValueCollection RequestArgs = new NameValueCollection
1208 {
1209 { "RequestMethod", "GetGenerics" },
1210 { "OwnerID", ownerID.ToString() },
1211 { "Type", type },
1212 { "Key", key}
1213 };
1214
1215
1216 OSDMap Response = CachedPostRequest(RequestArgs);
1217 if (Response["Success"].AsBoolean() && Response["Entries"] is OSDArray)
1218 {
1219 OSDArray entryArray = (OSDArray)Response["Entries"];
1220 if (entryArray.Count == 1)
1221 {
1222 OSDMap entryMap = entryArray[0] as OSDMap;
1223 key = entryMap["Key"].AsString();
1224 map = (OSDMap)OSDParser.DeserializeJson(entryMap["Value"].AsString());
1225
1226 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] Generics Result {0}", entryMap["Value"].AsString());
1227
1228 return true;
1229 }
1230 else
1231 {
1232 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] No Generics Results");
1233 }
1234 }
1235 else
1236 {
1237 m_log.WarnFormat("[SIMIAN GROUPS CONNECTOR]: Error retrieving group info ({0})", Response["Message"]);
1238 }
1239 map = null;
1240 return false;
1241 }
1242
1243 private bool SimianGetGenericEntries(UUID ownerID, string type, out Dictionary<string, OSDMap> maps)
1244 {
1245 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called ({1},{2})", System.Reflection.MethodBase.GetCurrentMethod().Name,ownerID, type);
1246
1247 NameValueCollection requestArgs = new NameValueCollection
1248 {
1249 { "RequestMethod", "GetGenerics" },
1250 { "OwnerID", ownerID.ToString() },
1251 { "Type", type }
1252 };
1253
1254
1255
1256 OSDMap response = CachedPostRequest(requestArgs);
1257 if (response["Success"].AsBoolean() && response["Entries"] is OSDArray)
1258 {
1259 maps = new Dictionary<string, OSDMap>();
1260
1261 OSDArray entryArray = (OSDArray)response["Entries"];
1262 foreach (OSDMap entryMap in entryArray)
1263 {
1264 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] Generics Result {0}", entryMap["Value"].AsString());
1265 maps.Add(entryMap["Key"].AsString(), (OSDMap)OSDParser.DeserializeJson(entryMap["Value"].AsString()));
1266 }
1267 if(maps.Count == 0)
1268 {
1269 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] No Generics Results");
1270 }
1271
1272 return true;
1273 }
1274 else
1275 {
1276 maps = null;
1277 m_log.WarnFormat("[SIMIAN GROUPS CONNECTOR]: Error retrieving group info ({0})", response["Message"]);
1278 }
1279 return false;
1280 }
1281 private bool SimianGetGenericEntries(string type, string key, out Dictionary<UUID, OSDMap> maps)
1282 {
1283 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called ({1},{2})", System.Reflection.MethodBase.GetCurrentMethod().Name, type, key);
1284
1285 NameValueCollection requestArgs = new NameValueCollection
1286 {
1287 { "RequestMethod", "GetGenerics" },
1288 { "Type", type },
1289 { "Key", key }
1290 };
1291
1292
1293
1294 OSDMap response = CachedPostRequest(requestArgs);
1295 if (response["Success"].AsBoolean() && response["Entries"] is OSDArray)
1296 {
1297 maps = new Dictionary<UUID, OSDMap>();
1298
1299 OSDArray entryArray = (OSDArray)response["Entries"];
1300 foreach (OSDMap entryMap in entryArray)
1301 {
1302 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] Generics Result {0}", entryMap["Value"].AsString());
1303 maps.Add(entryMap["OwnerID"].AsUUID(), (OSDMap)OSDParser.DeserializeJson(entryMap["Value"].AsString()));
1304 }
1305 if (maps.Count == 0)
1306 {
1307 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] No Generics Results");
1308 }
1309 return true;
1310 }
1311 else
1312 {
1313 maps = null;
1314 m_log.WarnFormat("[SIMIAN-GROUPS-CONNECTOR]: Error retrieving group info ({0})", response["Message"]);
1315 }
1316 return false;
1317 }
1318
1319 private bool SimianRemoveGenericEntry(UUID ownerID, string type, string key)
1320 {
1321 if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called ({1},{2},{3})", System.Reflection.MethodBase.GetCurrentMethod().Name, ownerID, type, key);
1322
1323 NameValueCollection requestArgs = new NameValueCollection
1324 {
1325 { "RequestMethod", "RemoveGeneric" },
1326 { "OwnerID", ownerID.ToString() },
1327 { "Type", type },
1328 { "Key", key }
1329 };
1330
1331
1332 OSDMap response = CachedPostRequest(requestArgs);
1333 if (response["Success"].AsBoolean())
1334 {
1335 return true;
1336 }
1337 else
1338 {
1339 m_log.WarnFormat("[SIMIAN GROUPS CONNECTOR]: Error {0}, {1}, {2}, {3}", ownerID, type, key, response["Message"]);
1340 return false;
1341 }
1342 }
1343 #endregion
1344
1345 #region CheesyCache
1346 OSDMap CachedPostRequest(NameValueCollection requestArgs)
1347 {
1348 // Immediately forward the request if the cache is disabled.
1349 if (m_cacheTimeout == 0)
1350 {
1351 return WebUtil.PostToService(m_groupsServerURI, requestArgs);
1352 }
1353
1354 // Check if this is an update or a request
1355 if ( requestArgs["RequestMethod"] == "RemoveGeneric"
1356 || requestArgs["RequestMethod"] == "AddGeneric"
1357 )
1358
1359 {
1360 // Any and all updates cause the cache to clear
1361 m_memoryCache.Clear();
1362
1363 // Send update to server, return the response without caching it
1364 return WebUtil.PostToService(m_groupsServerURI, requestArgs);
1365
1366 }
1367
1368 // If we're not doing an update, we must be requesting data
1369
1370 // Create the cache key for the request and see if we have it cached
1371 string CacheKey = WebUtil.BuildQueryString(requestArgs);
1372 OSDMap response = null;
1373 if (!m_memoryCache.TryGetValue(CacheKey, out response))
1374 {
1375 // if it wasn't in the cache, pass the request to the Simian Grid Services
1376 response = WebUtil.PostToService(m_groupsServerURI, requestArgs);
1377
1378 // and cache the response
1379 m_memoryCache.AddOrUpdate(CacheKey, response, TimeSpan.FromSeconds(m_cacheTimeout));
1380 }
1381
1382 // return cached response
1383 return response;
1384 }
1385 #endregion
1386
1387 }
1388
1389}
1390
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs
index 2a60b00..79b9a16 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs
@@ -29,6 +29,7 @@ using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Reflection; 31using System.Reflection;
32using System.Text;
32 33
33using Nwc.XmlRpc; 34using Nwc.XmlRpc;
34 35
@@ -40,7 +41,9 @@ using OpenMetaverse;
40using OpenMetaverse.StructuredData; 41using OpenMetaverse.StructuredData;
41 42
42using OpenSim.Framework; 43using OpenSim.Framework;
44using OpenSim.Framework.Communications;
43using OpenSim.Region.Framework.Interfaces; 45using OpenSim.Region.Framework.Interfaces;
46using OpenSim.Services.Interfaces;
44 47
45namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups 48namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
46{ 49{
@@ -66,6 +69,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
66 private string m_groupReadKey = string.Empty; 69 private string m_groupReadKey = string.Empty;
67 private string m_groupWriteKey = string.Empty; 70 private string m_groupWriteKey = string.Empty;
68 71
72 private IUserAccountService m_accountService = null;
73
74 private ExpiringCache<string, XmlRpcResponse> m_memoryCache;
75 private int m_cacheTimeout = 30;
69 76
70 // Used to track which agents are have dropped from a group chat session 77 // Used to track which agents are have dropped from a group chat session
71 // Should be reset per agent, on logon 78 // Should be reset per agent, on logon
@@ -108,7 +115,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
108 return; 115 return;
109 } 116 }
110 117
111 m_log.InfoFormat("[GROUPS-CONNECTOR]: Initializing {0}", this.Name); 118 m_log.InfoFormat("[XMLRPC-GROUPS-CONNECTOR]: Initializing {0}", this.Name);
112 119
113 m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty); 120 m_groupsServerURI = groupsConfig.GetString("GroupsServerURI", string.Empty);
114 if ((m_groupsServerURI == null) || 121 if ((m_groupsServerURI == null) ||
@@ -124,23 +131,39 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
124 m_groupReadKey = groupsConfig.GetString("XmlRpcServiceReadKey", string.Empty); 131 m_groupReadKey = groupsConfig.GetString("XmlRpcServiceReadKey", string.Empty);
125 m_groupWriteKey = groupsConfig.GetString("XmlRpcServiceWriteKey", string.Empty); 132 m_groupWriteKey = groupsConfig.GetString("XmlRpcServiceWriteKey", string.Empty);
126 133
127
128 134
135 m_cacheTimeout = groupsConfig.GetInt("GroupsCacheTimeout", 30);
136 if (m_cacheTimeout == 0)
137 {
138 m_log.WarnFormat("[XMLRPC-GROUPS-CONNECTOR]: Groups Cache Disabled.");
139 }
140 else
141 {
142 m_log.InfoFormat("[XMLRPC-GROUPS-CONNECTOR]: Groups Cache Timeout set to {0}.", m_cacheTimeout);
143 }
129 144
130 // If we got all the config options we need, lets start'er'up 145 // If we got all the config options we need, lets start'er'up
146 m_memoryCache = new ExpiringCache<string, XmlRpcResponse>();
131 m_connectorEnabled = true; 147 m_connectorEnabled = true;
132 } 148 }
133 } 149 }
134 150
135 public void Close() 151 public void Close()
136 { 152 {
137 m_log.InfoFormat("[GROUPS-CONNECTOR]: Closing {0}", this.Name); 153 m_log.InfoFormat("[XMLRPC-GROUPS-CONNECTOR]: Closing {0}", this.Name);
138 } 154 }
139 155
140 public void AddRegion(OpenSim.Region.Framework.Scenes.Scene scene) 156 public void AddRegion(OpenSim.Region.Framework.Scenes.Scene scene)
141 { 157 {
142 if (m_connectorEnabled) 158 if (m_connectorEnabled)
143 { 159 {
160
161 if (m_accountService == null)
162 {
163 m_accountService = scene.UserAccountService;
164 }
165
166
144 scene.RegisterModuleInterface<IGroupsServicesConnector>(this); 167 scene.RegisterModuleInterface<IGroupsServicesConnector>(this);
145 } 168 }
146 } 169 }
@@ -909,50 +932,84 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
909 /// </summary> 932 /// </summary>
910 private Hashtable XmlRpcCall(UUID requestingAgentID, string function, Hashtable param) 933 private Hashtable XmlRpcCall(UUID requestingAgentID, string function, Hashtable param)
911 { 934 {
912 string UserService; 935 XmlRpcResponse resp = null;
913 UUID SessionID; 936 string CacheKey = null;
914 GetClientGroupRequestID(requestingAgentID, out UserService, out SessionID); 937
915 param.Add("requestingAgentID", requestingAgentID.ToString()); 938 // Only bother with the cache if it isn't disabled.
916 param.Add("RequestingAgentUserService", UserService); 939 if (m_cacheTimeout > 0)
917 param.Add("RequestingSessionID", SessionID.ToString()); 940 {
918 941 if (!function.StartsWith("groups.get"))
942 {
943 // Any and all updates cause the cache to clear
944 m_memoryCache.Clear();
945 }
946 else
947 {
948 StringBuilder sb = new StringBuilder(requestingAgentID + function);
949 foreach (object key in param.Keys)
950 {
951 if (param[key] != null)
952 {
953 sb.AppendFormat(",{0}:{1}", key.ToString(), param[key].ToString());
954 }
955 }
956
957 CacheKey = sb.ToString();
958 m_memoryCache.TryGetValue(CacheKey, out resp);
959 }
919 960
920 param.Add("ReadKey", m_groupReadKey); 961 }
921 param.Add("WriteKey", m_groupWriteKey); 962
963 if( resp == null )
964 {
965 string UserService;
966 UUID SessionID;
967 GetClientGroupRequestID(requestingAgentID, out UserService, out SessionID);
968 param.Add("requestingAgentID", requestingAgentID.ToString());
969 param.Add("RequestingAgentUserService", UserService);
970 param.Add("RequestingSessionID", SessionID.ToString());
922 971
923 972
924 IList parameters = new ArrayList(); 973 param.Add("ReadKey", m_groupReadKey);
925 parameters.Add(param); 974 param.Add("WriteKey", m_groupWriteKey);
926 975
927 ConfigurableKeepAliveXmlRpcRequest req;
928 req = new ConfigurableKeepAliveXmlRpcRequest(function, parameters, m_disableKeepAlive);
929 976
930 XmlRpcResponse resp = null; 977 IList parameters = new ArrayList();
978 parameters.Add(param);
931 979
932 try 980 ConfigurableKeepAliveXmlRpcRequest req;
933 { 981 req = new ConfigurableKeepAliveXmlRpcRequest(function, parameters, m_disableKeepAlive);
934 resp = req.Send(m_groupsServerURI, 10000);
935 }
936 catch (Exception e)
937 {
938
939 982
940 m_log.ErrorFormat("[XMLRPCGROUPDATA]: An error has occured while attempting to access the XmlRpcGroups server method: {0}", function);
941 m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", e.ToString());
942 983
943 foreach (string ResponseLine in req.RequestResponse.Split(new string[] { Environment.NewLine },StringSplitOptions.None)) 984 try
944 { 985 {
945 m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", ResponseLine); 986 resp = req.Send(m_groupsServerURI, 10000);
946 }
947 987
948 foreach (string key in param.Keys) 988 if ((m_cacheTimeout > 0) && (CacheKey != null))
989 {
990 m_memoryCache.AddOrUpdate(CacheKey, resp, TimeSpan.FromSeconds(m_cacheTimeout));
991 }
992
993 }
994 catch (Exception e)
949 { 995 {
950 m_log.WarnFormat("[XMLRPCGROUPDATA]: {0} :: {1}", key, param[key].ToString()); 996 m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: An error has occured while attempting to access the XmlRpcGroups server method: {0}", function);
997 m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: {0} ", e.ToString());
998
999 foreach (string ResponseLine in req.RequestResponse.Split(new string[] { Environment.NewLine }, StringSplitOptions.None))
1000 {
1001 m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: {0} ", ResponseLine);
1002 }
1003
1004 foreach (string key in param.Keys)
1005 {
1006 m_log.WarnFormat("[XMLRPC-GROUPS-CONNECTOR]: {0} :: {1}", key, param[key].ToString());
1007 }
1008
1009 Hashtable respData = new Hashtable();
1010 respData.Add("error", e.ToString());
1011 return respData;
951 } 1012 }
952
953 Hashtable respData = new Hashtable();
954 respData.Add("error", e.ToString());
955 return respData;
956 } 1013 }
957 1014
958 if (resp.Value is Hashtable) 1015 if (resp.Value is Hashtable)
@@ -966,21 +1023,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
966 return respData; 1023 return respData;
967 } 1024 }
968 1025
969 m_log.ErrorFormat("[XMLRPCGROUPDATA]: The XmlRpc server returned a {1} instead of a hashtable for {0}", function, resp.Value.GetType().ToString()); 1026 m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: The XmlRpc server returned a {1} instead of a hashtable for {0}", function, resp.Value.GetType().ToString());
970 1027
971 if (resp.Value is ArrayList) 1028 if (resp.Value is ArrayList)
972 { 1029 {
973 ArrayList al = (ArrayList)resp.Value; 1030 ArrayList al = (ArrayList)resp.Value;
974 m_log.ErrorFormat("[XMLRPCGROUPDATA]: Contains {0} elements", al.Count); 1031 m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: Contains {0} elements", al.Count);
975 1032
976 foreach (object o in al) 1033 foreach (object o in al)
977 { 1034 {
978 m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} :: {1}", o.GetType().ToString(), o.ToString()); 1035 m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: {0} :: {1}", o.GetType().ToString(), o.ToString());
979 } 1036 }
980 } 1037 }
981 else 1038 else
982 { 1039 {
983 m_log.ErrorFormat("[XMLRPCGROUPDATA]: Function returned: {0}", resp.Value.ToString()); 1040 m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: Function returned: {0}", resp.Value.ToString());
984 } 1041 }
985 1042
986 Hashtable error = new Hashtable(); 1043 Hashtable error = new Hashtable();
@@ -990,16 +1047,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
990 1047
991 private void LogRespDataToConsoleError(Hashtable respData) 1048 private void LogRespDataToConsoleError(Hashtable respData)
992 { 1049 {
993 m_log.Error("[XMLRPCGROUPDATA]: Error:"); 1050 m_log.Error("[XMLRPC-GROUPS-CONNECTOR]: Error:");
994 1051
995 foreach (string key in respData.Keys) 1052 foreach (string key in respData.Keys)
996 { 1053 {
997 m_log.ErrorFormat("[XMLRPCGROUPDATA]: Key: {0}", key); 1054 m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: Key: {0}", key);
998 1055
999 string[] lines = respData[key].ToString().Split(new char[] { '\n' }); 1056 string[] lines = respData[key].ToString().Split(new char[] { '\n' });
1000 foreach (string line in lines) 1057 foreach (string line in lines)
1001 { 1058 {
1002 m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0}", line); 1059 m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: {0}", line);
1003 } 1060 }
1004 1061
1005 } 1062 }