diff options
author | UbitUmarov | 2016-08-04 22:54:29 +0100 |
---|---|---|
committer | UbitUmarov | 2016-08-04 22:54:29 +0100 |
commit | a90079bc92217325f1e284a679288df624b721b3 (patch) | |
tree | 3a17bbeaaa2f74137f7ce7dbc183384f5df8172f /OpenSim/Region/Framework/Scenes/ScenePresence.cs | |
parent | make sure all new scenepresences have fresh groups information at creation ti... (diff) | |
download | opensim-SC_OLD-a90079bc92217325f1e284a679288df624b721b3.zip opensim-SC_OLD-a90079bc92217325f1e284a679288df624b721b3.tar.gz opensim-SC_OLD-a90079bc92217325f1e284a679288df624b721b3.tar.bz2 opensim-SC_OLD-a90079bc92217325f1e284a679288df624b721b3.tar.xz |
cancel sending group powers on crossings, they are no longer needed.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 76 |
1 files changed, 21 insertions, 55 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 90b0f38..5c10345 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -568,7 +568,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
568 | public string Firstname { get; private set; } | 568 | public string Firstname { get; private set; } |
569 | public string Lastname { get; private set; } | 569 | public string Lastname { get; private set; } |
570 | 570 | ||
571 | public bool haveGroupInformation; | 571 | public bool haveGroupUpdate; |
572 | public bool gotCrossUpdate; | 572 | public bool gotCrossUpdate; |
573 | public byte crossingFlags; | 573 | public byte crossingFlags; |
574 | 574 | ||
@@ -1508,7 +1508,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1508 | /// </remarks> | 1508 | /// </remarks> |
1509 | public void MakeChildAgent(ulong newRegionHandle) | 1509 | public void MakeChildAgent(ulong newRegionHandle) |
1510 | { | 1510 | { |
1511 | haveGroupInformation = false; | 1511 | haveGroupUpdate = false; |
1512 | gotCrossUpdate = false; | 1512 | gotCrossUpdate = false; |
1513 | crossingFlags = 0; | 1513 | crossingFlags = 0; |
1514 | m_scene.EventManager.OnRegionHeartbeatEnd -= RegionHeartbeatEnd; | 1514 | m_scene.EventManager.OnRegionHeartbeatEnd -= RegionHeartbeatEnd; |
@@ -1978,9 +1978,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1978 | 1978 | ||
1979 | m_log.DebugFormat("[CompleteMovement] MakeRootAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 1979 | m_log.DebugFormat("[CompleteMovement] MakeRootAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
1980 | 1980 | ||
1981 | if(!haveGroupInformation && !IsChildAgent && !isNPC) | 1981 | if(!haveGroupUpdate && !IsChildAgent && !isNPC) |
1982 | { | 1982 | { |
1983 | // oh crap.. lets retry it directly | ||
1984 | IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); | 1983 | IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); |
1985 | if (gm != null) | 1984 | if (gm != null) |
1986 | Grouptitle = gm.GetGroupTitle(m_uuid); | 1985 | Grouptitle = gm.GetGroupTitle(m_uuid); |
@@ -2204,14 +2203,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2204 | m_log.DebugFormat("[CompleteMovement] friendsModule: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2203 | m_log.DebugFormat("[CompleteMovement] friendsModule: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
2205 | 2204 | ||
2206 | } | 2205 | } |
2207 | if(gotCrossUpdate) | 2206 | |
2208 | { | ||
2209 | // override group info with authorative data | ||
2210 | IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); | ||
2211 | if (gm != null) | ||
2212 | gm.SendAgentGroupDataUpdate(ControllingClient); | ||
2213 | m_log.DebugFormat("[CompleteMovement] delayed groups: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2214 | } | ||
2215 | } | 2207 | } |
2216 | finally | 2208 | finally |
2217 | { | 2209 | { |
@@ -2224,7 +2216,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2224 | // m_currentParcelHide = newhide; | 2216 | // m_currentParcelHide = newhide; |
2225 | // } | 2217 | // } |
2226 | 2218 | ||
2227 | haveGroupInformation = true; | 2219 | haveGroupUpdate = false; |
2228 | gotCrossUpdate = false; | 2220 | gotCrossUpdate = false; |
2229 | crossingFlags = 0; | 2221 | crossingFlags = 0; |
2230 | 2222 | ||
@@ -4557,24 +4549,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
4557 | else | 4549 | else |
4558 | cAgent.CrossingFlags = 0; | 4550 | cAgent.CrossingFlags = 0; |
4559 | 4551 | ||
4560 | if(isCrossUpdate && haveGroupInformation) | 4552 | if(isCrossUpdate) |
4561 | { | 4553 | { |
4562 | cAgent.agentCOF = COF; | 4554 | cAgent.agentCOF = COF; |
4563 | cAgent.ActiveGroupID = ControllingClient.ActiveGroupId; | 4555 | cAgent.ActiveGroupID = ControllingClient.ActiveGroupId; |
4564 | cAgent.ActiveGroupName = ControllingClient.ActiveGroupName; | 4556 | cAgent.ActiveGroupName = ControllingClient.ActiveGroupName; |
4565 | cAgent.ActiveGroupTitle = Grouptitle; | 4557 | cAgent.ActiveGroupTitle = Grouptitle; |
4566 | Dictionary<UUID, ulong> gpowers = ControllingClient.GetGroupPowers(); | ||
4567 | if(gpowers.Count >0) | ||
4568 | { | ||
4569 | cAgent.Groups = new AgentGroupData[gpowers.Count]; | ||
4570 | int i = 0; | ||
4571 | foreach (UUID gid in gpowers.Keys) | ||
4572 | { | ||
4573 | // WARNING we dont' have AcceptNotices in cache.. sending as true mb no one notices ;) | ||
4574 | AgentGroupData agd = new AgentGroupData(gid,gpowers[gid],true); | ||
4575 | cAgent.Groups[i++] = agd; | ||
4576 | } | ||
4577 | } | ||
4578 | } | 4558 | } |
4579 | } | 4559 | } |
4580 | 4560 | ||
@@ -4671,46 +4651,32 @@ namespace OpenSim.Region.Framework.Scenes | |||
4671 | if (Scene.AttachmentsModule != null) | 4651 | if (Scene.AttachmentsModule != null) |
4672 | Scene.AttachmentsModule.CopyAttachments(cAgent, this); | 4652 | Scene.AttachmentsModule.CopyAttachments(cAgent, this); |
4673 | 4653 | ||
4674 | haveGroupInformation = false; | 4654 | crossingFlags = cAgent.CrossingFlags; |
4655 | gotCrossUpdate = (crossingFlags != 0); | ||
4675 | 4656 | ||
4657 | haveGroupUpdate = false; | ||
4676 | // using this as protocol detection don't want to mess with the numbers for now | 4658 | // using this as protocol detection don't want to mess with the numbers for now |
4677 | if(cAgent.ActiveGroupTitle != null) | 4659 | if(cAgent.ActiveGroupTitle != null) |
4678 | { | 4660 | { |
4661 | haveGroupUpdate = true; | ||
4679 | COF = cAgent.agentCOF; | 4662 | COF = cAgent.agentCOF; |
4680 | ControllingClient.ActiveGroupId = cAgent.ActiveGroupID; | 4663 | if(ControllingClient.IsGroupMember(cAgent.ActiveGroupID)) |
4681 | ControllingClient.ActiveGroupName = cAgent.ActiveGroupName; | ||
4682 | ControllingClient.ActiveGroupPowers = 0; | ||
4683 | Grouptitle = cAgent.ActiveGroupTitle; | ||
4684 | |||
4685 | if(cAgent.Groups != null && cAgent.Groups.Length > 0) | ||
4686 | { | 4664 | { |
4687 | int ngroups = cAgent.Groups.Length; | 4665 | ControllingClient.ActiveGroupId = cAgent.ActiveGroupID; |
4688 | Dictionary<UUID, ulong> gpowers = new Dictionary<UUID, ulong>(ngroups); | 4666 | ControllingClient.ActiveGroupName = cAgent.ActiveGroupName; |
4689 | for(int i = 0 ; i < ngroups; i++) | 4667 | Grouptitle = cAgent.ActiveGroupTitle; |
4690 | { | 4668 | ControllingClient.ActiveGroupPowers = |
4691 | AgentGroupData agd = cAgent.Groups[i]; | 4669 | ControllingClient.GetGroupPowers(cAgent.ActiveGroupID); |
4692 | gpowers[agd.GroupID] = agd.GroupPowers; | ||
4693 | } | ||
4694 | |||
4695 | ControllingClient.SetGroupPowers(gpowers); | ||
4696 | |||
4697 | if(cAgent.ActiveGroupID == UUID.Zero) | ||
4698 | haveGroupInformation = true; | ||
4699 | else if(gpowers.ContainsKey(cAgent.ActiveGroupID)) | ||
4700 | { | ||
4701 | ControllingClient.ActiveGroupPowers = gpowers[cAgent.ActiveGroupID]; | ||
4702 | haveGroupInformation = true; | ||
4703 | } | ||
4704 | } | 4670 | } |
4705 | else if(cAgent.ActiveGroupID == UUID.Zero) | 4671 | else |
4706 | { | 4672 | { |
4707 | haveGroupInformation = true; | 4673 | // we got a unknown active group so get what groups thinks about us |
4674 | IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); | ||
4675 | if (gm != null) | ||
4676 | gm.SendAgentGroupDataUpdate(ControllingClient); | ||
4708 | } | 4677 | } |
4709 | } | 4678 | } |
4710 | 4679 | ||
4711 | crossingFlags = cAgent.CrossingFlags; | ||
4712 | gotCrossUpdate = (crossingFlags != 0); | ||
4713 | |||
4714 | lock (m_originRegionIDAccessLock) | 4680 | lock (m_originRegionIDAccessLock) |
4715 | m_originRegionID = cAgent.RegionID; | 4681 | m_originRegionID = cAgent.RegionID; |
4716 | } | 4682 | } |