From a90079bc92217325f1e284a679288df624b721b3 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 4 Aug 2016 22:54:29 +0100 Subject: [PATCH] cancel sending group powers on crossings, they are no longer needed. --- OpenSim/Framework/ChildAgentDataUpdate.cs | 23 ------ .../Region/Framework/Scenes/ScenePresence.cs | 76 +++++-------------- 2 files changed, 21 insertions(+), 78 deletions(-) diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index 74f18bf677..61c870eb5d 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -358,7 +358,6 @@ namespace OpenSim.Framework public UUID agentCOF; public byte CrossingFlags; - public AgentGroupData[] Groups; public Dictionary ChildrenCapSeeds = null; public Animation[] Anims; public Animation DefaultAnim = null; @@ -436,14 +435,6 @@ namespace OpenSim.Framework if(ActiveGroupTitle != null) args["active_group_title"] = OSD.FromString(ActiveGroupTitle); - if ((Groups != null) && (Groups.Length > 0)) - { - OSDArray groups = new OSDArray(Groups.Length); - foreach (AgentGroupData agd in Groups) - groups.Add(agd.PackUpdateMessage()); - args["groups"] = groups; - } - if (ChildrenCapSeeds != null && ChildrenCapSeeds.Count > 0) { OSDArray childrenSeeds = new OSDArray(ChildrenCapSeeds.Count); @@ -636,20 +627,6 @@ namespace OpenSim.Framework if(args.ContainsKey("active_group_title") && args["active_group_title"] != null) ActiveGroupTitle = args["active_group_title"].AsString(); - if (args.ContainsKey("groups") && (args["groups"] != null) && (args["groups"]).Type == OSDType.Array) - { - OSDArray groups = (OSDArray)(args["groups"]); - Groups = new AgentGroupData[groups.Count]; - int i = 0; - foreach (OSD o in groups) - { - if (o.Type == OSDType.Map) - { - Groups[i++] = new AgentGroupData((OSDMap)o); - } - } - } - if (args.ContainsKey("children_seeds") && (args["children_seeds"] != null) && (args["children_seeds"].Type == OSDType.Array)) { diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 90b0f381b4..5c10345087 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -568,7 +568,7 @@ namespace OpenSim.Region.Framework.Scenes public string Firstname { get; private set; } public string Lastname { get; private set; } - public bool haveGroupInformation; + public bool haveGroupUpdate; public bool gotCrossUpdate; public byte crossingFlags; @@ -1508,7 +1508,7 @@ namespace OpenSim.Region.Framework.Scenes /// public void MakeChildAgent(ulong newRegionHandle) { - haveGroupInformation = false; + haveGroupUpdate = false; gotCrossUpdate = false; crossingFlags = 0; m_scene.EventManager.OnRegionHeartbeatEnd -= RegionHeartbeatEnd; @@ -1978,9 +1978,8 @@ namespace OpenSim.Region.Framework.Scenes m_log.DebugFormat("[CompleteMovement] MakeRootAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); - if(!haveGroupInformation && !IsChildAgent && !isNPC) + if(!haveGroupUpdate && !IsChildAgent && !isNPC) { - // oh crap.. lets retry it directly IGroupsModule gm = m_scene.RequestModuleInterface(); if (gm != null) Grouptitle = gm.GetGroupTitle(m_uuid); @@ -2204,14 +2203,7 @@ namespace OpenSim.Region.Framework.Scenes m_log.DebugFormat("[CompleteMovement] friendsModule: {0}ms", Util.EnvironmentTickCountSubtract(ts)); } - if(gotCrossUpdate) - { - // override group info with authorative data - IGroupsModule gm = m_scene.RequestModuleInterface(); - if (gm != null) - gm.SendAgentGroupDataUpdate(ControllingClient); - m_log.DebugFormat("[CompleteMovement] delayed groups: {0}ms", Util.EnvironmentTickCountSubtract(ts)); - } + } finally { @@ -2224,7 +2216,7 @@ namespace OpenSim.Region.Framework.Scenes // m_currentParcelHide = newhide; // } - haveGroupInformation = true; + haveGroupUpdate = false; gotCrossUpdate = false; crossingFlags = 0; @@ -4557,24 +4549,12 @@ namespace OpenSim.Region.Framework.Scenes else cAgent.CrossingFlags = 0; - if(isCrossUpdate && haveGroupInformation) + if(isCrossUpdate) { cAgent.agentCOF = COF; cAgent.ActiveGroupID = ControllingClient.ActiveGroupId; cAgent.ActiveGroupName = ControllingClient.ActiveGroupName; cAgent.ActiveGroupTitle = Grouptitle; - Dictionary gpowers = ControllingClient.GetGroupPowers(); - if(gpowers.Count >0) - { - cAgent.Groups = new AgentGroupData[gpowers.Count]; - int i = 0; - foreach (UUID gid in gpowers.Keys) - { - // WARNING we dont' have AcceptNotices in cache.. sending as true mb no one notices ;) - AgentGroupData agd = new AgentGroupData(gid,gpowers[gid],true); - cAgent.Groups[i++] = agd; - } - } } } @@ -4671,46 +4651,32 @@ namespace OpenSim.Region.Framework.Scenes if (Scene.AttachmentsModule != null) Scene.AttachmentsModule.CopyAttachments(cAgent, this); - haveGroupInformation = false; + crossingFlags = cAgent.CrossingFlags; + gotCrossUpdate = (crossingFlags != 0); + haveGroupUpdate = false; // using this as protocol detection don't want to mess with the numbers for now if(cAgent.ActiveGroupTitle != null) { + haveGroupUpdate = true; COF = cAgent.agentCOF; - ControllingClient.ActiveGroupId = cAgent.ActiveGroupID; - ControllingClient.ActiveGroupName = cAgent.ActiveGroupName; - ControllingClient.ActiveGroupPowers = 0; - Grouptitle = cAgent.ActiveGroupTitle; - - if(cAgent.Groups != null && cAgent.Groups.Length > 0) + if(ControllingClient.IsGroupMember(cAgent.ActiveGroupID)) { - int ngroups = cAgent.Groups.Length; - Dictionary gpowers = new Dictionary(ngroups); - for(int i = 0 ; i < ngroups; i++) - { - AgentGroupData agd = cAgent.Groups[i]; - gpowers[agd.GroupID] = agd.GroupPowers; - } - - ControllingClient.SetGroupPowers(gpowers); - - if(cAgent.ActiveGroupID == UUID.Zero) - haveGroupInformation = true; - else if(gpowers.ContainsKey(cAgent.ActiveGroupID)) - { - ControllingClient.ActiveGroupPowers = gpowers[cAgent.ActiveGroupID]; - haveGroupInformation = true; - } + ControllingClient.ActiveGroupId = cAgent.ActiveGroupID; + ControllingClient.ActiveGroupName = cAgent.ActiveGroupName; + Grouptitle = cAgent.ActiveGroupTitle; + ControllingClient.ActiveGroupPowers = + ControllingClient.GetGroupPowers(cAgent.ActiveGroupID); } - else if(cAgent.ActiveGroupID == UUID.Zero) + else { - haveGroupInformation = true; + // we got a unknown active group so get what groups thinks about us + IGroupsModule gm = m_scene.RequestModuleInterface(); + if (gm != null) + gm.SendAgentGroupDataUpdate(ControllingClient); } } - crossingFlags = cAgent.CrossingFlags; - gotCrossUpdate = (crossingFlags != 0); - lock (m_originRegionIDAccessLock) m_originRegionID = cAgent.RegionID; }