diff options
author | Dan Lake | 2012-02-17 13:51:54 -0800 |
---|---|---|
committer | Dan Lake | 2012-02-17 13:51:54 -0800 |
commit | b313d16493b765c3981ef3d15b8919d376733df2 (patch) | |
tree | c1111d430dcf7ecbecc3fa82a01e4e9623c1b6bc | |
parent | Added the TriggerAvatarAppearanceChanged to EventManager. It's triggered by A... (diff) | |
parent | Add new and updated script events (diff) | |
download | opensim-SC_OLD-b313d16493b765c3981ef3d15b8919d376733df2.zip opensim-SC_OLD-b313d16493b765c3981ef3d15b8919d376733df2.tar.gz opensim-SC_OLD-b313d16493b765c3981ef3d15b8919d376733df2.tar.bz2 opensim-SC_OLD-b313d16493b765c3981ef3d15b8919d376733df2.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
19 files changed, 400 insertions, 75 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 7b1aa2c..1e22fcc 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/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 63ba3d3..d320af4 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -551,9 +551,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
551 | // "[INVENTORY ACCESS MODULE]: Target of {0} in CreateItemForObject() is {1} {2}", | 551 | // "[INVENTORY ACCESS MODULE]: Target of {0} in CreateItemForObject() is {1} {2}", |
552 | // action, remoteClient.Name, userID); | 552 | // action, remoteClient.Name, userID); |
553 | } | 553 | } |
554 | else if (so.RootPart.OwnerID == so.RootPart.GroupID) | ||
555 | { | ||
556 | // Group owned objects go to the last owner before the object was transferred. | ||
557 | userID = so.RootPart.LastOwnerID; | ||
558 | } | ||
554 | else | 559 | else |
555 | { | 560 | { |
556 | // All returns / deletes go to the object owner | 561 | // Other returns / deletes go to the object owner |
557 | // | 562 | // |
558 | userID = so.RootPart.OwnerID; | 563 | userID = so.RootPart.OwnerID; |
559 | 564 | ||
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 6586437..569c235 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -187,10 +187,62 @@ namespace OpenSim.Region.Framework.Scenes | |||
187 | 187 | ||
188 | public event ClientClosed OnClientClosed; | 188 | public event ClientClosed OnClientClosed; |
189 | 189 | ||
190 | // Fired when a script is created | ||
191 | // The indication that a new script exists in this region. | ||
192 | public delegate void NewScript(UUID clientID, SceneObjectPart part, UUID itemID); | ||
193 | public event NewScript OnNewScript; | ||
194 | public virtual void TriggerNewScript(UUID clientID, SceneObjectPart part, UUID itemID) | ||
195 | { | ||
196 | NewScript handlerNewScript = OnNewScript; | ||
197 | if (handlerNewScript != null) | ||
198 | { | ||
199 | foreach (NewScript d in handlerNewScript.GetInvocationList()) | ||
200 | { | ||
201 | try | ||
202 | { | ||
203 | d(clientID, part, itemID); | ||
204 | } | ||
205 | catch (Exception e) | ||
206 | { | ||
207 | m_log.ErrorFormat( | ||
208 | "[EVENT MANAGER]: Delegate for TriggerNewScript failed - continuing. {0} {1}", | ||
209 | e.Message, e.StackTrace); | ||
210 | } | ||
211 | } | ||
212 | } | ||
213 | } | ||
214 | |||
215 | //TriggerUpdateScript: triggered after Scene receives client's upload of updated script and stores it as asset | ||
216 | // An indication that the script has changed. | ||
217 | public delegate void UpdateScript(UUID clientID, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID); | ||
218 | public event UpdateScript OnUpdateScript; | ||
219 | public virtual void TriggerUpdateScript(UUID clientId, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID) | ||
220 | { | ||
221 | UpdateScript handlerUpdateScript = OnUpdateScript; | ||
222 | if (handlerUpdateScript != null) | ||
223 | { | ||
224 | foreach (UpdateScript d in handlerUpdateScript.GetInvocationList()) | ||
225 | { | ||
226 | try | ||
227 | { | ||
228 | d(clientId, itemId, primId, isScriptRunning, newAssetID); | ||
229 | } | ||
230 | catch (Exception e) | ||
231 | { | ||
232 | m_log.ErrorFormat( | ||
233 | "[EVENT MANAGER]: Delegate for TriggerUpdateScript failed - continuing. {0} {1}", | ||
234 | e.Message, e.StackTrace); | ||
235 | } | ||
236 | } | ||
237 | } | ||
238 | } | ||
239 | |||
190 | /// <summary> | 240 | /// <summary> |
191 | /// This is fired when a scene object property that a script might be interested in (such as color, scale or | 241 | /// ScriptChangedEvent is fired when a scene object property that a script might be interested |
192 | /// inventory) changes. Only enough information is sent for the LSL changed event | 242 | /// in (such as color, scale or inventory) changes. Only enough information sent is for the LSL changed event. |
193 | /// (see http://lslwiki.net/lslwiki/wakka.php?wakka=changed) | 243 | /// This is not an indication that the script has changed (see OnUpdateScript for that). |
244 | /// This event is sent to a script to tell it that some property changed on | ||
245 | /// the object the script is in. See http://lslwiki.net/lslwiki/wakka.php?wakka=changed . | ||
194 | /// </summary> | 246 | /// </summary> |
195 | public event ScriptChangedEvent OnScriptChangedEvent; | 247 | public event ScriptChangedEvent OnScriptChangedEvent; |
196 | public delegate void ScriptChangedEvent(uint localID, uint change); | 248 | public delegate void ScriptChangedEvent(uint localID, uint change); |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 5a5307c..6cc78b8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -283,6 +283,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
283 | { | 283 | { |
284 | remoteClient.SendAgentAlertMessage("Script saved", false); | 284 | remoteClient.SendAgentAlertMessage("Script saved", false); |
285 | } | 285 | } |
286 | |||
287 | // Tell anyone managing scripts that a script has been reloaded/changed | ||
288 | EventManager.TriggerUpdateScript(remoteClient.AgentId, itemId, primId, isScriptRunning, item.AssetID); | ||
289 | |||
286 | part.ParentGroup.ResumeScripts(); | 290 | part.ParentGroup.ResumeScripts(); |
287 | return errors; | 291 | return errors; |
288 | } | 292 | } |
@@ -1624,9 +1628,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
1624 | // have state in inventory | 1628 | // have state in inventory |
1625 | part.Inventory.CreateScriptInstance(copyID, 0, false, DefaultScriptEngine, 0); | 1629 | part.Inventory.CreateScriptInstance(copyID, 0, false, DefaultScriptEngine, 0); |
1626 | 1630 | ||
1631 | // tell anyone watching that there is a new script in town | ||
1632 | EventManager.TriggerNewScript(agentID, part, copyID); | ||
1633 | |||
1627 | // m_log.InfoFormat("[PRIMINVENTORY]: " + | 1634 | // m_log.InfoFormat("[PRIMINVENTORY]: " + |
1628 | // "Rezzed script {0} into prim local ID {1} for user {2}", | 1635 | // "Rezzed script {0} into prim local ID {1} for user {2}", |
1629 | // item.inventoryName, localID, remoteClient.Name); | 1636 | // item.inventoryName, localID, remoteClient.Name); |
1637 | |||
1630 | part.ParentGroup.ResumeScripts(); | 1638 | part.ParentGroup.ResumeScripts(); |
1631 | 1639 | ||
1632 | return part; | 1640 | return part; |
@@ -1707,6 +1715,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1707 | 1715 | ||
1708 | part.Inventory.AddInventoryItem(taskItem, false); | 1716 | part.Inventory.AddInventoryItem(taskItem, false); |
1709 | part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0); | 1717 | part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0); |
1718 | |||
1719 | // tell anyone managing scripts that a new script exists | ||
1720 | EventManager.TriggerNewScript(agentID, part, taskItem.ItemID); | ||
1721 | |||
1710 | part.ParentGroup.ResumeScripts(); | 1722 | part.ParentGroup.ResumeScripts(); |
1711 | 1723 | ||
1712 | return part; | 1724 | return part; |
@@ -1926,7 +1938,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1926 | 1938 | ||
1927 | foreach (SceneObjectGroup g in deleteGroups) | 1939 | foreach (SceneObjectGroup g in deleteGroups) |
1928 | { | 1940 | { |
1929 | AddReturn(g.OwnerID, g.Name, g.AbsolutePosition, "parcel owner return"); | 1941 | AddReturn(g.OwnerID == g.GroupID ? g.LastOwnerID : g.OwnerID, g.Name, g.AbsolutePosition, "parcel owner return"); |
1930 | } | 1942 | } |
1931 | } | 1943 | } |
1932 | } | 1944 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 4c8e2d2..ecc553d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3427,6 +3427,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
3427 | agent.startpos.Z = 720; | 3427 | agent.startpos.Z = 720; |
3428 | } | 3428 | } |
3429 | } | 3429 | } |
3430 | |||
3431 | // Honor Estate teleport routing via Telehubs | ||
3432 | if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero && RegionInfo.EstateSettings.AllowDirectTeleport == false) | ||
3433 | { | ||
3434 | SceneObjectGroup telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject); | ||
3435 | // Can have multiple SpawnPoints | ||
3436 | List<SpawnPoint> spawnpoints = RegionInfo.RegionSettings.SpawnPoints(); | ||
3437 | if ( spawnpoints.Count > 1) | ||
3438 | { | ||
3439 | // We have multiple SpawnPoints, Route the agent to a random one | ||
3440 | agent.startpos = spawnpoints[Util.RandomClass.Next(spawnpoints.Count)].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation); | ||
3441 | } | ||
3442 | else | ||
3443 | { | ||
3444 | // We have a single SpawnPoint and will route the agent to it | ||
3445 | agent.startpos = spawnpoints[0].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation); | ||
3446 | } | ||
3447 | |||
3448 | return true; | ||
3449 | } | ||
3450 | |||
3430 | // Honor parcel landing type and position. | 3451 | // Honor parcel landing type and position. |
3431 | if (land != null) | 3452 | if (land != null) |
3432 | { | 3453 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 693a79e..e66678a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -359,7 +359,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
359 | m_log.ErrorFormat( | 359 | m_log.ErrorFormat( |
360 | "[SCENEGRAPH]: Tried to add scene object {0} to {1} with illegal UUID of {2}", | 360 | "[SCENEGRAPH]: Tried to add scene object {0} to {1} with illegal UUID of {2}", |
361 | sceneObject.Name, m_parentScene.RegionInfo.RegionName, UUID.Zero); | 361 | sceneObject.Name, m_parentScene.RegionInfo.RegionName, UUID.Zero); |
362 | 362 | ||
363 | return false; | 363 | return false; |
364 | } | 364 | } |
365 | 365 | ||
@@ -368,12 +368,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
368 | // m_log.DebugFormat( | 368 | // m_log.DebugFormat( |
369 | // "[SCENEGRAPH]: Scene graph for {0} already contains object {1} in AddSceneObject()", | 369 | // "[SCENEGRAPH]: Scene graph for {0} already contains object {1} in AddSceneObject()", |
370 | // m_parentScene.RegionInfo.RegionName, sceneObject.UUID); | 370 | // m_parentScene.RegionInfo.RegionName, sceneObject.UUID); |
371 | 371 | ||
372 | return false; | 372 | return false; |
373 | } | 373 | } |
374 | 374 | ||
375 | // m_log.DebugFormat( | 375 | // m_log.DebugFormat( |
376 | // "[SCENEGRAPH]: Adding scene object {0} {1}, with {2} parts on {3}", | 376 | // "[SCENEGRAPH]: Adding scene object {0} {1}, with {2} parts on {3}", |
377 | // sceneObject.Name, sceneObject.UUID, sceneObject.Parts.Length, m_parentScene.RegionInfo.RegionName); | 377 | // sceneObject.Name, sceneObject.UUID, sceneObject.Parts.Length, m_parentScene.RegionInfo.RegionName); |
378 | 378 | ||
379 | SceneObjectPart[] parts = sceneObject.Parts; | 379 | SceneObjectPart[] parts = sceneObject.Parts; |
@@ -409,7 +409,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
409 | 409 | ||
410 | lock (SceneObjectGroupsByFullID) | 410 | lock (SceneObjectGroupsByFullID) |
411 | SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject; | 411 | SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject; |
412 | 412 | ||
413 | lock (SceneObjectGroupsByFullPartID) | 413 | lock (SceneObjectGroupsByFullPartID) |
414 | { | 414 | { |
415 | foreach (SceneObjectPart part in parts) | 415 | foreach (SceneObjectPart part in parts) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 5b838f8..878476e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1330,7 +1330,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1330 | m_log.DebugFormat( | 1330 | m_log.DebugFormat( |
1331 | "[SCENE OBJECT GROUP]: Returning object {0} due to parcel autoreturn", | 1331 | "[SCENE OBJECT GROUP]: Returning object {0} due to parcel autoreturn", |
1332 | RootPart.UUID); | 1332 | RootPart.UUID); |
1333 | m_scene.AddReturn(OwnerID, Name, AbsolutePosition, "parcel autoreturn"); | 1333 | m_scene.AddReturn(OwnerID == GroupID ? LastOwnerID : OwnerID, Name, AbsolutePosition, "parcel autoreturn"); |
1334 | m_scene.DeRezObjects(null, new List<uint>() { RootPart.LocalId }, UUID.Zero, | 1334 | m_scene.DeRezObjects(null, new List<uint>() { RootPart.LocalId }, UUID.Zero, |
1335 | DeRezAction.Return, UUID.Zero); | 1335 | DeRezAction.Return, UUID.Zero); |
1336 | 1336 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 4c339d9..b130bf7 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -303,6 +303,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
303 | 303 | ||
304 | // ~SceneObjectPart() | 304 | // ~SceneObjectPart() |
305 | // { | 305 | // { |
306 | // Console.WriteLine( | ||
307 | // "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}", | ||
308 | // Name, LocalId, ParentGroup.Name, ParentGroup.LocalId); | ||
306 | // m_log.DebugFormat( | 309 | // m_log.DebugFormat( |
307 | // "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}", | 310 | // "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}", |
308 | // Name, LocalId, ParentGroup.Name, ParentGroup.LocalId); | 311 | // Name, LocalId, ParentGroup.Name, ParentGroup.LocalId); |
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 0a32214..e6b88a3 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Drawing; | 30 | using System.Drawing; |
31 | using System.IO; | 31 | using System.IO; |
32 | using System.Linq; | ||
32 | using System.Reflection; | 33 | using System.Reflection; |
33 | using System.Xml; | 34 | using System.Xml; |
34 | using log4net; | 35 | using log4net; |
@@ -570,13 +571,15 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
570 | 571 | ||
571 | private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader) | 572 | private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader) |
572 | { | 573 | { |
573 | bool errors = false; | 574 | List<string> errorNodeNames; |
574 | obj.Shape = ReadShape(reader, "Shape", out errors); | 575 | obj.Shape = ReadShape(reader, "Shape", out errorNodeNames); |
575 | 576 | ||
576 | if (errors) | 577 | if (errorNodeNames != null) |
578 | { | ||
577 | m_log.DebugFormat( | 579 | m_log.DebugFormat( |
578 | "[SceneObjectSerializer]: Parsing PrimitiveBaseShape for object part {0} {1} encountered errors. Please see earlier log entries.", | 580 | "[SceneObjectSerializer]: Parsing PrimitiveBaseShape for object part {0} {1} encountered errors in properties {2}.", |
579 | obj.Name, obj.UUID); | 581 | obj.Name, obj.UUID, string.Join(", ", errorNodeNames.ToArray())); |
582 | } | ||
580 | } | 583 | } |
581 | 584 | ||
582 | private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader) | 585 | private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader) |
@@ -1519,37 +1522,44 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1519 | /// </summary> | 1522 | /// </summary> |
1520 | /// <param name="reader"></param> | 1523 | /// <param name="reader"></param> |
1521 | /// <param name="name">The name of the xml element containing the shape</param> | 1524 | /// <param name="name">The name of the xml element containing the shape</param> |
1522 | /// <param name="errors">true if any errors were encountered during parsing, false otherwise</param> | 1525 | /// <param name="errors">a list containing the failing node names. If no failures then null.</param> |
1523 | /// <returns>The shape parsed</returns> | 1526 | /// <returns>The shape parsed</returns> |
1524 | public static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out bool errors) | 1527 | public static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out List<string> errorNodeNames) |
1525 | { | 1528 | { |
1526 | errors = false; | 1529 | List<string> internalErrorNodeNames = null; |
1527 | 1530 | ||
1528 | PrimitiveBaseShape shape = new PrimitiveBaseShape(); | 1531 | PrimitiveBaseShape shape = new PrimitiveBaseShape(); |
1529 | 1532 | ||
1530 | if (reader.IsEmptyElement) | 1533 | if (reader.IsEmptyElement) |
1531 | { | 1534 | { |
1532 | reader.Read(); | 1535 | reader.Read(); |
1536 | errorNodeNames = null; | ||
1533 | return shape; | 1537 | return shape; |
1534 | } | 1538 | } |
1535 | 1539 | ||
1536 | reader.ReadStartElement(name, String.Empty); // Shape | 1540 | reader.ReadStartElement(name, String.Empty); // Shape |
1537 | 1541 | ||
1538 | errors = ExternalRepresentationUtils.ExecuteReadProcessors( | 1542 | ExternalRepresentationUtils.ExecuteReadProcessors( |
1539 | shape, | 1543 | shape, |
1540 | m_ShapeXmlProcessors, | 1544 | m_ShapeXmlProcessors, |
1541 | reader, | 1545 | reader, |
1542 | (o, nodeName, e) | 1546 | (o, nodeName, e) |
1543 | => | 1547 | => |
1544 | { | 1548 | { |
1545 | m_log.DebugFormat( | 1549 | // m_log.DebugFormat( |
1546 | "[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}", | 1550 | // "[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}", |
1547 | nodeName, e.Message, e.StackTrace); | 1551 | // nodeName, e.Message, e.StackTrace); |
1552 | if (internalErrorNodeNames == null) | ||
1553 | internalErrorNodeNames = new List<string>(); | ||
1554 | |||
1555 | internalErrorNodeNames.Add(nodeName); | ||
1548 | } | 1556 | } |
1549 | ); | 1557 | ); |
1550 | 1558 | ||
1551 | reader.ReadEndElement(); // Shape | 1559 | reader.ReadEndElement(); // Shape |
1552 | 1560 | ||
1561 | errorNodeNames = internalErrorNodeNames; | ||
1562 | |||
1553 | return shape; | 1563 | return shape; |
1554 | } | 1564 | } |
1555 | 1565 | ||
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 | ||
28 | using System; | 28 | using System; |
29 | using System.Reflection; | 29 | using System.Reflection; |
30 | using System.Threading; | ||
30 | using NUnit.Framework; | 31 | using NUnit.Framework; |
31 | using OpenMetaverse; | 32 | using OpenMetaverse; |
32 | using OpenSim.Framework; | 33 | using 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 5359354..2052cdb 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/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/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index b1583eb..c55e2ae 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -2233,7 +2233,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2233 | CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); | 2233 | CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); |
2234 | m_host.AddScriptLPS(1); | 2234 | m_host.AddScriptLPS(1); |
2235 | 2235 | ||
2236 | return NpcCreate(firstname, lastname, position, notecard, false, true); | 2236 | return NpcCreate(firstname, lastname, position, notecard, false, false); |
2237 | } | 2237 | } |
2238 | 2238 | ||
2239 | public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, int options) | 2239 | public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, int options) |
@@ -2244,7 +2244,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2244 | return NpcCreate( | 2244 | return NpcCreate( |
2245 | firstname, lastname, position, notecard, | 2245 | firstname, lastname, position, notecard, |
2246 | (options & ScriptBaseClass.OS_NPC_NOT_OWNED) == 0, | 2246 | (options & ScriptBaseClass.OS_NPC_NOT_OWNED) == 0, |
2247 | (options & ScriptBaseClass.OS_NPC_SENSE_AS_AGENT) == 0); | 2247 | (options & ScriptBaseClass.OS_NPC_SENSE_AS_AGENT) != 0); |
2248 | } | 2248 | } |
2249 | 2249 | ||
2250 | private LSL_Key NpcCreate( | 2250 | private LSL_Key NpcCreate( |
@@ -2595,7 +2595,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2595 | UUID npcID = new UUID(npc.m_string); | 2595 | UUID npcID = new UUID(npc.m_string); |
2596 | 2596 | ||
2597 | if (module.CheckPermissions(npcID, m_host.OwnerID)) | 2597 | if (module.CheckPermissions(npcID, m_host.OwnerID)) |
2598 | AvatarPlayAnimation(npcID.ToString(), animation); | 2598 | AvatarStopAnimation(npcID.ToString(), animation); |
2599 | } | 2599 | } |
2600 | } | 2600 | } |
2601 | 2601 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index 850f50b..5c1bdff 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; | |||
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using log4net; | 33 | using log4net; |
34 | |||
35 | using OpenSim.Region.Framework.Interfaces; | 34 | using OpenSim.Region.Framework.Interfaces; |
36 | using OpenSim.Region.Framework.Scenes; | 35 | using OpenSim.Region.Framework.Scenes; |
37 | using OpenSim.Region.ScriptEngine.Shared; | 36 | using 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) |
@@ -447,11 +448,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
447 | 448 | ||
448 | Action<ScenePresence> senseEntity = new Action<ScenePresence>(presence => | 449 | Action<ScenePresence> senseEntity = new Action<ScenePresence>(presence => |
449 | { | 450 | { |
451 | // m_log.DebugFormat( | ||
452 | // "[SENSOR REPEAT]: Inspecting scene presence {0}, type {1} on sensor sweep for {2}, type {3}", | ||
453 | // presence.Name, presence.PresenceType, ts.name, ts.type); | ||
454 | |||
450 | if ((ts.type & NPC) == 0 && presence.PresenceType == PresenceType.Npc) | 455 | if ((ts.type & NPC) == 0 && presence.PresenceType == PresenceType.Npc) |
451 | { | 456 | { |
452 | INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene); | 457 | INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene); |
453 | if (npcData == null || !npcData.SenseAsAgent) | 458 | if (npcData == null || !npcData.SenseAsAgent) |
459 | { | ||
460 | // m_log.DebugFormat( | ||
461 | // "[SENSOR REPEAT]: Discarding NPC {0} from agent sense sweep for script item id {1}", | ||
462 | // presence.Name, ts.itemID); | ||
454 | return; | 463 | return; |
464 | } | ||
455 | } | 465 | } |
456 | 466 | ||
457 | if ((ts.type & AGENT) == 0) | 467 | if ((ts.type & AGENT) == 0) |
@@ -464,7 +474,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
464 | { | 474 | { |
465 | INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene); | 475 | INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene); |
466 | if (npcData != null && npcData.SenseAsAgent) | 476 | if (npcData != null && npcData.SenseAsAgent) |
477 | { | ||
478 | // m_log.DebugFormat( | ||
479 | // "[SENSOR REPEAT]: Discarding NPC {0} from non-agent sense sweep for script item id {1}", | ||
480 | // presence.Name, ts.itemID); | ||
467 | return; | 481 | return; |
482 | } | ||
468 | } | 483 | } |
469 | } | 484 | } |
470 | 485 | ||
diff --git a/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs index 44138c9..b1dd84e 100644 --- a/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs +++ b/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs | |||
@@ -220,7 +220,7 @@ namespace OpenSim.Services.Connectors.Friends | |||
220 | public bool Delete(Dictionary<string, object> sendData, string PrincipalID, string Friend) | 220 | public bool Delete(Dictionary<string, object> sendData, string PrincipalID, string Friend) |
221 | { | 221 | { |
222 | string reply = string.Empty; | 222 | string reply = string.Empty; |
223 | string uri = m_ServerURI = "/friends"; | 223 | string uri = m_ServerURI + "/friends"; |
224 | try | 224 | try |
225 | { | 225 | { |
226 | reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData)); | 226 | reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData)); |
diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 328cd2b..eea68c3 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs | |||
@@ -50,7 +50,8 @@ namespace OpenSim.Tests.Common.Mock | |||
50 | 50 | ||
51 | ~TestScene() | 51 | ~TestScene() |
52 | { | 52 | { |
53 | Console.WriteLine("TestScene destructor called for {0}", RegionInfo.RegionName); | 53 | //Console.WriteLine("TestScene destructor called for {0}", RegionInfo.RegionName); |
54 | Console.WriteLine("TestScene destructor called"); | ||
54 | } | 55 | } |
55 | 56 | ||
56 | /// <summary> | 57 | /// <summary> |
diff --git a/OpenSim/Tests/Torture/ObjectTortureTests.cs b/OpenSim/Tests/Torture/ObjectTortureTests.cs index 74b336e..e83186a 100644 --- a/OpenSim/Tests/Torture/ObjectTortureTests.cs +++ b/OpenSim/Tests/Torture/ObjectTortureTests.cs | |||
@@ -49,6 +49,13 @@ namespace OpenSim.Tests.Torture | |||
49 | [TestFixture] | 49 | [TestFixture] |
50 | public class ObjectTortureTests | 50 | public class ObjectTortureTests |
51 | { | 51 | { |
52 | [TearDown] | ||
53 | public void TearDown() | ||
54 | { | ||
55 | GC.Collect(); | ||
56 | GC.WaitForPendingFinalizers(); | ||
57 | } | ||
58 | |||
52 | // [Test] | 59 | // [Test] |
53 | // public void Test0000Clean() | 60 | // public void Test0000Clean() |
54 | // { | 61 | // { |
@@ -141,8 +148,18 @@ namespace OpenSim.Tests.Torture | |||
141 | string.Format("Object {0} could not be retrieved", i)); | 148 | string.Format("Object {0} could not be retrieved", i)); |
142 | } | 149 | } |
143 | 150 | ||
144 | // This does not work to fire the SceneObjectGroup destructors - something else is hanging on to them. | 151 | // When a scene object is added to a scene, it is placed in the update list for sending to viewers |
145 | // scene.DeleteAllSceneObjects(); | 152 | // (though in this case we have none). When it is deleted, it is not removed from the update which is |
153 | // fine since it will later be ignored. | ||
154 | // | ||
155 | // However, that means that we need to manually run an update here to clear out that list so that deleted | ||
156 | // objects will be clean up by the garbage collector before the next stress test is run. | ||
157 | scene.Update(); | ||
158 | |||
159 | // Currently, we need to do this in order to garbage collect the scene objects ready for the next test run. | ||
160 | // However, what we really need to do is find out why the entire scene is not garbage collected in | ||
161 | // teardown. | ||
162 | scene.DeleteAllSceneObjects(); | ||
146 | 163 | ||
147 | Console.WriteLine( | 164 | Console.WriteLine( |
148 | "Took {0}ms, {1}MB ({2} - {3}) to create {4} objects each containing {5} prim(s)", | 165 | "Took {0}ms, {1}MB ({2} - {3}) to create {4} objects each containing {5} prim(s)", |