aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Addons
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Addons')
-rw-r--r--OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnectorModule.cs9
-rw-r--r--OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs2
-rw-r--r--OpenSim/Addons/Groups/RemoteConnectorCacheWrapper.cs9
-rw-r--r--OpenSim/Addons/Groups/Service/GroupsService.cs6
4 files changed, 18 insertions, 8 deletions
diff --git a/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnectorModule.cs b/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnectorModule.cs
index d1c02db..f1cf66c 100644
--- a/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnectorModule.cs
+++ b/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnectorModule.cs
@@ -74,11 +74,8 @@ namespace OpenSim.Groups
74 { 74 {
75 IConfig groupsConfig = config.Configs["Groups"]; 75 IConfig groupsConfig = config.Configs["Groups"];
76 string url = groupsConfig.GetString("GroupsServerURI", string.Empty); 76 string url = groupsConfig.GetString("GroupsServerURI", string.Empty);
77 if (url == string.Empty) 77 if (!Uri.IsWellFormedUriString(url, UriKind.Absolute))
78 { 78 throw new Exception(string.Format("[Groups.RemoteConnector]: Malformed groups server URL {0}. Fix it or disable the Groups feature.", url));
79 m_log.WarnFormat("[Groups.RemoteConnector]: Groups server URL not provided. Groups will not work.");
80 return;
81 }
82 79
83 m_GroupsService = new GroupsServiceRemoteConnector(url); 80 m_GroupsService = new GroupsServiceRemoteConnector(url);
84 m_Scenes = new List<Scene>(); 81 m_Scenes = new List<Scene>();
@@ -273,7 +270,7 @@ namespace OpenSim.Groups
273 public bool AddGroupRole(string RequestingAgentID, UUID groupID, UUID roleID, string name, string description, string title, ulong powers, out string reason) 270 public bool AddGroupRole(string RequestingAgentID, UUID groupID, UUID roleID, string name, string description, string title, ulong powers, out string reason)
274 { 271 {
275 string r = string.Empty; 272 string r = string.Empty;
276 bool success = m_CacheWrapper.AddGroupRole(roleID, description, name, powers, title, delegate 273 bool success = m_CacheWrapper.AddGroupRole(groupID, roleID, description, name, powers, title, delegate
277 { 274 {
278 return m_GroupsService.AddGroupRole(RequestingAgentID, groupID, roleID, name, description, title, powers, out r); 275 return m_GroupsService.AddGroupRole(RequestingAgentID, groupID, roleID, name, description, title, powers, out r);
279 }); 276 });
diff --git a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs
index 8c257ed..f991d01 100644
--- a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs
+++ b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs
@@ -371,7 +371,7 @@ namespace OpenSim.Groups
371 Dictionary<string, object> result = new Dictionary<string, object>(); 371 Dictionary<string, object> result = new Dictionary<string, object>();
372 372
373 if (!request.ContainsKey("RequestingAgentID") || !request.ContainsKey("GroupID") || !request.ContainsKey("RoleID") || 373 if (!request.ContainsKey("RequestingAgentID") || !request.ContainsKey("GroupID") || !request.ContainsKey("RoleID") ||
374 !request.ContainsKey("Name") || !request.ContainsKey("Descrption") || !request.ContainsKey("Title") || 374 !request.ContainsKey("Name") || !request.ContainsKey("Description") || !request.ContainsKey("Title") ||
375 !request.ContainsKey("Powers") || !request.ContainsKey("OP")) 375 !request.ContainsKey("Powers") || !request.ContainsKey("OP"))
376 NullResult(result, "Bad network data"); 376 NullResult(result, "Bad network data");
377 377
diff --git a/OpenSim/Addons/Groups/RemoteConnectorCacheWrapper.cs b/OpenSim/Addons/Groups/RemoteConnectorCacheWrapper.cs
index f789626..e7d38c2 100644
--- a/OpenSim/Addons/Groups/RemoteConnectorCacheWrapper.cs
+++ b/OpenSim/Addons/Groups/RemoteConnectorCacheWrapper.cs
@@ -393,7 +393,7 @@ namespace OpenSim.Groups
393 } 393 }
394 } 394 }
395 395
396 public bool AddGroupRole(UUID roleID, string description, string name, ulong powers, string title, BooleanDelegate d) 396 public bool AddGroupRole(UUID groupID, UUID roleID, string description, string name, ulong powers, string title, BooleanDelegate d)
397 { 397 {
398 if (d()) 398 if (d())
399 { 399 {
@@ -406,8 +406,15 @@ namespace OpenSim.Groups
406 role.Title = title; 406 role.Title = title;
407 407
408 lock (m_Cache) 408 lock (m_Cache)
409 {
409 m_Cache.AddOrUpdate("role-" + roleID.ToString(), role, GROUPS_CACHE_TIMEOUT); 410 m_Cache.AddOrUpdate("role-" + roleID.ToString(), role, GROUPS_CACHE_TIMEOUT);
410 411
412 // also remove this list
413 if (m_Cache.Contains("roles-" + groupID.ToString()))
414 m_Cache.Remove("roles-" + groupID.ToString());
415
416 }
417
411 return true; 418 return true;
412 } 419 }
413 420
diff --git a/OpenSim/Addons/Groups/Service/GroupsService.cs b/OpenSim/Addons/Groups/Service/GroupsService.cs
index fc567dd..0668870 100644
--- a/OpenSim/Addons/Groups/Service/GroupsService.cs
+++ b/OpenSim/Addons/Groups/Service/GroupsService.cs
@@ -785,10 +785,16 @@ namespace OpenSim.Groups
785 RoleData data = m_Database.RetrieveRole(groupID, roleID); 785 RoleData data = m_Database.RetrieveRole(groupID, roleID);
786 786
787 if (add && data != null) // it already exists, can't create 787 if (add && data != null) // it already exists, can't create
788 {
789 m_log.DebugFormat("[Groups]: Group {0} already exists. Can't create it again", groupID);
788 return false; 790 return false;
791 }
789 792
790 if (!add && data == null) // it deosn't exist, can't update 793 if (!add && data == null) // it deosn't exist, can't update
794 {
795 m_log.DebugFormat("[Groups]: Group {0} doesn't exist. Can't update it", groupID);
791 return false; 796 return false;
797 }
792 798
793 if (add) 799 if (add)
794 data = new RoleData(); 800 data = new RoleData();