From 5c545d1d2e0a1862d063a1bdf80d2cd2fa311101 Mon Sep 17 00:00:00 2001 From: PixelTomsen Date: Fri, 3 Feb 2012 22:02:36 +0100 Subject: Fix: Covenant changed time not set http://opensimulator.org/mantis/view.php?id=5869 Signed-off-by: BlueWall --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 8 ++++---- OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | 2 ++ .../Agent/InternetRelayClientView/Server/IRCClientView.cs | 2 +- OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index cdd4957..8273c6f 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -4439,7 +4439,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP EstateCovenantReplyPacket einfopack = new EstateCovenantReplyPacket(); EstateCovenantReplyPacket.DataBlock edata = new EstateCovenantReplyPacket.DataBlock(); edata.CovenantID = covenant; - edata.CovenantTimestamp = 0; + edata.CovenantTimestamp = (uint) m_scene.RegionInfo.RegionSettings.CovenantChangedDateTime; edata.EstateOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; edata.EstateName = Utils.StringToBytes(m_scene.RegionInfo.EstateSettings.EstateName); einfopack.Data = edata; @@ -4447,8 +4447,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP } public void SendDetailedEstateData( - UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, - UUID covenant, string abuseEmail, UUID estateOwner) + UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, + UUID covenant, uint covenantChanged, string abuseEmail, UUID estateOwner) { // m_log.DebugFormat( // "[LLCLIENTVIEW]: Sending detailed estate data to {0} with covenant asset id {1}", Name, covenant); @@ -4473,7 +4473,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP returnblock[4].Parameter = Utils.StringToBytes(sunPosition.ToString()); returnblock[5].Parameter = Utils.StringToBytes(parentEstate.ToString()); returnblock[6].Parameter = Utils.StringToBytes(covenant.ToString()); - returnblock[7].Parameter = Utils.StringToBytes("1160895077"); // what is this? + returnblock[7].Parameter = Utils.StringToBytes(covenantChanged.ToString()); returnblock[8].Parameter = Utils.StringToBytes("1"); // what is this? returnblock[9].Parameter = Utils.StringToBytes(abuseEmail); diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 2e1487f..c303d6d 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -80,6 +80,7 @@ namespace OpenSim.Region.CoreModules.World.Estate GetEstateFlags(), sun, Scene.RegionInfo.RegionSettings.Covenant, + (uint) Scene.RegionInfo.RegionSettings.CovenantChangedDateTime, Scene.RegionInfo.EstateSettings.AbuseEmail, estateOwner); @@ -268,6 +269,7 @@ namespace OpenSim.Region.CoreModules.World.Estate // remoteClient.Name, estateCovenantID); Scene.RegionInfo.RegionSettings.Covenant = estateCovenantID; + Scene.RegionInfo.RegionSettings.CovenantChangedDateTime = Util.UnixTimeSinceEpoch(); Scene.RegionInfo.RegionSettings.Save(); TriggerRegionInfoChange(); } diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 11f927c..c928af7 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -1243,7 +1243,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server } - public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, string abuseEmail, UUID estateOwner) + public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, uint covenantChanged, string abuseEmail, UUID estateOwner) { } diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 81bf9ed..be0d56e 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -933,7 +933,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC public void SendTelehubInfo(UUID ObjectID, string ObjectName, Vector3 ObjectPos, Quaternion ObjectRot, List SpawnPoint) { } - public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, string abuseEmail, UUID estateOwner) + public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, uint covenantChanged, string abuseEmail, UUID estateOwner) { } -- cgit v1.1 From ce34b359ad0254b6b4f460e2740e1a1ed30c456b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 3 Feb 2012 23:04:26 +0000 Subject: Extend m_avatars lock in NpcModule.CreateNPC over both creation of NPC scene presence and population of m_avatars. This is required to stop a race where the SensorRepeat module can detect an NPC avatar before m_avatars is populated. Extending the lock is the easiest to understand solution rather than getting complicated with null checks. Hopefully resolves http://opensimulator.org/mantis/view.php?id=5872 --- .../Region/OptionalModules/World/NPC/NPCModule.cs | 30 ++++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 3831d7a..6a48b89 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs @@ -140,24 +140,26 @@ namespace OpenSim.Region.OptionalModules.World.NPC // acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]); // } - scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode, acd); - scene.AddNewClient(npcAvatar, PresenceType.Npc); - - ScenePresence sp; - if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp)) + lock (m_avatars) { - m_log.DebugFormat( - "[NPC MODULE]: Successfully retrieved scene presence for NPC {0} {1}", sp.Name, sp.UUID); + scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode, acd); + scene.AddNewClient(npcAvatar, PresenceType.Npc); - sp.CompleteMovement(npcAvatar, false); - } - else - { - m_log.WarnFormat("[NPC MODULE]: Could not find scene presence for NPC {0} {1}", sp.Name, sp.UUID); - } + ScenePresence sp; + if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp)) + { + m_log.DebugFormat( + "[NPC MODULE]: Successfully retrieved scene presence for NPC {0} {1}", sp.Name, sp.UUID); + + sp.CompleteMovement(npcAvatar, false); + } + else + { + m_log.WarnFormat("[NPC MODULE]: Could not find scene presence for NPC {0} {1}", sp.Name, sp.UUID); + } - lock (m_avatars) m_avatars.Add(npcAvatar.AgentId, npcAvatar); + } m_log.DebugFormat("[NPC MODULE]: Created NPC with id {0}", npcAvatar.AgentId); -- cgit v1.1 From 107cef2b0e176a586ef81e3ada1cc3c1641c5467 Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Fri, 3 Feb 2012 15:18:48 -0800 Subject: Check for null scene in ScheduleFullUpdate and ScheduleTerseUpdate before triggering events on a potentially null Scene --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 9b660b6..0e899ca 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2729,8 +2729,6 @@ namespace OpenSim.Region.Framework.Scenes if (ParentGroup == null) return; - ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this); - ParentGroup.QueueForUpdateCheck(); int timeNow = Util.UnixTimeSinceEpoch(); @@ -2752,6 +2750,9 @@ namespace OpenSim.Region.Framework.Scenes // m_log.DebugFormat( // "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}", // UUID, Name, TimeStampFull); + + if (ParentGroup.Scene != null) + ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this); } /// @@ -2763,13 +2764,12 @@ namespace OpenSim.Region.Framework.Scenes if (ParentGroup == null) return; - ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this); - // This was pulled from SceneViewer. Attachments always receive full updates. // I could not verify if this is a requirement but this maintains existing behavior if (ParentGroup.IsAttachment) { ScheduleFullUpdate(); + return; } if (UpdateFlag == UpdateRequired.NONE) @@ -2784,6 +2784,9 @@ namespace OpenSim.Region.Framework.Scenes // "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}", // UUID, Name, TimeStampTerse); } + + if (ParentGroup.Scene != null) + ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this); } public void ScriptSetPhysicsStatus(bool UsePhysics) -- cgit v1.1