aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs89
-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
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs82
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs14
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs26
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs14
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs9
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs40
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs41
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs6
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs4
-rw-r--r--OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs2
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs3
-rw-r--r--OpenSim/Region/Physics/Meshing/Meshmerizer.cs4
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs27
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs17
23 files changed, 491 insertions, 82 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index 3139112..a79b387 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -903,47 +903,64 @@ namespace OpenSim.Region.ClientStack.LindenUDP
903 903
904 private void HandleUseCircuitCode(object o) 904 private void HandleUseCircuitCode(object o)
905 { 905 {
906// DateTime startTime = DateTime.Now; 906 IPEndPoint remoteEndPoint = null;
907 object[] array = (object[])o; 907 IClientAPI client = null;
908 UDPPacketBuffer buffer = (UDPPacketBuffer)array[0];
909 UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1];
910
911 m_log.DebugFormat("[LLUDPSERVER]: Handling UseCircuitCode request from {0}", buffer.RemoteEndPoint);
912
913 IPEndPoint remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint;
914 908
915 AuthenticateResponse sessionInfo; 909 try
916 if (IsClientAuthorized(uccp, out sessionInfo))
917 { 910 {
918 // Begin the process of adding the client to the simulator 911 // DateTime startTime = DateTime.Now;
919 IClientAPI client 912 object[] array = (object[])o;
920 = AddClient( 913 UDPPacketBuffer buffer = (UDPPacketBuffer)array[0];
921 uccp.CircuitCode.Code, 914 UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1];
922 uccp.CircuitCode.ID, 915
923 uccp.CircuitCode.SessionID, 916 m_log.DebugFormat("[LLUDPSERVER]: Handling UseCircuitCode request from {0}", buffer.RemoteEndPoint);
924 remoteEndPoint, 917
925 sessionInfo); 918 remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint;
926 919
927 // Send ack straight away to let the viewer know that the connection is active. 920 AuthenticateResponse sessionInfo;
928 // The client will be null if it already exists (e.g. if on a region crossing the client sends a use 921 if (IsClientAuthorized(uccp, out sessionInfo))
929 // circuit code to the existing child agent. This is not particularly obvious. 922 {
930 SendAckImmediate(remoteEndPoint, uccp.Header.Sequence); 923 // Begin the process of adding the client to the simulator
931 924 client
932 // We only want to send initial data to new clients, not ones which are being converted from child to root. 925 = AddClient(
933 if (client != null) 926 uccp.CircuitCode.Code,
934 client.SceneAgent.SendInitialDataToMe(); 927 uccp.CircuitCode.ID,
928 uccp.CircuitCode.SessionID,
929 remoteEndPoint,
930 sessionInfo);
931
932 // Send ack straight away to let the viewer know that the connection is active.
933 // The client will be null if it already exists (e.g. if on a region crossing the client sends a use
934 // circuit code to the existing child agent. This is not particularly obvious.
935 SendAckImmediate(remoteEndPoint, uccp.Header.Sequence);
936
937 // We only want to send initial data to new clients, not ones which are being converted from child to root.
938 if (client != null)
939 client.SceneAgent.SendInitialDataToMe();
940 }
941 else
942 {
943 // Don't create clients for unauthorized requesters.
944 m_log.WarnFormat(
945 "[LLUDPSERVER]: Connection request for client {0} connecting with unnotified circuit code {1} from {2}",
946 uccp.CircuitCode.ID, uccp.CircuitCode.Code, remoteEndPoint);
947 }
948
949 // m_log.DebugFormat(
950 // "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
951 // buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
952
935 } 953 }
936 else 954 catch (Exception e)
937 { 955 {
938 // Don't create clients for unauthorized requesters. 956 m_log.ErrorFormat(
939 m_log.WarnFormat( 957 "[LLUDPSERVER]: UseCircuitCode handling from endpoint {0}, client {1} {2} failed. Exception {3}{4}",
940 "[LLUDPSERVER]: Connection request for client {0} connecting with unnotified circuit code {1} from {2}", 958 remoteEndPoint != null ? remoteEndPoint.ToString() : "n/a",
941 uccp.CircuitCode.ID, uccp.CircuitCode.Code, remoteEndPoint); 959 client != null ? client.Name : "unknown",
960 client != null ? client.AgentId.ToString() : "unknown",
961 e.Message,
962 e.StackTrace);
942 } 963 }
943
944 // m_log.DebugFormat(
945// "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
946// buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
947 } 964 }
948 965
949 /// <summary> 966 /// <summary>
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();
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 57db4d6..9fcd5fe 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -177,6 +177,9 @@ namespace OpenSim.Region.Framework.Scenes
177 public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID); 177 public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID);
178 public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel; 178 public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel;
179 179
180 public delegate void AvatarAppearanceChange(ScenePresence avatar);
181 public event AvatarAppearanceChange OnAvatarAppearanceChange;
182
180 public event Action<ScenePresence> OnSignificantClientMovement; 183 public event Action<ScenePresence> OnSignificantClientMovement;
181 184
182 public delegate void IncomingInstantMessage(GridInstantMessage message); 185 public delegate void IncomingInstantMessage(GridInstantMessage message);
@@ -188,10 +191,62 @@ namespace OpenSim.Region.Framework.Scenes
188 191
189 public event ClientClosed OnClientClosed; 192 public event ClientClosed OnClientClosed;
190 193
194 // Fired when a script is created
195 // The indication that a new script exists in this region.
196 public delegate void NewScript(UUID clientID, SceneObjectPart part, UUID itemID);
197 public event NewScript OnNewScript;
198 public virtual void TriggerNewScript(UUID clientID, SceneObjectPart part, UUID itemID)
199 {
200 NewScript handlerNewScript = OnNewScript;
201 if (handlerNewScript != null)
202 {
203 foreach (NewScript d in handlerNewScript.GetInvocationList())
204 {
205 try
206 {
207 d(clientID, part, itemID);
208 }
209 catch (Exception e)
210 {
211 m_log.ErrorFormat(
212 "[EVENT MANAGER]: Delegate for TriggerNewScript failed - continuing. {0} {1}",
213 e.Message, e.StackTrace);
214 }
215 }
216 }
217 }
218
219 //TriggerUpdateScript: triggered after Scene receives client's upload of updated script and stores it as asset
220 // An indication that the script has changed.
221 public delegate void UpdateScript(UUID clientID, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID);
222 public event UpdateScript OnUpdateScript;
223 public virtual void TriggerUpdateScript(UUID clientId, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID)
224 {
225 UpdateScript handlerUpdateScript = OnUpdateScript;
226 if (handlerUpdateScript != null)
227 {
228 foreach (UpdateScript d in handlerUpdateScript.GetInvocationList())
229 {
230 try
231 {
232 d(clientId, itemId, primId, isScriptRunning, newAssetID);
233 }
234 catch (Exception e)
235 {
236 m_log.ErrorFormat(
237 "[EVENT MANAGER]: Delegate for TriggerUpdateScript failed - continuing. {0} {1}",
238 e.Message, e.StackTrace);
239 }
240 }
241 }
242 }
243
191 /// <summary> 244 /// <summary>
192 /// This is fired when a scene object property that a script might be interested in (such as color, scale or 245 /// ScriptChangedEvent is fired when a scene object property that a script might be interested
193 /// inventory) changes. Only enough information is sent for the LSL changed event 246 /// in (such as color, scale or inventory) changes. Only enough information sent is for the LSL changed event.
194 /// (see http://lslwiki.net/lslwiki/wakka.php?wakka=changed) 247 /// This is not an indication that the script has changed (see OnUpdateScript for that).
248 /// This event is sent to a script to tell it that some property changed on
249 /// the object the script is in. See http://lslwiki.net/lslwiki/wakka.php?wakka=changed .
195 /// </summary> 250 /// </summary>
196 public event ScriptChangedEvent OnScriptChangedEvent; 251 public event ScriptChangedEvent OnScriptChangedEvent;
197 public delegate void ScriptChangedEvent(uint localID, uint change); 252 public delegate void ScriptChangedEvent(uint localID, uint change);
@@ -1262,6 +1317,27 @@ namespace OpenSim.Region.Framework.Scenes
1262 } 1317 }
1263 } 1318 }
1264 1319
1320 public void TriggerAvatarAppearanceChanged(ScenePresence avatar)
1321 {
1322 AvatarAppearanceChange handler = OnAvatarAppearanceChange;
1323 if (handler != null)
1324 {
1325 foreach (AvatarAppearanceChange d in handler.GetInvocationList())
1326 {
1327 try
1328 {
1329 d(avatar);
1330 }
1331 catch (Exception e)
1332 {
1333 m_log.ErrorFormat(
1334 "[EVENT MANAGER]: Delegate for TriggerAvatarAppearanceChanged failed - continuing. {0} {1}",
1335 e.Message, e.StackTrace);
1336 }
1337 }
1338 }
1339 }
1340
1265 public void TriggerIncomingInstantMessage(GridInstantMessage message) 1341 public void TriggerIncomingInstantMessage(GridInstantMessage message)
1266 { 1342 {
1267 IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage; 1343 IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index fff39fb..e7a3b42 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -265,6 +265,10 @@ namespace OpenSim.Region.Framework.Scenes
265 // 265 //
266 errors = part.Inventory.CreateScriptInstanceEr(item.ItemID, 0, false, DefaultScriptEngine, 0); 266 errors = part.Inventory.CreateScriptInstanceEr(item.ItemID, 0, false, DefaultScriptEngine, 0);
267 } 267 }
268
269 // Tell anyone managing scripts that a script has been reloaded/changed
270 EventManager.TriggerUpdateScript(remoteClient.AgentId, itemId, primId, isScriptRunning, item.AssetID);
271
268 part.ParentGroup.ResumeScripts(); 272 part.ParentGroup.ResumeScripts();
269 return errors; 273 return errors;
270 } 274 }
@@ -1643,9 +1647,13 @@ namespace OpenSim.Region.Framework.Scenes
1643 // have state in inventory 1647 // have state in inventory
1644 part.Inventory.CreateScriptInstance(copyID, 0, false, DefaultScriptEngine, 0); 1648 part.Inventory.CreateScriptInstance(copyID, 0, false, DefaultScriptEngine, 0);
1645 1649
1650 // tell anyone watching that there is a new script in town
1651 EventManager.TriggerNewScript(agentID, part, copyID);
1652
1646 // m_log.InfoFormat("[PRIMINVENTORY]: " + 1653 // m_log.InfoFormat("[PRIMINVENTORY]: " +
1647 // "Rezzed script {0} into prim local ID {1} for user {2}", 1654 // "Rezzed script {0} into prim local ID {1} for user {2}",
1648 // item.inventoryName, localID, remoteClient.Name); 1655 // item.inventoryName, localID, remoteClient.Name);
1656
1649 part.ParentGroup.ResumeScripts(); 1657 part.ParentGroup.ResumeScripts();
1650 1658
1651 return part; 1659 return part;
@@ -1726,6 +1734,10 @@ namespace OpenSim.Region.Framework.Scenes
1726 1734
1727 part.Inventory.AddInventoryItem(taskItem, false); 1735 part.Inventory.AddInventoryItem(taskItem, false);
1728 part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0); 1736 part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0);
1737
1738 // tell anyone managing scripts that a new script exists
1739 EventManager.TriggerNewScript(agentID, part, taskItem.ItemID);
1740
1729 part.ParentGroup.ResumeScripts(); 1741 part.ParentGroup.ResumeScripts();
1730 1742
1731 return part; 1743 return part;
@@ -1954,7 +1966,7 @@ namespace OpenSim.Region.Framework.Scenes
1954 permissionToTake = true; 1966 permissionToTake = true;
1955 permissionToDelete = true; 1967 permissionToDelete = true;
1956 1968
1957 AddReturn(grp.OwnerID, grp.Name, grp.AbsolutePosition, "parcel owner return"); 1969 AddReturn(grp.OwnerID == grp.GroupID ? grp.LastOwnerID : grp.OwnerID, grp.Name, grp.AbsolutePosition, "parcel owner return");
1958 } 1970 }
1959 } 1971 }
1960 else // Auto return passes through here with null agent 1972 else // Auto return passes through here with null agent
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 8552d4c..6274e02 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3397,6 +3397,9 @@ namespace OpenSim.Region.Framework.Scenes
3397 { 3397 {
3398 bool vialogin = ((teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0 || 3398 bool vialogin = ((teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0 ||
3399 (teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0); 3399 (teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0);
3400 bool viahome = ((teleportFlags & (uint)Constants.TeleportFlags.ViaHome) != 0);
3401 bool godlike = ((teleportFlags & (uint)Constants.TeleportFlags.Godlike) != 0);
3402
3400 reason = String.Empty; 3403 reason = String.Empty;
3401 3404
3402 //Teleport flags: 3405 //Teleport flags:
@@ -3571,6 +3574,29 @@ namespace OpenSim.Region.Framework.Scenes
3571 agent.startpos.Z = 720; 3574 agent.startpos.Z = 720;
3572 } 3575 }
3573 } 3576 }
3577
3578 // Honor Estate teleport routing via Telehubs excluding ViaHome and GodLike TeleportFlags
3579 if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero &&
3580 RegionInfo.EstateSettings.AllowDirectTeleport == false &&
3581 !viahome && !godlike)
3582 {
3583 SceneObjectGroup telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject);
3584 // Can have multiple SpawnPoints
3585 List<SpawnPoint> spawnpoints = RegionInfo.RegionSettings.SpawnPoints();
3586 if ( spawnpoints.Count > 1)
3587 {
3588 // We have multiple SpawnPoints, Route the agent to a random one
3589 agent.startpos = spawnpoints[Util.RandomClass.Next(spawnpoints.Count)].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation);
3590 }
3591 else
3592 {
3593 // We have a single SpawnPoint and will route the agent to it
3594 agent.startpos = spawnpoints[0].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation);
3595 }
3596
3597 return true;
3598 }
3599
3574 // Honor parcel landing type and position. 3600 // Honor parcel landing type and position.
3575 /* 3601 /*
3576 ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); 3602 ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 6dd42dd..5a7f124 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -406,7 +406,7 @@ namespace OpenSim.Region.Framework.Scenes
406 m_log.ErrorFormat( 406 m_log.ErrorFormat(
407 "[SCENEGRAPH]: Tried to add scene object {0} to {1} with illegal UUID of {2}", 407 "[SCENEGRAPH]: Tried to add scene object {0} to {1} with illegal UUID of {2}",
408 sceneObject.Name, m_parentScene.RegionInfo.RegionName, UUID.Zero); 408 sceneObject.Name, m_parentScene.RegionInfo.RegionName, UUID.Zero);
409 409
410 return false; 410 return false;
411 } 411 }
412 412
@@ -415,12 +415,12 @@ namespace OpenSim.Region.Framework.Scenes
415// m_log.DebugFormat( 415// m_log.DebugFormat(
416// "[SCENEGRAPH]: Scene graph for {0} already contains object {1} in AddSceneObject()", 416// "[SCENEGRAPH]: Scene graph for {0} already contains object {1} in AddSceneObject()",
417// m_parentScene.RegionInfo.RegionName, sceneObject.UUID); 417// m_parentScene.RegionInfo.RegionName, sceneObject.UUID);
418 418
419 return false; 419 return false;
420 } 420 }
421 421
422// m_log.DebugFormat( 422// m_log.DebugFormat(
423// "[SCENEGRAPH]: Adding scene object {0} {1}, with {2} parts on {3}", 423// "[SCENEGRAPH]: Adding scene object {0} {1}, with {2} parts on {3}",
424// sceneObject.Name, sceneObject.UUID, sceneObject.Parts.Length, m_parentScene.RegionInfo.RegionName); 424// sceneObject.Name, sceneObject.UUID, sceneObject.Parts.Length, m_parentScene.RegionInfo.RegionName);
425 425
426 SceneObjectPart[] parts = sceneObject.Parts; 426 SceneObjectPart[] parts = sceneObject.Parts;
@@ -456,7 +456,7 @@ namespace OpenSim.Region.Framework.Scenes
456 456
457 lock (SceneObjectGroupsByFullID) 457 lock (SceneObjectGroupsByFullID)
458 SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject; 458 SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject;
459 459
460 lock (SceneObjectGroupsByFullPartID) 460 lock (SceneObjectGroupsByFullPartID)
461 { 461 {
462 foreach (SceneObjectPart part in parts) 462 foreach (SceneObjectPart part in parts)
@@ -1678,7 +1678,7 @@ namespace OpenSim.Region.Framework.Scenes
1678 1678
1679 if (group != null) 1679 if (group != null)
1680 { 1680 {
1681 if (m_parentScene.Permissions.CanEditObject(group.UUID,agentID)) 1681 if (m_parentScene.Permissions.CanEditObject(group.UUID, agentID))
1682 { 1682 {
1683 group.UpdateExtraParam(primLocalID, type, inUse, data); 1683 group.UpdateExtraParam(primLocalID, type, inUse, data);
1684 } 1684 }
@@ -1695,7 +1695,7 @@ namespace OpenSim.Region.Framework.Scenes
1695 SceneObjectGroup group = GetGroupByPrim(primLocalID); 1695 SceneObjectGroup group = GetGroupByPrim(primLocalID);
1696 if (group != null) 1696 if (group != null)
1697 { 1697 {
1698 if (m_parentScene.Permissions.CanEditObject(group.GetPartsFullID(primLocalID), agentID)) 1698 if (m_parentScene.Permissions.CanEditObject(group.UUID, agentID))
1699 { 1699 {
1700 ObjectShapePacket.ObjectDataBlock shapeData = new ObjectShapePacket.ObjectDataBlock(); 1700 ObjectShapePacket.ObjectDataBlock shapeData = new ObjectShapePacket.ObjectDataBlock();
1701 shapeData.ObjectLocalID = shapeBlock.ObjectLocalID; 1701 shapeData.ObjectLocalID = shapeBlock.ObjectLocalID;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 3427199..2481dd2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1776,7 +1776,7 @@ namespace OpenSim.Region.Framework.Scenes
1776 m_log.DebugFormat( 1776 m_log.DebugFormat(
1777 "[SCENE OBJECT GROUP]: Returning object {0} due to parcel autoreturn", 1777 "[SCENE OBJECT GROUP]: Returning object {0} due to parcel autoreturn",
1778 RootPart.UUID); 1778 RootPart.UUID);
1779 m_scene.AddReturn(OwnerID, Name, AbsolutePosition, "parcel autoreturn"); 1779 m_scene.AddReturn(OwnerID == GroupID ? LastOwnerID : OwnerID, Name, AbsolutePosition, "parcel autoreturn");
1780 m_scene.DeRezObjects(null, new List<uint>() { RootPart.LocalId }, UUID.Zero, 1780 m_scene.DeRezObjects(null, new List<uint>() { RootPart.LocalId }, UUID.Zero,
1781 DeRezAction.Return, UUID.Zero); 1781 DeRezAction.Return, UUID.Zero);
1782 1782
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 4cd5183..613f9b5 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -317,6 +317,9 @@ namespace OpenSim.Region.Framework.Scenes
317 317
318// ~SceneObjectPart() 318// ~SceneObjectPart()
319// { 319// {
320// Console.WriteLine(
321// "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}",
322// Name, LocalId, ParentGroup.Name, ParentGroup.LocalId);
320// m_log.DebugFormat( 323// m_log.DebugFormat(
321// "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}", 324// "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}",
322// Name, LocalId, ParentGroup.Name, ParentGroup.LocalId); 325// Name, LocalId, ParentGroup.Name, ParentGroup.LocalId);
@@ -1614,9 +1617,9 @@ namespace OpenSim.Region.Framework.Scenes
1614 dupe.GroupPosition = GroupPosition; 1617 dupe.GroupPosition = GroupPosition;
1615 dupe.OffsetPosition = OffsetPosition; 1618 dupe.OffsetPosition = OffsetPosition;
1616 dupe.RotationOffset = RotationOffset; 1619 dupe.RotationOffset = RotationOffset;
1617 dupe.Velocity = new Vector3(0, 0, 0); 1620 dupe.Velocity = Velocity;
1618 dupe.Acceleration = new Vector3(0, 0, 0); 1621 dupe.Acceleration = Acceleration;
1619 dupe.AngularVelocity = new Vector3(0, 0, 0); 1622 dupe.AngularVelocity = AngularVelocity;
1620 dupe.Flags = Flags; 1623 dupe.Flags = Flags;
1621 1624
1622 dupe.OwnershipCost = OwnershipCost; 1625 dupe.OwnershipCost = OwnershipCost;
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index eaf32b8..9f6dabb 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -29,6 +29,7 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Drawing; 30using System.Drawing;
31using System.IO; 31using System.IO;
32using System.Linq;
32using System.Reflection; 33using System.Reflection;
33using System.Xml; 34using System.Xml;
34using log4net; 35using log4net;
@@ -597,13 +598,15 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
597 598
598 private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader) 599 private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader)
599 { 600 {
600 bool errors = false; 601 List<string> errorNodeNames;
601 obj.Shape = ReadShape(reader, "Shape", out errors); 602 obj.Shape = ReadShape(reader, "Shape", out errorNodeNames);
602 603
603 if (errors) 604 if (errorNodeNames != null)
605 {
604 m_log.DebugFormat( 606 m_log.DebugFormat(
605 "[SceneObjectSerializer]: Parsing PrimitiveBaseShape for object part {0} {1} encountered errors. Please see earlier log entries.", 607 "[SceneObjectSerializer]: Parsing PrimitiveBaseShape for object part {0} {1} encountered errors in properties {2}.",
606 obj.Name, obj.UUID); 608 obj.Name, obj.UUID, string.Join(", ", errorNodeNames.ToArray()));
609 }
607 } 610 }
608 611
609 private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader) 612 private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader)
@@ -1557,31 +1560,44 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1557 /// </summary> 1560 /// </summary>
1558 /// <param name="reader"></param> 1561 /// <param name="reader"></param>
1559 /// <param name="name">The name of the xml element containing the shape</param> 1562 /// <param name="name">The name of the xml element containing the shape</param>
1560 /// <param name="errors">true if any errors were encountered during parsing, false otherwise</param> 1563 /// <param name="errors">a list containing the failing node names. If no failures then null.</param>
1561 /// <returns>The shape parsed</returns> 1564 /// <returns>The shape parsed</returns>
1562 public static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out bool errors) 1565 public static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out List<string> errorNodeNames)
1563 { 1566 {
1564 errors = false; 1567 List<string> internalErrorNodeNames = null;
1565 1568
1566 PrimitiveBaseShape shape = new PrimitiveBaseShape(); 1569 PrimitiveBaseShape shape = new PrimitiveBaseShape();
1567 1570
1571 if (reader.IsEmptyElement)
1572 {
1573 reader.Read();
1574 errorNodeNames = null;
1575 return shape;
1576 }
1577
1568 reader.ReadStartElement(name, String.Empty); // Shape 1578 reader.ReadStartElement(name, String.Empty); // Shape
1569 1579
1570 errors = ExternalRepresentationUtils.ExecuteReadProcessors( 1580 ExternalRepresentationUtils.ExecuteReadProcessors(
1571 shape, 1581 shape,
1572 m_ShapeXmlProcessors, 1582 m_ShapeXmlProcessors,
1573 reader, 1583 reader,
1574 (o, nodeName, e) 1584 (o, nodeName, e)
1575 => 1585 =>
1576 { 1586 {
1577 m_log.DebugFormat( 1587// m_log.DebugFormat(
1578 "[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}", 1588// "[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}",
1579 nodeName, e.Message, e.StackTrace); 1589// nodeName, e.Message, e.StackTrace);
1590 if (internalErrorNodeNames == null)
1591 internalErrorNodeNames = new List<string>();
1592
1593 internalErrorNodeNames.Add(nodeName);
1580 } 1594 }
1581 ); 1595 );
1582 1596
1583 reader.ReadEndElement(); // Shape 1597 reader.ReadEndElement(); // Shape
1584 1598
1599 errorNodeNames = internalErrorNodeNames;
1600
1585 return shape; 1601 return shape;
1586 } 1602 }
1587 1603
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
index 80f198d..7737d8e 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
@@ -27,6 +27,7 @@
27 27
28using System; 28using System;
29using System.Reflection; 29using System.Reflection;
30using System.Threading;
30using NUnit.Framework; 31using NUnit.Framework;
31using OpenMetaverse; 32using OpenMetaverse;
32using OpenSim.Framework; 33using OpenSim.Framework;
@@ -43,6 +44,42 @@ namespace OpenSim.Region.Framework.Scenes.Tests
43 [TestFixture] 44 [TestFixture]
44 public class SceneObjectBasicTests 45 public class SceneObjectBasicTests
45 { 46 {
47// [TearDown]
48// public void TearDown()
49// {
50// Console.WriteLine("TearDown");
51// GC.Collect();
52// Thread.Sleep(3000);
53// }
54
55// public class GcNotify
56// {
57// public static AutoResetEvent gcEvent = new AutoResetEvent(false);
58// private static bool _initialized = false;
59//
60// public static void Initialize()
61// {
62// if (!_initialized)
63// {
64// _initialized = true;
65// new GcNotify();
66// }
67// }
68//
69// private GcNotify(){}
70//
71// ~GcNotify()
72// {
73// if (!Environment.HasShutdownStarted &&
74// !AppDomain.CurrentDomain.IsFinalizingForUnload())
75// {
76// Console.WriteLine("GcNotify called");
77// gcEvent.Set();
78// new GcNotify();
79// }
80// }
81// }
82
46 /// <summary> 83 /// <summary>
47 /// Test adding an object to a scene. 84 /// Test adding an object to a scene.
48 /// </summary> 85 /// </summary>
@@ -147,11 +184,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
147 public void TestDeleteSceneObject() 184 public void TestDeleteSceneObject()
148 { 185 {
149 TestHelpers.InMethod(); 186 TestHelpers.InMethod();
150 187
151 TestScene scene = SceneHelpers.SetupScene(); 188 TestScene scene = SceneHelpers.SetupScene();
152 SceneObjectPart part = SceneHelpers.AddSceneObject(scene); 189 SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
153 scene.DeleteSceneObject(part.ParentGroup, false); 190 scene.DeleteSceneObject(part.ParentGroup, false);
154 191
155 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); 192 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
156 Assert.That(retrievedPart, Is.Null); 193 Assert.That(retrievedPart, Is.Null);
157 } 194 }
diff --git a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
index d2810be..d0142a4 100644
--- a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
@@ -230,8 +230,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
230 230
231 m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue; 231 m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue;
232 232
233 m_log.InfoFormat("[RegionReady]: Logins enabled for {0}, Oar {1}", 233 // m_log.InfoFormat("[RegionReady]: Logins enabled for {0}, Oar {1}",
234 m_scene.RegionInfo.RegionName, m_oarFileLoading.ToString()); 234 // m_scene.RegionInfo.RegionName, m_oarFileLoading.ToString());
235
236 m_log.InfoFormat("[RegionReady]: Logins enabled for {0}", m_scene.RegionInfo.RegionName);
235 237
236 if ( m_uri != string.Empty ) 238 if ( m_uri != string.Empty )
237 { 239 {
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index d395206..ae46c97 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -121,8 +121,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
121 npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, int.MaxValue); 121 npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, int.MaxValue);
122 122
123 m_log.DebugFormat( 123 m_log.DebugFormat(
124 "[NPC MODULE]: Creating NPC {0} {1} {2} at {3} in {4}", 124 "[NPC MODULE]: Creating NPC {0} {1} {2}, owner={3}, senseAsAgent={4} at {5} in {6}",
125 firstname, lastname, npcAvatar.AgentId, position, scene.RegionInfo.RegionName); 125 firstname, lastname, npcAvatar.AgentId, owner, senseAsAgent, position, scene.RegionInfo.RegionName);
126 126
127 AgentCircuitData acd = new AgentCircuitData(); 127 AgentCircuitData acd = new AgentCircuitData();
128 acd.AgentID = npcAvatar.AgentId; 128 acd.AgentID = npcAvatar.AgentId;
diff --git a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
index 2306309..80c1277 100644
--- a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
@@ -4297,4 +4297,4 @@ namespace OpenSim.Region.Physics.OdePlugin
4297 } // end root prims 4297 } // end root prims
4298 } // end Move() 4298 } // end Move()
4299 } // end class 4299 } // end class
4300} \ No newline at end of file 4300}
diff --git a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
index 3763696..8587a2b 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
@@ -30,7 +30,8 @@ using System.Collections.Generic;
30using System.IO; 30using System.IO;
31using System.Reflection; 31using System.Reflection;
32using Nini.Config; 32using Nini.Config;
33using log4net; 33using log4net;
34using OpenSim.Framework;
34 35
35namespace OpenSim.Region.Physics.Manager 36namespace OpenSim.Region.Physics.Manager
36{ 37{
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index ba461f7..c4b245f 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -327,7 +327,7 @@ namespace OpenSim.Region.Physics.Meshing
327 private bool GenerateCoordsAndFacesFromPrimMeshData( 327 private bool GenerateCoordsAndFacesFromPrimMeshData(
328 string primName, PrimitiveBaseShape primShape, Vector3 size, out List<Coord> coords, out List<Face> faces) 328 string primName, PrimitiveBaseShape primShape, Vector3 size, out List<Coord> coords, out List<Face> faces)
329 { 329 {
330 m_log.DebugFormat("[MESH]: experimental mesh proxy generation for {0}", primName); 330// m_log.DebugFormat("[MESH]: experimental mesh proxy generation for {0}", primName);
331 331
332 coords = new List<Coord>(); 332 coords = new List<Coord>();
333 faces = new List<Face>(); 333 faces = new List<Face>();
@@ -335,7 +335,7 @@ namespace OpenSim.Region.Physics.Meshing
335 335
336 if (primShape.SculptData.Length <= 0) 336 if (primShape.SculptData.Length <= 0)
337 { 337 {
338 m_log.Error("[MESH]: asset data is zero length"); 338 m_log.ErrorFormat("[MESH]: asset data for {0} is zero length", primName);
339 return false; 339 return false;
340 } 340 }
341 341
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index 716161a..e8bb476 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -46,7 +46,7 @@ namespace OpenSim.Region.Physics.OdePlugin
46 /// </summary> 46 /// </summary>
47 public class OdePlugin : IPhysicsPlugin 47 public class OdePlugin : IPhysicsPlugin
48 { 48 {
49 //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 49 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
50 50
51 private OdeScene m_scene; 51 private OdeScene m_scene;
52 52
@@ -59,13 +59,36 @@ namespace OpenSim.Region.Physics.OdePlugin
59 { 59 {
60 if (m_scene == null) 60 if (m_scene == null)
61 { 61 {
62 // We do this so that OpenSimulator on Windows loads the correct native ODE library depending on whether
63 // it's running as a 32-bit process or a 64-bit one. By invoking LoadLibary here, later DLLImports
64 // will find it already loaded later on.
65 //
66 // This isn't necessary for other platforms (e.g. Mac OSX and Linux) since the DLL used can be
67 // controlled in Ode.NET.dll.config
68 if (Util.IsWindows())
69 {
70 string nativeLibraryPath;
71
72 if (Util.Is64BitProcess())
73 nativeLibraryPath = "lib64/ode.dll";
74 else
75 nativeLibraryPath = "lib32/ode.dll";
76
77 m_log.DebugFormat("[ODE PLUGIN]: Loading native Windows ODE library at {0}", nativeLibraryPath);
78
79 if (Util.LoadLibrary(nativeLibraryPath) == IntPtr.Zero)
80 m_log.ErrorFormat(
81 "[ODE PLUGIN]: Couldn't find native Windows ODE library at {0}", nativeLibraryPath);
82 }
83
62 // Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to 84 // Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to
63 // http://opensimulator.org/mantis/view.php?id=2750). 85 // http://opensimulator.org/mantis/view.php?id=2750).
64 d.InitODE(); 86 d.InitODE();
65 87
66 m_scene = new OdeScene(sceneIdentifier); 88 m_scene = new OdeScene(sceneIdentifier);
67 } 89 }
68 return (m_scene); 90
91 return m_scene;
69 } 92 }
70 93
71 public string GetName() 94 public string GetName()
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index c83df4e..2424130 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -2254,7 +2254,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2254 firstname, lastname, position, notecard, 2254 firstname, lastname, position, notecard,
2255 (options & ScriptBaseClass.OS_NPC_NOT_OWNED) == 0, 2255 (options & ScriptBaseClass.OS_NPC_NOT_OWNED) == 0,
2256 false); 2256 false);
2257// (options & ScriptBaseClass.OS_NPC_SENSE_AS_AGENT) == 0); 2257// (options & ScriptBaseClass.OS_NPC_SENSE_AS_AGENT) != 0);
2258 } 2258 }
2259 2259
2260 private LSL_Key NpcCreate( 2260 private LSL_Key NpcCreate(
@@ -2634,7 +2634,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2634 UUID npcID = new UUID(npc.m_string); 2634 UUID npcID = new UUID(npc.m_string);
2635 2635
2636 if (module.CheckPermissions(npcID, m_host.OwnerID)) 2636 if (module.CheckPermissions(npcID, m_host.OwnerID))
2637 AvatarPlayAnimation(npcID.ToString(), animation); 2637 AvatarStopAnimation(npcID.ToString(), animation);
2638 } 2638 }
2639 } 2639 }
2640 2640
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
index 5c200d6..83da204 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
@@ -31,7 +31,6 @@ using System.Collections.Generic;
31using OpenMetaverse; 31using OpenMetaverse;
32using OpenSim.Framework; 32using OpenSim.Framework;
33using log4net; 33using log4net;
34
35using OpenSim.Region.Framework.Interfaces; 34using OpenSim.Region.Framework.Interfaces;
36using OpenSim.Region.Framework.Scenes; 35using OpenSim.Region.Framework.Scenes;
37using OpenSim.Region.ScriptEngine.Shared; 36using OpenSim.Region.ScriptEngine.Shared;
@@ -41,6 +40,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
41{ 40{
42 public class SensorRepeat 41 public class SensorRepeat
43 { 42 {
43// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
44
44 public AsyncCommandManager m_CmdManager; 45 public AsyncCommandManager m_CmdManager;
45 46
46 public SensorRepeat(AsyncCommandManager CmdManager) 47 public SensorRepeat(AsyncCommandManager CmdManager)
@@ -452,11 +453,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
452 453
453 Action<ScenePresence> senseEntity = new Action<ScenePresence>(presence => 454 Action<ScenePresence> senseEntity = new Action<ScenePresence>(presence =>
454 { 455 {
456// m_log.DebugFormat(
457// "[SENSOR REPEAT]: Inspecting scene presence {0}, type {1} on sensor sweep for {2}, type {3}",
458// presence.Name, presence.PresenceType, ts.name, ts.type);
459
455 if ((ts.type & NPC) == 0 && presence.PresenceType == PresenceType.Npc) 460 if ((ts.type & NPC) == 0 && presence.PresenceType == PresenceType.Npc)
456 { 461 {
457 INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene); 462 INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene);
458 if (npcData == null || !npcData.SenseAsAgent) 463 if (npcData == null || !npcData.SenseAsAgent)
464 {
465// m_log.DebugFormat(
466// "[SENSOR REPEAT]: Discarding NPC {0} from agent sense sweep for script item id {1}",
467// presence.Name, ts.itemID);
459 return; 468 return;
469 }
460 } 470 }
461 471
462 if ((ts.type & AGENT) == 0) 472 if ((ts.type & AGENT) == 0)
@@ -469,7 +479,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
469 { 479 {
470 INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene); 480 INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene);
471 if (npcData != null && npcData.SenseAsAgent) 481 if (npcData != null && npcData.SenseAsAgent)
482 {
483// m_log.DebugFormat(
484// "[SENSOR REPEAT]: Discarding NPC {0} from non-agent sense sweep for script item id {1}",
485// presence.Name, ts.itemID);
472 return; 486 return;
487 }
473 } 488 }
474 } 489 }
475 490