aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs122
1 files changed, 55 insertions, 67 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index e985903..732d5ef 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -224,7 +224,7 @@ namespace OpenSim.Region.Framework.Scenes
224 return true; 224 return true;
225 if (!land.LandData.GroupAVSounds) 225 if (!land.LandData.GroupAVSounds)
226 return false; 226 return false;
227 return land.LandData.GroupID == ControllingClient.ActiveGroupId; 227 return ControllingClient.IsGroupMember(land.LandData.GroupID);
228 } 228 }
229 } 229 }
230 catch 230 catch
@@ -1094,6 +1094,8 @@ namespace OpenSim.Region.Framework.Scenes
1094 m_LandingPointBehavior = LandingPointBehavior.SL; 1094 m_LandingPointBehavior = LandingPointBehavior.SL;
1095 } 1095 }
1096 1096
1097 ControllingClient.RefreshGroupMembership();
1098
1097 } 1099 }
1098 1100
1099 private float lastHealthSent = 0; 1101 private float lastHealthSent = 0;
@@ -1978,7 +1980,6 @@ namespace OpenSim.Region.Framework.Scenes
1978 1980
1979 if(!haveGroupInformation && !IsChildAgent && !isNPC) 1981 if(!haveGroupInformation && !IsChildAgent && !isNPC)
1980 { 1982 {
1981 // oh crap.. lets retry it directly
1982 IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); 1983 IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
1983 if (gm != null) 1984 if (gm != null)
1984 Grouptitle = gm.GetGroupTitle(m_uuid); 1985 Grouptitle = gm.GetGroupTitle(m_uuid);
@@ -2195,13 +2196,14 @@ namespace OpenSim.Region.Framework.Scenes
2195 if (friendsModule != null) 2196 if (friendsModule != null)
2196 { 2197 {
2197 if(gotCrossUpdate) 2198 if(gotCrossUpdate)
2198 friendsModule.IsNpwRoot(this); 2199 friendsModule.IsNowRoot(this);
2199 else 2200 else
2200 friendsModule.SendFriendsOnlineIfNeeded(ControllingClient); 2201 friendsModule.SendFriendsOnlineIfNeeded(ControllingClient);
2201 } 2202 }
2202 m_log.DebugFormat("[CompleteMovement] friendsModule: {0}ms", Util.EnvironmentTickCountSubtract(ts)); 2203 m_log.DebugFormat("[CompleteMovement] friendsModule: {0}ms", Util.EnvironmentTickCountSubtract(ts));
2203 2204
2204 } 2205 }
2206
2205 } 2207 }
2206 finally 2208 finally
2207 { 2209 {
@@ -2214,7 +2216,7 @@ namespace OpenSim.Region.Framework.Scenes
2214 // m_currentParcelHide = newhide; 2216 // m_currentParcelHide = newhide;
2215 // } 2217 // }
2216 2218
2217 haveGroupInformation = true; 2219 haveGroupInformation = false;
2218 gotCrossUpdate = false; 2220 gotCrossUpdate = false;
2219 crossingFlags = 0; 2221 crossingFlags = 0;
2220 2222
@@ -4547,24 +4549,12 @@ namespace OpenSim.Region.Framework.Scenes
4547 else 4549 else
4548 cAgent.CrossingFlags = 0; 4550 cAgent.CrossingFlags = 0;
4549 4551
4550 if(isCrossUpdate && haveGroupInformation) 4552 if(isCrossUpdate)
4551 { 4553 {
4552 cAgent.agentCOF = COF; 4554 cAgent.agentCOF = COF;
4553 cAgent.ActiveGroupID = ControllingClient.ActiveGroupId; 4555 cAgent.ActiveGroupID = ControllingClient.ActiveGroupId;
4554 cAgent.ActiveGroupName = ControllingClient.ActiveGroupName; 4556 cAgent.ActiveGroupName = ControllingClient.ActiveGroupName;
4555 cAgent.ActiveGroupTitle = Grouptitle; 4557 cAgent.ActiveGroupTitle = Grouptitle;
4556 Dictionary<UUID, ulong> gpowers = ControllingClient.GetGroupPowers();
4557 if(gpowers.Count >0)
4558 {
4559 cAgent.Groups = new AgentGroupData[gpowers.Count];
4560 int i = 0;
4561 foreach (UUID gid in gpowers.Keys)
4562 {
4563 // WARNING we dont' have AcceptNotices in cache.. sending as true mb no one notices ;)
4564 AgentGroupData agd = new AgentGroupData(gid,gpowers[gid],true);
4565 cAgent.Groups[i++] = agd;
4566 }
4567 }
4568 } 4558 }
4569 } 4559 }
4570 4560
@@ -4661,46 +4651,32 @@ namespace OpenSim.Region.Framework.Scenes
4661 if (Scene.AttachmentsModule != null) 4651 if (Scene.AttachmentsModule != null)
4662 Scene.AttachmentsModule.CopyAttachments(cAgent, this); 4652 Scene.AttachmentsModule.CopyAttachments(cAgent, this);
4663 4653
4664 haveGroupInformation = false; 4654 crossingFlags = cAgent.CrossingFlags;
4655 gotCrossUpdate = (crossingFlags != 0);
4665 4656
4657 haveGroupInformation = false;
4666 // 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
4667 if(cAgent.ActiveGroupTitle != null) 4659 if(cAgent.ActiveGroupTitle != null)
4668 { 4660 {
4661 haveGroupInformation = true;
4669 COF = cAgent.agentCOF; 4662 COF = cAgent.agentCOF;
4670 ControllingClient.ActiveGroupId = cAgent.ActiveGroupID; 4663 if(ControllingClient.IsGroupMember(cAgent.ActiveGroupID))
4671 ControllingClient.ActiveGroupName = cAgent.ActiveGroupName;
4672 ControllingClient.ActiveGroupPowers = 0;
4673 Grouptitle = cAgent.ActiveGroupTitle;
4674
4675 if(cAgent.Groups != null && cAgent.Groups.Length > 0)
4676 { 4664 {
4677 int ngroups = cAgent.Groups.Length; 4665 ControllingClient.ActiveGroupId = cAgent.ActiveGroupID;
4678 Dictionary<UUID, ulong> gpowers = new Dictionary<UUID, ulong>(ngroups); 4666 ControllingClient.ActiveGroupName = cAgent.ActiveGroupName;
4679 for(int i = 0 ; i < ngroups; i++) 4667 Grouptitle = cAgent.ActiveGroupTitle;
4680 { 4668 ControllingClient.ActiveGroupPowers =
4681 AgentGroupData agd = cAgent.Groups[i]; 4669 ControllingClient.GetGroupPowers(cAgent.ActiveGroupID);
4682 gpowers[agd.GroupID] = agd.GroupPowers;
4683 }
4684
4685 ControllingClient.SetGroupPowers(gpowers);
4686
4687 if(cAgent.ActiveGroupID == UUID.Zero)
4688 haveGroupInformation = true;
4689 else if(gpowers.ContainsKey(cAgent.ActiveGroupID))
4690 {
4691 ControllingClient.ActiveGroupPowers = gpowers[cAgent.ActiveGroupID];
4692 haveGroupInformation = true;
4693 }
4694 } 4670 }
4695 else if(cAgent.ActiveGroupID == UUID.Zero) 4671 else
4696 { 4672 {
4697 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);
4698 } 4677 }
4699 } 4678 }
4700 4679
4701 crossingFlags = cAgent.CrossingFlags;
4702 gotCrossUpdate = (crossingFlags != 0);
4703
4704 lock (m_originRegionIDAccessLock) 4680 lock (m_originRegionIDAccessLock)
4705 m_originRegionID = cAgent.RegionID; 4681 m_originRegionID = cAgent.RegionID;
4706 } 4682 }
@@ -6061,7 +6037,11 @@ namespace OpenSim.Region.Framework.Scenes
6061 detobj.posVector = av.AbsolutePosition; 6037 detobj.posVector = av.AbsolutePosition;
6062 detobj.rotQuat = av.Rotation; 6038 detobj.rotQuat = av.Rotation;
6063 detobj.velVector = av.Velocity; 6039 detobj.velVector = av.Velocity;
6064 detobj.colliderType = 0; 6040 detobj.colliderType = av.isNPC ? 0x20 : 0x1; // OpenSim\Region\ScriptEngine\Shared\Helpers.cs
6041 if(av.IsSatOnObject)
6042 detobj.colliderType |= 0x4; //passive
6043 else if(detobj.velVector != Vector3.Zero)
6044 detobj.colliderType |= 0x2; //active
6065 detobj.groupUUID = av.ControllingClient.ActiveGroupId; 6045 detobj.groupUUID = av.ControllingClient.ActiveGroupId;
6066 detobj.linkNumber = 0; 6046 detobj.linkNumber = 0;
6067 6047
@@ -6153,9 +6133,6 @@ namespace OpenSim.Region.Framework.Scenes
6153 List<uint> thisHitColliders = new List<uint>(); 6133 List<uint> thisHitColliders = new List<uint>();
6154 List<uint> endedColliders = new List<uint>(); 6134 List<uint> endedColliders = new List<uint>();
6155 List<uint> startedColliders = new List<uint>(); 6135 List<uint> startedColliders = new List<uint>();
6156 List<CollisionForSoundInfo> soundinfolist = new List<CollisionForSoundInfo>();
6157 CollisionForSoundInfo soundinfo;
6158 ContactPoint curcontact;
6159 6136
6160 if (coldata.Count == 0) 6137 if (coldata.Count == 0)
6161 { 6138 {
@@ -6168,30 +6145,41 @@ namespace OpenSim.Region.Framework.Scenes
6168 } 6145 }
6169 m_lastColliders.Clear(); 6146 m_lastColliders.Clear();
6170 } 6147 }
6171
6172 else 6148 else
6173 { 6149 {
6174 bool candoparcelSound = ParcelAllowThisAvatarSounds; 6150 List<CollisionForSoundInfo> soundinfolist = new List<CollisionForSoundInfo>();
6175 6151 if(ParcelAllowThisAvatarSounds)
6176 foreach (uint id in coldata.Keys)
6177 { 6152 {
6178 thisHitColliders.Add(id); 6153 CollisionForSoundInfo soundinfo;
6179 if (!m_lastColliders.Contains(id)) 6154 ContactPoint curcontact;
6155
6156 foreach (uint id in coldata.Keys)
6180 { 6157 {
6181 startedColliders.Add(id); 6158 thisHitColliders.Add(id);
6182 curcontact = coldata[id]; 6159 if (!m_lastColliders.Contains(id))
6183 if (candoparcelSound && Math.Abs(curcontact.RelativeSpeed) > 0.2)
6184 { 6160 {
6185 soundinfo = new CollisionForSoundInfo(); 6161 startedColliders.Add(id);
6186 soundinfo.colliderID = id; 6162 curcontact = coldata[id];
6187 soundinfo.position = curcontact.Position; 6163 if (Math.Abs(curcontact.RelativeSpeed) > 0.2)
6188 soundinfo.relativeVel = curcontact.RelativeSpeed; 6164 {
6189 soundinfolist.Add(soundinfo); 6165 soundinfo = new CollisionForSoundInfo();
6166 soundinfo.colliderID = id;
6167 soundinfo.position = curcontact.Position;
6168 soundinfo.relativeVel = curcontact.RelativeSpeed;
6169 soundinfolist.Add(soundinfo);
6170 }
6190 } 6171 }
6191 } 6172 }
6192 //m_log.Debug("[SCENE PRESENCE]: Collided with:" + localid.ToString() + " at depth of: " + collissionswith[localid].ToString());
6193 } 6173 }
6194 6174 else
6175 {
6176 foreach (uint id in coldata.Keys)
6177 {
6178 thisHitColliders.Add(id);
6179 if (!m_lastColliders.Contains(id))
6180 startedColliders.Add(id);
6181 }
6182 }
6195 // calculate things that ended colliding 6183 // calculate things that ended colliding
6196 foreach (uint localID in m_lastColliders) 6184 foreach (uint localID in m_lastColliders)
6197 { 6185 {