diff options
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 53 |
1 files changed, 40 insertions, 13 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6208416..e3e8871 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1912,6 +1912,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1912 | return; | 1912 | return; |
1913 | sog.SendFullUpdateToClient(p.ControllingClient); | 1913 | sog.SendFullUpdateToClient(p.ControllingClient); |
1914 | SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path | 1914 | SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path |
1915 | SendTerseUpdateToAgent(p); | ||
1915 | }); | 1916 | }); |
1916 | 1917 | ||
1917 | sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); | 1918 | sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); |
@@ -3370,11 +3371,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
3370 | 3371 | ||
3371 | #region Update Client(s) | 3372 | #region Update Client(s) |
3372 | 3373 | ||
3373 | // this is diferente from SendTerseUpdateToClient | 3374 | public void SendUpdateToAgent(ScenePresence p) |
3374 | // this sends bypassing ententies updates | ||
3375 | public void SendAgentTerseUpdate(ISceneEntity p) | ||
3376 | { | 3375 | { |
3377 | ControllingClient.SendAgentTerseUpdate(p); | 3376 | IClientAPI remoteClient = p.ControllingClient; |
3377 | |||
3378 | if (remoteClient.IsActive) | ||
3379 | { | ||
3380 | //m_log.DebugFormat("[SCENE PRESENCE]: " + Name + " sending TerseUpdate to " + remoteClient.Name + " : Pos={0} Rot={1} Vel={2}", m_pos, Rotation, m_velocity); | ||
3381 | remoteClient.SendEntityUpdate(this, PrimUpdateFlags.FullUpdate); | ||
3382 | m_scene.StatsReporter.AddAgentUpdates(1); | ||
3383 | } | ||
3378 | } | 3384 | } |
3379 | 3385 | ||
3380 | public void SendFullUpdateToClient(IClientAPI remoteClient) | 3386 | public void SendFullUpdateToClient(IClientAPI remoteClient) |
@@ -3387,6 +3393,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
3387 | } | 3393 | } |
3388 | } | 3394 | } |
3389 | 3395 | ||
3396 | // this is diferente from SendTerseUpdateToClient | ||
3397 | // this sends bypassing entities updates | ||
3398 | public void SendAgentTerseUpdate(ISceneEntity p) | ||
3399 | { | ||
3400 | ControllingClient.SendAgentTerseUpdate(p); | ||
3401 | } | ||
3402 | |||
3390 | /// <summary> | 3403 | /// <summary> |
3391 | /// Sends a location update to the client connected to this scenePresence | 3404 | /// Sends a location update to the client connected to this scenePresence |
3392 | /// via entity updates | 3405 | /// via entity updates |
@@ -3408,7 +3421,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3408 | } | 3421 | } |
3409 | } | 3422 | } |
3410 | 3423 | ||
3411 | public void SendTerseUpdateToAgentClient(ScenePresence p) | 3424 | public void SendTerseUpdateToAgent(ScenePresence p) |
3412 | { | 3425 | { |
3413 | IClientAPI remoteClient = p.ControllingClient; | 3426 | IClientAPI remoteClient = p.ControllingClient; |
3414 | 3427 | ||
@@ -3427,6 +3440,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
3427 | m_scene.StatsReporter.AddAgentUpdates(1); | 3440 | m_scene.StatsReporter.AddAgentUpdates(1); |
3428 | } | 3441 | } |
3429 | 3442 | ||
3443 | public void SendTerseUpdateToAgentNF(ScenePresence p) | ||
3444 | { | ||
3445 | IClientAPI remoteClient = p.ControllingClient; | ||
3446 | if (remoteClient.IsActive) | ||
3447 | { | ||
3448 | //m_log.DebugFormat("[SCENE PRESENCE]: " + Name + " sending TerseUpdate to " + remoteClient.Name + " : Pos={0} Rot={1} Vel={2}", m_pos, Rotation, m_velocity); | ||
3449 | remoteClient.SendEntityUpdate(this, PrimUpdateFlags.FullUpdate); | ||
3450 | m_scene.StatsReporter.AddAgentUpdates(1); | ||
3451 | } | ||
3452 | } | ||
3453 | |||
3454 | |||
3430 | // vars to support reduced update frequency when velocity is unchanged | 3455 | // vars to support reduced update frequency when velocity is unchanged |
3431 | private Vector3 lastVelocitySentToAllClients = Vector3.Zero; | 3456 | private Vector3 lastVelocitySentToAllClients = Vector3.Zero; |
3432 | private Vector3 lastPositionSentToAllClients = Vector3.Zero; | 3457 | private Vector3 lastPositionSentToAllClients = Vector3.Zero; |
@@ -3468,7 +3493,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3468 | 3493 | ||
3469 | // Console.WriteLine("Scheduled update for {0} in {1}", Name, Scene.Name); | 3494 | // Console.WriteLine("Scheduled update for {0} in {1}", Name, Scene.Name); |
3470 | // m_scene.ForEachClient(SendTerseUpdateToClient); | 3495 | // m_scene.ForEachClient(SendTerseUpdateToClient); |
3471 | m_scene.ForEachScenePresence(SendTerseUpdateToAgentClient); | 3496 | m_scene.ForEachScenePresence(SendTerseUpdateToAgent); |
3472 | } | 3497 | } |
3473 | TriggerScenePresenceUpdated(); | 3498 | TriggerScenePresenceUpdated(); |
3474 | } | 3499 | } |
@@ -5487,13 +5512,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
5487 | { | 5512 | { |
5488 | if (p.IsChildAgent) | 5513 | if (p.IsChildAgent) |
5489 | continue; | 5514 | continue; |
5490 | m_log.Debug("[AVATAR]: viewMe: " + Lastname + " " + p.Lastname); | 5515 | |
5491 | ControllingClient.SendAvatarDataImmediate(p); | 5516 | p.SendUpdateToAgent(this); |
5517 | p.SendAgentTerseUpdate(this); | ||
5492 | p.SendAppearanceToAgent(this); | 5518 | p.SendAppearanceToAgent(this); |
5493 | p.SendAttachmentsToAgentNF(this); | ||
5494 | if (p.Animator != null) | 5519 | if (p.Animator != null) |
5495 | p.Animator.SendAnimPackToClient(ControllingClient); | 5520 | p.Animator.SendAnimPackToClient(ControllingClient); |
5496 | 5521 | p.SendAttachmentsToAgentNF(this); | |
5497 | } | 5522 | } |
5498 | } | 5523 | } |
5499 | } | 5524 | } |
@@ -5804,8 +5829,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
5804 | { | 5829 | { |
5805 | foreach (ScenePresence p in viewsToSendto) | 5830 | foreach (ScenePresence p in viewsToSendto) |
5806 | { | 5831 | { |
5807 | p.ControllingClient.SendAvatarDataImmediate(this); | 5832 | SendUpdateToAgent(p); |
5808 | // m_log.Debug("[AVATAR]: viewTo: " + Lastname + " " + p.Lastname); | 5833 | SendAgentTerseUpdate(p); |
5809 | SendAppearanceToAgent(p); | 5834 | SendAppearanceToAgent(p); |
5810 | if (Animator != null) | 5835 | if (Animator != null) |
5811 | Animator.SendAnimPackToClient(p.ControllingClient); | 5836 | Animator.SendAnimPackToClient(p.ControllingClient); |
@@ -5820,7 +5845,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
5820 | if (p.IsChildAgent) | 5845 | if (p.IsChildAgent) |
5821 | continue; | 5846 | continue; |
5822 | // m_log.Debug("[AVATAR]: viewMe: " + Lastname + "<-" + p.Lastname); | 5847 | // m_log.Debug("[AVATAR]: viewMe: " + Lastname + "<-" + p.Lastname); |
5823 | ControllingClient.SendAvatarDataImmediate(p); | 5848 | |
5849 | p.SendUpdateToAgent(this); | ||
5850 | p.SendAgentTerseUpdate(this); | ||
5824 | p.SendAppearanceToAgent(this); | 5851 | p.SendAppearanceToAgent(this); |
5825 | if (p.Animator != null) | 5852 | if (p.Animator != null) |
5826 | p.Animator.SendAnimPackToClient(ControllingClient); | 5853 | p.Animator.SendAnimPackToClient(ControllingClient); |