aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2010-09-21 04:03:14 +0100
committerMelanie2010-09-21 04:03:14 +0100
commit9feef34a8144ee7661f8c6207a2a2e432c58eccf (patch)
tree7e04dfd88a6d02ff7fd2b2e45bf0d92d8db90ec8 /OpenSim/Region
parentOverwrite the core version of the string parsing method with ours (diff)
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC_OLD-9feef34a8144ee7661f8c6207a2a2e432c58eccf.zip
opensim-SC_OLD-9feef34a8144ee7661f8c6207a2a2e432c58eccf.tar.gz
opensim-SC_OLD-9feef34a8144ee7661f8c6207a2a2e432c58eccf.tar.bz2
opensim-SC_OLD-9feef34a8144ee7661f8c6207a2a2e432c58eccf.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs30
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs35
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs11
7 files changed, 69 insertions, 31 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 6094bad..edbae59 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -316,7 +316,7 @@ namespace OpenSim
316 m_console.Commands.AddCommand("region", false, "create region", 316 m_console.Commands.AddCommand("region", false, "create region",
317 "create region [\"region name\"] <region_file.ini>", 317 "create region [\"region name\"] <region_file.ini>",
318 "Create a new region.", 318 "Create a new region.",
319 "The settings for \"region name\" are read from <region_file.ini> in your Regions directory." 319 "The settings for \"region name\" are read from <region_file.ini>. Paths specified with <region_file.ini> are relative to your Regions directory, unless an absolute path is given."
320 + " If \"region name\" does not exist in <region_file.ini>, it will be added." + Environment.NewLine 320 + " If \"region name\" does not exist in <region_file.ini>, it will be added." + Environment.NewLine
321 + "Without \"region name\", the first region found in <region_file.ini> will be created." + Environment.NewLine 321 + "Without \"region name\", the first region found in <region_file.ini> will be created." + Environment.NewLine
322 + "If <region_file.ini> does not exist, it will be created.", 322 + "If <region_file.ini> does not exist, it will be created.",
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
index 06b1b00..2a590f1 100644
--- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
@@ -263,9 +263,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
263 263
264 public virtual void OnChatBroadcast(Object sender, OSChatMessage c) 264 public virtual void OnChatBroadcast(Object sender, OSChatMessage c)
265 { 265 {
266 // unless the chat to be broadcast is of type Region, we 266 if (c.Channel != 0 && c.Channel != DEBUG_CHANNEL) return;
267 // drop it if its channel is neither 0 nor DEBUG_CHANNEL
268 if (c.Channel != 0 && c.Channel != DEBUG_CHANNEL && c.Type != ChatTypeEnum.Region) return;
269 267
270 ChatTypeEnum cType = c.Type; 268 ChatTypeEnum cType = c.Type;
271 if (c.Channel == DEBUG_CHANNEL) 269 if (c.Channel == DEBUG_CHANNEL)
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index ecfd211..289741f 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -238,7 +238,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
238 m_scene.Permissions.OnEditNotecard += CanEditNotecard; //NOT YET IMPLEMENTED 238 m_scene.Permissions.OnEditNotecard += CanEditNotecard; //NOT YET IMPLEMENTED
239 m_scene.Permissions.OnEditScript += CanEditScript; //NOT YET IMPLEMENTED 239 m_scene.Permissions.OnEditScript += CanEditScript; //NOT YET IMPLEMENTED
240 240
241 m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory; //NOT IMPLEMENTED HERE 241 m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory;
242 m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED 242 m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED
243 m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; //NOT YET IMPLEMENTED 243 m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; //NOT YET IMPLEMENTED
244 m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; //NOT YET IMPLEMENTED 244 m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; //NOT YET IMPLEMENTED
@@ -1780,10 +1780,28 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1780 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1780 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1781 if (m_bypassPermissions) return m_bypassPermissionsValue; 1781 if (m_bypassPermissions) return m_bypassPermissionsValue;
1782 1782
1783 if ((int)InventoryType.LSL == invType) 1783 SceneObjectPart part = m_scene.GetSceneObjectPart(objectID);
1784 if (m_allowedScriptCreators == UserSet.Administrators && !IsAdministrator(userID)) 1784 ScenePresence p = m_scene.GetScenePresence(userID);
1785 return false; 1785
1786 1786 if (part == null || p == null)
1787 return false;
1788
1789 if (!IsAdministrator(userID))
1790 {
1791 if (part.OwnerID != userID)
1792 {
1793 // Group permissions
1794 if ((part.GroupID == UUID.Zero) || (p.ControllingClient.GetGroupPowers(part.GroupID) == 0) || ((part.GroupMask & (uint)PermissionMask.Modify) == 0))
1795 return false;
1796 } else {
1797 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
1798 return false;
1799 }
1800 if ((int)InventoryType.LSL == invType)
1801 if (m_allowedScriptCreators == UserSet.Administrators)
1802 return false;
1803 }
1804
1787 return true; 1805 return true;
1788 } 1806 }
1789 1807
@@ -1980,4 +1998,4 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1980 return false; 1998 return false;
1981 } 1999 }
1982 } 2000 }
1983} \ No newline at end of file 2001}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index ac82fda..18cfcbc 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1532,16 +1532,6 @@ namespace OpenSim.Region.Framework.Scenes
1532 if (part == null) 1532 if (part == null)
1533 return; 1533 return;
1534 1534
1535 if (part.OwnerID != remoteClient.AgentId)
1536 {
1537 // Group permissions
1538 if ((part.GroupID == UUID.Zero) || (remoteClient.GetGroupPowers(part.GroupID) == 0) || ((part.GroupMask & (uint)PermissionMask.Modify) == 0))
1539 return;
1540 } else {
1541 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
1542 return;
1543 }
1544
1545 if (!Permissions.CanCreateObjectInventory( 1535 if (!Permissions.CanCreateObjectInventory(
1546 itemBase.InvType, part.UUID, remoteClient.AgentId)) 1536 itemBase.InvType, part.UUID, remoteClient.AgentId))
1547 return; 1537 return;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index f9bfffd..62245d4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -424,8 +424,12 @@ namespace OpenSim.Region.Framework.Scenes
424 get { return m_rootPart.UUID; } 424 get { return m_rootPart.UUID; }
425 set 425 set
426 { 426 {
427 m_rootPart.UUID = value; 427 lock (m_parts.SyncRoot)
428 m_parts.AddOrReplace(value, m_rootPart); 428 {
429 m_parts.Remove(m_rootPart.UUID);
430 m_rootPart.UUID = value;
431 m_parts.Add(value, m_rootPart);
432 }
429 } 433 }
430 } 434 }
431 435
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
index 54b3260..e6ff0c0 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
@@ -189,5 +189,40 @@ namespace OpenSim.Region.Framework.Scenes.Tests
189 // SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); 189 // SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
190 // Assert.That(retrievedPart, Is.Null); 190 // Assert.That(retrievedPart, Is.Null);
191 //} 191 //}
192
193 /// <summary>
194 /// Changing a scene object uuid changes the root part uuid. This is a valid operation if the object is not
195 /// in a scene and is useful if one wants to supply a UUID directly rather than use the one generated by
196 /// OpenSim.
197 /// </summary>
198 [Test]
199 public void TestChangeSceneObjectUuid()
200 {
201 string rootPartName = "rootpart";
202 UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001");
203 string childPartName = "childPart";
204 UUID childPartUuid = new UUID("00000000-0000-0000-0001-000000000000");
205
206 SceneObjectPart rootPart
207 = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
208 { Name = rootPartName, UUID = rootPartUuid };
209 SceneObjectPart linkPart
210 = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
211 { Name = childPartName, UUID = childPartUuid };
212
213 SceneObjectGroup sog = new SceneObjectGroup(rootPart);
214 sog.AddPart(linkPart);
215
216 Assert.That(sog.UUID, Is.EqualTo(rootPartUuid));
217 Assert.That(sog.RootPart.UUID, Is.EqualTo(rootPartUuid));
218 Assert.That(sog.Parts.Length, Is.EqualTo(2));
219
220 UUID newRootPartUuid = new UUID("00000000-0000-0000-0000-000000000002");
221 sog.UUID = newRootPartUuid;
222
223 Assert.That(sog.UUID, Is.EqualTo(newRootPartUuid));
224 Assert.That(sog.RootPart.UUID, Is.EqualTo(newRootPartUuid));
225 Assert.That(sog.Parts.Length, Is.EqualTo(2));
226 }
192 } 227 }
193} 228}
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs
index a88c5e2..5fabbb0 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs
@@ -957,7 +957,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
957 CacheKey = sb.ToString(); 957 CacheKey = sb.ToString();
958 m_memoryCache.TryGetValue(CacheKey, out resp); 958 m_memoryCache.TryGetValue(CacheKey, out resp);
959 } 959 }
960
961 } 960 }
962 961
963 if (resp == null) 962 if (resp == null)
@@ -965,22 +964,19 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
965 string UserService; 964 string UserService;
966 UUID SessionID; 965 UUID SessionID;
967 GetClientGroupRequestID(requestingAgentID, out UserService, out SessionID); 966 GetClientGroupRequestID(requestingAgentID, out UserService, out SessionID);
968 param.Add("requestingAgentID", requestingAgentID.ToString()); 967
968 param.Add("RequestingAgentID", requestingAgentID.ToString());
969 param.Add("RequestingAgentUserService", UserService); 969 param.Add("RequestingAgentUserService", UserService);
970 param.Add("RequestingSessionID", SessionID.ToString()); 970 param.Add("RequestingSessionID", SessionID.ToString());
971
972
973 param.Add("ReadKey", m_groupReadKey); 971 param.Add("ReadKey", m_groupReadKey);
974 param.Add("WriteKey", m_groupWriteKey); 972 param.Add("WriteKey", m_groupWriteKey);
975 973
976
977 IList parameters = new ArrayList(); 974 IList parameters = new ArrayList();
978 parameters.Add(param); 975 parameters.Add(param);
979 976
980 ConfigurableKeepAliveXmlRpcRequest req; 977 ConfigurableKeepAliveXmlRpcRequest req;
981 req = new ConfigurableKeepAliveXmlRpcRequest(function, parameters, m_disableKeepAlive); 978 req = new ConfigurableKeepAliveXmlRpcRequest(function, parameters, m_disableKeepAlive);
982 979
983
984 try 980 try
985 { 981 {
986 resp = req.Send(m_groupsServerURI, 10000); 982 resp = req.Send(m_groupsServerURI, 10000);
@@ -989,7 +985,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
989 { 985 {
990 m_memoryCache.AddOrUpdate(CacheKey, resp, TimeSpan.FromSeconds(m_cacheTimeout)); 986 m_memoryCache.AddOrUpdate(CacheKey, resp, TimeSpan.FromSeconds(m_cacheTimeout));
991 } 987 }
992
993 } 988 }
994 catch (Exception e) 989 catch (Exception e)
995 { 990 {
@@ -1058,10 +1053,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1058 { 1053 {
1059 m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: {0}", line); 1054 m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: {0}", line);
1060 } 1055 }
1061
1062 } 1056 }
1063 } 1057 }
1064
1065 1058
1066 /// <summary> 1059 /// <summary>
1067 /// Group Request Tokens are an attempt to allow the groups service to authenticate 1060 /// Group Request Tokens are an attempt to allow the groups service to authenticate