diff options
author | Melanie | 2010-10-29 21:06:46 +0100 |
---|---|---|
committer | Melanie | 2010-10-29 21:06:46 +0100 |
commit | 934e53673856876762df27c7880df30df633ccd3 (patch) | |
tree | b50129669f9d7f725cf63db1df60c600b8da9f0c /OpenSim/Region/Framework/Scenes/ScenePresence.cs | |
parent | Add my work on top of cmickeyb's (diff) | |
parent | Clean up some cruft from the last commit. Re-add the initial update (diff) | |
download | opensim-SC_OLD-934e53673856876762df27c7880df30df633ccd3.zip opensim-SC_OLD-934e53673856876762df27c7880df30df633ccd3.tar.gz opensim-SC_OLD-934e53673856876762df27c7880df30df633ccd3.tar.bz2 opensim-SC_OLD-934e53673856876762df27c7880df30df633ccd3.tar.xz |
Merge commit 'cmickeyb/dev-appearance'
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 73 |
1 files changed, 50 insertions, 23 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6576e64..9402f8b 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -704,20 +704,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
704 | // we created a new ScenePresence (a new child agent) in a fresh region. | 704 | // we created a new ScenePresence (a new child agent) in a fresh region. |
705 | // Request info about all the (root) agents in this region | 705 | // Request info about all the (root) agents in this region |
706 | // Note: This won't send data *to* other clients in that region (children don't send) | 706 | // Note: This won't send data *to* other clients in that region (children don't send) |
707 | |||
708 | // MIC: This gets called again in CompleteMovement | ||
707 | SendInitialFullUpdateToAllClients(); | 709 | SendInitialFullUpdateToAllClients(); |
708 | 710 | ||
709 | RegisterToEvents(); | 711 | RegisterToEvents(); |
710 | SetDirectionVectors(); | 712 | SetDirectionVectors(); |
711 | } | 713 | } |
712 | 714 | ||
713 | /* | ||
714 | public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams, | ||
715 | AvatarWearable[] wearables) | ||
716 | : this(client, world, reginfo) | ||
717 | { | ||
718 | m_appearance = new AvatarAppearance(m_uuid, wearables, visualParams); | ||
719 | } | ||
720 | */ | ||
721 | public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, AvatarAppearance appearance) | 715 | public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, AvatarAppearance appearance) |
722 | : this(client, world, reginfo) | 716 | : this(client, world, reginfo) |
723 | { | 717 | { |
@@ -1081,7 +1075,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1081 | /// </summary> | 1075 | /// </summary> |
1082 | public void CompleteMovement(IClientAPI client) | 1076 | public void CompleteMovement(IClientAPI client) |
1083 | { | 1077 | { |
1084 | //m_log.Debug("[SCENE PRESENCE]: CompleteMovement"); | 1078 | // DEBUG ON |
1079 | m_log.WarnFormat("[SCENE PRESENCE]: CompleteMovement for {0}",UUID); | ||
1080 | // DEBUG OFF | ||
1085 | 1081 | ||
1086 | Vector3 look = Velocity; | 1082 | Vector3 look = Velocity; |
1087 | if ((look.X == 0) && (look.Y == 0) && (look.Z == 0)) | 1083 | if ((look.X == 0) && (look.Y == 0) && (look.Z == 0)) |
@@ -2381,12 +2377,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
2381 | // 2 stage check is needed. | 2377 | // 2 stage check is needed. |
2382 | if (remoteAvatar == null) | 2378 | if (remoteAvatar == null) |
2383 | return; | 2379 | return; |
2380 | |||
2384 | IClientAPI cl=remoteAvatar.ControllingClient; | 2381 | IClientAPI cl=remoteAvatar.ControllingClient; |
2385 | if (cl == null) | 2382 | if (cl == null) |
2386 | return; | 2383 | return; |
2384 | |||
2387 | if (m_appearance.Texture == null) | 2385 | if (m_appearance.Texture == null) |
2388 | return; | 2386 | return; |
2389 | 2387 | ||
2388 | if (LocalId == remoteAvatar.LocalId) | ||
2389 | { | ||
2390 | m_log.WarnFormat("[SP] An agent is attempting to send data to itself; {0}",UUID); | ||
2391 | return; | ||
2392 | } | ||
2393 | |||
2390 | if (IsChildAgent) | 2394 | if (IsChildAgent) |
2391 | { | 2395 | { |
2392 | m_log.WarnFormat("[SCENEPRESENCE] A child agent is attempting to send out avatar data"); | 2396 | m_log.WarnFormat("[SCENEPRESENCE] A child agent is attempting to send out avatar data"); |
@@ -2407,20 +2411,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
2407 | m_scene.ForEachScenePresence(delegate(ScenePresence avatar) | 2411 | m_scene.ForEachScenePresence(delegate(ScenePresence avatar) |
2408 | { | 2412 | { |
2409 | ++avUpdates; | 2413 | ++avUpdates; |
2410 | // only send if this is the root (children are only "listening posts" in a foreign region) | 2414 | |
2415 | // Don't update ourselves | ||
2416 | if (avatar.LocalId == LocalId) | ||
2417 | return; | ||
2418 | |||
2419 | // If this is a root agent, then get info about the avatar | ||
2411 | if (!IsChildAgent) | 2420 | if (!IsChildAgent) |
2412 | { | 2421 | { |
2413 | SendFullUpdateToOtherClient(avatar); | 2422 | SendFullUpdateToOtherClient(avatar); |
2414 | } | 2423 | } |
2415 | 2424 | ||
2416 | if (avatar.LocalId != LocalId) | 2425 | // If the other avatar is a root |
2426 | if (!avatar.IsChildAgent) | ||
2417 | { | 2427 | { |
2418 | if (!avatar.IsChildAgent) | 2428 | avatar.SendFullUpdateToOtherClient(this); |
2419 | { | 2429 | avatar.SendAppearanceToOtherAgent(this); |
2420 | avatar.SendFullUpdateToOtherClient(this); | 2430 | avatar.Animator.SendAnimPackToClient(ControllingClient); |
2421 | avatar.SendAppearanceToOtherAgent(this); | ||
2422 | avatar.Animator.SendAnimPackToClient(ControllingClient); | ||
2423 | } | ||
2424 | } | 2431 | } |
2425 | }); | 2432 | }); |
2426 | 2433 | ||
@@ -2465,7 +2472,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
2465 | // m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance); | 2472 | // m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance); |
2466 | 2473 | ||
2467 | m_controllingClient.SendAvatarDataImmediate(this); | 2474 | m_controllingClient.SendAvatarDataImmediate(this); |
2468 | m_controllingClient.SendAppearance(m_appearance.Owner,m_appearance.VisualParams,m_appearance.Texture.GetBytes()); | 2475 | if (m_scene.AvatarFactory != null) |
2476 | { | ||
2477 | if (m_scene.AvatarFactory.ValidateBakedTextureCache(m_controllingClient)) | ||
2478 | { | ||
2479 | m_log.WarnFormat("[SP] baked textures are in the ache for {0}",Name); | ||
2480 | m_controllingClient.SendAppearance( | ||
2481 | m_appearance.Owner,m_appearance.VisualParams,m_appearance.Texture.GetBytes()); | ||
2482 | } | ||
2483 | } | ||
2484 | else | ||
2485 | { | ||
2486 | m_log.WarnFormat("[SP] AvatarFactory not set"); | ||
2487 | } | ||
2469 | 2488 | ||
2470 | SendInitialFullUpdateToAllClients(); | 2489 | SendInitialFullUpdateToAllClients(); |
2471 | } | 2490 | } |
@@ -2497,9 +2516,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
2497 | /// <param name="avatar"></param> | 2516 | /// <param name="avatar"></param> |
2498 | public void SendAppearanceToOtherAgent(ScenePresence avatar) | 2517 | public void SendAppearanceToOtherAgent(ScenePresence avatar) |
2499 | { | 2518 | { |
2519 | if (LocalId == avatar.LocalId) | ||
2520 | { | ||
2521 | m_log.WarnFormat("[SP] An agent is attempting to send data to itself; {0}",UUID); | ||
2522 | return; | ||
2523 | } | ||
2524 | |||
2500 | // DEBUG ON | 2525 | // DEBUG ON |
2501 | m_log.WarnFormat("[SP] Send appearance from {0} to {1}",m_uuid,avatar.ControllingClient.AgentId); | 2526 | // m_log.WarnFormat("[SP] Send appearance from {0} to {1}",m_uuid,avatar.ControllingClient.AgentId); |
2502 | // DEBUG OFF | 2527 | // DEBUG OFF |
2528 | |||
2503 | avatar.ControllingClient.SendAppearance( | 2529 | avatar.ControllingClient.SendAppearance( |
2504 | m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes()); | 2530 | m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes()); |
2505 | } | 2531 | } |
@@ -3656,15 +3682,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
3656 | return; | 3682 | return; |
3657 | } | 3683 | } |
3658 | 3684 | ||
3659 | List<int> attPoints = m_appearance.GetAttachedPoints(); | 3685 | List<AvatarAttachment> attachments = m_appearance.GetAttachments(); |
3660 | foreach (int p in attPoints) | 3686 | foreach (AvatarAttachment attach in attachments) |
3661 | { | 3687 | { |
3662 | if (m_isDeleted) | 3688 | if (m_isDeleted) |
3663 | return; | 3689 | return; |
3664 | 3690 | ||
3665 | UUID itemID = m_appearance.GetAttachedItem(p); | 3691 | int p = attach.AttachPoint; |
3692 | UUID itemID = attach.ItemID; | ||
3666 | 3693 | ||
3667 | //UUID assetID = m_appearance.GetAttachedAsset(p); | 3694 | //UUID assetID = attach.AssetID; |
3668 | // For some reason assetIDs are being written as Zero's in the DB -- need to track tat down | 3695 | // For some reason assetIDs are being written as Zero's in the DB -- need to track tat down |
3669 | // But they're not used anyway, the item is being looked up for now, so let's proceed. | 3696 | // But they're not used anyway, the item is being looked up for now, so let's proceed. |
3670 | //if (UUID.Zero == assetID) | 3697 | //if (UUID.Zero == assetID) |