diff options
author | Melanie | 2010-10-29 21:22:35 +0100 |
---|---|---|
committer | Melanie | 2010-10-29 21:22:35 +0100 |
commit | 69c1e0b2f7cfaa195a8496aff1fb23c24a645c6e (patch) | |
tree | 2a046b787abced2a1e68b1e62831e0b4f3778323 /OpenSim/Region/Framework/Scenes | |
parent | Add my work on top of cmickeyb's (diff) | |
parent | Rename the new default texture to be consistent with the others (diff) | |
download | opensim-SC_OLD-69c1e0b2f7cfaa195a8496aff1fb23c24a645c6e.zip opensim-SC_OLD-69c1e0b2f7cfaa195a8496aff1fb23c24a645c6e.tar.gz opensim-SC_OLD-69c1e0b2f7cfaa195a8496aff1fb23c24a645c6e.tar.bz2 opensim-SC_OLD-69c1e0b2f7cfaa195a8496aff1fb23c24a645c6e.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 7 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 73 |
2 files changed, 57 insertions, 23 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f0f8d55..ae48c02 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -120,6 +120,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
120 | 120 | ||
121 | protected IXMLRPC m_xmlrpcModule; | 121 | protected IXMLRPC m_xmlrpcModule; |
122 | protected IWorldComm m_worldCommModule; | 122 | protected IWorldComm m_worldCommModule; |
123 | protected IAvatarFactory m_AvatarFactory; | ||
123 | protected IConfigSource m_config; | 124 | protected IConfigSource m_config; |
124 | protected IRegionSerialiserModule m_serialiser; | 125 | protected IRegionSerialiserModule m_serialiser; |
125 | protected IDialogModule m_dialogModule; | 126 | protected IDialogModule m_dialogModule; |
@@ -414,6 +415,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
414 | 415 | ||
415 | public IAttachmentsModule AttachmentsModule { get; set; } | 416 | public IAttachmentsModule AttachmentsModule { get; set; } |
416 | 417 | ||
418 | public IAvatarFactory AvatarFactory | ||
419 | { | ||
420 | get { return m_AvatarFactory; } | ||
421 | } | ||
422 | |||
417 | public ICapabilitiesModule CapsModule | 423 | public ICapabilitiesModule CapsModule |
418 | { | 424 | { |
419 | get { return m_capsModule; } | 425 | get { return m_capsModule; } |
@@ -1187,6 +1193,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1187 | m_xmlrpcModule = RequestModuleInterface<IXMLRPC>(); | 1193 | m_xmlrpcModule = RequestModuleInterface<IXMLRPC>(); |
1188 | m_worldCommModule = RequestModuleInterface<IWorldComm>(); | 1194 | m_worldCommModule = RequestModuleInterface<IWorldComm>(); |
1189 | XferManager = RequestModuleInterface<IXfer>(); | 1195 | XferManager = RequestModuleInterface<IXfer>(); |
1196 | m_AvatarFactory = RequestModuleInterface<IAvatarFactory>(); | ||
1190 | AttachmentsModule = RequestModuleInterface<IAttachmentsModule>(); | 1197 | AttachmentsModule = RequestModuleInterface<IAttachmentsModule>(); |
1191 | m_serialiser = RequestModuleInterface<IRegionSerialiserModule>(); | 1198 | m_serialiser = RequestModuleInterface<IRegionSerialiserModule>(); |
1192 | m_dialogModule = RequestModuleInterface<IDialogModule>(); | 1199 | m_dialogModule = RequestModuleInterface<IDialogModule>(); |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 8cbf4dc..dafc1af 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -766,6 +766,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
766 | // we created a new ScenePresence (a new child agent) in a fresh region. | 766 | // we created a new ScenePresence (a new child agent) in a fresh region. |
767 | // Request info about all the (root) agents in this region | 767 | // Request info about all the (root) agents in this region |
768 | // Note: This won't send data *to* other clients in that region (children don't send) | 768 | // Note: This won't send data *to* other clients in that region (children don't send) |
769 | |||
770 | // MIC: This gets called again in CompleteMovement | ||
769 | SendInitialFullUpdateToAllClients(); | 771 | SendInitialFullUpdateToAllClients(); |
770 | RegisterToEvents(); | 772 | RegisterToEvents(); |
771 | if (m_controllingClient != null) | 773 | if (m_controllingClient != null) |
@@ -775,14 +777,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
775 | SetDirectionVectors(); | 777 | SetDirectionVectors(); |
776 | } | 778 | } |
777 | 779 | ||
778 | /* | ||
779 | public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams, | ||
780 | AvatarWearable[] wearables) | ||
781 | : this(client, world, reginfo) | ||
782 | { | ||
783 | m_appearance = new AvatarAppearance(m_uuid, wearables, visualParams); | ||
784 | } | ||
785 | */ | ||
786 | public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, AvatarAppearance appearance) | 780 | public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, AvatarAppearance appearance) |
787 | : this(client, world, reginfo) | 781 | : this(client, world, reginfo) |
788 | { | 782 | { |
@@ -1221,7 +1215,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1221 | /// </summary> | 1215 | /// </summary> |
1222 | public void CompleteMovement(IClientAPI client) | 1216 | public void CompleteMovement(IClientAPI client) |
1223 | { | 1217 | { |
1224 | //m_log.Debug("[SCENE PRESENCE]: CompleteMovement"); | 1218 | // DEBUG ON |
1219 | m_log.WarnFormat("[SCENE PRESENCE]: CompleteMovement for {0}",UUID); | ||
1220 | // DEBUG OFF | ||
1225 | 1221 | ||
1226 | Vector3 look = Velocity; | 1222 | Vector3 look = Velocity; |
1227 | if ((look.X == 0) && (look.Y == 0) && (look.Z == 0)) | 1223 | if ((look.X == 0) && (look.Y == 0) && (look.Z == 0)) |
@@ -2731,12 +2727,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
2731 | // 2 stage check is needed. | 2727 | // 2 stage check is needed. |
2732 | if (remoteAvatar == null) | 2728 | if (remoteAvatar == null) |
2733 | return; | 2729 | return; |
2730 | |||
2734 | IClientAPI cl=remoteAvatar.ControllingClient; | 2731 | IClientAPI cl=remoteAvatar.ControllingClient; |
2735 | if (cl == null) | 2732 | if (cl == null) |
2736 | return; | 2733 | return; |
2734 | |||
2737 | if (m_appearance.Texture == null) | 2735 | if (m_appearance.Texture == null) |
2738 | return; | 2736 | return; |
2739 | 2737 | ||
2738 | if (LocalId == remoteAvatar.LocalId) | ||
2739 | { | ||
2740 | m_log.WarnFormat("[SP] An agent is attempting to send data to itself; {0}",UUID); | ||
2741 | return; | ||
2742 | } | ||
2743 | |||
2740 | if (IsChildAgent) | 2744 | if (IsChildAgent) |
2741 | { | 2745 | { |
2742 | m_log.WarnFormat("[SCENEPRESENCE] A child agent is attempting to send out avatar data"); | 2746 | m_log.WarnFormat("[SCENEPRESENCE] A child agent is attempting to send out avatar data"); |
@@ -2757,20 +2761,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
2757 | m_scene.ForEachScenePresence(delegate(ScenePresence avatar) | 2761 | m_scene.ForEachScenePresence(delegate(ScenePresence avatar) |
2758 | { | 2762 | { |
2759 | ++avUpdates; | 2763 | ++avUpdates; |
2760 | // only send if this is the root (children are only "listening posts" in a foreign region) | 2764 | |
2765 | // Don't update ourselves | ||
2766 | if (avatar.LocalId == LocalId) | ||
2767 | return; | ||
2768 | |||
2769 | // If this is a root agent, then get info about the avatar | ||
2761 | if (!IsChildAgent) | 2770 | if (!IsChildAgent) |
2762 | { | 2771 | { |
2763 | SendFullUpdateToOtherClient(avatar); | 2772 | SendFullUpdateToOtherClient(avatar); |
2764 | } | 2773 | } |
2765 | 2774 | ||
2766 | if (avatar.LocalId != LocalId) | 2775 | // If the other avatar is a root |
2776 | if (!avatar.IsChildAgent) | ||
2767 | { | 2777 | { |
2768 | if (!avatar.IsChildAgent) | 2778 | avatar.SendFullUpdateToOtherClient(this); |
2769 | { | 2779 | avatar.SendAppearanceToOtherAgent(this); |
2770 | avatar.SendFullUpdateToOtherClient(this); | 2780 | avatar.Animator.SendAnimPackToClient(ControllingClient); |
2771 | avatar.SendAppearanceToOtherAgent(this); | ||
2772 | avatar.Animator.SendAnimPackToClient(ControllingClient); | ||
2773 | } | ||
2774 | } | 2781 | } |
2775 | }); | 2782 | }); |
2776 | 2783 | ||
@@ -2815,7 +2822,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
2815 | // m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance); | 2822 | // m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance); |
2816 | 2823 | ||
2817 | m_controllingClient.SendAvatarDataImmediate(this); | 2824 | m_controllingClient.SendAvatarDataImmediate(this); |
2818 | m_controllingClient.SendAppearance(m_appearance.Owner,m_appearance.VisualParams,m_appearance.Texture.GetBytes()); | 2825 | if (m_scene.AvatarFactory != null) |
2826 | { | ||
2827 | if (m_scene.AvatarFactory.ValidateBakedTextureCache(m_controllingClient)) | ||
2828 | { | ||
2829 | m_log.WarnFormat("[SP] baked textures are in the ache for {0}",Name); | ||
2830 | m_controllingClient.SendAppearance( | ||
2831 | m_appearance.Owner,m_appearance.VisualParams,m_appearance.Texture.GetBytes()); | ||
2832 | } | ||
2833 | } | ||
2834 | else | ||
2835 | { | ||
2836 | m_log.WarnFormat("[SP] AvatarFactory not set"); | ||
2837 | } | ||
2819 | 2838 | ||
2820 | SendInitialFullUpdateToAllClients(); | 2839 | SendInitialFullUpdateToAllClients(); |
2821 | } | 2840 | } |
@@ -2847,9 +2866,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
2847 | /// <param name="avatar"></param> | 2866 | /// <param name="avatar"></param> |
2848 | public void SendAppearanceToOtherAgent(ScenePresence avatar) | 2867 | public void SendAppearanceToOtherAgent(ScenePresence avatar) |
2849 | { | 2868 | { |
2869 | if (LocalId == avatar.LocalId) | ||
2870 | { | ||
2871 | m_log.WarnFormat("[SP] An agent is attempting to send data to itself; {0}",UUID); | ||
2872 | return; | ||
2873 | } | ||
2874 | |||
2850 | // DEBUG ON | 2875 | // DEBUG ON |
2851 | m_log.WarnFormat("[SP] Send appearance from {0} to {1}",m_uuid,avatar.ControllingClient.AgentId); | 2876 | // m_log.WarnFormat("[SP] Send appearance from {0} to {1}",m_uuid,avatar.ControllingClient.AgentId); |
2852 | // DEBUG OFF | 2877 | // DEBUG OFF |
2878 | |||
2853 | avatar.ControllingClient.SendAppearance( | 2879 | avatar.ControllingClient.SendAppearance( |
2854 | m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes()); | 2880 | m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes()); |
2855 | } | 2881 | } |
@@ -4225,15 +4251,16 @@ if (m_animator.m_jumping) force.Z = m_animator.m_jumpVelocity; // add for ju | |||
4225 | } | 4251 | } |
4226 | } | 4252 | } |
4227 | 4253 | ||
4228 | List<int> attPoints = m_appearance.GetAttachedPoints(); | 4254 | List<AvatarAttachment> attachments = m_appearance.GetAttachments(); |
4229 | foreach (int p in attPoints) | 4255 | foreach (AvatarAttachment attach in attachments) |
4230 | { | 4256 | { |
4231 | if (m_isDeleted) | 4257 | if (m_isDeleted) |
4232 | return; | 4258 | return; |
4233 | 4259 | ||
4234 | UUID itemID = m_appearance.GetAttachedItem(p); | 4260 | int p = attach.AttachPoint; |
4261 | UUID itemID = attach.ItemID; | ||
4235 | 4262 | ||
4236 | //UUID assetID = m_appearance.GetAttachedAsset(p); | 4263 | //UUID assetID = attach.AssetID; |
4237 | // For some reason assetIDs are being written as Zero's in the DB -- need to track tat down | 4264 | // For some reason assetIDs are being written as Zero's in the DB -- need to track tat down |
4238 | // But they're not used anyway, the item is being looked up for now, so let's proceed. | 4265 | // But they're not used anyway, the item is being looked up for now, so let's proceed. |
4239 | //if (UUID.Zero == assetID) | 4266 | //if (UUID.Zero == assetID) |