diff options
Merge branch '0.6.9-post-fixes' into careminster
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 30 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 11 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 51 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 35 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 15 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 34 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneViewer.cs | 8 |
9 files changed, 146 insertions, 41 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 7fb1cd8..8d2ec0f 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -107,21 +107,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
107 | public event OnSetRootAgentSceneDelegate OnSetRootAgentScene; | 107 | public event OnSetRootAgentSceneDelegate OnSetRootAgentScene; |
108 | 108 | ||
109 | /// <summary> | 109 | /// <summary> |
110 | /// Called when an object is touched/grabbed. | 110 | /// Fired when an object is touched/grabbed. |
111 | /// </summary> | 111 | /// </summary> |
112 | /// The originalID is the local ID of the part that was actually touched. The localID itself is always that of | 112 | /// The originalID is the local ID of the part that was actually touched. The localID itself is always that of |
113 | /// the root part. | 113 | /// the root part. |
114 | public delegate void ObjectGrabDelegate(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs); | ||
115 | public event ObjectGrabDelegate OnObjectGrab; | 114 | public event ObjectGrabDelegate OnObjectGrab; |
115 | public delegate void ObjectGrabDelegate(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs); | ||
116 | 116 | ||
117 | public event ObjectGrabDelegate OnObjectGrabbing; | 117 | public event ObjectGrabDelegate OnObjectGrabbing; |
118 | public event ObjectDeGrabDelegate OnObjectDeGrab; | 118 | public event ObjectDeGrabDelegate OnObjectDeGrab; |
119 | public event ScriptResetDelegate OnScriptReset; | 119 | public event ScriptResetDelegate OnScriptReset; |
120 | 120 | ||
121 | public event OnPermissionErrorDelegate OnPermissionError; | 121 | public event OnPermissionErrorDelegate OnPermissionError; |
122 | 122 | ||
123 | public delegate void NewRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource); | 123 | /// <summary> |
124 | /// Fired when a new script is created. | ||
125 | /// </summary> | ||
124 | public event NewRezScript OnRezScript; | 126 | public event NewRezScript OnRezScript; |
127 | public delegate void NewRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource); | ||
125 | 128 | ||
126 | public delegate void RemoveScript(uint localID, UUID itemID); | 129 | public delegate void RemoveScript(uint localID, UUID itemID); |
127 | public event RemoveScript OnRemoveScript; | 130 | public event RemoveScript OnRemoveScript; |
@@ -163,38 +166,35 @@ namespace OpenSim.Region.Framework.Scenes | |||
163 | 166 | ||
164 | public delegate void ClientClosed(UUID clientID, Scene scene); | 167 | public delegate void ClientClosed(UUID clientID, Scene scene); |
165 | 168 | ||
166 | public event ClientClosed OnClientClosed; | 169 | public event ClientClosed OnClientClosed; |
167 | |||
168 | public delegate void ScriptChangedEvent(uint localID, uint change); | ||
169 | 170 | ||
171 | /// <summary> | ||
172 | /// This is fired when a scene object property that a script might be interested in (such as color, scale or | ||
173 | /// inventory) changes. Only enough information is sent for the LSL changed event | ||
174 | /// (see http://lslwiki.net/lslwiki/wakka.php?wakka=changed) | ||
175 | /// </summary> | ||
170 | public event ScriptChangedEvent OnScriptChangedEvent; | 176 | public event ScriptChangedEvent OnScriptChangedEvent; |
177 | public delegate void ScriptChangedEvent(uint localID, uint change); | ||
171 | 178 | ||
172 | public delegate void ScriptControlEvent(uint localID, UUID item, UUID avatarID, uint held, uint changed); | 179 | public delegate void ScriptControlEvent(uint localID, UUID item, UUID avatarID, uint held, uint changed); |
173 | |||
174 | public event ScriptControlEvent OnScriptControlEvent; | 180 | public event ScriptControlEvent OnScriptControlEvent; |
175 | 181 | ||
176 | public delegate void ScriptAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 atpos); | 182 | public delegate void ScriptAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 atpos); |
177 | |||
178 | public event ScriptAtTargetEvent OnScriptAtTargetEvent; | 183 | public event ScriptAtTargetEvent OnScriptAtTargetEvent; |
179 | 184 | ||
180 | public delegate void ScriptNotAtTargetEvent(uint localID); | 185 | public delegate void ScriptNotAtTargetEvent(uint localID); |
181 | |||
182 | public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent; | 186 | public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent; |
183 | 187 | ||
184 | public delegate void ScriptAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion atrot); | 188 | public delegate void ScriptAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion atrot); |
185 | |||
186 | public event ScriptAtRotTargetEvent OnScriptAtRotTargetEvent; | 189 | public event ScriptAtRotTargetEvent OnScriptAtRotTargetEvent; |
187 | 190 | ||
188 | public delegate void ScriptNotAtRotTargetEvent(uint localID); | 191 | public delegate void ScriptNotAtRotTargetEvent(uint localID); |
189 | |||
190 | public event ScriptNotAtRotTargetEvent OnScriptNotAtRotTargetEvent; | 192 | public event ScriptNotAtRotTargetEvent OnScriptNotAtRotTargetEvent; |
191 | 193 | ||
192 | public delegate void ScriptColliding(uint localID, ColliderArgs colliders); | 194 | public delegate void ScriptColliding(uint localID, ColliderArgs colliders); |
193 | |||
194 | public event ScriptColliding OnScriptColliderStart; | 195 | public event ScriptColliding OnScriptColliderStart; |
195 | public event ScriptColliding OnScriptColliding; | 196 | public event ScriptColliding OnScriptColliding; |
196 | public event ScriptColliding OnScriptCollidingEnd; | 197 | public event ScriptColliding OnScriptCollidingEnd; |
197 | |||
198 | public event ScriptColliding OnScriptLandColliderStart; | 198 | public event ScriptColliding OnScriptLandColliderStart; |
199 | public event ScriptColliding OnScriptLandColliding; | 199 | public event ScriptColliding OnScriptLandColliding; |
200 | public event ScriptColliding OnScriptLandColliderEnd; | 200 | public event ScriptColliding OnScriptLandColliderEnd; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index ba70ae5..4019c12 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -532,7 +532,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
532 | return null; | 532 | return null; |
533 | } | 533 | } |
534 | 534 | ||
535 | |||
536 | if (recipientParentFolderId == UUID.Zero) | 535 | if (recipientParentFolderId == UUID.Zero) |
537 | { | 536 | { |
538 | InventoryFolderBase recipientRootFolder = InventoryService.GetRootFolder(recipientId); | 537 | InventoryFolderBase recipientRootFolder = InventoryService.GetRootFolder(recipientId); |
@@ -2086,7 +2085,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2086 | group.RootPart.IsAttachment = true; | 2085 | group.RootPart.IsAttachment = true; |
2087 | } | 2086 | } |
2088 | 2087 | ||
2089 | AddNewSceneObject(group, true); | 2088 | // If we're rezzing an attachment then don't ask AddNewSceneObject() to update the client since |
2089 | // we'll be doing that later on. Scheduling more than one full update during the attachment | ||
2090 | // process causes some clients to fail to display the attachment properly. | ||
2091 | AddNewSceneObject(group, true, !attachment); | ||
2090 | 2092 | ||
2091 | // m_log.InfoFormat("ray end point for inventory rezz is {0} {1} {2} ", RayEnd.X, RayEnd.Y, RayEnd.Z); | 2093 | // m_log.InfoFormat("ray end point for inventory rezz is {0} {1} {2} ", RayEnd.X, RayEnd.Y, RayEnd.Z); |
2092 | // if attachment we set it's asset id so object updates can reflect that | 2094 | // if attachment we set it's asset id so object updates can reflect that |
@@ -2456,6 +2458,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2456 | return; | 2458 | return; |
2457 | } | 2459 | } |
2458 | 2460 | ||
2461 | m_log.DebugFormat("[SCENE INVENTORY]: {0} {1} IsAttachment={2}", att.Name, att.LocalId, att.IsAttachment); | ||
2462 | Console.WriteLine("HERE X"); | ||
2459 | ScenePresence presence; | 2463 | ScenePresence presence; |
2460 | if (TryGetAvatar(remoteClient.AgentId, out presence)) | 2464 | if (TryGetAvatar(remoteClient.AgentId, out presence)) |
2461 | { | 2465 | { |
@@ -2463,9 +2467,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2463 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | 2467 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
2464 | item = InventoryService.GetItem(item); | 2468 | item = InventoryService.GetItem(item); |
2465 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); | 2469 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); |
2470 | Console.WriteLine("HERE Y"); | ||
2466 | 2471 | ||
2467 | if (m_AvatarFactory != null) | 2472 | if (m_AvatarFactory != null) |
2468 | m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); | 2473 | m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); |
2474 | |||
2475 | Console.WriteLine("HERE Z"); | ||
2469 | } | 2476 | } |
2470 | } | 2477 | } |
2471 | 2478 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index ac04dc7..d8e604f 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 ee097bc..a3c5a03 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1891,9 +1891,31 @@ namespace OpenSim.Region.Framework.Scenes | |||
1891 | /// true if the object was added, false if an object with the same uuid was already in the scene | 1891 | /// true if the object was added, false if an object with the same uuid was already in the scene |
1892 | /// </returns> | 1892 | /// </returns> |
1893 | public bool AddRestoredSceneObject( | 1893 | public bool AddRestoredSceneObject( |
1894 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates) | ||
1895 | { | ||
1896 | return m_sceneGraph.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, sendClientUpdates); | ||
1897 | } | ||
1898 | |||
1899 | /// <summary> | ||
1900 | /// Add an object into the scene that has come from storage | ||
1901 | /// </summary> | ||
1902 | /// | ||
1903 | /// <param name="sceneObject"></param> | ||
1904 | /// <param name="attachToBackup"> | ||
1905 | /// If true, changes to the object will be reflected in its persisted data | ||
1906 | /// If false, the persisted data will not be changed even if the object in the scene is changed | ||
1907 | /// </param> | ||
1908 | /// <param name="alreadyPersisted"> | ||
1909 | /// If true, we won't persist this object until it changes | ||
1910 | /// If false, we'll persist this object immediately | ||
1911 | /// </param> | ||
1912 | /// <returns> | ||
1913 | /// true if the object was added, false if an object with the same uuid was already in the scene | ||
1914 | /// </returns> | ||
1915 | public bool AddRestoredSceneObject( | ||
1894 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) | 1916 | SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) |
1895 | { | 1917 | { |
1896 | return m_sceneGraph.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted); | 1918 | return AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, true); |
1897 | } | 1919 | } |
1898 | 1920 | ||
1899 | /// <summary> | 1921 | /// <summary> |
@@ -1927,7 +1949,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1927 | } | 1949 | } |
1928 | 1950 | ||
1929 | /// <summary> | 1951 | /// <summary> |
1930 | /// Delete every object from the scene | 1952 | /// Delete every object from the scene. This does not include attachments worn by avatars. |
1931 | /// </summary> | 1953 | /// </summary> |
1932 | public void DeleteAllSceneObjects() | 1954 | public void DeleteAllSceneObjects() |
1933 | { | 1955 | { |
@@ -1938,7 +1960,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1938 | foreach (EntityBase e in entities) | 1960 | foreach (EntityBase e in entities) |
1939 | { | 1961 | { |
1940 | if (e is SceneObjectGroup) | 1962 | if (e is SceneObjectGroup) |
1941 | DeleteSceneObject((SceneObjectGroup)e, false); | 1963 | { |
1964 | SceneObjectGroup sog = (SceneObjectGroup)e; | ||
1965 | if (!sog.IsAttachment) | ||
1966 | DeleteSceneObject((SceneObjectGroup)e, false); | ||
1967 | } | ||
1942 | } | 1968 | } |
1943 | } | 1969 | } |
1944 | } | 1970 | } |
@@ -2502,7 +2528,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2502 | /// <returns></returns> | 2528 | /// <returns></returns> |
2503 | public bool IncomingCreateObject(ISceneObject sog) | 2529 | public bool IncomingCreateObject(ISceneObject sog) |
2504 | { | 2530 | { |
2505 | //m_log.Debug(" >>> IncomingCreateObject(sog) <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); | 2531 | m_log.Debug(" >>> IncomingCreateObject(sog) <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); |
2506 | SceneObjectGroup newObject; | 2532 | SceneObjectGroup newObject; |
2507 | try | 2533 | try |
2508 | { | 2534 | { |
@@ -2574,10 +2600,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2574 | 2600 | ||
2575 | if (sceneObject.IsAttachmentCheckFull()) // Attachment | 2601 | if (sceneObject.IsAttachmentCheckFull()) // Attachment |
2576 | { | 2602 | { |
2603 | m_log.DebugFormat("[SCENE]: Adding attachment {0} {1}", sceneObject.Name, sceneObject.LocalId); | ||
2604 | |||
2577 | sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); | 2605 | sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); |
2578 | sceneObject.RootPart.AddFlag(PrimFlags.Phantom); | 2606 | sceneObject.RootPart.AddFlag(PrimFlags.Phantom); |
2579 | 2607 | ||
2580 | AddRestoredSceneObject(sceneObject, false, false); | 2608 | AddRestoredSceneObject(sceneObject, false, false, false); |
2581 | 2609 | ||
2582 | // Handle attachment special case | 2610 | // Handle attachment special case |
2583 | SceneObjectPart RootPrim = sceneObject.RootPart; | 2611 | SceneObjectPart RootPrim = sceneObject.RootPart; |
@@ -2585,6 +2613,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2585 | // Fix up attachment Parent Local ID | 2613 | // Fix up attachment Parent Local ID |
2586 | ScenePresence sp = GetScenePresence(sceneObject.OwnerID); | 2614 | ScenePresence sp = GetScenePresence(sceneObject.OwnerID); |
2587 | 2615 | ||
2616 | Console.WriteLine("AAAA"); | ||
2617 | |||
2588 | //uint parentLocalID = 0; | 2618 | //uint parentLocalID = 0; |
2589 | if (sp != null) | 2619 | if (sp != null) |
2590 | { | 2620 | { |
@@ -2603,20 +2633,25 @@ namespace OpenSim.Region.Framework.Scenes | |||
2603 | //grp.SetFromAssetID(grp.RootPart.LastOwnerID); | 2633 | //grp.SetFromAssetID(grp.RootPart.LastOwnerID); |
2604 | m_log.DebugFormat( | 2634 | m_log.DebugFormat( |
2605 | "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition); | 2635 | "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition); |
2606 | 2636 | ||
2637 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | ||
2607 | AttachObject( | 2638 | AttachObject( |
2608 | sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); | 2639 | sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); |
2609 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | 2640 | |
2610 | grp.SendGroupFullUpdate(); | 2641 | //grp.SendGroupFullUpdate(); |
2611 | } | 2642 | } |
2612 | else | 2643 | else |
2613 | { | 2644 | { |
2614 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); | 2645 | RootPrim.RemFlag(PrimFlags.TemporaryOnRez); |
2615 | RootPrim.AddFlag(PrimFlags.TemporaryOnRez); | 2646 | RootPrim.AddFlag(PrimFlags.TemporaryOnRez); |
2616 | } | 2647 | } |
2648 | |||
2649 | Console.WriteLine("BBBB"); | ||
2617 | } | 2650 | } |
2618 | else | 2651 | else |
2619 | { | 2652 | { |
2653 | m_log.DebugFormat("[SCENE]: Adding ordinary object {0} {1}", sceneObject.Name, sceneObject.LocalId); | ||
2654 | |||
2620 | AddRestoredSceneObject(sceneObject, true, false); | 2655 | AddRestoredSceneObject(sceneObject, true, false); |
2621 | 2656 | ||
2622 | if (!Permissions.CanObjectEntry(sceneObject.UUID, | 2657 | if (!Permissions.CanObjectEntry(sceneObject.UUID, |
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 04626d3..9153069 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -1410,7 +1410,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1410 | // now we have a child agent in this region. Request all interesting data about other (root) agents | 1410 | // now we have a child agent in this region. Request all interesting data about other (root) agents |
1411 | agent.SendInitialFullUpdateToAllClients(); | 1411 | agent.SendInitialFullUpdateToAllClients(); |
1412 | 1412 | ||
1413 | Console.WriteLine("SCS 1"); | ||
1413 | agent.CrossAttachmentsIntoNewRegion(neighbourHandle, true); | 1414 | agent.CrossAttachmentsIntoNewRegion(neighbourHandle, true); |
1415 | Console.WriteLine("SCS 2"); | ||
1414 | 1416 | ||
1415 | // m_scene.SendKillObject(m_localId); | 1417 | // m_scene.SendKillObject(m_localId); |
1416 | 1418 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 090f379..fb01140 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 | // KF: Check for out-of-region, move inside and make static. | 229 | // KF: Check for out-of-region, move inside and make static. |
226 | Vector3 npos = new Vector3(sceneObject.RootPart.GroupPosition.X, | 230 | Vector3 npos = new Vector3(sceneObject.RootPart.GroupPosition.X, |
@@ -252,8 +256,29 @@ namespace OpenSim.Region.Framework.Scenes | |||
252 | sceneObject.HasGroupChanged = true; | 256 | sceneObject.HasGroupChanged = true; |
253 | } | 257 | } |
254 | 258 | ||
255 | return AddSceneObject(sceneObject, attachToBackup, true); | 259 | return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates); |
256 | } | 260 | } |
261 | |||
262 | // /// <summary> | ||
263 | // /// Add an object into the scene that has come from storage | ||
264 | // /// </summary> | ||
265 | // /// <param name="sceneObject"></param> | ||
266 | // /// <param name="attachToBackup"> | ||
267 | // /// If true, changes to the object will be reflected in its persisted data | ||
268 | // /// If false, the persisted data will not be changed even if the object in the scene is changed | ||
269 | // /// </param> | ||
270 | // /// <param name="alreadyPersisted"> | ||
271 | // /// If true, we won't persist this object until it changes | ||
272 | // /// If false, we'll persist this object immediately | ||
273 | // /// </param> | ||
274 | // /// <returns> | ||
275 | // /// true if the object was added, false if an object with the same uuid was already in the scene | ||
276 | // /// </returns> | ||
277 | // protected internal bool AddRestoredSceneObject( | ||
278 | // SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) | ||
279 | // { | ||
280 | // AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, true); | ||
281 | // } | ||
257 | 282 | ||
258 | /// <summary> | 283 | /// <summary> |
259 | /// Add a newly created object to the scene. This will both update the scene, and send information about the | 284 | /// Add a newly created object to the scene. This will both update the scene, and send information about the |
@@ -560,7 +585,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
560 | // m_log.DebugFormat( | 585 | // m_log.DebugFormat( |
561 | // "[SCENE GRAPH]: Retrieved single object {0} for attachment to {1} on point {2}", | 586 | // "[SCENE GRAPH]: Retrieved single object {0} for attachment to {1} on point {2}", |
562 | // objatt.Name, remoteClient.Name, AttachmentPt); | 587 | // objatt.Name, remoteClient.Name, AttachmentPt); |
563 | |||
564 | if (objatt != null) | 588 | if (objatt != null) |
565 | { | 589 | { |
566 | bool tainted = false; | 590 | bool tainted = false; |
@@ -648,11 +672,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
648 | protected internal bool AttachObject( | 672 | protected internal bool AttachObject( |
649 | IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, Vector3 attachPos, bool silent) | 673 | IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, Vector3 attachPos, bool silent) |
650 | { | 674 | { |
675 | Console.WriteLine("HERE A"); | ||
651 | SceneObjectGroup group = GetGroupByPrim(objectLocalID); | 676 | SceneObjectGroup group = GetGroupByPrim(objectLocalID); |
652 | if (group != null) | 677 | if (group != null) |
653 | { | 678 | { |
654 | if (m_parentScene.Permissions.CanTakeObject(group.UUID, remoteClient.AgentId)) | 679 | if (m_parentScene.Permissions.CanTakeObject(group.UUID, remoteClient.AgentId)) |
655 | { | 680 | { |
681 | Console.WriteLine("HERE -1"); | ||
656 | // If the attachment point isn't the same as the one previously used | 682 | // If the attachment point isn't the same as the one previously used |
657 | // set it's offset position = 0 so that it appears on the attachment point | 683 | // set it's offset position = 0 so that it appears on the attachment point |
658 | // and not in a weird location somewhere unknown. | 684 | // and not in a weird location somewhere unknown. |
@@ -691,9 +717,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
691 | itemId = group.GetFromItemID(); | 717 | itemId = group.GetFromItemID(); |
692 | } | 718 | } |
693 | 719 | ||
720 | Console.WriteLine("HERE 0"); | ||
694 | m_parentScene.AttachObject(remoteClient, AttachmentPt, itemId, group); | 721 | m_parentScene.AttachObject(remoteClient, AttachmentPt, itemId, group); |
695 | 722 | ||
723 | Console.WriteLine("HERE 1"); | ||
696 | group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); | 724 | group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); |
725 | Console.WriteLine("HERE 2"); | ||
697 | // In case it is later dropped again, don't let | 726 | // In case it is later dropped again, don't let |
698 | // it get cleaned up | 727 | // it get cleaned up |
699 | // | 728 | // |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 13d1d4e..318357d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1651,6 +1651,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1651 | 1651 | ||
1652 | public void SendFullUpdateToClient(IClientAPI remoteClient) | 1652 | public void SendFullUpdateToClient(IClientAPI remoteClient) |
1653 | { | 1653 | { |
1654 | if (IsAttachment) | ||
1655 | m_log.DebugFormat( | ||
1656 | "[SOG]: Sending full update to client {0} for {1} {2}", remoteClient.Name, Name, LocalId); | ||
1657 | |||
1654 | SendPartFullUpdate(remoteClient, RootPart, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID)); | 1658 | SendPartFullUpdate(remoteClient, RootPart, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID)); |
1655 | 1659 | ||
1656 | lockPartsForRead(true); | 1660 | lockPartsForRead(true); |
@@ -1673,8 +1677,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1673 | /// <param name="part"></param> | 1677 | /// <param name="part"></param> |
1674 | internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part, uint clientFlags) | 1678 | internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part, uint clientFlags) |
1675 | { | 1679 | { |
1676 | // m_log.DebugFormat( | 1680 | if (IsAttachment) |
1677 | // "[SOG]: Sendinging part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId); | 1681 | m_log.DebugFormat( |
1682 | "[SOG]: Sending part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId); | ||
1678 | 1683 | ||
1679 | if (m_rootPart.UUID == part.UUID) | 1684 | if (m_rootPart.UUID == part.UUID) |
1680 | { | 1685 | { |
@@ -2186,7 +2191,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2186 | 2191 | ||
2187 | public void ScheduleFullUpdateToAvatar(ScenePresence presence) | 2192 | public void ScheduleFullUpdateToAvatar(ScenePresence presence) |
2188 | { | 2193 | { |
2189 | // m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1} just to avatar {2}", Name, UUID, presence.Name); | 2194 | if (IsAttachment) |
2195 | m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1} just to avatar {2}", Name, UUID, presence.Name); | ||
2190 | 2196 | ||
2191 | RootPart.AddFullUpdateToAvatar(presence); | 2197 | RootPart.AddFullUpdateToAvatar(presence); |
2192 | 2198 | ||
@@ -2222,7 +2228,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2222 | /// </summary> | 2228 | /// </summary> |
2223 | public void ScheduleGroupForFullUpdate() | 2229 | public void ScheduleGroupForFullUpdate() |
2224 | { | 2230 | { |
2225 | // m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, UUID); | 2231 | if (IsAttachment) |
2232 | m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, UUID); | ||
2226 | 2233 | ||
2227 | checkAtTargets(); | 2234 | checkAtTargets(); |
2228 | RootPart.ScheduleFullUpdate(); | 2235 | RootPart.ScheduleFullUpdate(); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 548a64f..3a101cc 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1270,16 +1270,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
1270 | /// Tell all scene presences that they should send updates for this part to their clients | 1270 | /// Tell all scene presences that they should send updates for this part to their clients |
1271 | /// </summary> | 1271 | /// </summary> |
1272 | public void AddFullUpdateToAllAvatars() | 1272 | public void AddFullUpdateToAllAvatars() |
1273 | { | 1273 | { |
1274 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 1274 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); |
1275 | for (int i = 0; i < avatars.Length; i++) | 1275 | for (int i = 0; i < avatars.Length; i++) |
1276 | { | 1276 | AddFullUpdateToAvatar(avatars[i]); |
1277 | avatars[i].SceneViewer.QueuePartForUpdate(this); | ||
1278 | } | ||
1279 | } | 1277 | } |
1280 | 1278 | ||
1281 | public void AddFullUpdateToAvatar(ScenePresence presence) | 1279 | public void AddFullUpdateToAvatar(ScenePresence presence) |
1282 | { | 1280 | { |
1281 | if (IsAttachment) | ||
1282 | m_log.DebugFormat("AddFullUpdateToAllAvatar() {0} for {1} {2}", presence.Name, Name, LocalId); | ||
1283 | |||
1283 | presence.SceneViewer.QueuePartForUpdate(this); | 1284 | presence.SceneViewer.QueuePartForUpdate(this); |
1284 | } | 1285 | } |
1285 | 1286 | ||
@@ -1298,13 +1299,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1298 | { | 1299 | { |
1299 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 1300 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); |
1300 | for (int i = 0; i < avatars.Length; i++) | 1301 | for (int i = 0; i < avatars.Length; i++) |
1301 | { | 1302 | AddTerseUpdateToAvatar(avatars[i]); |
1302 | avatars[i].SceneViewer.QueuePartForUpdate(this); | ||
1303 | } | ||
1304 | } | 1303 | } |
1305 | 1304 | ||
1306 | public void AddTerseUpdateToAvatar(ScenePresence presence) | 1305 | public void AddTerseUpdateToAvatar(ScenePresence presence) |
1307 | { | 1306 | { |
1307 | if (IsAttachment) | ||
1308 | m_log.DebugFormat("AddTerseUpdateToAvatar() {0} for {1} {2}", presence.Name, Name, LocalId); | ||
1309 | |||
1308 | presence.SceneViewer.QueuePartForUpdate(this); | 1310 | presence.SceneViewer.QueuePartForUpdate(this); |
1309 | } | 1311 | } |
1310 | 1312 | ||
@@ -2713,7 +2715,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2713 | /// </summary> | 2715 | /// </summary> |
2714 | public void ScheduleFullUpdate() | 2716 | public void ScheduleFullUpdate() |
2715 | { | 2717 | { |
2716 | // m_log.DebugFormat("[SCENE OBJECT PART]: Scheduling full update for {0} {1}", Name, LocalId); | 2718 | if (IsAttachment) |
2719 | m_log.DebugFormat("[SOP]: Scheduling full update for {0} {1}", Name, LocalId); | ||
2717 | 2720 | ||
2718 | if (m_parentGroup != null) | 2721 | if (m_parentGroup != null) |
2719 | { | 2722 | { |
@@ -2826,6 +2829,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2826 | /// <param name="remoteClient"></param> | 2829 | /// <param name="remoteClient"></param> |
2827 | public void SendFullUpdate(IClientAPI remoteClient, uint clientFlags) | 2830 | public void SendFullUpdate(IClientAPI remoteClient, uint clientFlags) |
2828 | { | 2831 | { |
2832 | if (IsAttachment) | ||
2833 | m_log.DebugFormat( | ||
2834 | "[SCENE OBJECT PART]: Sending part full update to {0} for {1} {2}", remoteClient.Name, Name, LocalId); | ||
2835 | |||
2829 | m_parentGroup.SendPartFullUpdate(remoteClient, this, clientFlags); | 2836 | m_parentGroup.SendPartFullUpdate(remoteClient, this, clientFlags); |
2830 | } | 2837 | } |
2831 | 2838 | ||
@@ -2834,6 +2841,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2834 | /// </summary> | 2841 | /// </summary> |
2835 | public void SendFullUpdateToAllClients() | 2842 | public void SendFullUpdateToAllClients() |
2836 | { | 2843 | { |
2844 | if (IsAttachment) | ||
2845 | m_log.DebugFormat( | ||
2846 | "[SCENE OBJECT PART]: Sending full update for {0} {1} for all clients", Name, LocalId); | ||
2847 | |||
2837 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 2848 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); |
2838 | for (int i = 0; i < avatars.Length; i++) | 2849 | for (int i = 0; i < avatars.Length; i++) |
2839 | { | 2850 | { |
@@ -2845,6 +2856,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2845 | 2856 | ||
2846 | public void SendFullUpdateToAllClientsExcept(UUID agentID) | 2857 | public void SendFullUpdateToAllClientsExcept(UUID agentID) |
2847 | { | 2858 | { |
2859 | if (IsAttachment) | ||
2860 | m_log.DebugFormat( | ||
2861 | "[SCENE OBJECT PART]: Sending full update for {0} {1} to all clients except {2}", Name, LocalId, agentID); | ||
2862 | |||
2848 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 2863 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); |
2849 | for (int i = 0; i < avatars.Length; i++) | 2864 | for (int i = 0; i < avatars.Length; i++) |
2850 | { | 2865 | { |
@@ -2953,6 +2968,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2953 | { | 2968 | { |
2954 | if (m_updateFlag == 2) // is a new prim, just created/reloaded or has major changes | 2969 | if (m_updateFlag == 2) // is a new prim, just created/reloaded or has major changes |
2955 | { | 2970 | { |
2971 | if (IsAttachment) | ||
2972 | m_log.DebugFormat("[SOP]: Sending scheduled full update for {0} {1}", Name, LocalId); | ||
2973 | |||
2956 | AddFullUpdateToAllAvatars(); | 2974 | AddFullUpdateToAllAvatars(); |
2957 | m_updateFlag = 0; //Same here | 2975 | m_updateFlag = 0; //Same here |
2958 | } | 2976 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneViewer.cs b/OpenSim/Region/Framework/Scenes/SceneViewer.cs index 1cff0eb..f88605b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneViewer.cs +++ b/OpenSim/Region/Framework/Scenes/SceneViewer.cs | |||
@@ -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 | ||