aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs7
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs34
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs8
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs3
-rw-r--r--OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs133
6 files changed, 185 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index c7f4c20..b0cee03 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -496,6 +496,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
496 SetAppearanceAssets(sp.UUID, sp.Appearance); 496 SetAppearanceAssets(sp.UUID, sp.Appearance);
497 497
498 m_scene.AvatarService.SetAppearance(agentid, sp.Appearance); 498 m_scene.AvatarService.SetAppearance(agentid, sp.Appearance);
499
500 // Trigger this here because it's the final step in the set/queue/save process for appearance setting.
501 // Everything has been updated and stored. Ensures bakes have been persisted (if option is set to persist bakes).
502 m_scene.EventManager.TriggerAvatarAppearanceChanged(sp);
499 } 503 }
500 504
501 private void SetAppearanceAssets(UUID userID, AvatarAppearance appearance) 505 private void SetAppearanceAssets(UUID userID, AvatarAppearance appearance)
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 82a035b..6c4c63f 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -565,9 +565,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
565// "[INVENTORY ACCESS MODULE]: Target of {0} in CreateItemForObject() is {1} {2}", 565// "[INVENTORY ACCESS MODULE]: Target of {0} in CreateItemForObject() is {1} {2}",
566// action, remoteClient.Name, userID); 566// action, remoteClient.Name, userID);
567 } 567 }
568 else if (so.RootPart.OwnerID == so.RootPart.GroupID)
569 {
570 // Group owned objects go to the last owner before the object was transferred.
571 userID = so.RootPart.LastOwnerID;
572 }
568 else 573 else
569 { 574 {
570 // All returns / deletes go to the object owner 575 // Other returns / deletes go to the object owner
571 // 576 //
572 userID = so.RootPart.OwnerID; 577 userID = so.RootPart.OwnerID;
573 578
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs
index 786e0b5..be8a9a2 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs
@@ -65,13 +65,26 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
65 } 65 }
66 } 66 }
67 67
68 internal struct ScopedRegionPosition
69 {
70 public UUID m_scopeID;
71 public ulong m_regionHandle;
72 public ScopedRegionPosition(UUID scopeID, ulong handle)
73 {
74 m_scopeID = scopeID;
75 m_regionHandle = handle;
76 }
77 }
78
68 private ExpiringCache<ScopedRegionUUID, GridRegion> m_UUIDCache; 79 private ExpiringCache<ScopedRegionUUID, GridRegion> m_UUIDCache;
69 private ExpiringCache<ScopedRegionName, ScopedRegionUUID> m_NameCache; 80 private ExpiringCache<ScopedRegionName, ScopedRegionUUID> m_NameCache;
81 private ExpiringCache<ScopedRegionPosition, GridRegion> m_PositionCache;
70 82
71 public RegionInfoCache() 83 public RegionInfoCache()
72 { 84 {
73 m_UUIDCache = new ExpiringCache<ScopedRegionUUID, GridRegion>(); 85 m_UUIDCache = new ExpiringCache<ScopedRegionUUID, GridRegion>();
74 m_NameCache = new ExpiringCache<ScopedRegionName, ScopedRegionUUID>(); 86 m_NameCache = new ExpiringCache<ScopedRegionName, ScopedRegionUUID>();
87 m_PositionCache = new ExpiringCache<ScopedRegionPosition, GridRegion>();
75 } 88 }
76 89
77 public void Cache(GridRegion rinfo) 90 public void Cache(GridRegion rinfo)
@@ -96,6 +109,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
96 { 109 {
97 ScopedRegionName name = new ScopedRegionName(scopeID,rinfo.RegionName); 110 ScopedRegionName name = new ScopedRegionName(scopeID,rinfo.RegionName);
98 m_NameCache.AddOrUpdate(name, id, CACHE_EXPIRATION_SECONDS); 111 m_NameCache.AddOrUpdate(name, id, CACHE_EXPIRATION_SECONDS);
112
113 ScopedRegionPosition pos = new ScopedRegionPosition(scopeID, rinfo.RegionHandle);
114 m_PositionCache.AddOrUpdate(pos, rinfo, CACHE_EXPIRATION_SECONDS);
99 } 115 }
100 } 116 }
101 117
@@ -114,6 +130,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
114 return null; 130 return null;
115 } 131 }
116 132
133 public GridRegion Get(UUID scopeID, ulong handle, out bool inCache)
134 {
135 inCache = false;
136
137 GridRegion rinfo = null;
138 ScopedRegionPosition pos = new ScopedRegionPosition(scopeID, handle);
139 if (m_PositionCache.TryGetValue(pos, out rinfo))
140 {
141 inCache = true;
142 return rinfo;
143 }
144
145 return null;
146 }
147
148
117 public GridRegion Get(UUID scopeID, string name, out bool inCache) 149 public GridRegion Get(UUID scopeID, string name, out bool inCache)
118 { 150 {
119 inCache = false; 151 inCache = false;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
index 6f364ae..e6c89d7 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
@@ -186,10 +186,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
186 186
187 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) 187 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
188 { 188 {
189 GridRegion rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y); 189 bool inCache = false;
190 GridRegion rinfo = m_RegionInfoCache.Get(scopeID, Util.UIntsToLong((uint)x, (uint)y), out inCache);
191 if (inCache)
192 return rinfo;
193
194 rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y);
190 if (rinfo == null) 195 if (rinfo == null)
191 rinfo = m_RemoteGridService.GetRegionByPosition(scopeID, x, y); 196 rinfo = m_RemoteGridService.GetRegionByPosition(scopeID, x, y);
192 197
198 m_RegionInfoCache.Cache(rinfo);
193 return rinfo; 199 return rinfo;
194 } 200 }
195 201
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 91aa228..02a163f 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -290,7 +290,8 @@ namespace OpenSim.Region.CoreModules.World.Land
290 ParcelFlags.AllowGroupScripts | 290 ParcelFlags.AllowGroupScripts |
291 ParcelFlags.CreateGroupObjects | 291 ParcelFlags.CreateGroupObjects |
292 ParcelFlags.AllowAPrimitiveEntry | 292 ParcelFlags.AllowAPrimitiveEntry |
293 ParcelFlags.AllowGroupObjectEntry); 293 ParcelFlags.AllowGroupObjectEntry |
294 ParcelFlags.AllowFly);
294 } 295 }
295 296
296 if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandSetSale)) 297 if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandSetSale))
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
index d5b585a..d1d2020 100644
--- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
+++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
@@ -148,6 +148,113 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
148 <OtherParts /> 148 <OtherParts />
149 </SceneObjectGroup>"; 149 </SceneObjectGroup>";
150 150
151 private string badFloatsXml = @"
152 <SceneObjectGroup>
153 <RootPart>
154 <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
155 <AllowedDrop>false</AllowedDrop>
156 <CreatorID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></CreatorID>
157 <FolderID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></FolderID>
158 <InventorySerial>1</InventorySerial>
159 <TaskInventory />
160 <ObjectFlags>0</ObjectFlags>
161 <UUID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></UUID>
162 <LocalId>2698615125</LocalId>
163 <Name>NaughtyPrim</Name>
164 <Material>0</Material>
165 <PassTouches>false</PassTouches>
166 <RegionHandle>1099511628032000</RegionHandle>
167 <ScriptAccessPin>0</ScriptAccessPin>
168 <GroupPosition><X>147.23</X><Y>92.698</Y><Z>22.78084</Z></GroupPosition>
169 <OffsetPosition><X>0</X><Y>0</Y><Z>0</Z></OffsetPosition>
170 <RotationOffset><X>-4.371139E-08</X><Y>-1</Y><Z>-4.371139E-08</Z><W>0</W></RotationOffset>
171 <Velocity><X>0</X><Y>0</Y><Z>0</Z></Velocity>
172 <RotationalVelocity><X>0</X><Y>0</Y><Z>0</Z></RotationalVelocity>
173 <AngularVelocity><X>0</X><Y>0</Y><Z>0</Z></AngularVelocity>
174 <Acceleration><X>0</X><Y>0</Y><Z>0</Z></Acceleration>
175 <Description />
176 <Color />
177 <Text />
178 <SitName />
179 <TouchName />
180 <LinkNum>0</LinkNum>
181 <ClickAction>0</ClickAction>
182 <Shape>
183 <ProfileCurve>1</ProfileCurve>
184 <TextureEntry>AAAAAAAAERGZmQAAAAAABQCVlZUAAAAAQEAAAABAQAAAAAAAAAAAAAAAAAAAAA==</TextureEntry>
185 <ExtraParams>AA==</ExtraParams>
186 <PathBegin>0</PathBegin>
187 <PathCurve>16</PathCurve>
188 <PathEnd>0</PathEnd>
189 <PathRadiusOffset>0</PathRadiusOffset>
190 <PathRevolutions>0</PathRevolutions>
191 <PathScaleX>100</PathScaleX>
192 <PathScaleY>100</PathScaleY>
193 <PathShearX>0</PathShearX>
194 <PathShearY>0</PathShearY>
195 <PathSkew>0</PathSkew>
196 <PathTaperX>0</PathTaperX>
197 <PathTaperY>0</PathTaperY>
198 <PathTwist>0</PathTwist>
199 <PathTwistBegin>0</PathTwistBegin>
200 <PCode>9</PCode>
201 <ProfileBegin>0</ProfileBegin>
202 <ProfileEnd>0</ProfileEnd>
203 <ProfileHollow>0</ProfileHollow>
204 <Scale><X>10</X><Y>10</Y><Z>0.5</Z></Scale>
205 <State>0</State>
206 <ProfileShape>Square</ProfileShape>
207 <HollowShape>Same</HollowShape>
208 <SculptTexture><Guid>00000000-0000-0000-0000-000000000000</Guid></SculptTexture>
209 <SculptType>0</SculptType><SculptData />
210 <FlexiSoftness>0</FlexiSoftness>
211 <FlexiTension>0,5</FlexiTension>
212 <FlexiDrag>yo mamma</FlexiDrag>
213 <FlexiGravity>0</FlexiGravity>
214 <FlexiWind>0</FlexiWind>
215 <FlexiForceX>0</FlexiForceX>
216 <FlexiForceY>0</FlexiForceY>
217 <FlexiForceZ>0</FlexiForceZ>
218 <LightColorR>0</LightColorR>
219 <LightColorG>0</LightColorG>
220 <LightColorB>0</LightColorB>
221 <LightColorA>1</LightColorA>
222 <LightRadius>0</LightRadius>
223 <LightCutoff>0</LightCutoff>
224 <LightFalloff>0</LightFalloff>
225 <LightIntensity>1</LightIntensity>
226 <FlexiEntry>false</FlexiEntry>
227 <LightEntry>false</LightEntry>
228 <SculptEntry>false</SculptEntry>
229 </Shape>
230 <Scale><X>10</X><Y>10</Y><Z>0.5</Z></Scale>
231 <UpdateFlag>0</UpdateFlag>
232 <SitTargetOrientation><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientation>
233 <SitTargetPosition><X>0</X><Y>0</Y><Z>0</Z></SitTargetPosition>
234 <SitTargetPositionLL><X>0</X><Y>0</Y><Z>0</Z></SitTargetPositionLL>
235 <SitTargetOrientationLL><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientationLL>
236 <ParentID>0</ParentID>
237 <CreationDate>1211330445</CreationDate>
238 <Category>0</Category>
239 <SalePrice>0</SalePrice>
240 <ObjectSaleType>0</ObjectSaleType>
241 <OwnershipCost>0</OwnershipCost>
242 <GroupID><Guid>00000000-0000-0000-0000-000000000000</Guid></GroupID>
243 <OwnerID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></OwnerID>
244 <LastOwnerID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></LastOwnerID>
245 <BaseMask>2147483647</BaseMask>
246 <OwnerMask>2147483647</OwnerMask>
247 <GroupMask>0</GroupMask>
248 <EveryoneMask>0</EveryoneMask>
249 <NextOwnerMask>2147483647</NextOwnerMask>
250 <Flags>None</Flags>
251 <CollisionSound><Guid>00000000-0000-0000-0000-000000000000</Guid></CollisionSound>
252 <CollisionSoundVolume>0</CollisionSoundVolume>
253 </SceneObjectPart>
254 </RootPart>
255 <OtherParts />
256 </SceneObjectGroup>";
257
151 private string xml2 = @" 258 private string xml2 = @"
152 <SceneObjectGroup> 259 <SceneObjectGroup>
153 <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""> 260 <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
@@ -257,6 +364,32 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
257 } 364 }
258 365
259 [Test] 366 [Test]
367 public void TestDeserializeBadFloatsXml()
368 {
369 TestHelpers.InMethod();
370// log4net.Config.XmlConfigurator.Configure();
371
372 SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(badFloatsXml);
373 SceneObjectPart rootPart = so.RootPart;
374
375 Assert.That(rootPart.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790")));
376 Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("a6dacf01-4636-4bb9-8a97-30609438af9d")));
377 Assert.That(rootPart.Name, Is.EqualTo("NaughtyPrim"));
378
379 // This terminates the deserialization earlier if couldn't be parsed.
380 // TODO: Need to address this
381 Assert.That(rootPart.GroupPosition.X, Is.EqualTo(147.23f));
382
383 Assert.That(rootPart.Shape.PathCurve, Is.EqualTo(16));
384
385 // Defaults for bad parses
386 Assert.That(rootPart.Shape.FlexiTension, Is.EqualTo(0));
387 Assert.That(rootPart.Shape.FlexiDrag, Is.EqualTo(0));
388
389 // TODO: Check other properties
390 }
391
392 [Test]
260 public void TestSerializeXml() 393 public void TestSerializeXml()
261 { 394 {
262 TestHelpers.InMethod(); 395 TestHelpers.InMethod();