cancel sending group powers on crossings, they are no longer needed.

LSLKeyTest
UbitUmarov 2016-08-04 22:54:29 +01:00
parent e57d3edf6f
commit a90079bc92
2 changed files with 21 additions and 78 deletions

View File

@ -358,7 +358,6 @@ namespace OpenSim.Framework
public UUID agentCOF; public UUID agentCOF;
public byte CrossingFlags; public byte CrossingFlags;
public AgentGroupData[] Groups;
public Dictionary<ulong, string> ChildrenCapSeeds = null; public Dictionary<ulong, string> ChildrenCapSeeds = null;
public Animation[] Anims; public Animation[] Anims;
public Animation DefaultAnim = null; public Animation DefaultAnim = null;
@ -436,14 +435,6 @@ namespace OpenSim.Framework
if(ActiveGroupTitle != null) if(ActiveGroupTitle != null)
args["active_group_title"] = OSD.FromString(ActiveGroupTitle); 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) if (ChildrenCapSeeds != null && ChildrenCapSeeds.Count > 0)
{ {
OSDArray childrenSeeds = new OSDArray(ChildrenCapSeeds.Count); OSDArray childrenSeeds = new OSDArray(ChildrenCapSeeds.Count);
@ -636,20 +627,6 @@ namespace OpenSim.Framework
if(args.ContainsKey("active_group_title") && args["active_group_title"] != null) if(args.ContainsKey("active_group_title") && args["active_group_title"] != null)
ActiveGroupTitle = args["active_group_title"].AsString(); 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) && if (args.ContainsKey("children_seeds") && (args["children_seeds"] != null) &&
(args["children_seeds"].Type == OSDType.Array)) (args["children_seeds"].Type == OSDType.Array))
{ {

View File

@ -568,7 +568,7 @@ namespace OpenSim.Region.Framework.Scenes
public string Firstname { get; private set; } public string Firstname { get; private set; }
public string Lastname { get; private set; } public string Lastname { get; private set; }
public bool haveGroupInformation; public bool haveGroupUpdate;
public bool gotCrossUpdate; public bool gotCrossUpdate;
public byte crossingFlags; public byte crossingFlags;
@ -1508,7 +1508,7 @@ namespace OpenSim.Region.Framework.Scenes
/// </remarks> /// </remarks>
public void MakeChildAgent(ulong newRegionHandle) public void MakeChildAgent(ulong newRegionHandle)
{ {
haveGroupInformation = false; haveGroupUpdate = false;
gotCrossUpdate = false; gotCrossUpdate = false;
crossingFlags = 0; crossingFlags = 0;
m_scene.EventManager.OnRegionHeartbeatEnd -= RegionHeartbeatEnd; m_scene.EventManager.OnRegionHeartbeatEnd -= RegionHeartbeatEnd;
@ -1978,9 +1978,8 @@ namespace OpenSim.Region.Framework.Scenes
m_log.DebugFormat("[CompleteMovement] MakeRootAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); 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<IGroupsModule>(); IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
if (gm != null) if (gm != null)
Grouptitle = gm.GetGroupTitle(m_uuid); Grouptitle = gm.GetGroupTitle(m_uuid);
@ -2204,14 +2203,7 @@ namespace OpenSim.Region.Framework.Scenes
m_log.DebugFormat("[CompleteMovement] friendsModule: {0}ms", Util.EnvironmentTickCountSubtract(ts)); m_log.DebugFormat("[CompleteMovement] friendsModule: {0}ms", Util.EnvironmentTickCountSubtract(ts));
} }
if(gotCrossUpdate)
{
// override group info with authorative data
IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
if (gm != null)
gm.SendAgentGroupDataUpdate(ControllingClient);
m_log.DebugFormat("[CompleteMovement] delayed groups: {0}ms", Util.EnvironmentTickCountSubtract(ts));
}
} }
finally finally
{ {
@ -2224,7 +2216,7 @@ namespace OpenSim.Region.Framework.Scenes
// m_currentParcelHide = newhide; // m_currentParcelHide = newhide;
// } // }
haveGroupInformation = true; haveGroupUpdate = false;
gotCrossUpdate = false; gotCrossUpdate = false;
crossingFlags = 0; crossingFlags = 0;
@ -4557,24 +4549,12 @@ namespace OpenSim.Region.Framework.Scenes
else else
cAgent.CrossingFlags = 0; cAgent.CrossingFlags = 0;
if(isCrossUpdate && haveGroupInformation) if(isCrossUpdate)
{ {
cAgent.agentCOF = COF; cAgent.agentCOF = COF;
cAgent.ActiveGroupID = ControllingClient.ActiveGroupId; cAgent.ActiveGroupID = ControllingClient.ActiveGroupId;
cAgent.ActiveGroupName = ControllingClient.ActiveGroupName; cAgent.ActiveGroupName = ControllingClient.ActiveGroupName;
cAgent.ActiveGroupTitle = Grouptitle; cAgent.ActiveGroupTitle = Grouptitle;
Dictionary<UUID, ulong> 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,45 +4651,31 @@ namespace OpenSim.Region.Framework.Scenes
if (Scene.AttachmentsModule != null) if (Scene.AttachmentsModule != null)
Scene.AttachmentsModule.CopyAttachments(cAgent, this); 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 // using this as protocol detection don't want to mess with the numbers for now
if(cAgent.ActiveGroupTitle != null) if(cAgent.ActiveGroupTitle != null)
{ {
haveGroupUpdate = true;
COF = cAgent.agentCOF; COF = cAgent.agentCOF;
if(ControllingClient.IsGroupMember(cAgent.ActiveGroupID))
{
ControllingClient.ActiveGroupId = cAgent.ActiveGroupID; ControllingClient.ActiveGroupId = cAgent.ActiveGroupID;
ControllingClient.ActiveGroupName = cAgent.ActiveGroupName; ControllingClient.ActiveGroupName = cAgent.ActiveGroupName;
ControllingClient.ActiveGroupPowers = 0;
Grouptitle = cAgent.ActiveGroupTitle; Grouptitle = cAgent.ActiveGroupTitle;
ControllingClient.ActiveGroupPowers =
if(cAgent.Groups != null && cAgent.Groups.Length > 0) ControllingClient.GetGroupPowers(cAgent.ActiveGroupID);
}
else
{ {
int ngroups = cAgent.Groups.Length; // we got a unknown active group so get what groups thinks about us
Dictionary<UUID, ulong> gpowers = new Dictionary<UUID, ulong>(ngroups); IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
for(int i = 0 ; i < ngroups; i++) if (gm != null)
{ gm.SendAgentGroupDataUpdate(ControllingClient);
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;
} }
} }
else if(cAgent.ActiveGroupID == UUID.Zero)
{
haveGroupInformation = true;
}
}
crossingFlags = cAgent.CrossingFlags;
gotCrossUpdate = (crossingFlags != 0);
lock (m_originRegionIDAccessLock) lock (m_originRegionIDAccessLock)
m_originRegionID = cAgent.RegionID; m_originRegionID = cAgent.RegionID;