From a69cb5e3901eb9aa7ebfa65a5787e023136a2b19 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 3 May 2010 21:34:38 +0100 Subject: Address symptom of Mantis 4588 (though not the cause) by moving the avatar dereference inside the exception catch --- OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs index 1a6cd6c..4bcfaac 100644 --- a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs @@ -146,10 +146,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule } private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID) - { - ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); + { try { + ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); + if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0) { avatar.Invulnerable = false; -- cgit v1.1 From 547e0278990208e52a35ac92add22f756d8674f2 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 30 Apr 2010 22:35:07 +0200 Subject: Fix linking issue introduced in my earlier commit --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 8716e0a..4f2b446 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -2594,8 +2594,17 @@ namespace OpenSim.Region.Framework.Scenes List children = new List(); SceneObjectPart root = GetSceneObjectPart(parentPrimId); - if (Permissions.CanLinkObject(client.AgentId, root.ParentGroup.RootPart.UUID)) + if (root == null) + { + m_log.DebugFormat("[LINK]: Can't find linkset root prim {0{", parentPrimId); + return; + } + + if (!Permissions.CanLinkObject(client.AgentId, root.ParentGroup.RootPart.UUID)) + { + m_log.DebugFormat("[LINK]: Refusing link. No permissions on root prim"); return; + } foreach (uint localID in childPrimIds) { @@ -2614,7 +2623,16 @@ namespace OpenSim.Region.Framework.Scenes // Must be all one owner // if (owners.Count > 1) + { + m_log.DebugFormat("[LINK]: Refusing link. Too many owners"); + return; + } + + if (children.Count == 0) + { + m_log.DebugFormat("[LINK]: Refusing link. No permissions to link any of the children"); return; + } m_sceneGraph.LinkObjects(root, children); } -- cgit v1.1 From 2f6bb013701b45421b906625560d8b417ad78689 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey Date: Fri, 14 May 2010 21:22:53 +0100 Subject: Apply patch from http://opensimulator.org/mantis/bug_view_page.php?bug_id=4671 Fixes a bug where the viewer didn't recieve the uuid of a chat broadcasting object Thanks crystalsgalicia! --- OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index 6dacbba..02f0968 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs @@ -264,6 +264,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat fromName = avatar.Name; sourceType = ChatSourceType.Agent; } + else if (c.SenderUUID != UUID.Zero) + { + fromID = c.SenderUUID; + } // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); -- cgit v1.1 From f5ca70127347b20f9bfbb81fe777b9a602bfef0d Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 1 Jun 2010 14:19:26 +0100 Subject: Comment and remove JScript support. Mono 2.7Dev and 2.8 no longer include the needed libraries --- .../ScriptEngine/Shared/CodeTools/Compiler.cs | 38 +++++++++++----------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'OpenSim/Region') 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; using System.Reflection; using System.IO; using Microsoft.CSharp; -using Microsoft.JScript; +//using Microsoft.JScript; using Microsoft.VisualBasic; using log4net; using OpenSim.Region.Framework.Interfaces; @@ -82,7 +82,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider(); private static VBCodeProvider VBcodeProvider = new VBCodeProvider(); - private static JScriptCodeProvider JScodeProvider = new JScriptCodeProvider(); +// private static JScriptCodeProvider JScodeProvider = new JScriptCodeProvider(); private static CSharpCodeProvider YPcodeProvider = new CSharpCodeProvider(); // YP is translated into CSharp private static YP2CSConverter YP_Converter = new YP2CSConverter(); @@ -395,9 +395,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools case enumCompileType.vb: compileScript = CreateVBCompilerScript(compileScript); break; - case enumCompileType.js: - compileScript = CreateJSCompilerScript(compileScript); - break; +// case enumCompileType.js: +// compileScript = CreateJSCompilerScript(compileScript); +// break; case enumCompileType.yp: compileScript = CreateYPCompilerScript(compileScript); break; @@ -420,16 +420,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools } } - private static string CreateJSCompilerScript(string compileScript) - { - compileScript = String.Empty + - "import OpenSim.Region.ScriptEngine.Shared; import System.Collections.Generic;\r\n" + - "package SecondLife {\r\n" + - "class Script extends OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass { \r\n" + - compileScript + - "} }\r\n"; - return compileScript; - } +// private static string CreateJSCompilerScript(string compileScript) +// { +// compileScript = String.Empty + +// "import OpenSim.Region.ScriptEngine.Shared; import System.Collections.Generic;\r\n" + +// "package SecondLife {\r\n" + +// "class Script extends OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass { \r\n" + +// compileScript + +// "} }\r\n"; +// return compileScript; +// } private static string CreateCSCompilerScript(string compileScript) { @@ -580,10 +580,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools } } while (!complete); break; - case enumCompileType.js: - results = JScodeProvider.CompileAssemblyFromSource( - parameters, Script); - break; +// case enumCompileType.js: +// results = JScodeProvider.CompileAssemblyFromSource( +// parameters, Script); +// break; case enumCompileType.yp: results = YPcodeProvider.CompileAssemblyFromSource( parameters, Script); -- cgit v1.1 From 241ed5734ee3c5b1417484dfa22af6cf6ae60b82 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 2 Jun 2010 17:14:37 +0100 Subject: After aborting a thread, wait for it to actually finish. EXPERIMENTAL for OSG testing. DO NOT UPDATE TO THIS UNLESS YOU KNOW WHAT YOU'RE DOING! --- OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index d30d2dc..f5b187f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -536,6 +536,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance if (!m_InSelfDelete) result.Abort(); + result.Wait(TimeSpan.FromSeconds(10)); lock (m_EventQueue) { m_CurrentResult = null; -- cgit v1.1 From c5cfae7bac9273d32c78409fe5080a202043b277 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 2 Jun 2010 17:39:58 +0100 Subject: Revert "After aborting a thread, wait for it to actually finish. EXPERIMENTAL for OSG" This reverts commit 241ed5734ee3c5b1417484dfa22af6cf6ae60b82. --- OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index f5b187f..d30d2dc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -536,7 +536,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance if (!m_InSelfDelete) result.Abort(); - result.Wait(TimeSpan.FromSeconds(10)); lock (m_EventQueue) { m_CurrentResult = null; -- cgit v1.1 From 20e6b7a320df97c69c9f23b2081c376951c39bed Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 2 Jun 2010 18:05:58 +0100 Subject: Next OSG test. Cowardly refuse to save the state of badly behaved scripts, instead of forcing the issue. --- OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') 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 m_CurrentResult = null; } - return true; + return false; } public void SetState(string state) @@ -991,7 +991,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance public string GetXMLState() { bool run = Running; - Stop(100); + bool stopped = Stop(100); Running = run; // We should not be doing this, but since we are about to @@ -1002,6 +1002,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance // Force an update of the in-memory plugin data // + if (!stopped) + return String.Empty; + PluginData = AsyncCommandManager.GetSerializationData(m_Engine, m_ItemID); return ScriptSerializer.Serialize(this); -- cgit v1.1 From f831a1778baa766b4810e352f3ae2ab6736e4620 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 2 Jun 2010 19:57:03 +0100 Subject: Next OSG test. Don't remove app domains if they contain running threads. --- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 98e77c0..46d674d 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -277,7 +277,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine // Clear the event queue and abort the instance thread // instance.ClearQueue(); - instance.Stop(0); + bool stopped = instance.Stop(0); // Release events, timer, etc // @@ -287,7 +287,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine // Must be done explicitly because they have infinite // lifetime // - m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); + if (stopped) + m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); if (m_DomainScripts[instance.AppDomain].Count == 0) { m_DomainScripts.Remove(instance.AppDomain); @@ -804,7 +805,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine m_Scripts.Remove(itemID); instance.ClearQueue(); - instance.Stop(0); + bool stopped = instance.Stop(0); // bool objectRemoved = false; @@ -829,7 +830,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine instance.RemoveState(); instance.DestroyScriptInstance(); - m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); + if (stopped) + m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); if (m_DomainScripts[instance.AppDomain].Count == 0) { m_DomainScripts.Remove(instance.AppDomain); -- cgit v1.1 From 82d0d1c092d309ab5c498e279155fc1ceb5738c8 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 2 Jun 2010 21:02:53 +0100 Subject: Revert "Next OSG test. Don't remove app domains if they contain running threads." This reverts commit f831a1778baa766b4810e352f3ae2ab6736e4620. With this, post-fixes is back to normal. --- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 46d674d..98e77c0 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -277,7 +277,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine // Clear the event queue and abort the instance thread // instance.ClearQueue(); - bool stopped = instance.Stop(0); + instance.Stop(0); // Release events, timer, etc // @@ -287,8 +287,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine // Must be done explicitly because they have infinite // lifetime // - if (stopped) - m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); + m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); if (m_DomainScripts[instance.AppDomain].Count == 0) { m_DomainScripts.Remove(instance.AppDomain); @@ -805,7 +804,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine m_Scripts.Remove(itemID); instance.ClearQueue(); - bool stopped = instance.Stop(0); + instance.Stop(0); // bool objectRemoved = false; @@ -830,8 +829,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine instance.RemoveState(); instance.DestroyScriptInstance(); - if (stopped) - m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); + m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); if (m_DomainScripts[instance.AppDomain].Count == 0) { m_DomainScripts.Remove(instance.AppDomain); -- cgit v1.1 From bdeda18b52f7ab37501f1751573e26e85656a4e4 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 4 Jun 2010 18:54:48 +0100 Subject: Revert "commit code which stops full updates being fired multiple times when attachments cross standalone region boundaries" This reverts commit 5074d290e4aeb583560272cadc8ba09aa8337210. This gets rid of the massive amount of scene object log spam - sorry about that, folks --- .../Interregion/LocalInterregionComms.cs | 2 +- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 5 --- .../Framework/Scenes/Scene.PacketHandlers.cs | 1 - OpenSim/Region/Framework/Scenes/Scene.cs | 43 +++------------------- .../Framework/Scenes/SceneCommunicationService.cs | 2 - OpenSim/Region/Framework/Scenes/SceneGraph.cs | 34 +---------------- .../Region/Framework/Scenes/SceneObjectGroup.cs | 15 ++------ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 34 ++++------------- OpenSim/Region/Framework/Scenes/SceneViewer.cs | 8 +--- 9 files changed, 22 insertions(+), 122 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs index 4abc215..d68c683 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 { if (s.RegionInfo.RegionHandle == regionHandle) { - m_log.Debug("[LOCAL COMMS]: Found region to SendCreateObject"); + //m_log.Debug("[LOCAL COMMS]: Found region to SendCreateObject"); if (isLocalCall) { // 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 f556b35..a2634f7 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -2449,8 +2449,6 @@ namespace OpenSim.Region.Framework.Scenes return; } - m_log.DebugFormat("[SCENE INVENTORY]: {0} {1} IsAttachment={2}", att.Name, att.LocalId, att.IsAttachment); - Console.WriteLine("HERE X"); ScenePresence presence; if (TryGetAvatar(remoteClient.AgentId, out presence)) { @@ -2458,12 +2456,9 @@ namespace OpenSim.Region.Framework.Scenes InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); item = InventoryService.GetItem(item); presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); - Console.WriteLine("HERE Y"); if (m_AvatarFactory != null) m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); - - Console.WriteLine("HERE Z"); } } diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index d8e604f..ac04dc7 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -124,7 +124,6 @@ namespace OpenSim.Region.Framework.Scenes { if (((SceneObjectGroup)ent).LocalId == primLocalID) { - m_log.DebugFormat("[SCENE]: Received full update request for {0} from {1}", primLocalID, remoteClient.Name); ((SceneObjectGroup)ent).SendFullUpdateToClient(remoteClient); return; } diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f8ca047..e8c4978 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1850,31 +1850,9 @@ namespace OpenSim.Region.Framework.Scenes /// true if the object was added, false if an object with the same uuid was already in the scene /// public bool AddRestoredSceneObject( - SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates) - { - return m_sceneGraph.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, sendClientUpdates); - } - - /// - /// Add an object into the scene that has come from storage - /// - /// - /// - /// - /// If true, changes to the object will be reflected in its persisted data - /// If false, the persisted data will not be changed even if the object in the scene is changed - /// - /// - /// If true, we won't persist this object until it changes - /// If false, we'll persist this object immediately - /// - /// - /// true if the object was added, false if an object with the same uuid was already in the scene - /// - public bool AddRestoredSceneObject( SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) { - return AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, true); + return m_sceneGraph.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted); } /// @@ -2487,7 +2465,7 @@ namespace OpenSim.Region.Framework.Scenes /// public bool IncomingCreateObject(ISceneObject sog) { - m_log.Debug(" >>> IncomingCreateObject(sog) <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); + //m_log.Debug(" >>> IncomingCreateObject(sog) <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); SceneObjectGroup newObject; try { @@ -2559,12 +2537,10 @@ namespace OpenSim.Region.Framework.Scenes if (sceneObject.IsAttachmentCheckFull()) // Attachment { - m_log.DebugFormat("[SCENE]: Adding attachment {0} {1}", sceneObject.Name, sceneObject.LocalId); - sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); sceneObject.RootPart.AddFlag(PrimFlags.Phantom); - AddRestoredSceneObject(sceneObject, false, false, false); + AddRestoredSceneObject(sceneObject, false, false); // Handle attachment special case SceneObjectPart RootPrim = sceneObject.RootPart; @@ -2572,8 +2548,6 @@ namespace OpenSim.Region.Framework.Scenes // Fix up attachment Parent Local ID ScenePresence sp = GetScenePresence(sceneObject.OwnerID); - Console.WriteLine("AAAA"); - //uint parentLocalID = 0; if (sp != null) { @@ -2592,25 +2566,20 @@ namespace OpenSim.Region.Framework.Scenes //grp.SetFromAssetID(grp.RootPart.LastOwnerID); m_log.DebugFormat( "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition); - - RootPrim.RemFlag(PrimFlags.TemporaryOnRez); + AttachObject( sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); - - //grp.SendGroupFullUpdate(); + RootPrim.RemFlag(PrimFlags.TemporaryOnRez); + grp.SendGroupFullUpdate(); } else { RootPrim.RemFlag(PrimFlags.TemporaryOnRez); RootPrim.AddFlag(PrimFlags.TemporaryOnRez); } - - Console.WriteLine("BBBB"); } else { - m_log.DebugFormat("[SCENE]: Adding ordinary object {0} {1}", sceneObject.Name, sceneObject.LocalId); - AddRestoredSceneObject(sceneObject, true, false); if (!Permissions.CanObjectEntry(sceneObject.UUID, diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 50feb17..2f6a0db 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -1383,9 +1383,7 @@ namespace OpenSim.Region.Framework.Scenes // now we have a child agent in this region. Request all interesting data about other (root) agents agent.SendInitialFullUpdateToAllClients(); - Console.WriteLine("SCS 1"); agent.CrossAttachmentsIntoNewRegion(neighbourHandle, true); - Console.WriteLine("SCS 2"); // m_scene.SendKillObject(m_localId); diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index fa3c5eb..59a2f41 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -216,15 +216,11 @@ namespace OpenSim.Region.Framework.Scenes /// If true, we won't persist this object until it changes /// If false, we'll persist this object immediately /// - /// - /// If true, we send updates to the client to tell it about this object - /// If false, we leave it up to the caller to do this - /// /// /// true if the object was added, false if an object with the same uuid was already in the scene /// protected internal bool AddRestoredSceneObject( - SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates) + SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) { if (!alreadyPersisted) { @@ -232,29 +228,8 @@ namespace OpenSim.Region.Framework.Scenes sceneObject.HasGroupChanged = true; } - return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates); + return AddSceneObject(sceneObject, attachToBackup, true); } - -// /// -// /// Add an object into the scene that has come from storage -// /// -// /// -// /// -// /// If true, changes to the object will be reflected in its persisted data -// /// If false, the persisted data will not be changed even if the object in the scene is changed -// /// -// /// -// /// If true, we won't persist this object until it changes -// /// If false, we'll persist this object immediately -// /// -// /// -// /// true if the object was added, false if an object with the same uuid was already in the scene -// /// -// protected internal bool AddRestoredSceneObject( -// SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted) -// { -// AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, true); -// } /// /// Add a newly created object to the scene. This will both update the scene, and send information about the @@ -636,13 +611,11 @@ namespace OpenSim.Region.Framework.Scenes protected internal bool AttachObject( IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, Vector3 attachPos, bool silent) { - Console.WriteLine("HERE A"); SceneObjectGroup group = GetGroupByPrim(objectLocalID); if (group != null) { if (m_parentScene.Permissions.CanTakeObject(group.UUID, remoteClient.AgentId)) { - Console.WriteLine("HERE -1"); // If the attachment point isn't the same as the one previously used // set it's offset position = 0 so that it appears on the attachment point // and not in a weird location somewhere unknown. @@ -681,12 +654,9 @@ namespace OpenSim.Region.Framework.Scenes itemId = group.GetFromItemID(); } - Console.WriteLine("HERE 0"); m_parentScene.AttachObject(remoteClient, AttachmentPt, itemId, group); - Console.WriteLine("HERE 1"); group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); - Console.WriteLine("HERE 2"); // In case it is later dropped again, don't let // it get cleaned up // diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index ba3fde7..602b811 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1494,10 +1494,6 @@ namespace OpenSim.Region.Framework.Scenes public void SendFullUpdateToClient(IClientAPI remoteClient) { - if (IsAttachment) - m_log.DebugFormat( - "[SOG]: Sending full update to client {0} for {1} {2}", remoteClient.Name, Name, LocalId); - SendPartFullUpdate(remoteClient, RootPart, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID)); lock (m_parts) @@ -1517,9 +1513,8 @@ namespace OpenSim.Region.Framework.Scenes /// internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part, uint clientFlags) { - if (IsAttachment) - m_log.DebugFormat( - "[SOG]: Sending part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId); +// m_log.DebugFormat( +// "[SOG]: Sending part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId); if (m_rootPart.UUID == part.UUID) { @@ -1999,8 +1994,7 @@ namespace OpenSim.Region.Framework.Scenes public void ScheduleFullUpdateToAvatar(ScenePresence presence) { - if (IsAttachment) - m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1} just to avatar {2}", Name, UUID, presence.Name); +// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1} just to avatar {2}", Name, UUID, presence.Name); RootPart.AddFullUpdateToAvatar(presence); @@ -2032,8 +2026,7 @@ namespace OpenSim.Region.Framework.Scenes /// public void ScheduleGroupForFullUpdate() { - if (IsAttachment) - m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, UUID); +// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, UUID); checkAtTargets(); RootPart.ScheduleFullUpdate(); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index ffbb427..a85a4b3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1259,17 +1259,16 @@ namespace OpenSim.Region.Framework.Scenes /// Tell all scene presences that they should send updates for this part to their clients /// public void AddFullUpdateToAllAvatars() - { + { ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); for (int i = 0; i < avatars.Length; i++) - AddFullUpdateToAvatar(avatars[i]); + { + avatars[i].SceneViewer.QueuePartForUpdate(this); + } } public void AddFullUpdateToAvatar(ScenePresence presence) { - if (IsAttachment) - m_log.DebugFormat("AddFullUpdateToAllAvatar() {0} for {1} {2}", presence.Name, Name, LocalId); - presence.SceneViewer.QueuePartForUpdate(this); } @@ -1288,14 +1287,13 @@ namespace OpenSim.Region.Framework.Scenes { ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); for (int i = 0; i < avatars.Length; i++) - AddTerseUpdateToAvatar(avatars[i]); + { + avatars[i].SceneViewer.QueuePartForUpdate(this); + } } public void AddTerseUpdateToAvatar(ScenePresence presence) { - if (IsAttachment) - m_log.DebugFormat("AddTerseUpdateToAvatar() {0} for {1} {2}", presence.Name, Name, LocalId); - presence.SceneViewer.QueuePartForUpdate(this); } @@ -2729,8 +2727,7 @@ namespace OpenSim.Region.Framework.Scenes /// public void ScheduleFullUpdate() { - if (IsAttachment) - m_log.DebugFormat("[SOP]: Scheduling full update for {0} {1}", Name, LocalId); +// m_log.DebugFormat("[SCENE OBJECT PART]: Scheduling full update for {0} {1}", Name, LocalId); if (m_parentGroup != null) { @@ -2843,10 +2840,6 @@ namespace OpenSim.Region.Framework.Scenes /// public void SendFullUpdate(IClientAPI remoteClient, uint clientFlags) { - if (IsAttachment) - m_log.DebugFormat( - "[SCENE OBJECT PART]: Sending part full update to {0} for {1} {2}", remoteClient.Name, Name, LocalId); - m_parentGroup.SendPartFullUpdate(remoteClient, this, clientFlags); } @@ -2855,10 +2848,6 @@ namespace OpenSim.Region.Framework.Scenes /// public void SendFullUpdateToAllClients() { - if (IsAttachment) - m_log.DebugFormat( - "[SCENE OBJECT PART]: Sending full update for {0} {1} for all clients", Name, LocalId); - ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); for (int i = 0; i < avatars.Length; i++) { @@ -2870,10 +2859,6 @@ namespace OpenSim.Region.Framework.Scenes public void SendFullUpdateToAllClientsExcept(UUID agentID) { - if (IsAttachment) - m_log.DebugFormat( - "[SCENE OBJECT PART]: Sending full update for {0} {1} to all clients except {2}", Name, LocalId, agentID); - ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); for (int i = 0; i < avatars.Length; i++) { @@ -2980,9 +2965,6 @@ namespace OpenSim.Region.Framework.Scenes { if (m_updateFlag == 2) // is a new prim, just created/reloaded or has major changes { - if (IsAttachment) - m_log.DebugFormat("[SOP]: Sending scheduled full update for {0} {1}", Name, LocalId); - AddFullUpdateToAllAvatars(); ClearUpdateSchedule(); } diff --git a/OpenSim/Region/Framework/Scenes/SceneViewer.cs b/OpenSim/Region/Framework/Scenes/SceneViewer.cs index 6f2bef9..e4296ef 100644 --- a/OpenSim/Region/Framework/Scenes/SceneViewer.cs +++ b/OpenSim/Region/Framework/Scenes/SceneViewer.cs @@ -27,7 +27,6 @@ using System; using System.Collections.Generic; -using System.Reflection; using OpenMetaverse; using log4net; using OpenSim.Framework; @@ -40,8 +39,6 @@ namespace OpenSim.Region.Framework.Scenes { public class SceneViewer : ISceneViewer { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - protected ScenePresence m_presence; protected UpdateQueue m_partsUpdateQueue = new UpdateQueue(); protected Queue m_pendingObjects; @@ -63,9 +60,6 @@ namespace OpenSim.Region.Framework.Scenes /// public void QueuePartForUpdate(SceneObjectPart part) { - if (part.IsAttachment) - m_log.DebugFormat("[SCENE VIEWER]: Queueing part {0} {1} for update", part.Name, part.LocalId); - lock (m_partsUpdateQueue) { m_partsUpdateQueue.Enqueue(part); @@ -140,7 +134,7 @@ namespace OpenSim.Region.Framework.Scenes } else if (update.LastTerseUpdateTime <= part.TimeStampTerse) { -// m_log.DebugFormat(AddFullUpdateToAvatar +// m_log.DebugFormat( // "[SCENE PRESENCE]: Tersely updating prim {0}, {1} - part timestamp {2}", // part.Name, part.UUID, part.TimeStampTerse); -- cgit v1.1