diff options
Diffstat (limited to 'OpenSim/Region/Framework')
9 files changed, 38 insertions, 116 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs index 2998f45..89a45da 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs | |||
@@ -191,7 +191,5 @@ namespace OpenSim.Region.Framework.Interfaces | |||
191 | /// A <see cref="Dictionary`2"/> | 191 | /// A <see cref="Dictionary`2"/> |
192 | /// </returns> | 192 | /// </returns> |
193 | Dictionary<UUID, string> GetScriptStates(); | 193 | Dictionary<UUID, string> GetScriptStates(); |
194 | |||
195 | bool CanBeDeleted(); | ||
196 | } | 194 | } |
197 | } | 195 | } |
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs index 72bb0f0..f11e571 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs | |||
@@ -35,7 +35,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
35 | string ScriptEngineName { get; } | 35 | string ScriptEngineName { get; } |
36 | 36 | ||
37 | string GetXMLState(UUID itemID); | 37 | string GetXMLState(UUID itemID); |
38 | bool CanBeDeleted(UUID itemID); | 38 | void SetXMLState(UUID itemID, string xml); |
39 | 39 | ||
40 | bool PostScriptEvent(UUID itemID, string name, Object[] args); | 40 | bool PostScriptEvent(UUID itemID, string name, Object[] args); |
41 | bool PostObjectEvent(UUID itemID, string name, Object[] args); | 41 | bool PostObjectEvent(UUID itemID, string name, Object[] args); |
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 2c4a4b0..ba11800 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | |||
@@ -247,8 +247,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
247 | else if (m_movementAnimation == "LAND") | 247 | else if (m_movementAnimation == "LAND") |
248 | { | 248 | { |
249 | float landElapsed = (float)(Environment.TickCount - m_animTickFall) / 1000f; | 249 | float landElapsed = (float)(Environment.TickCount - m_animTickFall) / 1000f; |
250 | 250 | if ((m_animTickFall != 0) && (landElapsed <= FALL_DELAY)) | |
251 | if (landElapsed <= FALL_DELAY) | ||
252 | return "LAND"; | 251 | return "LAND"; |
253 | } | 252 | } |
254 | 253 | ||
diff --git a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs index 5b571c7..9a7863b 100644 --- a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs +++ b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs | |||
@@ -131,11 +131,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
131 | if (left > 0) | 131 | if (left > 0) |
132 | { | 132 | { |
133 | x = m_inventoryDeletes.Dequeue(); | 133 | x = m_inventoryDeletes.Dequeue(); |
134 | if (!x.objectGroup.CanBeDeleted()) | ||
135 | { | ||
136 | m_inventoryDeletes.Enqueue(x); | ||
137 | return true; | ||
138 | } | ||
139 | 134 | ||
140 | m_log.DebugFormat( | 135 | m_log.DebugFormat( |
141 | "[SCENE]: Sending object to user's inventory, {0} item(s) remaining.", left); | 136 | "[SCENE]: Sending object to user's inventory, {0} item(s) remaining.", left); |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f932659..5b13b73 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -618,7 +618,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
618 | startupConfig.GetLong("MaximumTimeBeforePersistenceConsidered", DEFAULT_MAX_TIME_FOR_PERSISTENCE); | 618 | startupConfig.GetLong("MaximumTimeBeforePersistenceConsidered", DEFAULT_MAX_TIME_FOR_PERSISTENCE); |
619 | m_persistAfter *= 10000000; | 619 | m_persistAfter *= 10000000; |
620 | 620 | ||
621 | m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "DotNetEngine"); | 621 | m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "XEngine"); |
622 | 622 | ||
623 | IConfig packetConfig = m_config.Configs["PacketPool"]; | 623 | IConfig packetConfig = m_config.Configs["PacketPool"]; |
624 | if (packetConfig != null) | 624 | if (packetConfig != null) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs index 9a6f2b8..5a06bdb 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs | |||
@@ -351,12 +351,29 @@ namespace OpenSim.Region.Framework.Scenes | |||
351 | return xmldoc.InnerXml; | 351 | return xmldoc.InnerXml; |
352 | } | 352 | } |
353 | 353 | ||
354 | public void SetState(string objXMLData, UUID RegionID) | 354 | public void SetState(string objXMLData, IScene ins) |
355 | { | 355 | { |
356 | m_log.Debug("SetState called with " + objXMLData); | 356 | if (!(ins is Scene)) |
357 | return; | ||
358 | |||
359 | Scene s = (Scene)ins; | ||
360 | |||
357 | if (objXMLData == String.Empty) | 361 | if (objXMLData == String.Empty) |
358 | return; | 362 | return; |
359 | 363 | ||
364 | IScriptModule scriptModule = null; | ||
365 | |||
366 | foreach (IScriptModule sm in s.RequestModuleInterfaces<IScriptModule>()) | ||
367 | { | ||
368 | if (sm.ScriptEngineName == s.DefaultScriptEngine) | ||
369 | scriptModule = sm; | ||
370 | else if (scriptModule == null) | ||
371 | scriptModule = sm; | ||
372 | } | ||
373 | |||
374 | if (scriptModule == null) | ||
375 | return; | ||
376 | |||
360 | XmlDocument doc = new XmlDocument(); | 377 | XmlDocument doc = new XmlDocument(); |
361 | try | 378 | try |
362 | { | 379 | { |
@@ -374,69 +391,23 @@ m_log.Debug("SetState called with " + objXMLData); | |||
374 | } | 391 | } |
375 | 392 | ||
376 | XmlNodeList rootL = doc.GetElementsByTagName("ScriptData"); | 393 | XmlNodeList rootL = doc.GetElementsByTagName("ScriptData"); |
377 | if (rootL.Count == 1) | 394 | if (rootL.Count != 1) |
395 | return; | ||
396 | |||
397 | XmlElement rootE = (XmlElement)rootL[0]; | ||
398 | |||
399 | XmlNodeList dataL = rootE.GetElementsByTagName("ScriptStates"); | ||
400 | if (dataL.Count != 1) | ||
401 | return; | ||
402 | |||
403 | XmlElement dataE = (XmlElement)dataL[0]; | ||
404 | |||
405 | foreach (XmlNode n in dataE.ChildNodes) | ||
378 | { | 406 | { |
379 | XmlNode rootNode = rootL[0]; | 407 | XmlElement stateE = (XmlElement)n; |
380 | if (rootNode != null) | 408 | UUID itemID = new UUID(stateE.GetAttribute("UUID")); |
381 | { | 409 | |
382 | XmlNodeList partL = rootNode.ChildNodes; | 410 | scriptModule.SetXMLState(itemID, n.OuterXml); |
383 | |||
384 | foreach (XmlNode part in partL) | ||
385 | { | ||
386 | XmlNodeList nodeL = part.ChildNodes; | ||
387 | |||
388 | switch (part.Name) | ||
389 | { | ||
390 | case "Assemblies": | ||
391 | foreach (XmlNode asm in nodeL) | ||
392 | { | ||
393 | string fn = asm.Attributes.GetNamedItem("Filename").Value; | ||
394 | |||
395 | Byte[] filedata = Convert.FromBase64String(asm.InnerText); | ||
396 | string path = Path.Combine("ScriptEngines", RegionID.ToString()); | ||
397 | path = Path.Combine(path, fn); | ||
398 | |||
399 | if (!File.Exists(path)) | ||
400 | { | ||
401 | FileStream fs = File.Create(path); | ||
402 | fs.Write(filedata, 0, filedata.Length); | ||
403 | fs.Close(); | ||
404 | |||
405 | Byte[] textbytes = new System.Text.ASCIIEncoding().GetBytes(asm.InnerText); | ||
406 | fs = File.Create(path+".text"); | ||
407 | fs.Write(textbytes, 0, textbytes.Length); | ||
408 | fs.Close(); | ||
409 | } | ||
410 | } | ||
411 | break; | ||
412 | case "ScriptStates": | ||
413 | foreach (XmlNode st in nodeL) | ||
414 | { | ||
415 | string id = st.Attributes.GetNamedItem("UUID").Value; | ||
416 | UUID uuid = new UUID(id); | ||
417 | XmlNode state = st.ChildNodes[0]; | ||
418 | |||
419 | XmlDocument sdoc = new XmlDocument(); | ||
420 | XmlNode sxmlnode = sdoc.CreateNode( | ||
421 | XmlNodeType.XmlDeclaration, | ||
422 | "", ""); | ||
423 | sdoc.AppendChild(sxmlnode); | ||
424 | |||
425 | XmlNode newnode = sdoc.ImportNode(state, true); | ||
426 | sdoc.AppendChild(newnode); | ||
427 | |||
428 | string spath = Path.Combine("ScriptEngines", RegionID.ToString()); | ||
429 | spath = Path.Combine(spath, uuid.ToString()); | ||
430 | FileStream sfs = File.Create(spath + ".state"); | ||
431 | System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); | ||
432 | Byte[] buf = enc.GetBytes(sdoc.InnerXml); | ||
433 | sfs.Write(buf, 0, buf.Length); | ||
434 | sfs.Close(); | ||
435 | } | ||
436 | break; | ||
437 | } | ||
438 | } | ||
439 | } | ||
440 | } | 411 | } |
441 | } | 412 | } |
442 | } | 413 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index ea4f2c7..f36ff1d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -3380,17 +3380,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3380 | } | 3380 | } |
3381 | #endregion | 3381 | #endregion |
3382 | 3382 | ||
3383 | public bool CanBeDeleted() | ||
3384 | { | ||
3385 | foreach (SceneObjectPart part in Children.Values) | ||
3386 | { | ||
3387 | if (!part.CanBeDeleted()) | ||
3388 | return false; | ||
3389 | } | ||
3390 | |||
3391 | return true; | ||
3392 | } | ||
3393 | |||
3394 | public double GetUpdatePriority(IClientAPI client) | 3383 | public double GetUpdatePriority(IClientAPI client) |
3395 | { | 3384 | { |
3396 | switch (Scene.UpdatePrioritizationScheme) | 3385 | switch (Scene.UpdatePrioritizationScheme) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index bbece2f..19e3023 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -3807,10 +3807,5 @@ namespace OpenSim.Region.Framework.Scenes | |||
3807 | 3807 | ||
3808 | Inventory.ApplyNextOwnerPermissions(); | 3808 | Inventory.ApplyNextOwnerPermissions(); |
3809 | } | 3809 | } |
3810 | |||
3811 | public bool CanBeDeleted() | ||
3812 | { | ||
3813 | return Inventory.CanBeDeleted(); | ||
3814 | } | ||
3815 | } | 3810 | } |
3816 | } | 3811 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 2ef8258..eca8588 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -909,30 +909,5 @@ namespace OpenSim.Region.Framework.Scenes | |||
909 | } | 909 | } |
910 | return ret; | 910 | return ret; |
911 | } | 911 | } |
912 | |||
913 | public bool CanBeDeleted() | ||
914 | { | ||
915 | if (!ContainsScripts()) | ||
916 | return true; | ||
917 | |||
918 | IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); | ||
919 | |||
920 | if (engines == null) // No engine at all | ||
921 | return true; | ||
922 | |||
923 | foreach (TaskInventoryItem item in m_items.Values) | ||
924 | { | ||
925 | if (item.InvType == (int)InventoryType.LSL) | ||
926 | { | ||
927 | foreach (IScriptModule e in engines) | ||
928 | { | ||
929 | if (!e.CanBeDeleted(item.ItemID)) | ||
930 | return false; | ||
931 | } | ||
932 | } | ||
933 | } | ||
934 | |||
935 | return true; | ||
936 | } | ||
937 | } | 912 | } |
938 | } | 913 | } |