diff options
author | Justin Clark-Casey (justincc) | 2012-07-11 21:43:35 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-11 21:43:35 +0100 |
commit | fc2456320646df66b95a06d4cd292c3b2385a8ea (patch) | |
tree | c1f7eaf2c679a9e7d039240146510ffc6a744cd1 /OpenSim/Region/ScriptEngine | |
parent | Add regression TestRezScriptedAttachmentsFromInventory() though this currentl... (diff) | |
download | opensim-SC_OLD-fc2456320646df66b95a06d4cd292c3b2385a8ea.zip opensim-SC_OLD-fc2456320646df66b95a06d4cd292c3b2385a8ea.tar.gz opensim-SC_OLD-fc2456320646df66b95a06d4cd292c3b2385a8ea.tar.bz2 opensim-SC_OLD-fc2456320646df66b95a06d4cd292c3b2385a8ea.tar.xz |
Add regression TestDetachScriptedAttachmentToInventory()
This currently only does a relatively crude check for a ScriptState node in the serialized xml
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
3 files changed, 17 insertions, 10 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs index 993d10f..5b22860 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs | |||
@@ -233,17 +233,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
233 | m_Timer[engine].UnSetTimerEvents(localID, itemID); | 233 | m_Timer[engine].UnSetTimerEvents(localID, itemID); |
234 | 234 | ||
235 | // Remove from: HttpRequest | 235 | // Remove from: HttpRequest |
236 | IHttpRequestModule iHttpReq = | 236 | IHttpRequestModule iHttpReq = engine.World.RequestModuleInterface<IHttpRequestModule>(); |
237 | engine.World.RequestModuleInterface<IHttpRequestModule>(); | 237 | if (iHttpReq != null) |
238 | iHttpReq.StopHttpRequest(localID, itemID); | 238 | iHttpReq.StopHttpRequest(localID, itemID); |
239 | 239 | ||
240 | IWorldComm comms = engine.World.RequestModuleInterface<IWorldComm>(); | 240 | IWorldComm comms = engine.World.RequestModuleInterface<IWorldComm>(); |
241 | if (comms != null) | 241 | if (comms != null) |
242 | comms.DeleteListener(itemID); | 242 | comms.DeleteListener(itemID); |
243 | 243 | ||
244 | IXMLRPC xmlrpc = engine.World.RequestModuleInterface<IXMLRPC>(); | 244 | IXMLRPC xmlrpc = engine.World.RequestModuleInterface<IXMLRPC>(); |
245 | xmlrpc.DeleteChannels(itemID); | 245 | if (xmlrpc != null) |
246 | xmlrpc.CancelSRDRequests(itemID); | 246 | { |
247 | xmlrpc.DeleteChannels(itemID); | ||
248 | xmlrpc.CancelSRDRequests(itemID); | ||
249 | } | ||
247 | 250 | ||
248 | // Remove Sensors | 251 | // Remove Sensors |
249 | m_SensorRepeat[engine].UnSetSenseRepeaterEvents(localID, itemID); | 252 | m_SensorRepeat[engine].UnSetSenseRepeaterEvents(localID, itemID); |
@@ -305,7 +308,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
305 | { | 308 | { |
306 | List<Object> data = new List<Object>(); | 309 | List<Object> data = new List<Object>(); |
307 | 310 | ||
308 | Object[] listeners=m_Listener[engine].GetSerializationData(itemID); | 311 | Object[] listeners = m_Listener[engine].GetSerializationData(itemID); |
309 | if (listeners.Length > 0) | 312 | if (listeners.Length > 0) |
310 | { | 313 | { |
311 | data.Add("listener"); | 314 | data.Add("listener"); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs index 93e0261..efa86fc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs | |||
@@ -88,13 +88,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
88 | 88 | ||
89 | public Object[] GetSerializationData(UUID itemID) | 89 | public Object[] GetSerializationData(UUID itemID) |
90 | { | 90 | { |
91 | return m_commsPlugin.GetSerializationData(itemID); | 91 | if (m_commsPlugin != null) |
92 | return m_commsPlugin.GetSerializationData(itemID); | ||
93 | else | ||
94 | return new Object[]{}; | ||
92 | } | 95 | } |
93 | 96 | ||
94 | public void CreateFromData(uint localID, UUID itemID, UUID hostID, | 97 | public void CreateFromData(uint localID, UUID itemID, UUID hostID, |
95 | Object[] data) | 98 | Object[] data) |
96 | { | 99 | { |
97 | m_commsPlugin.CreateFromData(localID, itemID, hostID, data); | 100 | if (m_commsPlugin != null) |
101 | m_commsPlugin.CreateFromData(localID, itemID, hostID, data); | ||
98 | } | 102 | } |
99 | } | 103 | } |
100 | } \ No newline at end of file | 104 | } \ No newline at end of file |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index efcae94..e07ae1c 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -1676,12 +1676,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1676 | 1676 | ||
1677 | public string GetXMLState(UUID itemID) | 1677 | public string GetXMLState(UUID itemID) |
1678 | { | 1678 | { |
1679 | // m_log.DebugFormat("[XEngine]: Getting XML state for {0}", itemID); | 1679 | // m_log.DebugFormat("[XEngine]: Getting XML state for script instance {0}", itemID); |
1680 | 1680 | ||
1681 | IScriptInstance instance = GetInstance(itemID); | 1681 | IScriptInstance instance = GetInstance(itemID); |
1682 | if (instance == null) | 1682 | if (instance == null) |
1683 | { | 1683 | { |
1684 | // m_log.DebugFormat("[XEngine]: Found no script for {0}, returning empty string", itemID); | 1684 | // m_log.DebugFormat("[XEngine]: Found no script instance for {0}, returning empty string", itemID); |
1685 | return ""; | 1685 | return ""; |
1686 | } | 1686 | } |
1687 | 1687 | ||