aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2009-11-26 17:27:03 +0000
committerMelanie2009-11-26 17:27:03 +0000
commit06f41bb0176990d2c8bf5f6077418e4fc3b3d6c6 (patch)
tree7c0a0a90235a988d69482a4c93dad6c8bbf6a5fc
parentRemove the old remoting-type interregion code for prim/script crossing (diff)
parentFix a small bug. Trusted script crossings now work again (diff)
downloadopensim-SC_OLD-06f41bb0176990d2c8bf5f6077418e4fc3b3d6c6.zip
opensim-SC_OLD-06f41bb0176990d2c8bf5f6077418e4fc3b3d6c6.tar.gz
opensim-SC_OLD-06f41bb0176990d2c8bf5f6077418e4fc3b3d6c6.tar.bz2
opensim-SC_OLD-06f41bb0176990d2c8bf5f6077418e4fc3b3d6c6.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/ISceneObject.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs8
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs9
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs9
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs6
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEntityInventory.cs2
-rw-r--r--OpenSim/Region/Framework/Interfaces/IScriptModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs99
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs11
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs25
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs9
-rw-r--r--OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs12
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs5
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs124
20 files changed, 194 insertions, 147 deletions
diff --git a/OpenSim/Framework/ISceneObject.cs b/OpenSim/Framework/ISceneObject.cs
index 4fc3e01..5147901 100644
--- a/OpenSim/Framework/ISceneObject.cs
+++ b/OpenSim/Framework/ISceneObject.cs
@@ -38,6 +38,6 @@ namespace OpenSim.Framework
38 string ExtraToXmlString(); 38 string ExtraToXmlString();
39 void ExtraFromXmlString(string xmlstr); 39 void ExtraFromXmlString(string xmlstr);
40 string GetStateSnapshot(); 40 string GetStateSnapshot();
41 void SetState(string xmlstr, UUID regionID); 41 void SetState(string xmlstr, IScene s);
42 } 42 }
43} 43}
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index 8532d03..b778389 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -348,9 +348,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
348 348
349 UUID ospResolvedId = OspResolver.ResolveOspa(item.CreatorId, m_scene.CommsManager); 349 UUID ospResolvedId = OspResolver.ResolveOspa(item.CreatorId, m_scene.CommsManager);
350 if (UUID.Zero != ospResolvedId) 350 if (UUID.Zero != ospResolvedId)
351 {
351 item.CreatorIdAsUuid = ospResolvedId; 352 item.CreatorIdAsUuid = ospResolvedId;
353
354 // XXX: For now, don't preserve the OSPA in the creator id (which actually gets persisted to the
355 // database). Instead, replace with the UUID that we found.
356 item.CreatorId = ospResolvedId.ToString();
357 }
352 else 358 else
359 {
353 item.CreatorIdAsUuid = m_userInfo.UserProfile.ID; 360 item.CreatorIdAsUuid = m_userInfo.UserProfile.ID;
361 }
354 362
355 item.Owner = m_userInfo.UserProfile.ID; 363 item.Owner = m_userInfo.UserProfile.ID;
356 364
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
index 2c0d113..ecd60bd 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
@@ -280,7 +280,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
280 string savePath = (cmdparams.Length > 6 ? cmdparams[6] : DEFAULT_INV_BACKUP_FILENAME); 280 string savePath = (cmdparams.Length > 6 ? cmdparams[6] : DEFAULT_INV_BACKUP_FILENAME);
281 281
282 m_log.InfoFormat( 282 m_log.InfoFormat(
283 "[INVENTORY ARCHIVER]: Saving archive {0} from inventory path {1} for {2} {3}", 283 "[INVENTORY ARCHIVER]: Saving archive {0} using inventory path {1} for {2} {3}",
284 savePath, invPath, firstName, lastName); 284 savePath, invPath, firstName, lastName);
285 285
286 Guid id = Guid.NewGuid(); 286 Guid id = Guid.NewGuid();
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index 7927352..e4dad18 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -259,9 +259,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
259 = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, item1Name); 259 = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, item1Name);
260 260
261 Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); 261 Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1");
262
263// We have to disable this check since loaded items that did find users via OSPA resolution are now only storing the
264// UUID, not the OSPA itself.
265// Assert.That(
266// foundItem1.CreatorId, Is.EqualTo(item1.CreatorId),
267// "Loaded item non-uuid creator doesn't match original");
262 Assert.That( 268 Assert.That(
263 foundItem1.CreatorId, Is.EqualTo(item1.CreatorId), 269 foundItem1.CreatorId, Is.EqualTo(userItemCreatorUuid.ToString()),
264 "Loaded item non-uuid creator doesn't match original"); 270 "Loaded item non-uuid creator doesn't match original");
271
265 Assert.That( 272 Assert.That(
266 foundItem1.CreatorIdAsUuid, Is.EqualTo(userItemCreatorUuid), 273 foundItem1.CreatorIdAsUuid, Is.EqualTo(userItemCreatorUuid),
267 "Loaded item uuid creator doesn't match original"); 274 "Loaded item uuid creator doesn't match original");
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs
index ee809bd..d9f6e33 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs
@@ -263,8 +263,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
263 { 263 {
264 // We need to make a local copy of the object 264 // We need to make a local copy of the object
265 ISceneObject sogClone = sog.CloneForNewScene(); 265 ISceneObject sogClone = sog.CloneForNewScene();
266 sogClone.SetState(sog.GetStateSnapshot(), 266 sogClone.SetState(sog.GetStateSnapshot(), s);
267 s.RegionInfo.RegionID);
268 return s.IncomingCreateObject(sogClone); 267 return s.IncomingCreateObject(sogClone);
269 } 268 }
270 else 269 else
@@ -294,15 +293,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
294 293
295 #region Misc 294 #region Misc
296 295
297 public UUID GetRegionID(ulong regionhandle) 296 public Scene GetScene(ulong regionhandle)
298 { 297 {
299 foreach (Scene s in m_sceneList) 298 foreach (Scene s in m_sceneList)
300 { 299 {
301 if (s.RegionInfo.RegionHandle == regionhandle) 300 if (s.RegionInfo.RegionHandle == regionhandle)
302 return s.RegionInfo.RegionID; 301 return s;
303 } 302 }
304 // ? weird. should not happen 303 // ? weird. should not happen
305 return m_sceneList[0].RegionInfo.RegionID; 304 return m_sceneList[0];
306 } 305 }
307 306
308 public bool IsLocalRegion(ulong regionhandle) 307 public bool IsLocalRegion(ulong regionhandle)
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs
index 696225c..710e3ca 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs
@@ -641,7 +641,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
641 if (args["extra"] != null) 641 if (args["extra"] != null)
642 extraStr = args["extra"].AsString(); 642 extraStr = args["extra"].AsString();
643 643
644 UUID regionID = m_localBackend.GetRegionID(regionhandle); 644 IScene s = m_localBackend.GetScene(regionhandle);
645 SceneObjectGroup sog = null; 645 SceneObjectGroup sog = null;
646 try 646 try
647 { 647 {
@@ -663,7 +663,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
663 { 663 {
664 try 664 try
665 { 665 {
666 sog.SetState(stateXmlStr, regionID); 666 sog.SetState(stateXmlStr, s);
667 } 667 }
668 catch (Exception ex) 668 catch (Exception ex)
669 { 669 {
@@ -695,8 +695,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
695 if (args["itemid"] != null) 695 if (args["itemid"] != null)
696 itemID = args["itemid"].AsUUID(); 696 itemID = args["itemid"].AsUUID();
697 697
698 //UUID regionID = m_localBackend.GetRegionID(regionhandle);
699
700 // This is the meaning of PUT object 698 // This is the meaning of PUT object
701 bool result = m_localBackend.SendCreateObject(regionhandle, userID, itemID); 699 bool result = m_localBackend.SendCreateObject(regionhandle, userID, itemID);
702 700
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 {
356m_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}
diff --git a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
index 91c25a6..c653e98 100644
--- a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
@@ -62,7 +62,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
62 62
63 public void Initialise(IConfigSource config) 63 public void Initialise(IConfigSource config)
64 { 64 {
65 m_log.Info("[RegionReady] Initialising"); 65 //m_log.Info("[RegionReady] Initialising");
66 66
67 m_config = config.Configs["RegionReady"]; 67 m_config = config.Configs["RegionReady"];
68 if (m_config != null) 68 if (m_config != null)
@@ -74,8 +74,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
74 } 74 }
75 } 75 }
76 76
77 if (!m_enabled) 77// if (!m_enabled)
78 m_log.Info("[RegionReady] disabled."); 78// m_log.Info("[RegionReady] disabled.");
79 } 79 }
80 80
81 public void AddRegion(Scene scene) 81 public void AddRegion(Scene scene)
@@ -92,7 +92,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
92 m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue; 92 m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue;
93 m_scene.EventManager.OnOarFileLoaded += OnOarFileLoaded; 93 m_scene.EventManager.OnOarFileLoaded += OnOarFileLoaded;
94 94
95 m_log.InfoFormat("[RegionReady]: Enabled for region {0}", scene.RegionInfo.RegionName); 95 m_log.DebugFormat("[RegionReady]: Enabled for region {0}", scene.RegionInfo.RegionName);
96 } 96 }
97 97
98 public void RemoveRegion(Scene scene) 98 public void RemoveRegion(Scene scene)
@@ -120,7 +120,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
120 } 120 }
121 121
122 #endregion 122 #endregion
123
124 123
125 void OnEmptyScriptCompileQueue(int numScriptsFailed, string message) 124 void OnEmptyScriptCompileQueue(int numScriptsFailed, string message)
126 { 125 {
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
index f49aea8..ae148a9 100644
--- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
@@ -96,7 +96,6 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
96 UUID GetDetectID(int idx); 96 UUID GetDetectID(int idx);
97 void SaveState(string assembly); 97 void SaveState(string assembly);
98 void DestroyScriptInstance(); 98 void DestroyScriptInstance();
99 bool CanBeDeleted();
100 99
101 IScriptApi GetApi(string name); 100 IScriptApi GetApi(string name);
102 101
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index a94cd46..6e5436a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -2002,6 +2002,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2002 2002
2003//KF: Do NOT use this next line if using ODE physics engine. This need a switch based on .ini Phys Engine type 2003//KF: Do NOT use this next line if using ODE physics engine. This need a switch based on .ini Phys Engine type
2004// part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition; 2004// part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition;
2005
2006 // So, after thinking about this for a bit, the issue with the part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition line
2007 // is it isn't compatible with vehicles because it causes the vehicle body to have to be broken down and rebuilt
2008 // It's perfectly okay when the object is not an active physical body though.
2009 // So, part.ParentGroup.ResetChildPrimPhysicsPositions(); does the thing that Kitto is warning against
2010 // but only if the object is not physial and active. This is important for rotating doors.
2011 // without the absoluteposition = absoluteposition happening, the doors do not move in the physics
2012 // scene
2013 if (part.PhysActor != null && !part.PhysActor.IsPhysical)
2014 {
2015 part.ParentGroup.ResetChildPrimPhysicsPositions();
2016 }
2005 } 2017 }
2006 2018
2007 /// <summary> 2019 /// <summary>
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index 0f4a9ad..8333a27 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -1018,10 +1018,5 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
1018 { 1018 {
1019 get { return m_RegionID; } 1019 get { return m_RegionID; }
1020 } 1020 }
1021
1022 public bool CanBeDeleted()
1023 {
1024 return true;
1025 }
1026 } 1021 }
1027} 1022}
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 4dc6cb8..2fc2ea1 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -1328,6 +1328,19 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1328 } 1328 }
1329 } 1329 }
1330 1330
1331 string map = String.Empty;
1332
1333 if (File.Exists(fn + ".map"))
1334 {
1335 FileStream mfs = File.Open(fn + ".map", FileMode.Open, FileAccess.Read);
1336 StreamReader msr = new StreamReader(mfs);
1337
1338 map = msr.ReadToEnd();
1339
1340 msr.Close();
1341 mfs.Close();
1342 }
1343
1331 XmlElement assemblyData = doc.CreateElement("", "Assembly", ""); 1344 XmlElement assemblyData = doc.CreateElement("", "Assembly", "");
1332 XmlAttribute assemblyName = doc.CreateAttribute("", "Filename", ""); 1345 XmlAttribute assemblyName = doc.CreateAttribute("", "Filename", "");
1333 1346
@@ -1338,21 +1351,116 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1338 1351
1339 stateData.AppendChild(assemblyData); 1352 stateData.AppendChild(assemblyData);
1340 1353
1341 return doc.InnerXml; 1354 XmlElement mapData = doc.CreateElement("", "LineMap", "");
1342 } 1355 XmlAttribute mapName = doc.CreateAttribute("", "Filename", "");
1343 1356
1344 public bool CanBeDeleted(UUID itemID) 1357 mapName.Value = fn + ".map";
1345 { 1358 mapData.Attributes.Append(mapName);
1346 IScriptInstance instance = GetInstance(itemID);
1347 if (instance == null)
1348 return true;
1349 1359
1350 return instance.CanBeDeleted(); 1360 mapData.InnerText = map;
1361
1362 stateData.AppendChild(mapData);
1363 return doc.InnerXml;
1351 } 1364 }
1352 1365
1353 private bool ShowScriptSaveResponse(UUID ownerID, UUID assetID, string text, bool compiled) 1366 private bool ShowScriptSaveResponse(UUID ownerID, UUID assetID, string text, bool compiled)
1354 { 1367 {
1355 return false; 1368 return false;
1356 } 1369 }
1370
1371 public void SetXMLState(UUID itemID, string xml)
1372 {
1373 if (xml == String.Empty)
1374 return;
1375
1376 XmlDocument doc = new XmlDocument();
1377
1378 try
1379 {
1380 doc.LoadXml(xml);
1381 }
1382 catch (Exception)
1383 {
1384 m_log.Error("[XEngine]: Exception decoding XML data from region transfer");
1385 return;
1386 }
1387
1388 XmlNodeList rootL = doc.GetElementsByTagName("State");
1389 if (rootL.Count < 1)
1390 return;
1391
1392 XmlElement rootE = (XmlElement)rootL[0];
1393
1394 if (rootE.GetAttribute("UUID") != itemID.ToString())
1395 return;
1396
1397 string assetID = rootE.GetAttribute("Asset");
1398
1399 XmlNodeList stateL = rootE.GetElementsByTagName("ScriptState");
1400
1401 if (stateL.Count != 1)
1402 return;
1403
1404 XmlElement stateE = (XmlElement)stateL[0];
1405
1406 if (World.m_trustBinaries)
1407 {
1408 XmlNodeList assemL = rootE.GetElementsByTagName("Assembly");
1409
1410 if (assemL.Count != 1)
1411 return;
1412
1413 XmlElement assemE = (XmlElement)assemL[0];
1414
1415 string fn = assemE.GetAttribute("Filename");
1416 string base64 = assemE.InnerText;
1417
1418 string path = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString());
1419 path = Path.Combine(path, fn);
1420
1421 if (!File.Exists(path))
1422 {
1423 Byte[] filedata = Convert.FromBase64String(base64);
1424
1425 FileStream fs = File.Create(path);
1426 fs.Write(filedata, 0, filedata.Length);
1427 fs.Close();
1428
1429 fs = File.Create(path + ".text");
1430 StreamWriter sw = new StreamWriter(fs);
1431
1432 sw.Write(base64);
1433
1434 sw.Close();
1435 fs.Close();
1436 }
1437 }
1438
1439 string statepath = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString());
1440 statepath = Path.Combine(statepath, itemID.ToString() + ".state");
1441
1442 FileStream sfs = File.Create(statepath);
1443 StreamWriter ssw = new StreamWriter(sfs);
1444
1445 ssw.Write(stateE.OuterXml);
1446
1447 ssw.Close();
1448 sfs.Close();
1449
1450 XmlNodeList mapL = rootE.GetElementsByTagName("LineMap");
1451
1452 XmlElement mapE = (XmlElement)mapL[0];
1453
1454 string mappath = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString());
1455 mappath = Path.Combine(mappath, mapE.GetAttribute("Filename"));
1456
1457 FileStream mfs = File.Create(mappath);
1458 StreamWriter msw = new StreamWriter(mfs);
1459
1460 msw.Write(mapE.InnerText);
1461
1462 msw.Close();
1463 mfs.Close();
1464 }
1357 } 1465 }
1358} 1466}