aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
diff options
context:
space:
mode:
authorMelanie2013-07-24 04:45:07 +0100
committerMelanie2013-07-24 04:45:07 +0100
commite82d4154a2e348e4a38f01cb1877878c94569bba (patch)
tree7b27e6d30d04f6089fd17d5779cfb0a81e50d508 /OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
parentMerge branch 'master' into careminster (diff)
parentFor unknown user issue, bump GUN7 to GUN8 and UMMAU3 to UMMAU4 to assess what... (diff)
downloadopensim-SC-e82d4154a2e348e4a38f01cb1877878c94569bba.zip
opensim-SC-e82d4154a2e348e4a38f01cb1877878c94569bba.tar.gz
opensim-SC-e82d4154a2e348e4a38f01cb1877878c94569bba.tar.bz2
opensim-SC-e82d4154a2e348e4a38f01cb1877878c94569bba.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs OpenSim/Region/Framework/Scenes/ScenePresence.cs OpenSim/Region/Physics/Manager/PhysicsActor.cs OpenSim/Region/Physics/Manager/PhysicsScene.cs
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs30
1 files changed, 24 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index ce6415a..421cb08 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -416,6 +416,7 @@ namespace OpenSim.Region.Framework.Scenes
416 void ProcessViewerEffect(IClientAPI remoteClient, List<ViewerEffectEventHandlerArg> args) 416 void ProcessViewerEffect(IClientAPI remoteClient, List<ViewerEffectEventHandlerArg> args)
417 { 417 {
418 // TODO: don't create new blocks if recycling an old packet 418 // TODO: don't create new blocks if recycling an old packet
419 bool discardableEffects = true;
419 ViewerEffectPacket.EffectBlock[] effectBlockArray = new ViewerEffectPacket.EffectBlock[args.Count]; 420 ViewerEffectPacket.EffectBlock[] effectBlockArray = new ViewerEffectPacket.EffectBlock[args.Count];
420 for (int i = 0; i < args.Count; i++) 421 for (int i = 0; i < args.Count; i++)
421 { 422 {
@@ -427,17 +428,34 @@ namespace OpenSim.Region.Framework.Scenes
427 effect.Type = args[i].Type; 428 effect.Type = args[i].Type;
428 effect.TypeData = args[i].TypeData; 429 effect.TypeData = args[i].TypeData;
429 effectBlockArray[i] = effect; 430 effectBlockArray[i] = effect;
431
432 if ((EffectType)effect.Type != EffectType.LookAt && (EffectType)effect.Type != EffectType.Beam)
433 discardableEffects = false;
434
435 //m_log.DebugFormat("[YYY]: VE {0} {1} {2}", effect.AgentID, effect.Duration, (EffectType)effect.Type);
430 } 436 }
431 437
432 ForEachClient( 438 ForEachScenePresence(sp =>
433 delegate(IClientAPI client)
434 { 439 {
435 if (client.AgentId != remoteClient.AgentId) 440 if (sp.ControllingClient.AgentId != remoteClient.AgentId)
436 client.SendViewerEffect(effectBlockArray); 441 {
437 } 442 if (!discardableEffects ||
438 ); 443 (discardableEffects && ShouldSendDiscardableEffect(remoteClient, sp)))
444 {
445 //m_log.DebugFormat("[YYY]: Sending to {0}", sp.UUID);
446 sp.ControllingClient.SendViewerEffect(effectBlockArray);
447 }
448 //else
449 // m_log.DebugFormat("[YYY]: Not sending to {0}", sp.UUID);
450 }
451 });
439 } 452 }
440 453
454 private bool ShouldSendDiscardableEffect(IClientAPI thisClient, ScenePresence other)
455 {
456 return Vector3.Distance(other.CameraPosition, thisClient.SceneAgent.AbsolutePosition) < 10;
457 }
458
441 private class DescendentsRequestData 459 private class DescendentsRequestData
442 { 460 {
443 public IClientAPI RemoteClient; 461 public IClientAPI RemoteClient;