aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs20
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs21
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs47
-rw-r--r--OpenSim/Region/Framework/Scenes/UuidGatherer.cs18
5 files changed, 83 insertions, 28 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index fdd5205..01de824 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3665,6 +3665,15 @@ namespace OpenSim.Region.Framework.Scenes
3665 return false; 3665 return false;
3666 } 3666 }
3667 3667
3668 int num = m_sceneGraph.GetNumberOfScenePresences();
3669
3670 if (num >= RegionInfo.RegionSettings.AgentLimit)
3671 {
3672 if (!Permissions.IsAdministrator(cAgentData.AgentID))
3673 return false;
3674 }
3675
3676
3668 ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID); 3677 ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID);
3669 3678
3670 if (childAgentUpdate != null) 3679 if (childAgentUpdate != null)
@@ -4966,6 +4975,17 @@ namespace OpenSim.Region.Framework.Scenes
4966 // child agent creation, thereby emulating the SL behavior. 4975 // child agent creation, thereby emulating the SL behavior.
4967 public bool QueryAccess(UUID agentID, Vector3 position, out string reason) 4976 public bool QueryAccess(UUID agentID, Vector3 position, out string reason)
4968 { 4977 {
4978 int num = m_sceneGraph.GetNumberOfScenePresences();
4979
4980 if (num >= RegionInfo.RegionSettings.AgentLimit)
4981 {
4982 if (!Permissions.IsAdministrator(agentID))
4983 {
4984 reason = "The region is full";
4985 return false;
4986 }
4987 }
4988
4969 reason = String.Empty; 4989 reason = String.Empty;
4970 return true; 4990 return true;
4971 } 4991 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 72f0402..fc31b65 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -800,6 +800,11 @@ namespace OpenSim.Region.Framework.Scenes
800 return m_scenePresenceArray; 800 return m_scenePresenceArray;
801 } 801 }
802 802
803 public int GetNumberOfScenePresences()
804 {
805 return m_scenePresenceArray.Count;
806 }
807
803 /// <summary> 808 /// <summary>
804 /// Request a scene presence by UUID. Fast, indexed lookup. 809 /// Request a scene presence by UUID. Fast, indexed lookup.
805 /// </summary> 810 /// </summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
index e8095c0..4bca3d0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
@@ -81,16 +81,20 @@ namespace OpenSim.Region.Framework.Scenes
81 } 81 }
82 82
83 /// <summary> 83 /// <summary>
84 /// Add an inventory item to a prim in this group. 84 /// Add an inventory item from a user's inventory to a prim in this scene object.
85 /// </summary> 85 /// </summary>
86 /// <param name="remoteClient"></param> 86 /// <param name="remoteClient">The client adding the item.</param>
87 /// <param name="localID"></param> 87 /// <param name="localID">The local ID of the part receiving the add.</param>
88 /// <param name="item"></param> 88 /// <param name="item">The user inventory item being added.</param>
89 /// <param name="copyItemID">The item UUID that should be used by the new item.</param> 89 /// <param name="copyItemID">The item UUID that should be used by the new item.</param>
90 /// <returns></returns> 90 /// <returns></returns>
91 public bool AddInventoryItem(IClientAPI remoteClient, uint localID, 91 public bool AddInventoryItem(IClientAPI remoteClient, uint localID,
92 InventoryItemBase item, UUID copyItemID) 92 InventoryItemBase item, UUID copyItemID)
93 { 93 {
94// m_log.DebugFormat(
95// "[PRIM INVENTORY]: Adding inventory item {0} from {1} to part with local ID {2}",
96// item.Name, remoteClient.Name, localID);
97
94 UUID newItemId = (copyItemID != UUID.Zero) ? copyItemID : item.ID; 98 UUID newItemId = (copyItemID != UUID.Zero) ? copyItemID : item.ID;
95 99
96 SceneObjectPart part = GetChildPart(localID); 100 SceneObjectPart part = GetChildPart(localID);
@@ -132,15 +136,20 @@ namespace OpenSim.Region.Framework.Scenes
132 taskItem.GroupPermissions = item.GroupPermissions; 136 taskItem.GroupPermissions = item.GroupPermissions;
133 taskItem.NextPermissions = item.NextPermissions; 137 taskItem.NextPermissions = item.NextPermissions;
134 } 138 }
135 139
136 taskItem.Flags = item.Flags; 140 taskItem.Flags = item.Flags;
141
142// m_log.DebugFormat(
143// "[PRIM INVENTORY]: Flags are 0x{0:X} for item {1} added to part {2} by {3}",
144// taskItem.Flags, taskItem.Name, localID, remoteClient.Name);
145
137 // TODO: These are pending addition of those fields to TaskInventoryItem 146 // TODO: These are pending addition of those fields to TaskInventoryItem
138// taskItem.SalePrice = item.SalePrice; 147// taskItem.SalePrice = item.SalePrice;
139// taskItem.SaleType = item.SaleType; 148// taskItem.SaleType = item.SaleType;
140 taskItem.CreationDate = (uint)item.CreationDate; 149 taskItem.CreationDate = (uint)item.CreationDate;
141 150
142 bool addFromAllowedDrop = false; 151 bool addFromAllowedDrop = false;
143 if (remoteClient!=null) 152 if (remoteClient != null)
144 { 153 {
145 addFromAllowedDrop = remoteClient.AgentId != part.OwnerID; 154 addFromAllowedDrop = remoteClient.AgentId != part.OwnerID;
146 } 155 }
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs
index babcb54..55455cc 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs
@@ -117,29 +117,40 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
117 { 117 {
118 using (XmlTextReader reader = new XmlTextReader(sr)) 118 using (XmlTextReader reader = new XmlTextReader(sr))
119 { 119 {
120 reader.Read(); 120 try
121 if (reader.Name != "CoalescedObject")
122 { 121 {
123// m_log.DebugFormat( 122 reader.Read();
124// "[COALESCED SCENE OBJECTS SERIALIZER]: TryFromXml() root element was {0} so returning false", 123 if (reader.Name != "CoalescedObject")
125// reader.Name); 124 {
125 // m_log.DebugFormat(
126 // "[COALESCED SCENE OBJECTS SERIALIZER]: TryFromXml() root element was {0} so returning false",
127 // reader.Name);
128
129 return false;
130 }
126 131
127 return false; 132 coa = new CoalescedSceneObjects(UUID.Zero);
128 } 133 reader.Read();
129 134
130 coa = new CoalescedSceneObjects(UUID.Zero); 135 while (reader.NodeType != XmlNodeType.EndElement && reader.Name != "CoalescedObject")
131 reader.Read();
132
133 while (reader.NodeType != XmlNodeType.EndElement && reader.Name != "CoalescedObject")
134 {
135 if (reader.Name == "SceneObjectGroup")
136 { 136 {
137 string soXml = reader.ReadOuterXml(); 137 if (reader.Name == "SceneObjectGroup")
138 coa.Add(SceneObjectSerializer.FromOriginalXmlFormat(soXml)); 138 {
139 string soXml = reader.ReadOuterXml();
140 coa.Add(SceneObjectSerializer.FromOriginalXmlFormat(soXml));
141 }
139 } 142 }
143
144 reader.ReadEndElement(); // CoalescedObject
140 } 145 }
141 146 catch (Exception e)
142 reader.ReadEndElement(); // CoalescedObject 147 {
148 m_log.ErrorFormat(
149 "[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml failed with {0} {1}",
150 e.Message, e.StackTrace);
151
152 return false;
153 }
143 } 154 }
144 } 155 }
145 156
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
index 83906d7..77b1535 100644
--- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
+++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
@@ -298,10 +298,20 @@ namespace OpenSim.Region.Framework.Scenes
298 if (null != objectAsset) 298 if (null != objectAsset)
299 { 299 {
300 string xml = Utils.BytesToString(objectAsset.Data); 300 string xml = Utils.BytesToString(objectAsset.Data);
301 SceneObjectGroup sog = SceneObjectSerializer.FromOriginalXmlFormat(xml); 301
302 302 CoalescedSceneObjects coa;
303 if (null != sog) 303 if (CoalescedSceneObjectsSerializer.TryFromXml(xml, out coa))
304 GatherAssetUuids(sog, assetUuids); 304 {
305 foreach (SceneObjectGroup sog in coa.Objects)
306 GatherAssetUuids(sog, assetUuids);
307 }
308 else
309 {
310 SceneObjectGroup sog = SceneObjectSerializer.FromOriginalXmlFormat(xml);
311
312 if (null != sog)
313 GatherAssetUuids(sog, assetUuids);
314 }
305 } 315 }
306 } 316 }
307 317