diff options
Diffstat (limited to 'OpenSim/Region')
14 files changed, 224 insertions, 59 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index c9ef173..ec238ef 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -365,6 +365,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
365 | /// </value> | 365 | /// </value> |
366 | protected HashSet<uint> m_killRecord; | 366 | protected HashSet<uint> m_killRecord; |
367 | 367 | ||
368 | // protected HashSet<uint> m_attachmentsQueued; | ||
369 | // protected HashSet<uint> m_attachmentsSent; | ||
370 | |||
368 | private int m_moneyBalance; | 371 | private int m_moneyBalance; |
369 | private int m_animationSequenceNumber = 1; | 372 | private int m_animationSequenceNumber = 1; |
370 | private bool m_SendLogoutPacketWhenClosing = true; | 373 | private bool m_SendLogoutPacketWhenClosing = true; |
@@ -456,6 +459,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
456 | m_primFullUpdates = new PriorityQueue<double, ObjectUpdatePacket.ObjectDataBlock>(m_scene.Entities.Count); | 459 | m_primFullUpdates = new PriorityQueue<double, ObjectUpdatePacket.ObjectDataBlock>(m_scene.Entities.Count); |
457 | m_fullUpdateDataBlocksBuilder = new List<ObjectUpdatePacket.ObjectDataBlock>(); | 460 | m_fullUpdateDataBlocksBuilder = new List<ObjectUpdatePacket.ObjectDataBlock>(); |
458 | m_killRecord = new HashSet<uint>(); | 461 | m_killRecord = new HashSet<uint>(); |
462 | // m_attachmentsQueued = new HashSet<uint>(); | ||
463 | // m_attachmentsSent = new HashSet<uint>(); | ||
459 | 464 | ||
460 | m_assetService = m_scene.RequestModuleInterface<IAssetService>(); | 465 | m_assetService = m_scene.RequestModuleInterface<IAssetService>(); |
461 | m_hyperAssets = m_scene.RequestModuleInterface<IHyperAssetService>(); | 466 | m_hyperAssets = m_scene.RequestModuleInterface<IHyperAssetService>(); |
@@ -3400,6 +3405,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3400 | objupdate.ObjectData[0] = CreateAvatarUpdateBlock(data); | 3405 | objupdate.ObjectData[0] = CreateAvatarUpdateBlock(data); |
3401 | 3406 | ||
3402 | OutPacket(objupdate, ThrottleOutPacketType.Task); | 3407 | OutPacket(objupdate, ThrottleOutPacketType.Task); |
3408 | |||
3409 | // We need to record the avatar local id since the root prim of an attachment points to this. | ||
3410 | // m_attachmentsSent.Add(data.AvatarLocalID); | ||
3403 | } | 3411 | } |
3404 | 3412 | ||
3405 | /// <summary> | 3413 | /// <summary> |
@@ -3522,6 +3530,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3522 | return; | 3530 | return; |
3523 | 3531 | ||
3524 | ObjectUpdatePacket.ObjectDataBlock objectData = CreatePrimUpdateBlock(data); | 3532 | ObjectUpdatePacket.ObjectDataBlock objectData = CreatePrimUpdateBlock(data); |
3533 | |||
3534 | // if (data.attachment) | ||
3535 | // m_attachmentsQueued.Add(data.localID); | ||
3525 | 3536 | ||
3526 | lock (m_primFullUpdates.SyncRoot) | 3537 | lock (m_primFullUpdates.SyncRoot) |
3527 | m_primFullUpdates.Enqueue(data.priority, objectData, data.localID); | 3538 | m_primFullUpdates.Enqueue(data.priority, objectData, data.localID); |
@@ -3548,15 +3559,37 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3548 | ObjectUpdatePacket.ObjectDataBlock block = m_primFullUpdates.Dequeue(); | 3559 | ObjectUpdatePacket.ObjectDataBlock block = m_primFullUpdates.Dequeue(); |
3549 | 3560 | ||
3550 | if (!m_killRecord.Contains(block.ID)) | 3561 | if (!m_killRecord.Contains(block.ID)) |
3551 | { | 3562 | { |
3563 | // if (m_attachmentsQueued.Contains(block.ID)) | ||
3564 | // { | ||
3565 | // string text = Util.FieldToString(block.Text); | ||
3566 | // if (text.IndexOf("\n") >= 0) | ||
3567 | // text = text.Remove(text.IndexOf("\n")); | ||
3568 | // | ||
3569 | // if (m_attachmentsSent.Contains(block.ParentID)) | ||
3570 | // { | ||
3571 | // m_log.DebugFormat( | ||
3572 | // "[CLIENT]: Sending full info about attached prim {0} text {1}", | ||
3573 | // block.ID, text); | ||
3574 | // | ||
3575 | // m_fullUpdateDataBlocksBuilder.Add(block); | ||
3576 | // | ||
3577 | // m_attachmentsSent.Add(block.ID); | ||
3578 | // } | ||
3579 | // else | ||
3580 | // { | ||
3581 | // m_log.DebugFormat( | ||
3582 | // "[CLIENT]: Requeueing full update of prim {0} text {1} since we haven't sent its parent {2} yet", | ||
3583 | // block.ID, text, block.ParentID); | ||
3584 | // | ||
3585 | // lock (m_primFullUpdates.SyncRoot) | ||
3586 | // m_primFullUpdates.Enqueue(double.MaxValue, block, block.ID); | ||
3587 | // } | ||
3588 | // } | ||
3589 | // else | ||
3590 | // { | ||
3552 | m_fullUpdateDataBlocksBuilder.Add(block); | 3591 | m_fullUpdateDataBlocksBuilder.Add(block); |
3553 | 3592 | // } | |
3554 | // string text = Util.FieldToString(outPacket.ObjectData[i].Text); | ||
3555 | // if (text.IndexOf("\n") >= 0) | ||
3556 | // text = text.Remove(text.IndexOf("\n")); | ||
3557 | // m_log.DebugFormat( | ||
3558 | // "[CLIENT]: Sending full info about prim {0} text {1} to client {2}", | ||
3559 | // outPacket.ObjectData[i].ID, text, Name); | ||
3560 | } | 3593 | } |
3561 | // else | 3594 | // else |
3562 | // { | 3595 | // { |
@@ -4505,6 +4538,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4505 | 4538 | ||
4506 | protected ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(SendPrimitiveData data) | 4539 | protected ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(SendPrimitiveData data) |
4507 | { | 4540 | { |
4541 | // if (data.attachment) | ||
4542 | // m_log.DebugFormat( | ||
4543 | // "[LLCLIENTVIEW]: Creating prim update block for {0}, parent {1}, priority {2}", | ||
4544 | // data.localID, data.parentID, data.priority); | ||
4545 | |||
4508 | byte[] objectData = new byte[60]; | 4546 | byte[] objectData = new byte[60]; |
4509 | data.pos.ToBytes(objectData, 0); | 4547 | data.pos.ToBytes(objectData, 0); |
4510 | data.vel.ToBytes(objectData, 12); | 4548 | data.vel.ToBytes(objectData, 12); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs index d68c683..0730f8b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs | |||
@@ -260,7 +260,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion | |||
260 | { | 260 | { |
261 | if (s.RegionInfo.RegionHandle == regionHandle) | 261 | if (s.RegionInfo.RegionHandle == regionHandle) |
262 | { | 262 | { |
263 | //m_log.Debug("[LOCAL COMMS]: Found region to SendCreateObject"); | 263 | // m_log.Debug("[LOCAL COMMS]: Found region to SendCreateObject"); |
264 | if (isLocalCall) | 264 | if (isLocalCall) |
265 | { | 265 | { |
266 | // We need to make a local copy of the object | 266 | // We need to make a local copy of the object |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 26d3372..79b3cfd 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -2450,6 +2450,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2450 | return; | 2450 | return; |
2451 | } | 2451 | } |
2452 | 2452 | ||
2453 | // m_log.DebugFormat("[SCENE INVENTORY]: {0} {1} IsAttachment={2}", att.Name, att.LocalId, att.IsAttachment); | ||
2454 | // Console.WriteLine("HERE X"); | ||
2453 | ScenePresence presence; | 2455 | ScenePresence presence; |
2454 | if (TryGetAvatar(remoteClient.AgentId, out presence)) | 2456 | if (TryGetAvatar(remoteClient.AgentId, out presence)) |
2455 | { | 2457 | { |
@@ -2457,9 +2459,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2457 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | 2459 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
2458 | item = InventoryService.GetItem(item); | 2460 | item = InventoryService.GetItem(item); |
2459 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); | 2461 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); |
2462 | // Console.WriteLine("HERE Y"); | ||
2460 | 2463 | ||
2461 | if (m_AvatarFactory != null) | 2464 | if (m_AvatarFactory != null) |
2462 | m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); | 2465 | m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); |
2466 | |||
2467 | // Console.WriteLine("HERE Z"); | ||
2463 | } | 2468 | } |
2464 | } | 2469 | } |
2465 | 2470 | ||
@@ -2642,4 +2647,4 @@ namespace OpenSim.Region.Framework.Scenes | |||
2642 | m_sceneGraph.LinkObjects(root, children); | 2647 | m_sceneGraph.LinkObjects(root, children); |
2643 | } | 2648 | } |
2644 | } | 2649 | } |
2645 | } | 2650 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index ac04dc7..adc9496 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -124,6 +124,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
124 | { | 124 | { |
125 | if (((SceneObjectGroup)ent).LocalId == primLocalID) | 125 | if (((SceneObjectGroup)ent).LocalId == primLocalID) |
126 | { | 126 | { |
127 | // m_log.DebugFormat("[SCENE]: Received full update request for {0} from {1}", primLocalID, remoteClient.Name); | ||
127 | ((SceneObjectGroup)ent).SendFullUpdateToClient(remoteClient); | 128 | ((SceneObjectGroup)ent).SendFullUpdateToClient(remoteClient); |
128 | return; | 129 | return; |
129 | } | 130 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 637ebff..7089368 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1850,9 +1850,31 @@ namespace OpenSim.Region.Framework.Scenes | |||
1850 | /// true if the object was added, false if an object with the same uuid was already in the scene | 1850 | /// true if the object was added, false if an object with the same uuid was already in the scene |
1851 | /// </returns> | 1851 | /// </returns> |
1852 | public bool AddRestoredSceneObject( | 1852 | public bool AddRestoredSceneObject( |
1853 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates) | ||
1854 | { | ||
1855 | return m_sceneGraph.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, sendClientUpdates); | ||
1856 | } | ||
1857 | |||
1858 | /// <summary> | ||
1859 | /// Add an object into the scene that has come from storage | ||
1860 | /// </summary> | ||
1861 | /// | ||
1862 | /// <param name="sceneObject"></param> | ||
1863 | /// <param name="attachToBackup"> | ||
1864 | /// If true, changes to the object will be reflected in its persisted data | ||
1865 | /// If false, the persisted data will not be changed even if the object in the scene is changed | ||
1866 | /// </param> | ||
1867 | /// <param name="alreadyPersisted"> | ||
1868 | /// If true, we won't persist this object until it changes | ||
1869 | /// If false, we'll persist this object immediately | ||
1870 | /// </param> | ||
1871 | /// <returns> | ||
1872 | /// true if the object was added, false if an object with the same uuid was already in the scene | ||
1873 | /// </returns> | ||
1874 | public bool AddRestoredSceneObject( | ||
1853 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) | 1875 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) |
1854 | { | 1876 | { |
1855 | return m_sceneGraph.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted); | 1877 | return AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, true); |
1856 | } | 1878 | } |
1857 | 1879 | ||
1858 | /// <summary> | 1880 | /// <summary> |
@@ -1886,7 +1908,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1886 | } | 1908 | } |
1887 | 1909 | ||
1888 | /// <summary> | 1910 | /// <summary> |
1889 | /// Delete every object from the scene | 1911 | /// Delete every object from the scene. This does not include attachments worn by avatars. |
1890 | /// </summary> | 1912 | /// </summary> |
1891 | public void DeleteAllSceneObjects() | 1913 | public void DeleteAllSceneObjects() |
1892 | { | 1914 | { |
@@ -1897,7 +1919,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1897 | foreach (EntityBase e in entities) | 1919 | foreach (EntityBase e in entities) |
1898 | { | 1920 | { |
1899 | if (e is SceneObjectGroup) | 1921 | if (e is SceneObjectGroup) |
1900 | DeleteSceneObject((SceneObjectGroup)e, false); | 1922 | { |
1923 | SceneObjectGroup sog = (SceneObjectGroup)e; | ||
1924 | if (!sog.IsAttachment) | ||
1925 | DeleteSceneObject((SceneObjectGroup)e, false); | ||
1926 | } | ||
1901 | } | 1927 | } |
1902 | } | 1928 | } |
1903 | } | 1929 | } |
@@ -2461,7 +2487,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2461 | /// <returns></returns> | 2487 | /// <returns></returns> |
2462 | public bool IncomingCreateObject(ISceneObject sog) | 2488 | public bool IncomingCreateObject(ISceneObject sog) |
2463 | { | 2489 | { |
2464 | //m_log.Debug(" >>> IncomingCreateObject(sog) <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); | 2490 | // m_log.Debug(" >>> IncomingCreateObject(sog) <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); |
2465 | SceneObjectGroup newObject; | 2491 | SceneObjectGroup newObject; |
2466 | try | 2492 | try |
2467 | { | 2493 | { |
@@ -2533,10 +2559,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2533 | 2559 | ||
2534 | if (sceneObject.IsAttachmentCheckFull()) // Attachment | 2560 | if (sceneObject.IsAttachmentCheckFull()) // Attachment |
2535 | { | 2561 | { |
2562 | // m_log.DebugFormat("[SCENE]: Adding attachment {0} {1}", sceneObject.Name, sceneObject.LocalId); | ||
2563 | |||
2536 | sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); | 2564 | sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); |
2537 | sceneObject.RootPart.AddFlag(PrimFlags.Phantom); | 2565 | sceneObject.RootPart.AddFlag(PrimFlags.Phantom); |
2538 | 2566 | ||
2539 | AddRestoredSceneObject(sceneObject, false, false); | 2567 | AddRestoredSceneObject(sceneObject, false, false, false); |
2540 | 2568 | ||
2541 | // Handle attachment special case | 2569 | // Handle attachment special case |
2542 | SceneObjectPart RootPrim = sceneObject.RootPart; | 2570 | SceneObjectPart RootPrim = sceneObject.RootPart; |
@@ -2544,6 +2572,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2544 | // Fix up attachment Parent Local ID | 2572 | // Fix up attachment Parent Local ID |
2545 | ScenePresence sp = GetScenePresence(sceneObject.OwnerID); | 2573 | ScenePresence sp = GetScenePresence(sceneObject.OwnerID); |
2546 | 2574 | ||
2575 | // Console.WriteLine("AAAA"); | ||
2576 | |||
2547 | //uint parentLocalID = 0; | 2577 | //uint parentLocalID = 0; |
2548 | if (sp != null) | 2578 | if (sp != null) |
2549 | { | 2579 | { |
@@ -2562,20 +2592,25 @@ namespace OpenSim.Region.Framework.Scenes | |||
2562 | //grp.SetFromAssetID(grp.RootPart.LastOwnerID); | 2592 | //grp.SetFromAssetID(grp.RootPart.LastOwnerID); |
2563 | m_log.DebugFormat( | 2593 | m_log.DebugFormat( |
2564 | "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition); | 2594 | "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition); |
2565 | 2595 | ||
2596 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | ||
2566 | AttachObject( | 2597 | AttachObject( |
2567 | sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); | 2598 | sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); |
2568 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | 2599 | |
2569 | grp.SendGroupFullUpdate(); | 2600 | //grp.SendGroupFullUpdate(); |
2570 | } | 2601 | } |
2571 | else | 2602 | else |
2572 | { | 2603 | { |
2573 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | 2604 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); |
2574 | RootPrim.AddFlag(PrimFlags.TemporaryOnRez); | 2605 | RootPrim.AddFlag(PrimFlags.TemporaryOnRez); |
2575 | } | 2606 | } |
2607 | |||
2608 | // Console.WriteLine("BBBB"); | ||
2576 | } | 2609 | } |
2577 | else | 2610 | else |
2578 | { | 2611 | { |
2612 | // m_log.DebugFormat("[SCENE]: Adding ordinary object {0} {1}", sceneObject.Name, sceneObject.LocalId); | ||
2613 | |||
2579 | AddRestoredSceneObject(sceneObject, true, false); | 2614 | AddRestoredSceneObject(sceneObject, true, false); |
2580 | 2615 | ||
2581 | if (!Permissions.CanObjectEntry(sceneObject.UUID, | 2616 | if (!Permissions.CanObjectEntry(sceneObject.UUID, |
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 2f6a0db..67fa13d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -1383,7 +1383,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1383 | // now we have a child agent in this region. Request all interesting data about other (root) agents | 1383 | // now we have a child agent in this region. Request all interesting data about other (root) agents |
1384 | agent.SendInitialFullUpdateToAllClients(); | 1384 | agent.SendInitialFullUpdateToAllClients(); |
1385 | 1385 | ||
1386 | // Console.WriteLine("SCS 1"); | ||
1386 | agent.CrossAttachmentsIntoNewRegion(neighbourHandle, true); | 1387 | agent.CrossAttachmentsIntoNewRegion(neighbourHandle, true); |
1388 | // Console.WriteLine("SCS 2"); | ||
1387 | 1389 | ||
1388 | // m_scene.SendKillObject(m_localId); | 1390 | // m_scene.SendKillObject(m_localId); |
1389 | 1391 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 59a2f41..bdab696 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -216,11 +216,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
216 | /// If true, we won't persist this object until it changes | 216 | /// If true, we won't persist this object until it changes |
217 | /// If false, we'll persist this object immediately | 217 | /// If false, we'll persist this object immediately |
218 | /// </param> | 218 | /// </param> |
219 | /// <param name="sendClientUpdate"> | ||
220 | /// If true, we send updates to the client to tell it about this object | ||
221 | /// If false, we leave it up to the caller to do this | ||
222 | /// </param> | ||
219 | /// <returns> | 223 | /// <returns> |
220 | /// true if the object was added, false if an object with the same uuid was already in the scene | 224 | /// true if the object was added, false if an object with the same uuid was already in the scene |
221 | /// </returns> | 225 | /// </returns> |
222 | protected internal bool AddRestoredSceneObject( | 226 | protected internal bool AddRestoredSceneObject( |
223 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) | 227 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates) |
224 | { | 228 | { |
225 | if (!alreadyPersisted) | 229 | if (!alreadyPersisted) |
226 | { | 230 | { |
@@ -228,8 +232,29 @@ namespace OpenSim.Region.Framework.Scenes | |||
228 | sceneObject.HasGroupChanged = true; | 232 | sceneObject.HasGroupChanged = true; |
229 | } | 233 | } |
230 | 234 | ||
231 | return AddSceneObject(sceneObject, attachToBackup, true); | 235 | return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates); |
232 | } | 236 | } |
237 | |||
238 | // /// <summary> | ||
239 | // /// Add an object into the scene that has come from storage | ||
240 | // /// </summary> | ||
241 | // /// <param name="sceneObject"></param> | ||
242 | // /// <param name="attachToBackup"> | ||
243 | // /// If true, changes to the object will be reflected in its persisted data | ||
244 | // /// If false, the persisted data will not be changed even if the object in the scene is changed | ||
245 | // /// </param> | ||
246 | // /// <param name="alreadyPersisted"> | ||
247 | // /// If true, we won't persist this object until it changes | ||
248 | // /// If false, we'll persist this object immediately | ||
249 | // /// </param> | ||
250 | // /// <returns> | ||
251 | // /// true if the object was added, false if an object with the same uuid was already in the scene | ||
252 | // /// </returns> | ||
253 | // protected internal bool AddRestoredSceneObject( | ||
254 | // SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) | ||
255 | // { | ||
256 | // AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, true); | ||
257 | // } | ||
233 | 258 | ||
234 | /// <summary> | 259 | /// <summary> |
235 | /// Add a newly created object to the scene. This will both update the scene, and send information about the | 260 | /// Add a newly created object to the scene. This will both update the scene, and send information about the |
@@ -611,11 +636,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
611 | protected internal bool AttachObject( | 636 | protected internal bool AttachObject( |
612 | IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, Vector3 attachPos, bool silent) | 637 | IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, Vector3 attachPos, bool silent) |
613 | { | 638 | { |
639 | // Console.WriteLine("HERE A"); | ||
614 | SceneObjectGroup group = GetGroupByPrim(objectLocalID); | 640 | SceneObjectGroup group = GetGroupByPrim(objectLocalID); |
615 | if (group != null) | 641 | if (group != null) |
616 | { | 642 | { |
617 | if (m_parentScene.Permissions.CanTakeObject(group.UUID, remoteClient.AgentId)) | 643 | if (m_parentScene.Permissions.CanTakeObject(group.UUID, remoteClient.AgentId)) |
618 | { | 644 | { |
645 | // Console.WriteLine("HERE -1"); | ||
619 | // If the attachment point isn't the same as the one previously used | 646 | // If the attachment point isn't the same as the one previously used |
620 | // set it's offset position = 0 so that it appears on the attachment point | 647 | // set it's offset position = 0 so that it appears on the attachment point |
621 | // and not in a weird location somewhere unknown. | 648 | // and not in a weird location somewhere unknown. |
@@ -654,9 +681,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
654 | itemId = group.GetFromItemID(); | 681 | itemId = group.GetFromItemID(); |
655 | } | 682 | } |
656 | 683 | ||
684 | // Console.WriteLine("HERE 0"); | ||
657 | m_parentScene.AttachObject(remoteClient, AttachmentPt, itemId, group); | 685 | m_parentScene.AttachObject(remoteClient, AttachmentPt, itemId, group); |
658 | 686 | ||
687 | // Console.WriteLine("HERE 1"); | ||
659 | group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); | 688 | group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); |
689 | // Console.WriteLine("HERE 2"); | ||
660 | // In case it is later dropped again, don't let | 690 | // In case it is later dropped again, don't let |
661 | // it get cleaned up | 691 | // it get cleaned up |
662 | // | 692 | // |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 602b811..451c6f9 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1494,6 +1494,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1494 | 1494 | ||
1495 | public void SendFullUpdateToClient(IClientAPI remoteClient) | 1495 | public void SendFullUpdateToClient(IClientAPI remoteClient) |
1496 | { | 1496 | { |
1497 | // if (IsAttachment) | ||
1498 | // m_log.DebugFormat( | ||
1499 | // "[SOG]: Sending full update to client {0} for {1} {2}", remoteClient.Name, Name, LocalId); | ||
1500 | |||
1497 | SendPartFullUpdate(remoteClient, RootPart, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID)); | 1501 | SendPartFullUpdate(remoteClient, RootPart, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID)); |
1498 | 1502 | ||
1499 | lock (m_parts) | 1503 | lock (m_parts) |
@@ -1513,8 +1517,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1513 | /// <param name="part"></param> | 1517 | /// <param name="part"></param> |
1514 | internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part, uint clientFlags) | 1518 | internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part, uint clientFlags) |
1515 | { | 1519 | { |
1516 | // m_log.DebugFormat( | 1520 | // if (IsAttachment) |
1517 | // "[SOG]: Sending part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId); | 1521 | // m_log.DebugFormat( |
1522 | // "[SOG]: Sending part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId); | ||
1518 | 1523 | ||
1519 | if (m_rootPart.UUID == part.UUID) | 1524 | if (m_rootPart.UUID == part.UUID) |
1520 | { | 1525 | { |
@@ -1994,7 +1999,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1994 | 1999 | ||
1995 | public void ScheduleFullUpdateToAvatar(ScenePresence presence) | 2000 | public void ScheduleFullUpdateToAvatar(ScenePresence presence) |
1996 | { | 2001 | { |
1997 | // m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1} just to avatar {2}", Name, UUID, presence.Name); | 2002 | // if (IsAttachment) |
2003 | // m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1} just to avatar {2}", Name, UUID, presence.Name); | ||
1998 | 2004 | ||
1999 | RootPart.AddFullUpdateToAvatar(presence); | 2005 | RootPart.AddFullUpdateToAvatar(presence); |
2000 | 2006 | ||
@@ -2026,7 +2032,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2026 | /// </summary> | 2032 | /// </summary> |
2027 | public void ScheduleGroupForFullUpdate() | 2033 | public void ScheduleGroupForFullUpdate() |
2028 | { | 2034 | { |
2029 | // m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, UUID); | 2035 | // if (IsAttachment) |
2036 | // m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, UUID); | ||
2030 | 2037 | ||
2031 | checkAtTargets(); | 2038 | checkAtTargets(); |
2032 | RootPart.ScheduleFullUpdate(); | 2039 | RootPart.ScheduleFullUpdate(); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index a85a4b3..19ff288 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1259,16 +1259,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
1259 | /// Tell all scene presences that they should send updates for this part to their clients | 1259 | /// Tell all scene presences that they should send updates for this part to their clients |
1260 | /// </summary> | 1260 | /// </summary> |
1261 | public void AddFullUpdateToAllAvatars() | 1261 | public void AddFullUpdateToAllAvatars() |
1262 | { | 1262 | { |
1263 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 1263 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); |
1264 | for (int i = 0; i < avatars.Length; i++) | 1264 | for (int i = 0; i < avatars.Length; i++) |
1265 | { | 1265 | AddFullUpdateToAvatar(avatars[i]); |
1266 | avatars[i].SceneViewer.QueuePartForUpdate(this); | ||
1267 | } | ||
1268 | } | 1266 | } |
1269 | 1267 | ||
1270 | public void AddFullUpdateToAvatar(ScenePresence presence) | 1268 | public void AddFullUpdateToAvatar(ScenePresence presence) |
1271 | { | 1269 | { |
1270 | // if (IsAttachment) | ||
1271 | // m_log.DebugFormat("AddFullUpdateToAllAvatar() {0} for {1} {2}", presence.Name, Name, LocalId); | ||
1272 | |||
1272 | presence.SceneViewer.QueuePartForUpdate(this); | 1273 | presence.SceneViewer.QueuePartForUpdate(this); |
1273 | } | 1274 | } |
1274 | 1275 | ||
@@ -1287,13 +1288,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1287 | { | 1288 | { |
1288 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 1289 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); |
1289 | for (int i = 0; i < avatars.Length; i++) | 1290 | for (int i = 0; i < avatars.Length; i++) |
1290 | { | 1291 | AddTerseUpdateToAvatar(avatars[i]); |
1291 | avatars[i].SceneViewer.QueuePartForUpdate(this); | ||
1292 | } | ||
1293 | } | 1292 | } |
1294 | 1293 | ||
1295 | public void AddTerseUpdateToAvatar(ScenePresence presence) | 1294 | public void AddTerseUpdateToAvatar(ScenePresence presence) |
1296 | { | 1295 | { |
1296 | // if (IsAttachment) | ||
1297 | // m_log.DebugFormat("AddTerseUpdateToAvatar() {0} for {1} {2}", presence.Name, Name, LocalId); | ||
1298 | |||
1297 | presence.SceneViewer.QueuePartForUpdate(this); | 1299 | presence.SceneViewer.QueuePartForUpdate(this); |
1298 | } | 1300 | } |
1299 | 1301 | ||
@@ -2727,7 +2729,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2727 | /// </summary> | 2729 | /// </summary> |
2728 | public void ScheduleFullUpdate() | 2730 | public void ScheduleFullUpdate() |
2729 | { | 2731 | { |
2730 | // m_log.DebugFormat("[SCENE OBJECT PART]: Scheduling full update for {0} {1}", Name, LocalId); | 2732 | // if (IsAttachment) |
2733 | // m_log.DebugFormat("[SOP]: Scheduling full update for {0} {1}", Name, LocalId); | ||
2731 | 2734 | ||
2732 | if (m_parentGroup != null) | 2735 | if (m_parentGroup != null) |
2733 | { | 2736 | { |
@@ -2840,6 +2843,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2840 | /// <param name="remoteClient"></param> | 2843 | /// <param name="remoteClient"></param> |
2841 | public void SendFullUpdate(IClientAPI remoteClient, uint clientFlags) | 2844 | public void SendFullUpdate(IClientAPI remoteClient, uint clientFlags) |
2842 | { | 2845 | { |
2846 | // if (IsAttachment) | ||
2847 | // m_log.DebugFormat( | ||
2848 | // "[SCENE OBJECT PART]: Sending part full update to {0} for {1} {2}", remoteClient.Name, Name, LocalId); | ||
2849 | |||
2843 | m_parentGroup.SendPartFullUpdate(remoteClient, this, clientFlags); | 2850 | m_parentGroup.SendPartFullUpdate(remoteClient, this, clientFlags); |
2844 | } | 2851 | } |
2845 | 2852 | ||
@@ -2848,6 +2855,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2848 | /// </summary> | 2855 | /// </summary> |
2849 | public void SendFullUpdateToAllClients() | 2856 | public void SendFullUpdateToAllClients() |
2850 | { | 2857 | { |
2858 | // if (IsAttachment) | ||
2859 | // m_log.DebugFormat( | ||
2860 | // "[SCENE OBJECT PART]: Sending full update for {0} {1} for all clients", Name, LocalId); | ||
2861 | |||
2851 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 2862 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); |
2852 | for (int i = 0; i < avatars.Length; i++) | 2863 | for (int i = 0; i < avatars.Length; i++) |
2853 | { | 2864 | { |
@@ -2859,6 +2870,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2859 | 2870 | ||
2860 | public void SendFullUpdateToAllClientsExcept(UUID agentID) | 2871 | public void SendFullUpdateToAllClientsExcept(UUID agentID) |
2861 | { | 2872 | { |
2873 | // if (IsAttachment) | ||
2874 | // m_log.DebugFormat( | ||
2875 | // "[SCENE OBJECT PART]: Sending full update for {0} {1} to all clients except {2}", Name, LocalId, agentID); | ||
2876 | |||
2862 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 2877 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); |
2863 | for (int i = 0; i < avatars.Length; i++) | 2878 | for (int i = 0; i < avatars.Length; i++) |
2864 | { | 2879 | { |
@@ -2914,10 +2929,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
2914 | //isattachment = ParentGroup.RootPart.IsAttachment; | 2929 | //isattachment = ParentGroup.RootPart.IsAttachment; |
2915 | 2930 | ||
2916 | byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A}; | 2931 | byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A}; |
2917 | remoteClient.SendPrimitiveToClient(new SendPrimitiveData(m_regionHandle, m_parentGroup.GetTimeDilation(), LocalId, m_shape, | 2932 | |
2918 | lPos, Velocity, Acceleration, RotationOffset, AngularVelocity, clientFlags, m_uuid, _ownerID, | 2933 | double priority = ParentGroup.GetUpdatePriority(remoteClient); |
2919 | m_text, color, _parentID, m_particleSystem, m_clickAction, (byte)m_material, m_TextureAnimation, IsAttachment, | 2934 | if (IsRoot && IsAttachment) |
2920 | AttachmentPoint,FromItemID, Sound, SoundGain, SoundFlags, SoundRadius, ParentGroup.GetUpdatePriority(remoteClient))); | 2935 | { |
2936 | if (double.MinValue == priority) | ||
2937 | { | ||
2938 | m_log.WarnFormat( | ||
2939 | "[SOP]: Couldn't raise update priority of root part for attachment {0} {1} because priority is already highest value", | ||
2940 | Name, LocalId); | ||
2941 | } | ||
2942 | else | ||
2943 | { | ||
2944 | priority = double.MinValue; | ||
2945 | } | ||
2946 | } | ||
2947 | |||
2948 | remoteClient.SendPrimitiveToClient( | ||
2949 | new SendPrimitiveData(m_regionHandle, m_parentGroup.GetTimeDilation(), LocalId, m_shape, | ||
2950 | lPos, Velocity, Acceleration, RotationOffset, AngularVelocity, clientFlags, m_uuid, _ownerID, | ||
2951 | m_text, color, _parentID, m_particleSystem, m_clickAction, (byte)m_material, m_TextureAnimation, IsAttachment, | ||
2952 | AttachmentPoint,FromItemID, Sound, SoundGain, SoundFlags, SoundRadius, priority)); | ||
2921 | } | 2953 | } |
2922 | 2954 | ||
2923 | /// <summary> | 2955 | /// <summary> |
@@ -2965,6 +2997,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2965 | { | 2997 | { |
2966 | if (m_updateFlag == 2) // is a new prim, just created/reloaded or has major changes | 2998 | if (m_updateFlag == 2) // is a new prim, just created/reloaded or has major changes |
2967 | { | 2999 | { |
3000 | // if (IsAttachment) | ||
3001 | // m_log.DebugFormat("[SOP]: Sending scheduled full update for {0} {1}", Name, LocalId); | ||
3002 | |||
2968 | AddFullUpdateToAllAvatars(); | 3003 | AddFullUpdateToAllAvatars(); |
2969 | ClearUpdateSchedule(); | 3004 | ClearUpdateSchedule(); |
2970 | } | 3005 | } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 4973663..51cdf1b 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -3873,6 +3873,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3873 | 3873 | ||
3874 | private double UpdatePriority(UpdatePriorityData data) | 3874 | private double UpdatePriority(UpdatePriorityData data) |
3875 | { | 3875 | { |
3876 | // m_log.DebugFormat("[SCENE PRESENCE]: Reprioritizing updates to client {0} for {1}", Name, data.localID); | ||
3877 | |||
3876 | EntityBase entity; | 3878 | EntityBase entity; |
3877 | SceneObjectGroup group; | 3879 | SceneObjectGroup group; |
3878 | 3880 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneViewer.cs b/OpenSim/Region/Framework/Scenes/SceneViewer.cs index e4296ef..23663dd 100644 --- a/OpenSim/Region/Framework/Scenes/SceneViewer.cs +++ b/OpenSim/Region/Framework/Scenes/SceneViewer.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | ||
30 | using OpenMetaverse; | 31 | using OpenMetaverse; |
31 | using log4net; | 32 | using log4net; |
32 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
@@ -39,6 +40,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
39 | { | 40 | { |
40 | public class SceneViewer : ISceneViewer | 41 | public class SceneViewer : ISceneViewer |
41 | { | 42 | { |
43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
44 | |||
42 | protected ScenePresence m_presence; | 45 | protected ScenePresence m_presence; |
43 | protected UpdateQueue m_partsUpdateQueue = new UpdateQueue(); | 46 | protected UpdateQueue m_partsUpdateQueue = new UpdateQueue(); |
44 | protected Queue<SceneObjectGroup> m_pendingObjects; | 47 | protected Queue<SceneObjectGroup> m_pendingObjects; |
@@ -60,6 +63,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
60 | /// <param name="part"></param> | 63 | /// <param name="part"></param> |
61 | public void QueuePartForUpdate(SceneObjectPart part) | 64 | public void QueuePartForUpdate(SceneObjectPart part) |
62 | { | 65 | { |
66 | // if (part.IsAttachment) | ||
67 | // m_log.DebugFormat("[SCENE VIEWER]: Queueing part {0} {1} for update", part.Name, part.LocalId); | ||
68 | |||
63 | lock (m_partsUpdateQueue) | 69 | lock (m_partsUpdateQueue) |
64 | { | 70 | { |
65 | m_partsUpdateQueue.Enqueue(part); | 71 | m_partsUpdateQueue.Enqueue(part); |
@@ -134,7 +140,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
134 | } | 140 | } |
135 | else if (update.LastTerseUpdateTime <= part.TimeStampTerse) | 141 | else if (update.LastTerseUpdateTime <= part.TimeStampTerse) |
136 | { | 142 | { |
137 | // m_log.DebugFormat( | 143 | // m_log.DebugFormat(AddFullUpdateToAvatar |
138 | // "[SCENE PRESENCE]: Tersely updating prim {0}, {1} - part timestamp {2}", | 144 | // "[SCENE PRESENCE]: Tersely updating prim {0}, {1} - part timestamp {2}", |
139 | // part.Name, part.UUID, part.TimeStampTerse); | 145 | // part.Name, part.UUID, part.TimeStampTerse); |
140 | 146 | ||
diff --git a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs index c653e98..672109b 100644 --- a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs | |||
@@ -146,6 +146,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady | |||
146 | c.Position = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 30); | 146 | c.Position = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 30); |
147 | c.Sender = null; | 147 | c.Sender = null; |
148 | c.SenderUUID = UUID.Zero; | 148 | c.SenderUUID = UUID.Zero; |
149 | c.Scene = m_scene; | ||
149 | 150 | ||
150 | m_log.InfoFormat("[RegionReady]: Region \"{0}\" is ready: \"{1}\" on channel {2}", | 151 | m_log.InfoFormat("[RegionReady]: Region \"{0}\" is ready: \"{1}\" on channel {2}", |
151 | m_scene.RegionInfo.RegionName, c.Message, m_channelNotify); | 152 | m_scene.RegionInfo.RegionName, c.Message, m_channelNotify); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index d8c0ba5..959164b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs | |||
@@ -32,7 +32,7 @@ using System.Globalization; | |||
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.IO; | 33 | using System.IO; |
34 | using Microsoft.CSharp; | 34 | using Microsoft.CSharp; |
35 | using Microsoft.JScript; | 35 | //using Microsoft.JScript; |
36 | using Microsoft.VisualBasic; | 36 | using Microsoft.VisualBasic; |
37 | using log4net; | 37 | using log4net; |
38 | using OpenSim.Region.Framework.Interfaces; | 38 | using OpenSim.Region.Framework.Interfaces; |
@@ -82,7 +82,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
82 | 82 | ||
83 | private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider(); | 83 | private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider(); |
84 | private static VBCodeProvider VBcodeProvider = new VBCodeProvider(); | 84 | private static VBCodeProvider VBcodeProvider = new VBCodeProvider(); |
85 | private static JScriptCodeProvider JScodeProvider = new JScriptCodeProvider(); | 85 | // private static JScriptCodeProvider JScodeProvider = new JScriptCodeProvider(); |
86 | private static CSharpCodeProvider YPcodeProvider = new CSharpCodeProvider(); // YP is translated into CSharp | 86 | private static CSharpCodeProvider YPcodeProvider = new CSharpCodeProvider(); // YP is translated into CSharp |
87 | private static YP2CSConverter YP_Converter = new YP2CSConverter(); | 87 | private static YP2CSConverter YP_Converter = new YP2CSConverter(); |
88 | 88 | ||
@@ -395,9 +395,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
395 | case enumCompileType.vb: | 395 | case enumCompileType.vb: |
396 | compileScript = CreateVBCompilerScript(compileScript); | 396 | compileScript = CreateVBCompilerScript(compileScript); |
397 | break; | 397 | break; |
398 | case enumCompileType.js: | 398 | // case enumCompileType.js: |
399 | compileScript = CreateJSCompilerScript(compileScript); | 399 | // compileScript = CreateJSCompilerScript(compileScript); |
400 | break; | 400 | // break; |
401 | case enumCompileType.yp: | 401 | case enumCompileType.yp: |
402 | compileScript = CreateYPCompilerScript(compileScript); | 402 | compileScript = CreateYPCompilerScript(compileScript); |
403 | break; | 403 | break; |
@@ -420,16 +420,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
420 | } | 420 | } |
421 | } | 421 | } |
422 | 422 | ||
423 | private static string CreateJSCompilerScript(string compileScript) | 423 | // private static string CreateJSCompilerScript(string compileScript) |
424 | { | 424 | // { |
425 | compileScript = String.Empty + | 425 | // compileScript = String.Empty + |
426 | "import OpenSim.Region.ScriptEngine.Shared; import System.Collections.Generic;\r\n" + | 426 | // "import OpenSim.Region.ScriptEngine.Shared; import System.Collections.Generic;\r\n" + |
427 | "package SecondLife {\r\n" + | 427 | // "package SecondLife {\r\n" + |
428 | "class Script extends OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass { \r\n" + | 428 | // "class Script extends OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass { \r\n" + |
429 | compileScript + | 429 | // compileScript + |
430 | "} }\r\n"; | 430 | // "} }\r\n"; |
431 | return compileScript; | 431 | // return compileScript; |
432 | } | 432 | // } |
433 | 433 | ||
434 | private static string CreateCSCompilerScript(string compileScript) | 434 | private static string CreateCSCompilerScript(string compileScript) |
435 | { | 435 | { |
@@ -580,10 +580,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
580 | } | 580 | } |
581 | } while (!complete); | 581 | } while (!complete); |
582 | break; | 582 | break; |
583 | case enumCompileType.js: | 583 | // case enumCompileType.js: |
584 | results = JScodeProvider.CompileAssemblyFromSource( | 584 | // results = JScodeProvider.CompileAssemblyFromSource( |
585 | parameters, Script); | 585 | // parameters, Script); |
586 | break; | 586 | // break; |
587 | case enumCompileType.yp: | 587 | case enumCompileType.yp: |
588 | results = YPcodeProvider.CompileAssemblyFromSource( | 588 | results = YPcodeProvider.CompileAssemblyFromSource( |
589 | parameters, Script); | 589 | parameters, Script); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index d30d2dc..18351ad 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -541,7 +541,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
541 | m_CurrentResult = null; | 541 | m_CurrentResult = null; |
542 | } | 542 | } |
543 | 543 | ||
544 | return true; | 544 | return false; |
545 | } | 545 | } |
546 | 546 | ||
547 | public void SetState(string state) | 547 | public void SetState(string state) |
@@ -991,7 +991,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
991 | public string GetXMLState() | 991 | public string GetXMLState() |
992 | { | 992 | { |
993 | bool run = Running; | 993 | bool run = Running; |
994 | Stop(100); | 994 | bool stopped = Stop(100); |
995 | Running = run; | 995 | Running = run; |
996 | 996 | ||
997 | // We should not be doing this, but since we are about to | 997 | // We should not be doing this, but since we are about to |
@@ -1002,6 +1002,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
1002 | 1002 | ||
1003 | // Force an update of the in-memory plugin data | 1003 | // Force an update of the in-memory plugin data |
1004 | // | 1004 | // |
1005 | if (!stopped) | ||
1006 | return String.Empty; | ||
1007 | |||
1005 | PluginData = AsyncCommandManager.GetSerializationData(m_Engine, m_ItemID); | 1008 | PluginData = AsyncCommandManager.GetSerializationData(m_Engine, m_ItemID); |
1006 | 1009 | ||
1007 | return ScriptSerializer.Serialize(this); | 1010 | return ScriptSerializer.Serialize(this); |