diff options
author | lbsa71 | 2007-09-21 03:13:49 +0000 |
---|---|---|
committer | lbsa71 | 2007-09-21 03:13:49 +0000 |
commit | 409bcd999d19c52133f7099963febdf96d865467 (patch) | |
tree | a4853c05b6af3b17a2ee1392aca9e08ed38ac427 /OpenSim/Region/Environment/Scenes/Scene.cs | |
parent | physics-related fixes; should stabilize border crossings (diff) | |
download | opensim-SC-409bcd999d19c52133f7099963febdf96d865467.zip opensim-SC-409bcd999d19c52133f7099963febdf96d865467.tar.gz opensim-SC-409bcd999d19c52133f7099963febdf96d865467.tar.bz2 opensim-SC-409bcd999d19c52133f7099963febdf96d865467.tar.xz |
* Continuing refactoring of presence
* Deleted stub ScenePresence.Body.cs
* Added stub Region classes
The idea is to, at first, have every ScenePresence have one RegionPresence, moving code over to it until we can detach the two classes and not have a ScenePresence for every RegionPresence.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index d89ca28..55d760e 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -310,7 +310,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
310 | { | 310 | { |
311 | if (Terrain.Tainted(x * 16, y * 16)) | 311 | if (Terrain.Tainted(x * 16, y * 16)) |
312 | { | 312 | { |
313 | SendLayerData(x, y, presence._ControllingClient, | 313 | SendLayerData(x, y, presence.ControllingClient, |
314 | terData); | 314 | terData); |
315 | } | 315 | } |
316 | } | 316 | } |
@@ -344,7 +344,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
344 | List<ScenePresence> avatars = GetAvatars(); | 344 | List<ScenePresence> avatars = GetAvatars(); |
345 | foreach (ScenePresence avatar in avatars) | 345 | foreach (ScenePresence avatar in avatars) |
346 | { | 346 | { |
347 | avatar._ControllingClient.SendViewerTime(m_timePhase); | 347 | avatar.ControllingClient.SendViewerTime(m_timePhase); |
348 | } | 348 | } |
349 | 349 | ||
350 | m_timeUpdateCount = 0; | 350 | m_timeUpdateCount = 0; |
@@ -396,7 +396,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
396 | 396 | ||
397 | storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD()); | 397 | storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD()); |
398 | 398 | ||
399 | ForEachScenePresence(delegate(ScenePresence presence) { SendLayerData(presence._ControllingClient); }); | 399 | ForEachScenePresence(delegate(ScenePresence presence) { SendLayerData(presence.ControllingClient); }); |
400 | 400 | ||
401 | foreach (LLUUID UUID in Entities.Keys) | 401 | foreach (LLUUID UUID in Entities.Keys) |
402 | { | 402 | { |
@@ -424,7 +424,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
424 | } | 424 | } |
425 | storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD()); | 425 | storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD()); |
426 | 426 | ||
427 | ForEachScenePresence(delegate(ScenePresence presence) { SendLayerData(presence._ControllingClient); }); | 427 | ForEachScenePresence(delegate(ScenePresence presence) { SendLayerData(presence.ControllingClient); }); |
428 | 428 | ||
429 | foreach (LLUUID UUID in Entities.Keys) | 429 | foreach (LLUUID UUID in Entities.Keys) |
430 | { | 430 | { |
@@ -772,7 +772,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
772 | ScenePresence newAvatar = null; | 772 | ScenePresence newAvatar = null; |
773 | 773 | ||
774 | newAvatar = new ScenePresence(client, this, m_regInfo); | 774 | newAvatar = new ScenePresence(client, this, m_regInfo); |
775 | newAvatar.childAgent = child; | 775 | newAvatar.IsChildAgent = child; |
776 | 776 | ||
777 | if (child) | 777 | if (child) |
778 | { | 778 | { |
@@ -829,7 +829,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
829 | delegate(ScenePresence presence) | 829 | delegate(ScenePresence presence) |
830 | { | 830 | { |
831 | presence.CoarseLocationChange(avatar); | 831 | presence.CoarseLocationChange(avatar); |
832 | presence._ControllingClient.SendKillObject(avatar.RegionHandle, avatar.LocalId); | 832 | presence.ControllingClient.SendKillObject(avatar.RegionHandle, avatar.LocalId); |
833 | if (presence.PhysicsActor != null) | 833 | if (presence.PhysicsActor != null) |
834 | { | 834 | { |
835 | phyScene.RemoveAvatar(presence.PhysicsActor); | 835 | phyScene.RemoveAvatar(presence.PhysicsActor); |
@@ -881,7 +881,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
881 | { | 881 | { |
882 | List<ScenePresence> result = GetScenePresences(delegate(ScenePresence scenePresence) | 882 | List<ScenePresence> result = GetScenePresences(delegate(ScenePresence scenePresence) |
883 | { | 883 | { |
884 | return !scenePresence.childAgent; | 884 | return !scenePresence.IsChildAgent; |
885 | }); | 885 | }); |
886 | 886 | ||
887 | return result; | 887 | return result; |
@@ -954,7 +954,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
954 | { | 954 | { |
955 | ForEachScenePresence(delegate(ScenePresence presence) | 955 | ForEachScenePresence(delegate(ScenePresence presence) |
956 | { | 956 | { |
957 | presence._ControllingClient.SendKillObject(m_regionHandle, localID); | 957 | presence.ControllingClient.SendKillObject(m_regionHandle, localID); |
958 | }); | 958 | }); |
959 | } | 959 | } |
960 | 960 | ||
@@ -1182,7 +1182,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1182 | { | 1182 | { |
1183 | if (m_scenePresences.ContainsKey(avatarID)) | 1183 | if (m_scenePresences.ContainsKey(avatarID)) |
1184 | { | 1184 | { |
1185 | m_scenePresences[avatarID]._ControllingClient.SendLoadURL(objectname, objectID, ownerID, groupOwned, message, url); | 1185 | m_scenePresences[avatarID].ControllingClient.SendLoadURL(objectname, objectID, ownerID, groupOwned, message, url); |
1186 | } | 1186 | } |
1187 | } | 1187 | } |
1188 | 1188 | ||
@@ -1198,7 +1198,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1198 | { | 1198 | { |
1199 | foreach (ScenePresence presence in m_scenePresences.Values) | 1199 | foreach (ScenePresence presence in m_scenePresences.Values) |
1200 | { | 1200 | { |
1201 | presence._ControllingClient.SendAlertMessage(message); | 1201 | presence.ControllingClient.SendAlertMessage(message); |
1202 | } | 1202 | } |
1203 | } | 1203 | } |
1204 | 1204 | ||
@@ -1206,7 +1206,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1206 | { | 1206 | { |
1207 | if (m_scenePresences.ContainsKey(agentID)) | 1207 | if (m_scenePresences.ContainsKey(agentID)) |
1208 | { | 1208 | { |
1209 | m_scenePresences[agentID]._ControllingClient.SendAgentAlertMessage(message, modal); | 1209 | m_scenePresences[agentID].ControllingClient.SendAgentAlertMessage(message, modal); |
1210 | } | 1210 | } |
1211 | } | 1211 | } |
1212 | 1212 | ||
@@ -1216,7 +1216,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1216 | { | 1216 | { |
1217 | if ((presence.Firstname == firstName) && (presence.Lastname == lastName)) | 1217 | if ((presence.Firstname == firstName) && (presence.Lastname == lastName)) |
1218 | { | 1218 | { |
1219 | presence._ControllingClient.SendAgentAlertMessage(message, modal); | 1219 | presence.ControllingClient.SendAgentAlertMessage(message, modal); |
1220 | break; | 1220 | break; |
1221 | } | 1221 | } |
1222 | } | 1222 | } |
@@ -1292,24 +1292,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
1292 | String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}{6,-16}", "Firstname", "Lastname", | 1292 | String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}{6,-16}", "Firstname", "Lastname", |
1293 | "Agent ID", "Session ID", "Circuit", "IP", "World")); | 1293 | "Agent ID", "Session ID", "Circuit", "IP", "World")); |
1294 | 1294 | ||
1295 | foreach (EntityBase entity in Entities.Values) | 1295 | foreach (ScenePresence scenePrescence in GetAvatars()) |
1296 | { | 1296 | { |
1297 | if (entity is ScenePresence) | 1297 | MainLog.Instance.Error( |
1298 | { | ||
1299 | ScenePresence scenePrescence = entity as ScenePresence; | ||
1300 | if (!scenePrescence.childAgent) | ||
1301 | { | ||
1302 | MainLog.Instance.Error( | ||
1303 | String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}{6,-16}", | 1298 | String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}{6,-16}", |
1304 | scenePrescence.Firstname, | 1299 | scenePrescence.Firstname, |
1305 | scenePrescence.Lastname, | 1300 | scenePrescence.Lastname, |
1306 | scenePrescence.UUID, | 1301 | scenePrescence.UUID, |
1307 | scenePrescence._ControllingClient.AgentId, | 1302 | scenePrescence.ControllingClient.AgentId, |
1308 | "Unknown", | 1303 | "Unknown", |
1309 | "Unknown", | 1304 | "Unknown", |
1310 | RegionInfo.RegionName)); | 1305 | RegionInfo.RegionName)); |
1311 | } | ||
1312 | } | ||
1313 | } | 1306 | } |
1314 | break; | 1307 | break; |
1315 | case "modules": | 1308 | case "modules": |
@@ -1403,7 +1396,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1403 | ScenePresence presence; | 1396 | ScenePresence presence; |
1404 | if (m_scenePresences.TryGetValue(avatarId, out presence)) | 1397 | if (m_scenePresences.TryGetValue(avatarId, out presence)) |
1405 | { | 1398 | { |
1406 | if (!presence.childAgent) | 1399 | if (!presence.IsChildAgent) |
1407 | { | 1400 | { |
1408 | avatar = presence; | 1401 | avatar = presence; |
1409 | return true; | 1402 | return true; |