aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2012-02-19 14:20:53 +0100
committerMelanie2012-02-19 14:20:53 +0100
commit185bf55804af69390f54650f238d126614062e87 (patch)
tree3371a66f758745ae0694f8199054c3fa3d8548e6 /OpenSim/Region
parentNow if chode prim.cs detects out of bounds it requests a update and blocks mo... (diff)
parentMerge branch 'master' into careminster (diff)
downloadopensim-SC_OLD-185bf55804af69390f54650f238d126614062e87.zip
opensim-SC_OLD-185bf55804af69390f54650f238d126614062e87.tar.gz
opensim-SC_OLD-185bf55804af69390f54650f238d126614062e87.tar.bz2
opensim-SC_OLD-185bf55804af69390f54650f238d126614062e87.tar.xz
Merge branch 'master' of ssh://3dhosting.de/var/git/careminster
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/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
22 files changed, 490 insertions, 81 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 bbdf35d..7b1ef40 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 e7c6ee8..cbd45c3 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1764,7 +1764,7 @@ namespace OpenSim.Region.Framework.Scenes
1764 m_log.DebugFormat( 1764 m_log.DebugFormat(
1765 "[SCENE OBJECT GROUP]: Returning object {0} due to parcel autoreturn", 1765 "[SCENE OBJECT GROUP]: Returning object {0} due to parcel autoreturn",
1766 RootPart.UUID); 1766 RootPart.UUID);
1767 m_scene.AddReturn(OwnerID, Name, AbsolutePosition, "parcel autoreturn"); 1767 m_scene.AddReturn(OwnerID == GroupID ? LastOwnerID : OwnerID, Name, AbsolutePosition, "parcel autoreturn");
1768 m_scene.DeRezObjects(null, new List<uint>() { RootPart.LocalId }, UUID.Zero, 1768 m_scene.DeRezObjects(null, new List<uint>() { RootPart.LocalId }, UUID.Zero,
1769 DeRezAction.Return, UUID.Zero); 1769 DeRezAction.Return, UUID.Zero);
1770 1770
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index f9e61be..d6d04b2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -314,6 +314,9 @@ namespace OpenSim.Region.Framework.Scenes
314 314
315// ~SceneObjectPart() 315// ~SceneObjectPart()
316// { 316// {
317// Console.WriteLine(
318// "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}",
319// Name, LocalId, ParentGroup.Name, ParentGroup.LocalId);
317// m_log.DebugFormat( 320// m_log.DebugFormat(
318// "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}", 321// "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}",
319// Name, LocalId, ParentGroup.Name, ParentGroup.LocalId); 322// Name, LocalId, ParentGroup.Name, ParentGroup.LocalId);
@@ -1601,9 +1604,9 @@ namespace OpenSim.Region.Framework.Scenes
1601 dupe.GroupPosition = GroupPosition; 1604 dupe.GroupPosition = GroupPosition;
1602 dupe.OffsetPosition = OffsetPosition; 1605 dupe.OffsetPosition = OffsetPosition;
1603 dupe.RotationOffset = RotationOffset; 1606 dupe.RotationOffset = RotationOffset;
1604 dupe.Velocity = new Vector3(0, 0, 0); 1607 dupe.Velocity = Velocity;
1605 dupe.Acceleration = new Vector3(0, 0, 0); 1608 dupe.Acceleration = Acceleration;
1606 dupe.AngularVelocity = new Vector3(0, 0, 0); 1609 dupe.AngularVelocity = AngularVelocity;
1607 dupe.Flags = Flags; 1610 dupe.Flags = Flags;
1608 1611
1609 dupe.OwnershipCost = OwnershipCost; 1612 dupe.OwnershipCost = OwnershipCost;
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 4b80e37..19cb9fb 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;
@@ -573,13 +574,15 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
573 574
574 private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader) 575 private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader)
575 { 576 {
576 bool errors = false; 577 List<string> errorNodeNames;
577 obj.Shape = ReadShape(reader, "Shape", out errors); 578 obj.Shape = ReadShape(reader, "Shape", out errorNodeNames);
578 579
579 if (errors) 580 if (errorNodeNames != null)
581 {
580 m_log.DebugFormat( 582 m_log.DebugFormat(
581 "[SceneObjectSerializer]: Parsing PrimitiveBaseShape for object part {0} {1} encountered errors. Please see earlier log entries.", 583 "[SceneObjectSerializer]: Parsing PrimitiveBaseShape for object part {0} {1} encountered errors in properties {2}.",
582 obj.Name, obj.UUID); 584 obj.Name, obj.UUID, string.Join(", ", errorNodeNames.ToArray()));
585 }
583 } 586 }
584 587
585 private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader) 588 private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader)
@@ -1529,31 +1532,44 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1529 /// </summary> 1532 /// </summary>
1530 /// <param name="reader"></param> 1533 /// <param name="reader"></param>
1531 /// <param name="name">The name of the xml element containing the shape</param> 1534 /// <param name="name">The name of the xml element containing the shape</param>
1532 /// <param name="errors">true if any errors were encountered during parsing, false otherwise</param> 1535 /// <param name="errors">a list containing the failing node names. If no failures then null.</param>
1533 /// <returns>The shape parsed</returns> 1536 /// <returns>The shape parsed</returns>
1534 public static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out bool errors) 1537 public static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out List<string> errorNodeNames)
1535 { 1538 {
1536 errors = false; 1539 List<string> internalErrorNodeNames = null;
1537 1540
1538 PrimitiveBaseShape shape = new PrimitiveBaseShape(); 1541 PrimitiveBaseShape shape = new PrimitiveBaseShape();
1539 1542
1543 if (reader.IsEmptyElement)
1544 {
1545 reader.Read();
1546 errorNodeNames = null;
1547 return shape;
1548 }
1549
1540 reader.ReadStartElement(name, String.Empty); // Shape 1550 reader.ReadStartElement(name, String.Empty); // Shape
1541 1551
1542 errors = ExternalRepresentationUtils.ExecuteReadProcessors( 1552 ExternalRepresentationUtils.ExecuteReadProcessors(
1543 shape, 1553 shape,
1544 m_ShapeXmlProcessors, 1554 m_ShapeXmlProcessors,
1545 reader, 1555 reader,
1546 (o, nodeName, e) 1556 (o, nodeName, e)
1547 => 1557 =>
1548 { 1558 {
1549 m_log.DebugFormat( 1559// m_log.DebugFormat(
1550 "[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}", 1560// "[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}",
1551 nodeName, e.Message, e.StackTrace); 1561// nodeName, e.Message, e.StackTrace);
1562 if (internalErrorNodeNames == null)
1563 internalErrorNodeNames = new List<string>();
1564
1565 internalErrorNodeNames.Add(nodeName);
1552 } 1566 }
1553 ); 1567 );
1554 1568
1555 reader.ReadEndElement(); // Shape 1569 reader.ReadEndElement(); // Shape
1556 1570
1571 errorNodeNames = internalErrorNodeNames;
1572
1557 return shape; 1573 return shape;
1558 } 1574 }
1559 1575
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/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 f15e81b..6f6ed7f 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -313,7 +313,7 @@ namespace OpenSim.Region.Physics.Meshing
313 private bool GenerateCoordsAndFacesFromPrimMeshData( 313 private bool GenerateCoordsAndFacesFromPrimMeshData(
314 string primName, PrimitiveBaseShape primShape, Vector3 size, out List<Coord> coords, out List<Face> faces) 314 string primName, PrimitiveBaseShape primShape, Vector3 size, out List<Coord> coords, out List<Face> faces)
315 { 315 {
316 m_log.DebugFormat("[MESH]: experimental mesh proxy generation for {0}", primName); 316// m_log.DebugFormat("[MESH]: experimental mesh proxy generation for {0}", primName);
317 317
318 coords = new List<Coord>(); 318 coords = new List<Coord>();
319 faces = new List<Face>(); 319 faces = new List<Face>();
@@ -321,7 +321,7 @@ namespace OpenSim.Region.Physics.Meshing
321 321
322 if (primShape.SculptData.Length <= 0) 322 if (primShape.SculptData.Length <= 0)
323 { 323 {
324 m_log.Error("[MESH]: asset data is zero length"); 324 m_log.ErrorFormat("[MESH]: asset data for {0} is zero length", primName);
325 return false; 325 return false;
326 } 326 }
327 327
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