diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index a542ab0..bdb8957 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -346,15 +346,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
346 | m_timeUpdateCount++; | 346 | m_timeUpdateCount++; |
347 | if (m_timeUpdateCount > 600) | 347 | if (m_timeUpdateCount > 600) |
348 | { | 348 | { |
349 | List<ScenePresence> Avatars = RequestAvatarList(); | 349 | List<ScenePresence> avatars = GetAvatars(); |
350 | foreach (ScenePresence avatar in Avatars) | 350 | foreach (ScenePresence avatar in avatars) |
351 | { | 351 | { |
352 | if (!avatar.childAgent) | 352 | avatar.ControllingClient.SendViewerTime(m_timePhase); |
353 | { | ||
354 | //Console.WriteLine("sending time update " + timePhase + " from region " + m_regionHandle + " to avatar " + avatar.Firstname); | ||
355 | avatar.ControllingClient.SendViewerTime(m_timePhase); | ||
356 | } | ||
357 | } | 353 | } |
354 | |||
358 | m_timeUpdateCount = 0; | 355 | m_timeUpdateCount = 0; |
359 | m_timePhase++; | 356 | m_timePhase++; |
360 | if (m_timePhase > 94) | 357 | if (m_timePhase > 94) |
@@ -831,7 +828,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
831 | { | 828 | { |
832 | m_eventManager.TriggerOnRemovePresence(agentID); | 829 | m_eventManager.TriggerOnRemovePresence(agentID); |
833 | 830 | ||
834 | ScenePresence avatar = RequestAvatar(agentID); | 831 | ScenePresence avatar = GetScenePresence(agentID); |
835 | 832 | ||
836 | ForEachScenePresence( | 833 | ForEachScenePresence( |
837 | delegate(ScenePresence presence) | 834 | delegate(ScenePresence presence) |
@@ -877,14 +874,19 @@ namespace OpenSim.Region.Environment.Scenes | |||
877 | /// Request a List of all Avatars in this World | 874 | /// Request a List of all Avatars in this World |
878 | /// </summary> | 875 | /// </summary> |
879 | /// <returns></returns> | 876 | /// <returns></returns> |
880 | public List<ScenePresence> RequestAvatarList() | 877 | public List<ScenePresence> GetScenePresences() |
881 | { | 878 | { |
882 | List<ScenePresence> result = new List<ScenePresence>(); | 879 | List<ScenePresence> result = new List<ScenePresence>(Avatars.Values); |
883 | 880 | ||
884 | foreach (ScenePresence avatar in Avatars.Values) | 881 | return result; |
885 | { | 882 | } |
886 | result.Add(avatar); | 883 | |
887 | } | 884 | public List<ScenePresence> GetAvatars() |
885 | { | ||
886 | List<ScenePresence> result = GetScenePresences(delegate(ScenePresence scenePresence) | ||
887 | { | ||
888 | return !scenePresence.childAgent; | ||
889 | }); | ||
888 | 890 | ||
889 | return result; | 891 | return result; |
890 | } | 892 | } |
@@ -893,7 +895,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
893 | /// Request a filtered list of Avatars in this World | 895 | /// Request a filtered list of Avatars in this World |
894 | /// </summary> | 896 | /// </summary> |
895 | /// <returns></returns> | 897 | /// <returns></returns> |
896 | public List<ScenePresence> RequestAvatarList(FilterAvatarList filter) | 898 | public List<ScenePresence> GetScenePresences(FilterAvatarList filter) |
897 | { | 899 | { |
898 | List<ScenePresence> result = new List<ScenePresence>(); | 900 | List<ScenePresence> result = new List<ScenePresence>(); |
899 | 901 | ||
@@ -913,7 +915,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
913 | /// </summary> | 915 | /// </summary> |
914 | /// <param name="avatarID"></param> | 916 | /// <param name="avatarID"></param> |
915 | /// <returns></returns> | 917 | /// <returns></returns> |
916 | public ScenePresence RequestAvatar(LLUUID avatarID) | 918 | public ScenePresence GetScenePresence(LLUUID avatarID) |
917 | { | 919 | { |
918 | if (Avatars.ContainsKey(avatarID)) | 920 | if (Avatars.ContainsKey(avatarID)) |
919 | { | 921 | { |
@@ -954,11 +956,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
954 | 956 | ||
955 | public void SendKillObject(uint localID) | 957 | public void SendKillObject(uint localID) |
956 | { | 958 | { |
957 | List<ScenePresence> avatars = RequestAvatarList(); | 959 | ForEachScenePresence(delegate(ScenePresence presence) |
958 | for (int i = 0; i < avatars.Count; i++) | 960 | { |
959 | { | 961 | presence.ControllingClient.SendKillObject(m_regionHandle, localID); |
960 | avatars[i].ControllingClient.SendKillObject(m_regionHandle, localID); | 962 | }); |
961 | } | ||
962 | } | 963 | } |
963 | 964 | ||
964 | public void SendAllSceneObjectsToClient(ScenePresence presence) | 965 | public void SendAllSceneObjectsToClient(ScenePresence presence) |
@@ -1419,7 +1420,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1419 | 1420 | ||
1420 | public override void Close() | 1421 | public override void Close() |
1421 | { | 1422 | { |
1422 | m_heartbeatTimer.Close(); | 1423 | m_heartbeatTimer.Close(); |
1423 | 1424 | ||
1424 | base.Close(); | 1425 | base.Close(); |
1425 | } | 1426 | } |