diff options
Diffstat (limited to '')
-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 48e34ee..539f2b1 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1208,15 +1208,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1208 | 1208 | ||
1209 | private void SendObjectPropertiesToClient(UUID AgentID) | 1209 | private void SendObjectPropertiesToClient(UUID AgentID) |
1210 | { | 1210 | { |
1211 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 1211 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) |
1212 | for (int i = 0; i < avatars.Length; i++) | ||
1213 | { | 1212 | { |
1214 | // Ugly reference :( | 1213 | // Ugly reference :( |
1215 | if (avatars[i].UUID == AgentID) | 1214 | if (avatar.UUID == AgentID) |
1216 | { | 1215 | { |
1217 | m_parentGroup.GetProperties(avatars[i].ControllingClient); | 1216 | m_parentGroup.GetProperties(avatar.ControllingClient); |
1218 | } | 1217 | } |
1219 | } | 1218 | }); |
1220 | } | 1219 | } |
1221 | 1220 | ||
1222 | // TODO: unused: | 1221 | // TODO: unused: |
@@ -1271,11 +1270,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1271 | /// </summary> | 1270 | /// </summary> |
1272 | public void AddFullUpdateToAllAvatars() | 1271 | public void AddFullUpdateToAllAvatars() |
1273 | { | 1272 | { |
1274 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 1273 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) |
1275 | for (int i = 0; i < avatars.Length; i++) | ||
1276 | { | 1274 | { |
1277 | avatars[i].SceneViewer.QueuePartForUpdate(this); | 1275 | avatar.SceneViewer.QueuePartForUpdate(this); |
1278 | } | 1276 | }); |
1279 | } | 1277 | } |
1280 | 1278 | ||
1281 | public void AddFullUpdateToAvatar(ScenePresence presence) | 1279 | public void AddFullUpdateToAvatar(ScenePresence presence) |
@@ -1296,11 +1294,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1296 | /// Terse updates | 1294 | /// Terse updates |
1297 | public void AddTerseUpdateToAllAvatars() | 1295 | public void AddTerseUpdateToAllAvatars() |
1298 | { | 1296 | { |
1299 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 1297 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) |
1300 | for (int i = 0; i < avatars.Length; i++) | ||
1301 | { | 1298 | { |
1302 | avatars[i].SceneViewer.QueuePartForUpdate(this); | 1299 | avatar.SceneViewer.QueuePartForUpdate(this); |
1303 | } | 1300 | }); |
1304 | } | 1301 | } |
1305 | 1302 | ||
1306 | public void AddTerseUpdateToAvatar(ScenePresence presence) | 1303 | public void AddTerseUpdateToAvatar(ScenePresence presence) |
@@ -2137,17 +2134,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2137 | } | 2134 | } |
2138 | else | 2135 | else |
2139 | { | 2136 | { |
2140 | ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences(); | 2137 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence av) |
2141 | |||
2142 | for (int i = 0; i < avlist.Length; i++) | ||
2143 | { | 2138 | { |
2144 | ScenePresence av = avlist[i]; | ||
2145 | |||
2146 | if (av.LocalId == localId) | 2139 | if (av.LocalId == localId) |
2147 | { | 2140 | { |
2148 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) | 2141 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) |
2149 | { | 2142 | { |
2150 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2143 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); |
2151 | //If it is 1, it is to accept ONLY collisions from this avatar | 2144 | //If it is 1, it is to accept ONLY collisions from this avatar |
2152 | if (found) | 2145 | if (found) |
2153 | { | 2146 | { |
@@ -2169,7 +2162,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2169 | } | 2162 | } |
2170 | else | 2163 | else |
2171 | { | 2164 | { |
2172 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2165 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); |
2173 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | 2166 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work |
2174 | if (!found) | 2167 | if (!found) |
2175 | { | 2168 | { |
@@ -2187,7 +2180,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2187 | } | 2180 | } |
2188 | 2181 | ||
2189 | } | 2182 | } |
2190 | } | 2183 | }); |
2191 | } | 2184 | } |
2192 | } | 2185 | } |
2193 | if (colliding.Count > 0) | 2186 | if (colliding.Count > 0) |
@@ -2273,17 +2266,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2273 | } | 2266 | } |
2274 | else | 2267 | else |
2275 | { | 2268 | { |
2276 | ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences(); | 2269 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence av) |
2277 | |||
2278 | for (int i = 0; i < avlist.Length; i++) | ||
2279 | { | 2270 | { |
2280 | ScenePresence av = avlist[i]; | ||
2281 | |||
2282 | if (av.LocalId == localId) | 2271 | if (av.LocalId == localId) |
2283 | { | 2272 | { |
2284 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) | 2273 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) |
2285 | { | 2274 | { |
2286 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2275 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); |
2287 | //If it is 1, it is to accept ONLY collisions from this avatar | 2276 | //If it is 1, it is to accept ONLY collisions from this avatar |
2288 | if (found) | 2277 | if (found) |
2289 | { | 2278 | { |
@@ -2305,7 +2294,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2305 | } | 2294 | } |
2306 | else | 2295 | else |
2307 | { | 2296 | { |
2308 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2297 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); |
2309 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | 2298 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work |
2310 | if (!found) | 2299 | if (!found) |
2311 | { | 2300 | { |
@@ -2323,7 +2312,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2323 | } | 2312 | } |
2324 | 2313 | ||
2325 | } | 2314 | } |
2326 | } | 2315 | }); |
2327 | } | 2316 | } |
2328 | } | 2317 | } |
2329 | if (colliding.Count > 0) | 2318 | if (colliding.Count > 0) |
@@ -2404,17 +2393,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2404 | } | 2393 | } |
2405 | else | 2394 | else |
2406 | { | 2395 | { |
2407 | ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences(); | 2396 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence av) |
2408 | |||
2409 | for (int i = 0; i < avlist.Length; i++) | ||
2410 | { | 2397 | { |
2411 | ScenePresence av = avlist[i]; | ||
2412 | |||
2413 | if (av.LocalId == localId) | 2398 | if (av.LocalId == localId) |
2414 | { | 2399 | { |
2415 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) | 2400 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) |
2416 | { | 2401 | { |
2417 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2402 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); |
2418 | //If it is 1, it is to accept ONLY collisions from this avatar | 2403 | //If it is 1, it is to accept ONLY collisions from this avatar |
2419 | if (found) | 2404 | if (found) |
2420 | { | 2405 | { |
@@ -2436,7 +2421,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2436 | } | 2421 | } |
2437 | else | 2422 | else |
2438 | { | 2423 | { |
2439 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2424 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); |
2440 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | 2425 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work |
2441 | if (!found) | 2426 | if (!found) |
2442 | { | 2427 | { |
@@ -2454,7 +2439,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2454 | } | 2439 | } |
2455 | 2440 | ||
2456 | } | 2441 | } |
2457 | } | 2442 | }); |
2458 | } | 2443 | } |
2459 | } | 2444 | } |
2460 | 2445 | ||
@@ -2863,11 +2848,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2863 | /// </summary> | 2848 | /// </summary> |
2864 | public void SendFullUpdateToAllClients() | 2849 | public void SendFullUpdateToAllClients() |
2865 | { | 2850 | { |
2866 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 2851 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) |
2867 | for (int i = 0; i < avatars.Length; i++) | ||
2868 | { | 2852 | { |
2869 | SendFullUpdate(avatars[i].ControllingClient, avatars[i].GenerateClientFlags(UUID)); | 2853 | SendFullUpdate(avatar.ControllingClient, avatar.GenerateClientFlags(UUID)); |
2870 | } | 2854 | }); |
2871 | } | 2855 | } |
2872 | 2856 | ||
2873 | /// <summary> | 2857 | /// <summary> |
@@ -2876,13 +2860,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2876 | /// <param name="agentID"></param> | 2860 | /// <param name="agentID"></param> |
2877 | public void SendFullUpdateToAllClientsExcept(UUID agentID) | 2861 | public void SendFullUpdateToAllClientsExcept(UUID agentID) |
2878 | { | 2862 | { |
2879 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 2863 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) |
2880 | for (int i = 0; i < avatars.Length; i++) | ||
2881 | { | 2864 | { |
2882 | // Ugly reference :( | 2865 | // Ugly reference :( |
2883 | if (avatars[i].UUID != agentID) | 2866 | if (avatar.UUID != agentID) |
2884 | SendFullUpdate(avatars[i].ControllingClient, avatars[i].GenerateClientFlags(UUID)); | 2867 | SendFullUpdate(avatar.ControllingClient, avatar.GenerateClientFlags(UUID)); |
2885 | } | 2868 | }); |
2886 | } | 2869 | } |
2887 | 2870 | ||
2888 | /// <summary> | 2871 | /// <summary> |
@@ -3083,11 +3066,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
3083 | /// </summary> | 3066 | /// </summary> |
3084 | public void SendTerseUpdateToAllClients() | 3067 | public void SendTerseUpdateToAllClients() |
3085 | { | 3068 | { |
3086 | ScenePresence[] avatars = m_parentGroup.Scene.GetScenePresences(); | 3069 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) |
3087 | for (int i = 0; i < avatars.Length; i++) | ||
3088 | { | 3070 | { |
3089 | SendTerseUpdateToClient(avatars[i].ControllingClient); | 3071 | SendTerseUpdateToClient(avatar.ControllingClient); |
3090 | } | 3072 | }); |
3091 | } | 3073 | } |
3092 | 3074 | ||
3093 | public void SetAttachmentPoint(uint AttachmentPoint) | 3075 | public void SetAttachmentPoint(uint AttachmentPoint) |