aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2014-08-01 01:43:12 +0100
committerUbitUmarov2014-08-01 01:43:12 +0100
commite5f9f064a706d6be40e3da075f89b170aeb0ee1d (patch)
tree94f8577ca4980b808112b9bbed3a34cc221dafc0
parentwork on hide avatars (diff)
downloadopensim-SC_OLD-e5f9f064a706d6be40e3da075f89b170aeb0ee1d.zip
opensim-SC_OLD-e5f9f064a706d6be40e3da075f89b170aeb0ee1d.tar.gz
opensim-SC_OLD-e5f9f064a706d6be40e3da075f89b170aeb0ee1d.tar.bz2
opensim-SC_OLD-e5f9f064a706d6be40e3da075f89b170aeb0ee1d.tar.xz
filter local chat from avatars or attachment acording to parcel hide (
not fully tested)
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs37
1 files changed, 34 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
index 5cbfec6..9b41083 100644
--- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
@@ -216,6 +216,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
216 Vector3 regionPos = new Vector3(scene.RegionInfo.RegionLocX * Constants.RegionSize, 216 Vector3 regionPos = new Vector3(scene.RegionInfo.RegionLocX * Constants.RegionSize,
217 scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); 217 scene.RegionInfo.RegionLocY * Constants.RegionSize, 0);
218 218
219 bool checkParcelHide = false;
220 UUID sourceParcelID = UUID.Zero;
221 Vector3 hidePos = fromPos;
222
219 if (c.Channel == DEBUG_CHANNEL) c.Type = ChatTypeEnum.DebugChannel; 223 if (c.Channel == DEBUG_CHANNEL) c.Type = ChatTypeEnum.DebugChannel;
220 224
221 switch (sourceType) 225 switch (sourceType)
@@ -237,15 +241,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
237 } 241 }
238 destination = UUID.Zero; // Avatars cant "SayTo" 242 destination = UUID.Zero; // Avatars cant "SayTo"
239 ownerID = c.Sender.AgentId; 243 ownerID = c.Sender.AgentId;
240 244 checkParcelHide = true;
245 hidePos = fromPos;
241 break; 246 break;
242 247
243 case ChatSourceType.Object: 248 case ChatSourceType.Object:
244 fromID = c.SenderUUID; 249 fromID = c.SenderUUID;
245 250
246 if (c.SenderObject != null && c.SenderObject is SceneObjectPart) 251 if (c.SenderObject != null && c.SenderObject is SceneObjectPart)
252 {
247 ownerID = ((SceneObjectPart)c.SenderObject).OwnerID; 253 ownerID = ((SceneObjectPart)c.SenderObject).OwnerID;
248 254 if (((SceneObjectPart)c.SenderObject).ParentGroup.IsAttachment)
255 {
256 checkParcelHide = true;
257 hidePos = ((SceneObjectPart)c.SenderObject).ParentGroup.AbsolutePosition;
258 }
259 }
249 break; 260 break;
250 } 261 }
251 262
@@ -258,13 +269,28 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
258// fromID, fromName, scene.RegionInfo.RegionName, c.Type, sourceType); 269// fromID, fromName, scene.RegionInfo.RegionName, c.Type, sourceType);
259 270
260 HashSet<UUID> receiverIDs = new HashSet<UUID>(); 271 HashSet<UUID> receiverIDs = new HashSet<UUID>();
261 272
273 if (checkParcelHide)
274 {
275 checkParcelHide = false;
276 if (c.Type < ChatTypeEnum.DebugChannel && destination == UUID.Zero)
277 {
278 ILandObject srcland = (scene as Scene).LandChannel.GetLandObject(hidePos.X, hidePos.Y);
279 if (srcland != null && !srcland.LandData.SeeAVs)
280 {
281 sourceParcelID = srcland.LandData.GlobalID;
282 checkParcelHide = true;
283 }
284 }
285 }
286
262 foreach (Scene s in m_scenes) 287 foreach (Scene s in m_scenes)
263 { 288 {
264 // This should use ForEachClient, but clients don't have a position. 289 // This should use ForEachClient, but clients don't have a position.
265 // If camera is moved into client, then camera position can be used 290 // If camera is moved into client, then camera position can be used
266 // MT: No, it can't, as chat is heard from the avatar position, not 291 // MT: No, it can't, as chat is heard from the avatar position, not
267 // the camera position. 292 // the camera position.
293
268 s.ForEachScenePresence( 294 s.ForEachScenePresence(
269 delegate(ScenePresence presence) 295 delegate(ScenePresence presence)
270 { 296 {
@@ -277,6 +303,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
277 // perfect, but it will do. For now. Better 303 // perfect, but it will do. For now. Better
278 // than the prior behavior of muting all 304 // than the prior behavior of muting all
279 // objects on a parcel with access restrictions 305 // objects on a parcel with access restrictions
306 if (checkParcelHide)
307 {
308 if (sourceParcelID != Presencecheck.LandData.GlobalID)
309 return;
310 }
280 if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true) 311 if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true)
281 { 312 {
282 if (destination != UUID.Zero) 313 if (destination != UUID.Zero)