diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 59 |
1 files changed, 47 insertions, 12 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index a85a4b3..19ff288 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1259,16 +1259,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
1259 | /// Tell all scene presences that they should send updates for this part to their clients | 1259 | /// Tell all scene presences that they should send updates for this part to their clients |
1260 | /// </summary> | 1260 | /// </summary> |
1261 | public void AddFullUpdateToAllAvatars() | 1261 | public void AddFullUpdateToAllAvatars() |
1262 | { | 1262 | { |
1263 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 1263 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); |
1264 | for (int i = 0; i < avatars.Length; i++) | 1264 | for (int i = 0; i < avatars.Length; i++) |
1265 | { | 1265 | AddFullUpdateToAvatar(avatars[i]); |
1266 | avatars[i].SceneViewer.QueuePartForUpdate(this); | ||
1267 | } | ||
1268 | } | 1266 | } |
1269 | 1267 | ||
1270 | public void AddFullUpdateToAvatar(ScenePresence presence) | 1268 | public void AddFullUpdateToAvatar(ScenePresence presence) |
1271 | { | 1269 | { |
1270 | // if (IsAttachment) | ||
1271 | // m_log.DebugFormat("AddFullUpdateToAllAvatar() {0} for {1} {2}", presence.Name, Name, LocalId); | ||
1272 | |||
1272 | presence.SceneViewer.QueuePartForUpdate(this); | 1273 | presence.SceneViewer.QueuePartForUpdate(this); |
1273 | } | 1274 | } |
1274 | 1275 | ||
@@ -1287,13 +1288,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1287 | { | 1288 | { |
1288 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 1289 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); |
1289 | for (int i = 0; i < avatars.Length; i++) | 1290 | for (int i = 0; i < avatars.Length; i++) |
1290 | { | 1291 | AddTerseUpdateToAvatar(avatars[i]); |
1291 | avatars[i].SceneViewer.QueuePartForUpdate(this); | ||
1292 | } | ||
1293 | } | 1292 | } |
1294 | 1293 | ||
1295 | public void AddTerseUpdateToAvatar(ScenePresence presence) | 1294 | public void AddTerseUpdateToAvatar(ScenePresence presence) |
1296 | { | 1295 | { |
1296 | // if (IsAttachment) | ||
1297 | // m_log.DebugFormat("AddTerseUpdateToAvatar() {0} for {1} {2}", presence.Name, Name, LocalId); | ||
1298 | |||
1297 | presence.SceneViewer.QueuePartForUpdate(this); | 1299 | presence.SceneViewer.QueuePartForUpdate(this); |
1298 | } | 1300 | } |
1299 | 1301 | ||
@@ -2727,7 +2729,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2727 | /// </summary> | 2729 | /// </summary> |
2728 | public void ScheduleFullUpdate() | 2730 | public void ScheduleFullUpdate() |
2729 | { | 2731 | { |
2730 | // m_log.DebugFormat("[SCENE OBJECT PART]: Scheduling full update for {0} {1}", Name, LocalId); | 2732 | // if (IsAttachment) |
2733 | // m_log.DebugFormat("[SOP]: Scheduling full update for {0} {1}", Name, LocalId); | ||
2731 | 2734 | ||
2732 | if (m_parentGroup != null) | 2735 | if (m_parentGroup != null) |
2733 | { | 2736 | { |
@@ -2840,6 +2843,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2840 | /// <param name="remoteClient"></param> | 2843 | /// <param name="remoteClient"></param> |
2841 | public void SendFullUpdate(IClientAPI remoteClient, uint clientFlags) | 2844 | public void SendFullUpdate(IClientAPI remoteClient, uint clientFlags) |
2842 | { | 2845 | { |
2846 | // if (IsAttachment) | ||
2847 | // m_log.DebugFormat( | ||
2848 | // "[SCENE OBJECT PART]: Sending part full update to {0} for {1} {2}", remoteClient.Name, Name, LocalId); | ||
2849 | |||
2843 | m_parentGroup.SendPartFullUpdate(remoteClient, this, clientFlags); | 2850 | m_parentGroup.SendPartFullUpdate(remoteClient, this, clientFlags); |
2844 | } | 2851 | } |
2845 | 2852 | ||
@@ -2848,6 +2855,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2848 | /// </summary> | 2855 | /// </summary> |
2849 | public void SendFullUpdateToAllClients() | 2856 | public void SendFullUpdateToAllClients() |
2850 | { | 2857 | { |
2858 | // if (IsAttachment) | ||
2859 | // m_log.DebugFormat( | ||
2860 | // "[SCENE OBJECT PART]: Sending full update for {0} {1} for all clients", Name, LocalId); | ||
2861 | |||
2851 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 2862 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); |
2852 | for (int i = 0; i < avatars.Length; i++) | 2863 | for (int i = 0; i < avatars.Length; i++) |
2853 | { | 2864 | { |
@@ -2859,6 +2870,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2859 | 2870 | ||
2860 | public void SendFullUpdateToAllClientsExcept(UUID agentID) | 2871 | public void SendFullUpdateToAllClientsExcept(UUID agentID) |
2861 | { | 2872 | { |
2873 | // if (IsAttachment) | ||
2874 | // m_log.DebugFormat( | ||
2875 | // "[SCENE OBJECT PART]: Sending full update for {0} {1} to all clients except {2}", Name, LocalId, agentID); | ||
2876 | |||
2862 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 2877 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); |
2863 | for (int i = 0; i < avatars.Length; i++) | 2878 | for (int i = 0; i < avatars.Length; i++) |
2864 | { | 2879 | { |
@@ -2914,10 +2929,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
2914 | //isattachment = ParentGroup.RootPart.IsAttachment; | 2929 | //isattachment = ParentGroup.RootPart.IsAttachment; |
2915 | 2930 | ||
2916 | byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A}; | 2931 | byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A}; |
2917 | remoteClient.SendPrimitiveToClient(new SendPrimitiveData(m_regionHandle, m_parentGroup.GetTimeDilation(), LocalId, m_shape, | 2932 | |
2918 | lPos, Velocity, Acceleration, RotationOffset, AngularVelocity, clientFlags, m_uuid, _ownerID, | 2933 | double priority = ParentGroup.GetUpdatePriority(remoteClient); |
2919 | m_text, color, _parentID, m_particleSystem, m_clickAction, (byte)m_material, m_TextureAnimation, IsAttachment, | 2934 | if (IsRoot && IsAttachment) |
2920 | AttachmentPoint,FromItemID, Sound, SoundGain, SoundFlags, SoundRadius, ParentGroup.GetUpdatePriority(remoteClient))); | 2935 | { |
2936 | if (double.MinValue == priority) | ||
2937 | { | ||
2938 | m_log.WarnFormat( | ||
2939 | "[SOP]: Couldn't raise update priority of root part for attachment {0} {1} because priority is already highest value", | ||
2940 | Name, LocalId); | ||
2941 | } | ||
2942 | else | ||
2943 | { | ||
2944 | priority = double.MinValue; | ||
2945 | } | ||
2946 | } | ||
2947 | |||
2948 | remoteClient.SendPrimitiveToClient( | ||
2949 | new SendPrimitiveData(m_regionHandle, m_parentGroup.GetTimeDilation(), LocalId, m_shape, | ||
2950 | lPos, Velocity, Acceleration, RotationOffset, AngularVelocity, clientFlags, m_uuid, _ownerID, | ||
2951 | m_text, color, _parentID, m_particleSystem, m_clickAction, (byte)m_material, m_TextureAnimation, IsAttachment, | ||
2952 | AttachmentPoint,FromItemID, Sound, SoundGain, SoundFlags, SoundRadius, priority)); | ||
2921 | } | 2953 | } |
2922 | 2954 | ||
2923 | /// <summary> | 2955 | /// <summary> |
@@ -2965,6 +2997,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2965 | { | 2997 | { |
2966 | if (m_updateFlag == 2) // is a new prim, just created/reloaded or has major changes | 2998 | if (m_updateFlag == 2) // is a new prim, just created/reloaded or has major changes |
2967 | { | 2999 | { |
3000 | // if (IsAttachment) | ||
3001 | // m_log.DebugFormat("[SOP]: Sending scheduled full update for {0} {1}", Name, LocalId); | ||
3002 | |||
2968 | AddFullUpdateToAllAvatars(); | 3003 | AddFullUpdateToAllAvatars(); |
2969 | ClearUpdateSchedule(); | 3004 | ClearUpdateSchedule(); |
2970 | } | 3005 | } |