diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 82 |
1 files changed, 32 insertions, 50 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index a2b98b9..0e21487 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1197,15 +1197,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1197 | 1197 | ||
1198 | private void SendObjectPropertiesToClient(UUID AgentID) | 1198 | private void SendObjectPropertiesToClient(UUID AgentID) |
1199 | { | 1199 | { |
1200 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 1200 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) |
1201 | for (int i = 0; i < avatars.Length; i++) | ||
1202 | { | 1201 | { |
1203 | // Ugly reference :( | 1202 | // Ugly reference :( |
1204 | if (avatars[i].UUID == AgentID) | 1203 | if (avatar.UUID == AgentID) |
1205 | { | 1204 | { |
1206 | m_parentGroup.GetProperties(avatars[i].ControllingClient); | 1205 | m_parentGroup.GetProperties(avatar.ControllingClient); |
1207 | } | 1206 | } |
1208 | } | 1207 | }); |
1209 | } | 1208 | } |
1210 | 1209 | ||
1211 | // TODO: unused: | 1210 | // TODO: unused: |
@@ -1260,11 +1259,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1260 | /// </summary> | 1259 | /// </summary> |
1261 | public void AddFullUpdateToAllAvatars() | 1260 | public void AddFullUpdateToAllAvatars() |
1262 | { | 1261 | { |
1263 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 1262 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) |
1264 | for (int i = 0; i < avatars.Length; i++) | ||
1265 | { | 1263 | { |
1266 | avatars[i].SceneViewer.QueuePartForUpdate(this); | 1264 | avatar.SceneViewer.QueuePartForUpdate(this); |
1267 | } | 1265 | }); |
1268 | } | 1266 | } |
1269 | 1267 | ||
1270 | public void AddFullUpdateToAvatar(ScenePresence presence) | 1268 | public void AddFullUpdateToAvatar(ScenePresence presence) |
@@ -1285,11 +1283,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1285 | /// Terse updates | 1283 | /// Terse updates |
1286 | public void AddTerseUpdateToAllAvatars() | 1284 | public void AddTerseUpdateToAllAvatars() |
1287 | { | 1285 | { |
1288 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 1286 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) |
1289 | for (int i = 0; i < avatars.Length; i++) | ||
1290 | { | 1287 | { |
1291 | avatars[i].SceneViewer.QueuePartForUpdate(this); | 1288 | avatar.SceneViewer.QueuePartForUpdate(this); |
1292 | } | 1289 | }); |
1293 | } | 1290 | } |
1294 | 1291 | ||
1295 | public void AddTerseUpdateToAvatar(ScenePresence presence) | 1292 | public void AddTerseUpdateToAvatar(ScenePresence presence) |
@@ -2121,17 +2118,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2121 | } | 2118 | } |
2122 | else | 2119 | else |
2123 | { | 2120 | { |
2124 | ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences(); | 2121 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence av) |
2125 | |||
2126 | for (int i = 0; i < avlist.Length; i++) | ||
2127 | { | 2122 | { |
2128 | ScenePresence av = avlist[i]; | ||
2129 | |||
2130 | if (av.LocalId == localId) | 2123 | if (av.LocalId == localId) |
2131 | { | 2124 | { |
2132 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) | 2125 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) |
2133 | { | 2126 | { |
2134 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2127 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); |
2135 | //If it is 1, it is to accept ONLY collisions from this avatar | 2128 | //If it is 1, it is to accept ONLY collisions from this avatar |
2136 | if (found) | 2129 | if (found) |
2137 | { | 2130 | { |
@@ -2153,7 +2146,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2153 | } | 2146 | } |
2154 | else | 2147 | else |
2155 | { | 2148 | { |
2156 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2149 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); |
2157 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | 2150 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work |
2158 | if (!found) | 2151 | if (!found) |
2159 | { | 2152 | { |
@@ -2171,7 +2164,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2171 | } | 2164 | } |
2172 | 2165 | ||
2173 | } | 2166 | } |
2174 | } | 2167 | }); |
2175 | } | 2168 | } |
2176 | } | 2169 | } |
2177 | if (colliding.Count > 0) | 2170 | if (colliding.Count > 0) |
@@ -2257,17 +2250,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2257 | } | 2250 | } |
2258 | else | 2251 | else |
2259 | { | 2252 | { |
2260 | ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences(); | 2253 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence av) |
2261 | |||
2262 | for (int i = 0; i < avlist.Length; i++) | ||
2263 | { | 2254 | { |
2264 | ScenePresence av = avlist[i]; | ||
2265 | |||
2266 | if (av.LocalId == localId) | 2255 | if (av.LocalId == localId) |
2267 | { | 2256 | { |
2268 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) | 2257 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) |
2269 | { | 2258 | { |
2270 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2259 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); |
2271 | //If it is 1, it is to accept ONLY collisions from this avatar | 2260 | //If it is 1, it is to accept ONLY collisions from this avatar |
2272 | if (found) | 2261 | if (found) |
2273 | { | 2262 | { |
@@ -2289,7 +2278,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2289 | } | 2278 | } |
2290 | else | 2279 | else |
2291 | { | 2280 | { |
2292 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2281 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); |
2293 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | 2282 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work |
2294 | if (!found) | 2283 | if (!found) |
2295 | { | 2284 | { |
@@ -2307,7 +2296,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2307 | } | 2296 | } |
2308 | 2297 | ||
2309 | } | 2298 | } |
2310 | } | 2299 | }); |
2311 | } | 2300 | } |
2312 | } | 2301 | } |
2313 | if (colliding.Count > 0) | 2302 | if (colliding.Count > 0) |
@@ -2388,17 +2377,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2388 | } | 2377 | } |
2389 | else | 2378 | else |
2390 | { | 2379 | { |
2391 | ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences(); | 2380 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence av) |
2392 | |||
2393 | for (int i = 0; i < avlist.Length; i++) | ||
2394 | { | 2381 | { |
2395 | ScenePresence av = avlist[i]; | ||
2396 | |||
2397 | if (av.LocalId == localId) | 2382 | if (av.LocalId == localId) |
2398 | { | 2383 | { |
2399 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) | 2384 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) |
2400 | { | 2385 | { |
2401 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2386 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); |
2402 | //If it is 1, it is to accept ONLY collisions from this avatar | 2387 | //If it is 1, it is to accept ONLY collisions from this avatar |
2403 | if (found) | 2388 | if (found) |
2404 | { | 2389 | { |
@@ -2420,7 +2405,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2420 | } | 2405 | } |
2421 | else | 2406 | else |
2422 | { | 2407 | { |
2423 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2408 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); |
2424 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | 2409 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work |
2425 | if (!found) | 2410 | if (!found) |
2426 | { | 2411 | { |
@@ -2438,7 +2423,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2438 | } | 2423 | } |
2439 | 2424 | ||
2440 | } | 2425 | } |
2441 | } | 2426 | }); |
2442 | } | 2427 | } |
2443 | } | 2428 | } |
2444 | 2429 | ||
@@ -2877,11 +2862,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2877 | /// </summary> | 2862 | /// </summary> |
2878 | public void SendFullUpdateToAllClients() | 2863 | public void SendFullUpdateToAllClients() |
2879 | { | 2864 | { |
2880 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 2865 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) |
2881 | for (int i = 0; i < avatars.Length; i++) | ||
2882 | { | 2866 | { |
2883 | SendFullUpdate(avatars[i].ControllingClient, avatars[i].GenerateClientFlags(UUID)); | 2867 | SendFullUpdate(avatar.ControllingClient, avatar.GenerateClientFlags(UUID)); |
2884 | } | 2868 | }); |
2885 | } | 2869 | } |
2886 | 2870 | ||
2887 | /// <summary> | 2871 | /// <summary> |
@@ -2890,13 +2874,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2890 | /// <param name="agentID"></param> | 2874 | /// <param name="agentID"></param> |
2891 | public void SendFullUpdateToAllClientsExcept(UUID agentID) | 2875 | public void SendFullUpdateToAllClientsExcept(UUID agentID) |
2892 | { | 2876 | { |
2893 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 2877 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) |
2894 | for (int i = 0; i < avatars.Length; i++) | ||
2895 | { | 2878 | { |
2896 | // Ugly reference :( | 2879 | // Ugly reference :( |
2897 | if (avatars[i].UUID != agentID) | 2880 | if (avatar.UUID != agentID) |
2898 | SendFullUpdate(avatars[i].ControllingClient, avatars[i].GenerateClientFlags(UUID)); | 2881 | SendFullUpdate(avatar.ControllingClient, avatar.GenerateClientFlags(UUID)); |
2899 | } | 2882 | }); |
2900 | } | 2883 | } |
2901 | 2884 | ||
2902 | /// <summary> | 2885 | /// <summary> |
@@ -3096,11 +3079,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
3096 | /// </summary> | 3079 | /// </summary> |
3097 | public void SendTerseUpdateToAllClients() | 3080 | public void SendTerseUpdateToAllClients() |
3098 | { | 3081 | { |
3099 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 3082 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) |
3100 | for (int i = 0; i < avatars.Length; i++) | ||
3101 | { | 3083 | { |
3102 | SendTerseUpdateToClient(avatars[i].ControllingClient); | 3084 | SendTerseUpdateToClient(avatar.ControllingClient); |
3103 | } | 3085 | }); |
3104 | } | 3086 | } |
3105 | 3087 | ||
3106 | public void SetAttachmentPoint(uint AttachmentPoint) | 3088 | public void SetAttachmentPoint(uint AttachmentPoint) |